From 9f9a58af2a077231af6652d175b6437bafd4fadf Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Sun, 3 Mar 2024 13:42:57 +0100 Subject: [PATCH] Add an option to respect manual changes on changing automation. --- Glamourer/Automation/AutoDesignApplier.cs | 4 ++-- Glamourer/Configuration.cs | 1 + Glamourer/Gui/Tabs/SettingsTab/SettingsTab.cs | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Glamourer/Automation/AutoDesignApplier.cs b/Glamourer/Automation/AutoDesignApplier.cs index 40533f8..4cd07e5 100644 --- a/Glamourer/Automation/AutoDesignApplier.cs +++ b/Glamourer/Automation/AutoDesignApplier.cs @@ -151,7 +151,7 @@ public sealed class AutoDesignApplier : IDisposable { if (_state.GetOrCreate(id, data.Objects[0], out var state)) { - Reduce(data.Objects[0], state, newSet, false, false); + Reduce(data.Objects[0], state, newSet, _config.RespectManualOnAutomationUpdate, false); foreach (var actor in data.Objects) _state.ReapplyState(actor, StateSource.Fixed); } @@ -163,7 +163,7 @@ public sealed class AutoDesignApplier : IDisposable var specificId = actor.GetIdentifier(_actors); if (_state.GetOrCreate(specificId, actor, out var state)) { - Reduce(actor, state, newSet, false, false); + Reduce(actor, state, newSet, _config.RespectManualOnAutomationUpdate, false); _state.ReapplyState(actor, StateSource.Fixed); } } diff --git a/Glamourer/Configuration.cs b/Glamourer/Configuration.cs index 4f6c435..896b431 100644 --- a/Glamourer/Configuration.cs +++ b/Glamourer/Configuration.cs @@ -45,6 +45,7 @@ public class Configuration : IPluginConfiguration, ISavable public bool ChangeEntireItem { get; set; } = false; public bool AlwaysApplyAssociatedMods { get; set; } = false; public bool AllowDoubleClickToApply { get; set; } = false; + public bool RespectManualOnAutomationUpdate { get; set; } = false; public ModifiableHotkey ToggleQuickDesignBar { get; set; } = new(VirtualKey.NO_KEY); public DoubleModifier DeleteDesignModifier { get; set; } = new(ModifierHotkey.Control, ModifierHotkey.Shift); public ChangeLogDisplayType ChangeLogDisplayType { get; set; } = ChangeLogDisplayType.New; diff --git a/Glamourer/Gui/Tabs/SettingsTab/SettingsTab.cs b/Glamourer/Gui/Tabs/SettingsTab/SettingsTab.cs index 4ac8d80..e988d13 100644 --- a/Glamourer/Gui/Tabs/SettingsTab/SettingsTab.cs +++ b/Glamourer/Gui/Tabs/SettingsTab/SettingsTab.cs @@ -7,7 +7,6 @@ using Glamourer.Designs; using Glamourer.Gui.Tabs.DesignTab; using Glamourer.Interop; using Glamourer.Interop.PalettePlus; -using Glamourer.Interop.Penumbra; using Glamourer.Services; using Glamourer.State; using ImGuiNET; @@ -78,6 +77,9 @@ public class SettingsTab( Checkbox("Do Not Apply Unobtained Items in Automation", "Enable this if you want automatically applied designs to only consider items and customizations you have actually unlocked once, and skip those you have not.", config.UnlockedItemMode, v => config.UnlockedItemMode = v); + Checkbox("Respect Manual Changes When Editing Automation", + "Whether changing any currently active automation group will respect manual changes to the character before re-applying the changed automation or not.", + config.RespectManualOnAutomationUpdate, v => config.RespectManualOnAutomationUpdate = v); Checkbox("Enable Festival Easter-Eggs", "Glamourer may do some fun things on specific dates. Disable this if you do not want your experience disrupted by this.", config.DisableFestivals == 0, v => config.DisableFestivals = v ? (byte)0 : (byte)2);