Add an option to ignore 'Minimum Seals to keep' for a character

pull/3/head v2.18
Liza 2023-11-09 12:25:37 +01:00
parent 2198fdc4e1
commit 5b0bcd981b
Signed by: liza
GPG Key ID: 7199F8D727D55F67
4 changed files with 28 additions and 10 deletions

View File

@ -11,8 +11,9 @@ internal sealed class CharacterConfiguration
public string? CachedPlayerName { get; set; }
public string? CachedWorldName { get; set; }
public bool DisableForCharacter { get; set; } = false;
public bool UseHideArmouryChestItemsFilter { get; set; } = false;
public bool DisableForCharacter { get; set; }
public bool UseHideArmouryChestItemsFilter { get; set; }
public bool IgnoreMinimumSealsToKeep { get; set; }
public bool OverrideItemsToPurchase { get; set; }
public List<Configuration.PurchasePriority> ItemsToPurchase { get; set; } = new();

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework>
<Version>2.17</Version>
<Version>2.18</Version>
<LangVersion>11.0</LangVersion>
<Nullable>enable</Nullable>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>

View File

@ -145,10 +145,18 @@ public sealed partial class DeliverooPlugin : IDalamudPlugin
}
}
public int EffectiveReservedSealCount =>
_configuration.ReserveDifferentSealCountAtMaxRank && GetSealCap() == GetMaxSealCap()
public int EffectiveReservedSealCount
{
get
{
if (CharacterConfiguration is { IgnoreMinimumSealsToKeep: true })
return 0;
return _configuration.ReserveDifferentSealCountAtMaxRank && GetSealCap() == GetMaxSealCap()
? _configuration.ReservedSealCountAtMaxRank
: _configuration.ReservedSealCount;
}
}
private void Login()
{

View File

@ -205,9 +205,18 @@ internal sealed class ConfigWindow : LImGui.LWindow
charConfiguration.Save(_pluginInterface);
}
if (ImGui.IsItemHovered())
ImGui.SetTooltip(
"The default filter for all characters is 'Hide Gear Set Items', but you may want to override this to hide all Armoury Chest items (regardless of whether they're part of a gear set) e.g. for your main character.");
ImGui.SameLine();
ImGuiComponents.HelpMarker("The default filter for all characters is 'Hide Gear Set Items', but you may want to override this to hide all Armoury Chest items (regardless of whether they're part of a gear set) e.g. for your main character.");
bool ignoreMinimumSealsToKeep = charConfiguration.IgnoreMinimumSealsToKeep;
if (ImGui.Checkbox("Ignore 'Minimum Seals to keep' setting", ref ignoreMinimumSealsToKeep))
{
charConfiguration.IgnoreMinimumSealsToKeep = ignoreMinimumSealsToKeep;
charConfiguration.Save(_pluginInterface);
}
ImGui.SameLine();
ImGuiComponents.HelpMarker("When enabled, all GC seals will be spent. This is effectively the same as setting 'Minimum Seals to keep' to 0.");
ImGui.EndDisabled();
ImGui.Spacing();