1
0
forked from liza/ARDiscard

Character post processing settings

This commit is contained in:
Liza 2023-09-13 20:26:48 +02:00
parent 36c52f433b
commit 2025b0253d
Signed by: liza
GPG Key ID: 7199F8D727D55F67
4 changed files with 14 additions and 6 deletions

View File

@ -17,7 +17,7 @@
<PropertyGroup> <PropertyGroup>
<DalamudLibPath>$(appdata)\XIVLauncher\addon\Hooks\dev\</DalamudLibPath> <DalamudLibPath>$(appdata)\XIVLauncher\addon\Hooks\dev\</DalamudLibPath>
<AutoRetainerLibPath>$(appdata)\XIVLauncher\installedPlugins\AutoRetainer\4.1.0.9\</AutoRetainerLibPath> <AutoRetainerLibPath>$(appdata)\XIVLauncher\installedPlugins\AutoRetainer\4.1.1.1\</AutoRetainerLibPath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))'"> <PropertyGroup Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))'">

View File

@ -65,14 +65,14 @@ public class AutoDiscardPlogon : IDalamudPlugin
public string Name => "Discard after AutoRetainer"; public string Name => "Discard after AutoRetainer";
private void CheckRetainerPostProcess(string retainerName) => private void CheckRetainerPostProcess(string retainerName) =>
CheckPostProcessInternal(PostProcessType.Retainer, retainerName); CheckPostProcessInternal(PostProcessType.Retainer, retainerName, _configuration.RunAfterVenture);
private void CheckCharacterPostProcess() => private void CheckCharacterPostProcess() =>
CheckPostProcessInternal(PostProcessType.Character, "current character"); CheckPostProcessInternal(PostProcessType.Character, "current character", _configuration.RunBeforeLogout);
private unsafe void CheckPostProcessInternal(PostProcessType type, string name) private unsafe void CheckPostProcessInternal(PostProcessType type, string name, bool enabled)
{ {
if (!_configuration.RunAfterVenture) if (!enabled)
{ {
PluginLog.Information($"Not running post-venture tasks for {name}, disabled globally"); PluginLog.Information($"Not running post-venture tasks for {name}, disabled globally");
} }

View File

@ -57,6 +57,13 @@ public class ConfigWindow : Window
Save(); Save();
} }
bool runBeforeLogout = _configuration.RunBeforeLogout;
if (ImGui.Checkbox("[Global] Run before logging out in Multi-Mode", ref runBeforeLogout))
{
_configuration.RunBeforeLogout = runBeforeLogout;
Save();
}
if (ImGui.BeginTabBar("AutoDiscardTabs")) if (ImGui.BeginTabBar("AutoDiscardTabs"))
{ {
DrawDiscardList(); DrawDiscardList();
@ -181,7 +188,7 @@ public class ConfigWindow : Window
} }
else else
{ {
if (_configuration.RunAfterVenture) if (_configuration.RunAfterVenture || _configuration.RunBeforeLogout)
{ {
ImGui.TextColored(ImGuiColors.HealerGreen, ImGui.TextColored(ImGuiColors.HealerGreen,
"This character is currently included (and will be post-processed in autoretainer)."); "This character is currently included (and will be post-processed in autoretainer).");

View File

@ -7,6 +7,7 @@ public class Configuration : IPluginConfiguration
{ {
public int Version { get; set; } = 1; public int Version { get; set; } = 1;
public bool RunAfterVenture { get; set; } public bool RunAfterVenture { get; set; }
public bool RunBeforeLogout { get; set; }
public List<uint> DiscardingItems { get; set; } = new(); public List<uint> DiscardingItems { get; set; } = new();
public List<CharacterInfo> ExcludedCharacters { get; set; } = new(); public List<CharacterInfo> ExcludedCharacters { get; set; } = new();