Fix reverter designs a bit.

This commit is contained in:
Ottermandias 2023-07-20 01:30:19 +02:00
parent 0dc0a534cf
commit 55af7f7371
3 changed files with 8 additions and 12 deletions

View file

@ -5,13 +5,11 @@ using System.Text;
using Dalamud.Interface; using Dalamud.Interface;
using Glamourer.Automation; using Glamourer.Automation;
using Glamourer.Customization; using Glamourer.Customization;
using Glamourer.Designs;
using Glamourer.Interop; using Glamourer.Interop;
using Glamourer.Services; using Glamourer.Services;
using Glamourer.Structs; using Glamourer.Structs;
using Glamourer.Unlocks; using Glamourer.Unlocks;
using ImGuiNET; using ImGuiNET;
using Lumina.Excel.GeneratedSheets;
using OtterGui; using OtterGui;
using OtterGui.Raii; using OtterGui.Raii;
using OtterGui.Widgets; using OtterGui.Widgets;
@ -192,7 +190,7 @@ public class SetPanel
if (!equipFlags.HasFlag(flag)) if (!equipFlags.HasFlag(flag))
continue; continue;
var item = design.Design.DesignData.Item(slot); var item = design.Design!.DesignData.Item(slot);
if (!_itemUnlocks.IsUnlocked(item.ItemId, out _)) if (!_itemUnlocks.IsUnlocked(item.ItemId, out _))
sb.AppendLine($"{item.Name} in {slot.ToName()} slot is not unlocked. Consider obtaining it via gameplay means!"); sb.AppendLine($"{item.Name} in {slot.ToName()} slot is not unlocked. Consider obtaining it via gameplay means!");
} }
@ -227,7 +225,7 @@ public class SetPanel
sb.Clear(); sb.Clear();
var sb2 = new StringBuilder(); var sb2 = new StringBuilder();
var customize = design.Design.DesignData.Customize; var customize = design.Design!.DesignData.Customize;
if (!design.Design.DesignData.IsHuman) if (!design.Design.DesignData.IsHuman)
sb.AppendLine("The base model id can not be changed automatically to something non-human."); sb.AppendLine("The base model id can not be changed automatically to something non-human.");

View file

@ -50,10 +50,7 @@ public class StateApplier
{ {
var data = GetData(state); var data = GetData(state);
if (apply) if (apply)
{
state.TempLock();
ForceRedraw(data); ForceRedraw(data);
}
return data; return data;
} }
@ -76,10 +73,7 @@ public class StateApplier
_changeCustomize.UpdateCustomize(mdl, customize.Data); _changeCustomize.UpdateCustomize(mdl, customize.Data);
} }
else else
{
state?.TempLock();
_penumbra.RedrawObject(actor, RedrawType.Redraw); _penumbra.RedrawObject(actor, RedrawType.Redraw);
}
} }
} }

View file

@ -377,7 +377,6 @@ public class StateManager : IReadOnlyDictionary<ActorIdentifier, ActorState>
var actors = _applier.ChangeWetness(state, true); var actors = _applier.ChangeWetness(state, true);
if (redraw) if (redraw)
{ {
state.TempLock();
_applier.ForceRedraw(actors); _applier.ForceRedraw(actors);
} }
else else
@ -419,7 +418,12 @@ public class StateManager : IReadOnlyDictionary<ActorIdentifier, ActorState>
foreach (var type in Enum.GetValues<ActorState.MetaIndex>()) foreach (var type in Enum.GetValues<ActorState.MetaIndex>())
state[type] = StateChanged.Source.Game; state[type] = StateChanged.Source.Game;
var actors = source is StateChanged.Source.Manual or StateChanged.Source.Ipc ? ApplyAll(state, redraw) : ActorData.Invalid; var actors = ActorData.Invalid;
if (source is StateChanged.Source.Manual or StateChanged.Source.Ipc)
{
state.TempLock();
actors = ApplyAll(state, redraw);
}
Glamourer.Log.Verbose( Glamourer.Log.Verbose(
$"Reset entire state of {state.Identifier.Incognito(null)} to game base. [Affecting {actors.ToLazyString("nothing")}.]"); $"Reset entire state of {state.Identifier.Incognito(null)} to game base. [Affecting {actors.ToLazyString("nothing")}.]");
_event.Invoke(StateChanged.Type.Design, StateChanged.Source.Manual, state, actors, null); _event.Invoke(StateChanged.Type.Design, StateChanged.Source.Manual, state, actors, null);