using Dalamud.Plugin; using Penumbra.Api.Api; using Penumbra.Api.Enums; using Penumbra.Api.Helpers; namespace Penumbra.Api.IpcSubscribers; /// public sealed class GetDrawObjectInfo(IDalamudPluginInterface pi) : FuncSubscriber(pi, Label) { /// The label. public const string Label = $"Penumbra.{nameof(GetDrawObjectInfo)}.V5"; /// public new (nint GameObject, (Guid Id, string Name) AssociatedCollection) Invoke(nint drawObjectAddress) => base.Invoke(drawObjectAddress); /// Create a provider. public static FuncProvider Provider(IDalamudPluginInterface pi, IPenumbraApiGameState api) => new(pi, Label, api.GetDrawObjectInfo); } /// public sealed class GetCutsceneParentIndex(IDalamudPluginInterface pi) : FuncSubscriber(pi, Label) { /// The label. public const string Label = $"Penumbra.{nameof(GetCutsceneParentIndex)}"; /// public new int Invoke(int actorIndex) => base.Invoke(actorIndex); /// Create a provider. public static FuncProvider Provider(IDalamudPluginInterface pi, IPenumbraApiGameState api) => new(pi, Label, api.GetCutsceneParentIndex); } /// public sealed class SetCutsceneParentIndex(IDalamudPluginInterface pi) : FuncSubscriber(pi, Label) { /// The label. public const string Label = $"Penumbra.{nameof(SetCutsceneParentIndex)}.V5"; /// public new PenumbraApiEc Invoke(int copyIdx, int newParentIdx) => (PenumbraApiEc)base.Invoke(copyIdx, newParentIdx); /// Create a provider. public static FuncProvider Provider(IDalamudPluginInterface pi, IPenumbraApiGameState api) => new(pi, Label, (a, b) => (int) api.SetCutsceneParentIndex(a, b)); } /// public static class CreatingCharacterBase { /// The label. public const string Label = $"Penumbra.{nameof(CreatingCharacterBase)}.V5"; /// Create a new event subscriber. public static EventSubscriber Subscriber(IDalamudPluginInterface pi, params Action[] actions) => new(pi, Label, actions); /// Create a provider. public static EventProvider Provider(IDalamudPluginInterface pi, IPenumbraApiGameState api) => new(pi, Label, t => api.CreatingCharacterBase += t.Invoke, t => api.CreatingCharacterBase -= t.Invoke); } /// public static class CreatedCharacterBase { /// The label. public const string Label = $"Penumbra.{nameof(CreatedCharacterBase)}.V5"; /// Create a new event subscriber. public static EventSubscriber Subscriber(IDalamudPluginInterface pi, params Action[] actions) => new(pi, Label, actions); /// Create a provider. public static EventProvider Provider(IDalamudPluginInterface pi, IPenumbraApiGameState api) => new(pi, Label, t => api.CreatedCharacterBase += t.Invoke, t => api.CreatedCharacterBase -= t.Invoke); } /// public static class GameObjectResourcePathResolved { /// The label. public const string Label = $"Penumbra.{nameof(GameObjectResourcePathResolved)}"; /// Create a new event subscriber. public static EventSubscriber Subscriber(IDalamudPluginInterface pi, params Action[] actions) => new(pi, Label, actions); /// Create a provider. public static EventProvider Provider(IDalamudPluginInterface pi, IPenumbraApiGameState api) => new(pi, Label, t => api.GameObjectResourceResolved += t.Invoke, t => api.GameObjectResourceResolved -= t.Invoke); }