mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 10:17:23 +01:00
Fix some issues with UI actors.
This commit is contained in:
parent
abcb1a6222
commit
68e85a640c
4 changed files with 18 additions and 3 deletions
|
|
@ -41,6 +41,7 @@ public class ActorPanel
|
|||
private Actor _actor = Actor.Null;
|
||||
private ActorData _data;
|
||||
private ActorState? _state;
|
||||
private bool _lockedRedraw;
|
||||
|
||||
public ActorPanel(ActorSelector selector, StateManager stateManager, CustomizationDrawer customizationDrawer,
|
||||
EquipmentDrawer equipmentDrawer, IdentifierService identification, AutoDesignApplier autoDesignApplier,
|
||||
|
|
@ -59,10 +60,14 @@ public class ActorPanel
|
|||
_datFileService = datFileService;
|
||||
}
|
||||
|
||||
private CustomizeFlag CustomizeApplicationFlags
|
||||
=> _lockedRedraw ? CustomizeFlagExtensions.AllRelevant & ~CustomizeFlagExtensions.RedrawRequired : CustomizeFlagExtensions.AllRelevant;
|
||||
|
||||
public void Draw()
|
||||
{
|
||||
using var group = ImRaii.Group();
|
||||
(_identifier, _data) = _selector.Selection;
|
||||
_lockedRedraw = _identifier.Type is IdentifierType.Special;
|
||||
(_actorName, _actor) = GetHeaderName();
|
||||
DrawHeader();
|
||||
DrawPanel();
|
||||
|
|
@ -71,7 +76,7 @@ public class ActorPanel
|
|||
return;
|
||||
|
||||
if (_datFileService.CreateImGuiTarget(out var dat))
|
||||
_stateManager.ChangeCustomize(_state!, dat.Customize, CustomizeFlagExtensions.AllRelevant, StateChanged.Source.Manual);
|
||||
_stateManager.ChangeCustomize(_state!, dat.Customize, CustomizeApplicationFlags, StateChanged.Source.Manual);
|
||||
_datFileService.CreateSource();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,9 @@ public class ActorState
|
|||
|
||||
public readonly ActorIdentifier Identifier;
|
||||
|
||||
public bool AllowsRedraw
|
||||
=> Identifier.Type is not IdentifierType.Special;
|
||||
|
||||
/// <summary> This should always represent the unmodified state of the draw object. </summary>
|
||||
public DesignData BaseData;
|
||||
|
||||
|
|
|
|||
|
|
@ -177,8 +177,14 @@ public class StateListener : IDisposable
|
|||
{
|
||||
case UpdateState.Transformed: break;
|
||||
case UpdateState.Change:
|
||||
var set = _customizations.AwaitedService.GetList(state.ModelData.Customize.Clan, state.ModelData.Customize.Gender);
|
||||
var model = state.ModelData.Customize;
|
||||
if (customize.Gender != model.Gender || customize.Clan != model.Clan)
|
||||
{
|
||||
_manager.ChangeCustomize(state, in customize, CustomizeFlagExtensions.AllRelevant, StateChanged.Source.Game);
|
||||
return;
|
||||
}
|
||||
|
||||
var set = _customizations.AwaitedService.GetList(model.Clan, model.Gender);
|
||||
foreach (var index in CustomizationExtensions.AllBasic)
|
||||
{
|
||||
if (state[index] is not StateChanged.Source.Fixed)
|
||||
|
|
|
|||
|
|
@ -378,7 +378,8 @@ public class StateManager : IReadOnlyDictionary<ActorIdentifier, ActorState>
|
|||
if (design.DoApplyVisorToggle())
|
||||
_editor.ChangeMetaState(state, ActorState.MetaIndex.VisorState, design.DesignData.IsVisorToggled(), source, out _, key);
|
||||
|
||||
_editor.ChangeHumanCustomize(state, design.DesignData.Customize, design.ApplyCustomize, source, out _, out var applied, key);
|
||||
var flags = state.AllowsRedraw ? design.ApplyCustomize : design.ApplyCustomize & ~CustomizeFlagExtensions.RedrawRequired;
|
||||
_editor.ChangeHumanCustomize(state, design.DesignData.Customize, flags, source, out _, out var applied, key);
|
||||
redraw |= applied.RequiresRedraw();
|
||||
|
||||
foreach (var slot in EquipSlotExtensions.FullSlots)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue