Apply API renames.

This commit is contained in:
Ottermandias 2025-01-24 16:46:10 +01:00
parent 748c324acf
commit 7be283ca30
7 changed files with 16 additions and 16 deletions

@ -1 +1 @@
Subproject commit b1b90e6ecfeee76a12cb27793753fa87af21083f
Subproject commit 4ac38fbed6fb0f31c0b75de26950ab82d3bee258

View file

@ -52,7 +52,7 @@ public sealed class IpcProviders : IDisposable, IApiService
IpcSubscribers.RevertToAutomationName.Provider(pi, api.State),
IpcSubscribers.StateChanged.Provider(pi, api.State),
IpcSubscribers.StateChangedWithType.Provider(pi, api.State),
IpcSubscribers.StateUpdated.Provider(pi, api.State),
IpcSubscribers.StateFinalized.Provider(pi, api.State),
IpcSubscribers.GPoseChanged.Provider(pi, api.State),
];
_initializedProvider.Invoke();

View file

@ -255,7 +255,7 @@ public sealed class StateApi : IGlamourerApiState, IApiService, IDisposable
public event Action<nint>? StateChanged;
public event Action<IntPtr, StateChangeType>? StateChangedWithType;
public event Action<IntPtr, StateUpdateType>? StateUpdated;
public event Action<IntPtr, StateFinalizationType>? StateFinalized;
public event Action<bool>? GPoseChanged;
private void ApplyDesign(ActorState state, DesignBase design, uint key, ApplyFlag flags)
@ -349,11 +349,11 @@ public sealed class StateApi : IGlamourerApiState, IApiService, IDisposable
StateChangedWithType.Invoke(actor.Address, type);
}
private void OnStateUpdated(StateUpdateType type, ActorData actors)
private void OnStateUpdated(StateFinalizationType type, ActorData actors)
{
Glamourer.Log.Verbose($"[OnStateUpdated] State Updated with Type {type}. [Affecting {actors.ToLazyString("nothing")}.]");
if (StateUpdated != null)
if (StateFinalized != null)
foreach (var actor in actors.Objects)
StateUpdated.Invoke(actor.Address, type);
StateFinalized.Invoke(actor.Address, type);
}
}

View file

@ -14,7 +14,7 @@ namespace Glamourer.Events;
/// </list>
/// </summary>
public sealed class StateUpdated()
: EventWrapper<StateUpdateType, ActorData, StateUpdated.Priority>(nameof(StateUpdated))
: EventWrapper<StateFinalizationType, ActorData, StateUpdated.Priority>(nameof(StateUpdated))
{
public enum Priority
{

View file

@ -43,7 +43,7 @@ public class StateEditor(
Glamourer.Log.Verbose(
$"Set model id in state {state.Identifier.Incognito(null)} from {old} to {modelId}. [Affecting {actors.ToLazyString("nothing")}.]");
StateChanged.Invoke(StateChangeType.Model, source, state, actors, null);
StateUpdated.Invoke(StateUpdateType.ModelChange, actors);
StateUpdated.Invoke(StateFinalizationType.ModelChange, actors);
}
/// <inheritdoc/>
@ -421,7 +421,7 @@ public class StateEditor(
$"Applied design to {state.Identifier.Incognito(null)}. [Affecting {actors.ToLazyString("nothing")}.]");
StateChanged.Invoke(StateChangeType.Design, state.Sources[MetaIndex.Wetness], state, actors, null); // FIXME: maybe later
if(settings.SendStateUpdate)
StateUpdated.Invoke(StateUpdateType.DesignApplied, actors);
StateUpdated.Invoke(StateFinalizationType.DesignApplied, actors);
return;

View file

@ -281,7 +281,7 @@ public class StateListener : IDisposable
_objects.Update();
if (_objects.TryGetValue(identifier, out var actors) && actors.Valid)
_stateUpdated.Invoke(StateUpdateType.Gearset, actors);
_stateUpdated.Invoke(StateFinalizationType.Gearset, actors);
}

View file

@ -279,7 +279,7 @@ public sealed class StateManager(
StateChanged.Invoke(StateChangeType.Reset, source, state, actors, null);
// only invoke if we define this reset call as the final call in our state update.
if(stateUpdate)
StateUpdated.Invoke(StateUpdateType.Revert, actors);
StateUpdated.Invoke(StateFinalizationType.Revert, actors);
}
public void ResetAdvancedState(ActorState state, StateSource source, uint key = 0)
@ -306,7 +306,7 @@ public sealed class StateManager(
$"Reset advanced customization and dye state of {state.Identifier.Incognito(null)} to game base. [Affecting {actors.ToLazyString("nothing")}.]");
StateChanged.Invoke(StateChangeType.Reset, source, state, actors, null);
// Update that we have completed a full operation. (We can do this directly as nothing else is linked)
StateUpdated.Invoke(StateUpdateType.RevertAdvanced, actors);
StateUpdated.Invoke(StateFinalizationType.RevertAdvanced, actors);
}
public void ResetCustomize(ActorState state, StateSource source, uint key = 0)
@ -325,7 +325,7 @@ public sealed class StateManager(
Glamourer.Log.Verbose(
$"Reset customization state of {state.Identifier.Incognito(null)} to game base. [Affecting {actors.ToLazyString("nothing")}.]");
// Update that we have completed a full operation. (We can do this directly as nothing else is linked)
StateUpdated.Invoke(StateUpdateType.RevertCustomize, actors);
StateUpdated.Invoke(StateFinalizationType.RevertCustomize, actors);
}
public void ResetEquip(ActorState state, StateSource source, uint key = 0)
@ -376,7 +376,7 @@ public sealed class StateManager(
Glamourer.Log.Verbose(
$"Reset equipment state of {state.Identifier.Incognito(null)} to game base. [Affecting {actors.ToLazyString("nothing")}.]");
// Update that we have completed a full operation. (We can do this directly as nothing else is linked)
StateUpdated.Invoke(StateUpdateType.RevertEquipment, actors);
StateUpdated.Invoke(StateFinalizationType.RevertEquipment, actors);
}
public void ResetStateFixed(ActorState state, bool respectManualPalettes, uint key = 0)
@ -469,7 +469,7 @@ public sealed class StateManager(
|| CustomizeArray.Compare(actor.Model.GetCustomize(), state.ModelData.Customize).RequiresRedraw(), false);
StateChanged.Invoke(StateChangeType.Reapply, source, state, data, null);
if(stateUpdate)
StateUpdated.Invoke(StateUpdateType.Reapply, data);
StateUpdated.Invoke(StateFinalizationType.Reapply, data);
}
/// <summary> Automation variant for reapply, to fire the correct StateUpdateType once reapplied. </summary>
@ -490,7 +490,7 @@ public sealed class StateManager(
|| CustomizeArray.Compare(actor.Model.GetCustomize(), state.ModelData.Customize).RequiresRedraw(), false);
StateChanged.Invoke(StateChangeType.Reapply, source, state, data, null);
// invoke the automation update based on what reset is.
StateUpdated.Invoke(wasReset ? StateUpdateType.RevertAutomation : StateUpdateType.ReapplyAutomation, data);
StateUpdated.Invoke(wasReset ? StateFinalizationType.RevertAutomation : StateFinalizationType.ReapplyAutomation, data);
}
public void DeleteState(ActorIdentifier identifier)