mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-15 21:24:18 +01:00
Maybe fix disabling auto designs.
This commit is contained in:
parent
33bf5c5392
commit
a116243900
2 changed files with 25 additions and 6 deletions
|
|
@ -55,6 +55,15 @@ public sealed class AutoDesignApplier : IDisposable
|
||||||
_equippedGearset.Subscribe(OnEquippedGearset, EquippedGearset.Priority.AutoDesignApplier);
|
_equippedGearset.Subscribe(OnEquippedGearset, EquippedGearset.Priority.AutoDesignApplier);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void OnEnableAutoDesignsChanged(bool value)
|
||||||
|
{
|
||||||
|
if (value)
|
||||||
|
return;
|
||||||
|
|
||||||
|
foreach (var state in _state.Values)
|
||||||
|
state.Sources.RemoveFixedDesignSources();
|
||||||
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
_weapons.Unsubscribe(OnWeaponLoading);
|
_weapons.Unsubscribe(OnWeaponLoading);
|
||||||
|
|
@ -234,9 +243,6 @@ public sealed class AutoDesignApplier : IDisposable
|
||||||
AutoDesignSet set;
|
AutoDesignSet set;
|
||||||
if (!_state.TryGetValue(identifier, out state))
|
if (!_state.TryGetValue(identifier, out state))
|
||||||
{
|
{
|
||||||
if (!_config.EnableAutoDesigns)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (!GetPlayerSet(identifier, out set!))
|
if (!GetPlayerSet(identifier, out set!))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -257,7 +263,8 @@ public sealed class AutoDesignApplier : IDisposable
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private unsafe void Reduce(Actor actor, ActorState state, AutoDesignSet set, bool respectManual, bool fromJobChange, bool newApplication, out bool forcedRedraw)
|
private unsafe void Reduce(Actor actor, ActorState state, AutoDesignSet set, bool respectManual, bool fromJobChange, bool newApplication,
|
||||||
|
out bool forcedRedraw)
|
||||||
{
|
{
|
||||||
if (set.BaseState is AutoDesignSet.Base.Game)
|
if (set.BaseState is AutoDesignSet.Base.Game)
|
||||||
{
|
{
|
||||||
|
|
@ -294,6 +301,12 @@ public sealed class AutoDesignApplier : IDisposable
|
||||||
/// <summary> Get world-specific first and all-world afterward. </summary>
|
/// <summary> Get world-specific first and all-world afterward. </summary>
|
||||||
private bool GetPlayerSet(ActorIdentifier identifier, [NotNullWhen(true)] out AutoDesignSet? set)
|
private bool GetPlayerSet(ActorIdentifier identifier, [NotNullWhen(true)] out AutoDesignSet? set)
|
||||||
{
|
{
|
||||||
|
if (!_config.EnableAutoDesigns)
|
||||||
|
{
|
||||||
|
set = null;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
switch (identifier.Type)
|
switch (identifier.Type)
|
||||||
{
|
{
|
||||||
case IdentifierType.Player:
|
case IdentifierType.Player:
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Components;
|
using Dalamud.Interface.Components;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
|
using Glamourer.Automation;
|
||||||
using Glamourer.Designs;
|
using Glamourer.Designs;
|
||||||
using Glamourer.Gui.Tabs.DesignTab;
|
using Glamourer.Gui.Tabs.DesignTab;
|
||||||
using Glamourer.Interop;
|
using Glamourer.Interop;
|
||||||
|
|
@ -27,7 +28,8 @@ public class SettingsTab(
|
||||||
PalettePlusChecker paletteChecker,
|
PalettePlusChecker paletteChecker,
|
||||||
CollectionOverrideDrawer overrides,
|
CollectionOverrideDrawer overrides,
|
||||||
CodeDrawer codeDrawer,
|
CodeDrawer codeDrawer,
|
||||||
Glamourer glamourer)
|
Glamourer glamourer,
|
||||||
|
AutoDesignApplier autoDesignApplier)
|
||||||
: ITab
|
: ITab
|
||||||
{
|
{
|
||||||
private readonly VirtualKey[] _validKeys = keys.GetValidVirtualKeys().Prepend(VirtualKey.NO_KEY).ToArray();
|
private readonly VirtualKey[] _validKeys = keys.GetValidVirtualKeys().Prepend(VirtualKey.NO_KEY).ToArray();
|
||||||
|
|
@ -43,7 +45,11 @@ public class SettingsTab(
|
||||||
|
|
||||||
Checkbox("Enable Auto Designs",
|
Checkbox("Enable Auto Designs",
|
||||||
"Enable the application of designs associated to characters in the Automation tab to be applied automatically.",
|
"Enable the application of designs associated to characters in the Automation tab to be applied automatically.",
|
||||||
config.EnableAutoDesigns, v => config.EnableAutoDesigns = v);
|
config.EnableAutoDesigns, v =>
|
||||||
|
{
|
||||||
|
config.EnableAutoDesigns = v;
|
||||||
|
autoDesignApplier.OnEnableAutoDesignsChanged(v);
|
||||||
|
});
|
||||||
ImGui.NewLine();
|
ImGui.NewLine();
|
||||||
ImGui.NewLine();
|
ImGui.NewLine();
|
||||||
ImGui.NewLine();
|
ImGui.NewLine();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue