mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-30 12:23:42 +01:00
Add StateChangedWithType.
This commit is contained in:
parent
86fc472144
commit
0450c4e3f7
8 changed files with 56 additions and 92 deletions
|
|
@ -247,8 +247,9 @@ public sealed class StateApi : IGlamourerApiState, IApiService, IDisposable
|
|||
return ApiHelpers.Return(GlamourerApiEc.Success, args);
|
||||
}
|
||||
|
||||
public event Action<IntPtr>? StateChanged;
|
||||
public event Action<bool>? GPoseChanged;
|
||||
public event Action<nint>? StateChanged;
|
||||
public event Action<IntPtr, StateChangeType>? StateChangedWithType;
|
||||
public event Action<bool>? GPoseChanged;
|
||||
|
||||
private void ApplyDesign(ActorState state, DesignBase design, uint key, ApplyFlag flags)
|
||||
{
|
||||
|
|
@ -329,12 +330,14 @@ public sealed class StateApi : IGlamourerApiState, IApiService, IDisposable
|
|||
private void OnGPoseChange(bool gPose)
|
||||
=> GPoseChanged?.Invoke(gPose);
|
||||
|
||||
private void OnStateChange(StateChanged.Type _1, StateSource _2, ActorState _3, ActorData actors, object? _5)
|
||||
private void OnStateChange(StateChangeType type, StateSource _2, ActorState _3, ActorData actors, object? _5)
|
||||
{
|
||||
if (StateChanged == null)
|
||||
return;
|
||||
if (StateChanged != null)
|
||||
foreach (var actor in actors.Objects)
|
||||
StateChanged.Invoke(actor.Address);
|
||||
|
||||
foreach (var actor in actors.Objects)
|
||||
StateChanged.Invoke(actor.Address);
|
||||
if (StateChangedWithType != null)
|
||||
foreach (var actor in actors.Objects)
|
||||
StateChangedWithType.Invoke(actor.Address, type);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue