Merge branch 'main' into CordeliaMist/main

This commit is contained in:
Ottermandias 2025-01-24 15:13:46 +01:00
commit 748c324acf
4 changed files with 63 additions and 29 deletions

View file

@ -234,6 +234,22 @@ public class AutoDesignManager : ISavable, IReadOnlyList<AutoDesignSet>, IDispos
_event.Invoke(AutomationChanged.Type.ChangedBase, set, (old, newBase));
}
public void ChangeResetSettings(int whichSet, bool newValue)
{
if (whichSet >= _data.Count || whichSet < 0)
return;
var set = _data[whichSet];
if (newValue == set.ResetTemporarySettings)
return;
var old = set.ResetTemporarySettings;
set.ResetTemporarySettings = newValue;
Save();
Glamourer.Log.Debug($"Changed resetting of temporary settings of set {whichSet + 1} from {old} to {newValue}.");
_event.Invoke(AutomationChanged.Type.ChangedTemporarySettingsReset, set, newValue);
}
public void AddDesign(AutoDesignSet set, IDesignStandIn design)
{
var newDesign = new AutoDesign()

View file

@ -37,6 +37,9 @@ public sealed class AutomationChanged()
/// <summary> Change the used base state of a given set. Additional data is prior and new base. [(AutoDesignSet.Base, AutoDesignSet.Base)]. </summary>
ChangedBase,
/// <summary> Change the resetting of temporary settings for a given set. Additional data is the new value. </summary>
ChangedTemporarySettingsReset,
/// <summary> Add a new associated design to a given set. Additional data is the index it got added at [int]. </summary>
AddedDesign,

View file

@ -58,7 +58,9 @@ public class SetPanel(
var spacing = ImGui.GetStyle().ItemInnerSpacing with { Y = ImGui.GetStyle().ItemSpacing.Y };
using (_ = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, spacing))
using (ImUtf8.Group())
{
using (ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, spacing))
{
var enabled = Selection.Enabled;
if (ImGui.Checkbox("##Enabled", ref enabled))
@ -67,8 +69,7 @@ public class SetPanel(
"Whether the designs in this set should be applied at all. Only one set can be enabled for a character at the same time.");
}
ImGui.SameLine();
using (_ = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, spacing))
using (ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, spacing))
{
var useGame = _selector.Selection!.BaseState is AutoDesignSet.Base.Game;
if (ImGui.Checkbox("##gameState", ref useGame))
@ -77,9 +78,12 @@ public class SetPanel(
"When this is enabled, the designs matching conditions will be applied successively on top of what your character is supposed to look like for the game. "
+ "Otherwise, they will be applied on top of the characters actual current look using Glamourer.");
}
}
ImGui.SameLine();
using (_ = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, spacing))
using (ImUtf8.Group())
{
using (ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, spacing))
{
var editing = _config.ShowAutomationSetEditing;
if (ImGui.Checkbox("##Show Editing", ref editing))
@ -92,6 +96,17 @@ public class SetPanel(
"Show options to change the name or the associated character or NPC of this design set.");
}
using (ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, spacing))
{
var resetSettings = _selector.Selection!.ResetTemporarySettings;
if (ImGui.Checkbox("##resetSettings", ref resetSettings))
_manager.ChangeResetSettings(_selector.SelectionIndex, resetSettings);
ImGuiUtil.LabeledHelpMarker("Reset Temporary Settings",
"Always reset all temporary settings applied by Glamourer when this automation set is applied, regardless of active designs.");
}
}
if (_config.ShowAutomationSetEditing)
{
ImGui.Dummy(Vector2.Zero);

View file

@ -201,7 +201,7 @@ public class ModAssociationsTab(PenumbraService penumbra, DesignFileSystemSelect
ImGui.TableNextColumn();
var inherit = settings.ForceInherit;
if (TwoStateCheckbox.Instance.Draw("##Enabled"u8, ref inherit))
if (TwoStateCheckbox.Instance.Draw("##ForceInherit"u8, ref inherit))
updatedMod = (mod, settings with { ForceInherit = inherit });
ImUtf8.HoverTooltip("Force the mod to inherit its settings from inherited collections."u8);
ImGui.TableNextColumn();