Fix revert to automation.

This commit is contained in:
Ottermandias 2024-03-14 16:22:14 +01:00
parent fdd74c0514
commit 7af0a1d562
3 changed files with 8 additions and 14 deletions

View file

@ -223,6 +223,7 @@ public sealed class AutoDesignApplier : IDisposable
if (!GetPlayerSet(identifier, out var set)) if (!GetPlayerSet(identifier, out var set))
return; return;
_state.ResetState(state, StateSource.Game);
Reduce(actor, state, set, false, false); Reduce(actor, state, set, false, false);
} }

View file

@ -4,25 +4,19 @@ using OtterGui.Widgets;
namespace Glamourer.Gui.Tabs.AutomationTab; namespace Glamourer.Gui.Tabs.AutomationTab;
public class AutomationTab : ITab public class AutomationTab(SetSelector selector, SetPanel panel, Configuration config) : ITab
{ {
private readonly SetSelector _selector;
private readonly SetPanel _panel;
public AutomationTab(SetSelector selector, SetPanel panel)
{
_selector = selector;
_panel = panel;
}
public ReadOnlySpan<byte> Label public ReadOnlySpan<byte> Label
=> "Automation"u8; => "Automation"u8;
public bool IsVisible
=> config.EnableAutoDesigns;
public void DrawContent() public void DrawContent()
{ {
_selector.Draw(GetSetSelectorSize()); selector.Draw(GetSetSelectorSize());
ImGui.SameLine(); ImGui.SameLine();
_panel.Draw(); panel.Draw();
} }
public float GetSetSelectorSize() public float GetSetSelectorSize()

View file

@ -223,8 +223,7 @@ public class InternalStateEditor(
/// <summary> Change the value of a single material color table entry. </summary> /// <summary> Change the value of a single material color table entry. </summary>
public bool ChangeMaterialValue(ActorState state, MaterialValueIndex index, in MaterialValueState newValue, StateSource source, public bool ChangeMaterialValue(ActorState state, MaterialValueIndex index, in MaterialValueState newValue, StateSource source,
out ColorRow? oldValue, out ColorRow? oldValue, uint key = 0)
uint key = 0)
{ {
// We already have an existing value. // We already have an existing value.
if (state.Materials.TryGetValue(index, out var old)) if (state.Materials.TryGetValue(index, out var old))