mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 18:27:24 +01:00
Apply API renames.
This commit is contained in:
parent
748c324acf
commit
7be283ca30
7 changed files with 16 additions and 16 deletions
|
|
@ -1 +1 @@
|
||||||
Subproject commit b1b90e6ecfeee76a12cb27793753fa87af21083f
|
Subproject commit 4ac38fbed6fb0f31c0b75de26950ab82d3bee258
|
||||||
|
|
@ -52,7 +52,7 @@ public sealed class IpcProviders : IDisposable, IApiService
|
||||||
IpcSubscribers.RevertToAutomationName.Provider(pi, api.State),
|
IpcSubscribers.RevertToAutomationName.Provider(pi, api.State),
|
||||||
IpcSubscribers.StateChanged.Provider(pi, api.State),
|
IpcSubscribers.StateChanged.Provider(pi, api.State),
|
||||||
IpcSubscribers.StateChangedWithType.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),
|
IpcSubscribers.GPoseChanged.Provider(pi, api.State),
|
||||||
];
|
];
|
||||||
_initializedProvider.Invoke();
|
_initializedProvider.Invoke();
|
||||||
|
|
|
||||||
|
|
@ -255,7 +255,7 @@ public sealed class StateApi : IGlamourerApiState, IApiService, IDisposable
|
||||||
|
|
||||||
public event Action<nint>? StateChanged;
|
public event Action<nint>? StateChanged;
|
||||||
public event Action<IntPtr, StateChangeType>? StateChangedWithType;
|
public event Action<IntPtr, StateChangeType>? StateChangedWithType;
|
||||||
public event Action<IntPtr, StateUpdateType>? StateUpdated;
|
public event Action<IntPtr, StateFinalizationType>? StateFinalized;
|
||||||
public event Action<bool>? GPoseChanged;
|
public event Action<bool>? GPoseChanged;
|
||||||
|
|
||||||
private void ApplyDesign(ActorState state, DesignBase design, uint key, ApplyFlag flags)
|
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);
|
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")}.]");
|
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)
|
foreach (var actor in actors.Objects)
|
||||||
StateUpdated.Invoke(actor.Address, type);
|
StateFinalized.Invoke(actor.Address, type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ namespace Glamourer.Events;
|
||||||
/// </list>
|
/// </list>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class StateUpdated()
|
public sealed class StateUpdated()
|
||||||
: EventWrapper<StateUpdateType, ActorData, StateUpdated.Priority>(nameof(StateUpdated))
|
: EventWrapper<StateFinalizationType, ActorData, StateUpdated.Priority>(nameof(StateUpdated))
|
||||||
{
|
{
|
||||||
public enum Priority
|
public enum Priority
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ public class StateEditor(
|
||||||
Glamourer.Log.Verbose(
|
Glamourer.Log.Verbose(
|
||||||
$"Set model id in state {state.Identifier.Incognito(null)} from {old} to {modelId}. [Affecting {actors.ToLazyString("nothing")}.]");
|
$"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);
|
StateChanged.Invoke(StateChangeType.Model, source, state, actors, null);
|
||||||
StateUpdated.Invoke(StateUpdateType.ModelChange, actors);
|
StateUpdated.Invoke(StateFinalizationType.ModelChange, actors);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
|
@ -421,7 +421,7 @@ public class StateEditor(
|
||||||
$"Applied design to {state.Identifier.Incognito(null)}. [Affecting {actors.ToLazyString("nothing")}.]");
|
$"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
|
StateChanged.Invoke(StateChangeType.Design, state.Sources[MetaIndex.Wetness], state, actors, null); // FIXME: maybe later
|
||||||
if(settings.SendStateUpdate)
|
if(settings.SendStateUpdate)
|
||||||
StateUpdated.Invoke(StateUpdateType.DesignApplied, actors);
|
StateUpdated.Invoke(StateFinalizationType.DesignApplied, actors);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -281,7 +281,7 @@ public class StateListener : IDisposable
|
||||||
|
|
||||||
_objects.Update();
|
_objects.Update();
|
||||||
if (_objects.TryGetValue(identifier, out var actors) && actors.Valid)
|
if (_objects.TryGetValue(identifier, out var actors) && actors.Valid)
|
||||||
_stateUpdated.Invoke(StateUpdateType.Gearset, actors);
|
_stateUpdated.Invoke(StateFinalizationType.Gearset, actors);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -279,7 +279,7 @@ public sealed class StateManager(
|
||||||
StateChanged.Invoke(StateChangeType.Reset, source, state, actors, null);
|
StateChanged.Invoke(StateChangeType.Reset, source, state, actors, null);
|
||||||
// only invoke if we define this reset call as the final call in our state update.
|
// only invoke if we define this reset call as the final call in our state update.
|
||||||
if(stateUpdate)
|
if(stateUpdate)
|
||||||
StateUpdated.Invoke(StateUpdateType.Revert, actors);
|
StateUpdated.Invoke(StateFinalizationType.Revert, actors);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResetAdvancedState(ActorState state, StateSource source, uint key = 0)
|
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")}.]");
|
$"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);
|
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)
|
// 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)
|
public void ResetCustomize(ActorState state, StateSource source, uint key = 0)
|
||||||
|
|
@ -325,7 +325,7 @@ public sealed class StateManager(
|
||||||
Glamourer.Log.Verbose(
|
Glamourer.Log.Verbose(
|
||||||
$"Reset customization state of {state.Identifier.Incognito(null)} to game base. [Affecting {actors.ToLazyString("nothing")}.]");
|
$"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)
|
// 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)
|
public void ResetEquip(ActorState state, StateSource source, uint key = 0)
|
||||||
|
|
@ -376,7 +376,7 @@ public sealed class StateManager(
|
||||||
Glamourer.Log.Verbose(
|
Glamourer.Log.Verbose(
|
||||||
$"Reset equipment state of {state.Identifier.Incognito(null)} to game base. [Affecting {actors.ToLazyString("nothing")}.]");
|
$"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)
|
// 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)
|
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);
|
|| CustomizeArray.Compare(actor.Model.GetCustomize(), state.ModelData.Customize).RequiresRedraw(), false);
|
||||||
StateChanged.Invoke(StateChangeType.Reapply, source, state, data, null);
|
StateChanged.Invoke(StateChangeType.Reapply, source, state, data, null);
|
||||||
if(stateUpdate)
|
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>
|
/// <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);
|
|| CustomizeArray.Compare(actor.Model.GetCustomize(), state.ModelData.Customize).RequiresRedraw(), false);
|
||||||
StateChanged.Invoke(StateChangeType.Reapply, source, state, data, null);
|
StateChanged.Invoke(StateChangeType.Reapply, source, state, data, null);
|
||||||
// invoke the automation update based on what reset is.
|
// 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)
|
public void DeleteState(ActorIdentifier identifier)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue