This commit is contained in:
2025-08-22 02:19:48 +01:00
commit a4c82452be
373 changed files with 52044 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
using Dalamud.Plugin;
using Glamourer.Api.Api;
using Glamourer.Api.Enums;
using Glamourer.Api.Helpers;
namespace Glamourer.Api.IpcSubscribers;
/// <inheritdoc cref="IGlamourerApiDesigns.GetDesignList"/>
public sealed class GetDesignList(IDalamudPluginInterface pi)
: FuncSubscriber<Dictionary<Guid, string>>(pi, Label)
{
/// <summary> The label. </summary>
public const string Label = $"Glamourer.{nameof(GetDesignList)}.V2";
/// <inheritdoc cref="IGlamourerApiDesigns.GetDesignList"/>
public new Dictionary<Guid, string> Invoke()
=> base.Invoke();
/// <summary> Create a provider. </summary>
public static FuncProvider<Dictionary<Guid, string>> Provider(IDalamudPluginInterface pi, IGlamourerApiDesigns api)
=> new(pi, Label, api.GetDesignList);
}
/// <inheritdoc cref="IGlamourerApiDesigns.ApplyDesign"/>
public sealed class ApplyDesign(IDalamudPluginInterface pi) : FuncSubscriber<Guid, int, uint, ulong, int>(pi, Label)
{
/// <summary> The label. </summary>
public const string Label = $"Glamourer.{nameof(ApplyDesign)}";
/// <inheritdoc cref="IGlamourerApiDesigns.ApplyDesign"/>
public GlamourerApiEc Invoke(Guid designId, int objectIndex, uint key = 0, ApplyFlag flags = ApplyFlagEx.DesignDefault)
=> (GlamourerApiEc)Invoke(designId, objectIndex, key, (ulong)flags);
/// <summary> Create a provider. </summary>
public static FuncProvider<Guid, int, uint, ulong, int> Provider(IDalamudPluginInterface pi, IGlamourerApiDesigns api)
=> new(pi, Label, (a, b, c, d) => (int)api.ApplyDesign(a, b, c, (ApplyFlag)d));
}
/// <inheritdoc cref="IGlamourerApiDesigns.ApplyDesignName"/>
public sealed class ApplyDesignName(IDalamudPluginInterface pi) : FuncSubscriber<Guid, string, uint, ulong, int>(pi, Label)
{
/// <summary> The label. </summary>
public const string Label = $"Glamourer.{nameof(ApplyDesignName)}";
/// <inheritdoc cref="IGlamourerApiDesigns.ApplyDesignName"/>
public GlamourerApiEc Invoke(Guid designId, string objectName, uint key = 0, ApplyFlag flags = ApplyFlagEx.DesignDefault)
=> (GlamourerApiEc)Invoke(designId, objectName, key, (ulong)flags);
/// <summary> Create a provider. </summary>
public static FuncProvider<Guid, string, uint, ulong, int> Provider(IDalamudPluginInterface pi, IGlamourerApiDesigns api)
=> new(pi, Label, (a, b, c, d) => (int)api.ApplyDesignName(a, b, c, (ApplyFlag)d));
}

View File

@@ -0,0 +1,110 @@
using Dalamud.Plugin;
using Glamourer.Api.Api;
using Glamourer.Api.Enums;
using Glamourer.Api.Helpers;
namespace Glamourer.Api.IpcSubscribers;
/// <inheritdoc cref="IGlamourerApiItems.SetItem"/>
public sealed class SetItem(IDalamudPluginInterface pi)
: FuncSubscriber<int, byte, ulong, IReadOnlyList<byte>, uint, ulong, int>(pi, Label)
{
/// <summary> The label. </summary>
public const string Label = $"Glamourer.{nameof(SetItem)}.V3";
/// <inheritdoc cref="IGlamourerApiItems.SetItem"/>
public GlamourerApiEc Invoke(int objectIndex, ApiEquipSlot slot, ulong itemId, IReadOnlyList<byte> stain, uint key = 0,
ApplyFlag flags = ApplyFlag.Once)
=> (GlamourerApiEc)Invoke(objectIndex, (byte)slot, itemId, stain, key, (ulong)flags);
/// <summary> Create a provider. </summary>
public static FuncProvider<int, byte, ulong, IReadOnlyList<byte>, uint, ulong, int> Provider(IDalamudPluginInterface pi,
IGlamourerApiItems api)
=> new(pi, Label, (a, b, c, d, e, f) => (int)api.SetItem(a, (ApiEquipSlot)b, c, d, e, (ApplyFlag)f));
}
/// <inheritdoc cref="IGlamourerApiItems.SetItemName"/>
public sealed class SetItemName(IDalamudPluginInterface pi)
: FuncSubscriber<string, byte, ulong, IReadOnlyList<byte>, uint, ulong, int>(pi, Label)
{
/// <summary> The label. </summary>
public const string Label = $"Glamourer.{nameof(SetItemName)}.V2";
/// <inheritdoc cref="IGlamourerApiItems.SetItem"/>
public GlamourerApiEc Invoke(string objectName, ApiEquipSlot slot, ulong itemId, IReadOnlyList<byte> stain, uint key = 0,
ApplyFlag flags = ApplyFlag.Once)
=> (GlamourerApiEc)Invoke(objectName, (byte)slot, itemId, stain, key, (ulong)flags);
/// <summary> Create a provider. </summary>
public static FuncProvider<string, byte, ulong, IReadOnlyList<byte>, uint, ulong, int> Provider(IDalamudPluginInterface pi,
IGlamourerApiItems api)
=> new(pi, Label, (a, b, c, d, e, f) => (int)api.SetItemName(a, (ApiEquipSlot)b, c, d, e, (ApplyFlag)f));
}
/// <inheritdoc cref="IGlamourerApiItems.SetBonusItem"/>
public sealed class SetBonusItem(IDalamudPluginInterface pi)
: FuncSubscriber<int, byte, ulong, uint, ulong, int>(pi, Label)
{
/// <summary> The label. </summary>
public const string Label = $"Glamourer.{nameof(SetBonusItem)}";
/// <inheritdoc cref="IGlamourerApiItems.SetBonusItem"/>
public GlamourerApiEc Invoke(int objectIndex, ApiBonusSlot slot, ulong itemId, uint key = 0, ApplyFlag flags = ApplyFlag.Once)
=> (GlamourerApiEc)Invoke(objectIndex, (byte)slot, itemId, key, (ulong)flags);
/// <summary> Create a provider. </summary>
public static FuncProvider<int, byte, ulong, uint, ulong, int> Provider(IDalamudPluginInterface pi, IGlamourerApiItems api)
=> new(pi, Label, (a, b, c, d, e) => (int)api.SetBonusItem(a, (ApiBonusSlot)b, c, d, (ApplyFlag)e));
}
/// <inheritdoc cref="IGlamourerApiItems.SetBonusItemName"/>
public sealed class SetBonusItemName(IDalamudPluginInterface pi)
: FuncSubscriber<string, byte, ulong, uint, ulong, int>(pi, Label)
{
/// <summary> The label. </summary>
public const string Label = $"Glamourer.{nameof(SetBonusItemName)}.V2";
/// <inheritdoc cref="IGlamourerApiItems.SetBonusItemName"/>
public GlamourerApiEc Invoke(string objectName, ApiBonusSlot slot, ulong itemId, uint key = 0, ApplyFlag flags = ApplyFlag.Once)
=> (GlamourerApiEc)Invoke(objectName, (byte)slot, itemId, key, (ulong)flags);
/// <summary> Create a provider. </summary>
public static FuncProvider<string, byte, ulong, uint, ulong, int> Provider(IDalamudPluginInterface pi, IGlamourerApiItems api)
=> new(pi, Label, (a, b, c, d, e) => (int)api.SetBonusItemName(a, (ApiBonusSlot)b, c, d, (ApplyFlag)e));
}
/// <inheritdoc cref="IGlamourerApiItems.SetMetaState"/>
public sealed class SetMetaState(IDalamudPluginInterface pi)
: FuncSubscriber<int, ulong, bool, uint, ulong, int>(pi, Label)
{
/// <summary> The label. </summary>
public const string Label = $"Glamourer.{nameof(SetMetaState)}";
/// <inheritdoc cref="IGlamourerApiItems.SetMetaState"/>
public GlamourerApiEc Invoke(int objectIndex, MetaFlag types, bool newValue, uint key = 0,
ApplyFlag flags = ApplyFlag.Once)
=> (GlamourerApiEc)Invoke(objectIndex, (ulong)types, newValue, key, (ulong)flags);
/// <summary> Create a provider. </summary>
public static FuncProvider<int, ulong, bool, uint, ulong, int> Provider(IDalamudPluginInterface pi,
IGlamourerApiItems api)
=> new(pi, Label, (a, b, c, d, e) => (int)api.SetMetaState(a, (MetaFlag)b, c, d, (ApplyFlag)e));
}
/// <inheritdoc cref="IGlamourerApiItems.SetMetaStateName"/>
public sealed class SetMetaStateName(IDalamudPluginInterface pi)
: FuncSubscriber<string, ulong, bool, uint, ulong, int>(pi, Label)
{
/// <summary> The label. </summary>
public const string Label = $"Glamourer.{nameof(SetMetaStateName)}";
/// <inheritdoc cref="IGlamourerApiItems.SetMetaStateName"/>
public GlamourerApiEc Invoke(string objectName, MetaFlag types, bool newValue, uint key = 0,
ApplyFlag flags = ApplyFlag.Once)
=> (GlamourerApiEc)Invoke(objectName, (ulong)types, newValue, key, (ulong)flags);
/// <summary> Create a provider. </summary>
public static FuncProvider<string, ulong, bool, uint, ulong, int> Provider(IDalamudPluginInterface pi,
IGlamourerApiItems api)
=> new(pi, Label, (a, b, c, d, e) => (int)api.SetMetaStateName(a, (MetaFlag)b, c, d, (ApplyFlag)e));
}

View File

@@ -0,0 +1,52 @@
using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.Plugin;
using Glamourer.Api.Helpers;
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
namespace Glamourer.Api.IpcSubscribers.Legacy;
public sealed class GetDesignList(IDalamudPluginInterface pi)
: FuncSubscriber<(string Name, Guid Identifier)[]>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(GetDesignList)}";
public new (string Name, Guid Identifier)[] Invoke()
=> base.Invoke();
}
public sealed class ApplyByGuid(IDalamudPluginInterface pi)
: ActionSubscriber<Guid, string>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(ApplyByGuid)}";
public new void Invoke(Guid design, string name)
=> base.Invoke(design, name);
}
public sealed class ApplyByGuidOnce(IDalamudPluginInterface pi)
: ActionSubscriber<Guid, string>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(ApplyByGuidOnce)}";
public new void Invoke(Guid design, string name)
=> base.Invoke(design, name);
}
public sealed class ApplyByGuidToCharacter(IDalamudPluginInterface pi)
: ActionSubscriber<Guid, ICharacter?>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(ApplyByGuidToCharacter)}";
public new void Invoke(Guid design, ICharacter? character)
=> base.Invoke(design, character);
}
public sealed class ApplyByGuidOnceToCharacter(IDalamudPluginInterface pi)
: ActionSubscriber<Guid, ICharacter?>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(ApplyByGuidOnceToCharacter)}";
public new void Invoke(Guid design, ICharacter? character)
=> base.Invoke(design, character);
}

View File

@@ -0,0 +1,66 @@
using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.Plugin;
using Glamourer.Api.Api;
using Glamourer.Api.Enums;
using Glamourer.Api.Helpers;
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
namespace Glamourer.Api.IpcSubscribers.Legacy;
public sealed class SetItem(IDalamudPluginInterface pi)
: FuncSubscriber<ICharacter?, byte, ulong, byte, uint, int>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(SetItem)}";
public new GlamourerApiEc Invoke(ICharacter? character, byte slot, ulong itemId, byte stainId, uint key)
=> (GlamourerApiEc)base.Invoke(character, slot, itemId, stainId, key);
}
public sealed class SetItemOnce(IDalamudPluginInterface pi)
: FuncSubscriber<ICharacter?, byte, ulong, byte, uint, int>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(SetItemOnce)}";
public new GlamourerApiEc Invoke(ICharacter? character, byte slot, ulong itemId, byte stainId, uint key)
=> (GlamourerApiEc)base.Invoke(character, slot, itemId, stainId, key);
}
public sealed class SetItemByActorName(IDalamudPluginInterface pi)
: FuncSubscriber<string, byte, ulong, byte, uint, int>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(SetItemByActorName)}";
public new GlamourerApiEc Invoke(string actorName, byte slot, ulong itemId, byte stainId, uint key)
=> (GlamourerApiEc)base.Invoke(actorName, slot, itemId, stainId, key);
}
public sealed class SetItemOnceByActorName(IDalamudPluginInterface pi)
: FuncSubscriber<string, byte, ulong, byte, uint, int>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(SetItemOnceByActorName)}";
public new GlamourerApiEc Invoke(string actorName, byte slot, ulong itemId, byte stainId, uint key)
=> (GlamourerApiEc)base.Invoke(actorName, slot, itemId, stainId, key);
}
public sealed class SetItemV2(IDalamudPluginInterface pi)
: FuncSubscriber<int, byte, ulong, byte, uint, ulong, int>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(SetItem)}.V2";
public GlamourerApiEc Invoke(int objectIndex, ApiEquipSlot slot, ulong itemId, byte stain, uint key = 0, ApplyFlag flags = ApplyFlag.Once)
=> (GlamourerApiEc)Invoke(objectIndex, (byte)slot, itemId, stain, key, (ulong)flags);
}
public sealed class SetItemName(IDalamudPluginInterface pi)
: FuncSubscriber<string, byte, ulong, byte, uint, ulong, int>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(SetItemName)}";
public GlamourerApiEc Invoke(string objectName, ApiEquipSlot slot, ulong itemId, byte stain, uint key = 0, ApplyFlag flags = ApplyFlag.Once)
=> (GlamourerApiEc)Invoke(objectName, (byte)slot, itemId, stain, key, (ulong)flags);
public static FuncProvider<string, byte, ulong, byte, uint, ulong, int> Provider(IDalamudPluginInterface pi, IGlamourerApiItems api)
=> new(pi, Label, (a, b, c, d, e, f) => (int)api.SetItemName(a, (ApiEquipSlot)b, c, [d], e, (ApplyFlag)f));
}

View File

@@ -0,0 +1,15 @@
using Dalamud.Plugin;
using Glamourer.Api.Helpers;
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
namespace Glamourer.Api.IpcSubscribers.Legacy;
public sealed class ApiVersions(IDalamudPluginInterface pi)
: FuncSubscriber<(int, int)>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(ApiVersions)}";
public new (int Major, int Minor) Invoke()
=> base.Invoke();
}

View File

@@ -0,0 +1,250 @@
using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.Plugin;
using Glamourer.Api.Helpers;
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
namespace Glamourer.Api.IpcSubscribers.Legacy;
public sealed class Revert(IDalamudPluginInterface pi)
: ActionSubscriber<string>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(Revert)}";
public new void Invoke(string characterName)
=> base.Invoke(characterName);
}
public sealed class RevertCharacter(IDalamudPluginInterface pi)
: ActionSubscriber<ICharacter?>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(RevertCharacter)}";
public new void Invoke(ICharacter? character)
=> base.Invoke(character);
}
public sealed class RevertLock(IDalamudPluginInterface pi)
: ActionSubscriber<string, uint>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(RevertLock)}";
public new void Invoke(string characterName, uint key)
=> base.Invoke(characterName, key);
}
public sealed class RevertCharacterLock(IDalamudPluginInterface pi)
: ActionSubscriber<ICharacter?, uint>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(RevertCharacterLock)}";
public new void Invoke(ICharacter? character, uint key)
=> base.Invoke(character, key);
}
public sealed class RevertToAutomation(IDalamudPluginInterface pi)
: FuncSubscriber<string, uint, bool>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(RevertToAutomation)}";
public new bool Invoke(string characterName, uint key)
=> base.Invoke(characterName, key);
}
public sealed class RevertToAutomationCharacter(IDalamudPluginInterface pi)
: FuncSubscriber<ICharacter?, uint, bool>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(RevertToAutomationCharacter)}";
public new bool Invoke(ICharacter? character, uint key)
=> base.Invoke(character, key);
}
public sealed class Unlock(IDalamudPluginInterface pi)
: FuncSubscriber<ICharacter?, uint, bool>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(Unlock)}";
public new bool Invoke(ICharacter? character, uint key)
=> base.Invoke(character, key);
}
public sealed class UnlockName(IDalamudPluginInterface pi)
: FuncSubscriber<string, uint, bool>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(UnlockName)}";
public new bool Invoke(string characterName, uint key)
=> base.Invoke(characterName, key);
}
public static class StateChanged
{
public const string Label = $"Penumbra.{nameof(StateChanged)}";
public static EventSubscriber<int, nint, Lazy<string>> Subscriber(IDalamudPluginInterface pi,
params Action<int, nint, Lazy<string>>[] actions)
=> new(pi, Label, actions);
}
public sealed class GetAllCustomization(IDalamudPluginInterface pi)
: FuncSubscriber<string, string?>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(GetAllCustomization)}";
public new string? Invoke(string characterName)
=> base.Invoke(characterName);
}
public sealed class GetAllCustomizationFromCharacter(IDalamudPluginInterface pi)
: FuncSubscriber<ICharacter?, string?>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(GetAllCustomizationFromCharacter)}";
public new string? Invoke(ICharacter? character)
=> base.Invoke(character);
}
public sealed class GetAllCustomizationLocked(IDalamudPluginInterface pi)
: FuncSubscriber<string, uint, string?>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(GetAllCustomizationLocked)}";
public new string? Invoke(string characterName, uint key)
=> base.Invoke(characterName, key);
}
public sealed class GetAllCustomizationFromLockedCharacter(IDalamudPluginInterface pi)
: FuncSubscriber<ICharacter?, uint, string?>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(GetAllCustomizationFromLockedCharacter)}";
public new string? Invoke(ICharacter? character, uint key)
=> base.Invoke(character, key);
}
public sealed class ApplyAll(IDalamudPluginInterface pi)
: ActionSubscriber<string, string>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(ApplyAll)}";
public new void Invoke(string characterName, string stateBase64)
=> base.Invoke(characterName, stateBase64);
}
public sealed class ApplyAllOnce(IDalamudPluginInterface pi)
: ActionSubscriber<string, string>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(ApplyAllOnce)}";
public new void Invoke(string characterName, string stateBase64)
=> base.Invoke(characterName, stateBase64);
}
public sealed class ApplyAllToCharacter(IDalamudPluginInterface pi)
: ActionSubscriber<ICharacter?, string>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(ApplyAllToCharacter)}";
public new void Invoke(ICharacter? character, string stateBase64)
=> base.Invoke(character, stateBase64);
}
public sealed class ApplyAllOnceToCharacter(IDalamudPluginInterface pi)
: ActionSubscriber<ICharacter?, string>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(ApplyAllOnceToCharacter)}";
public new void Invoke(ICharacter? character, string stateBase64)
=> base.Invoke(character, stateBase64);
}
public sealed class ApplyOnlyEquipment(IDalamudPluginInterface pi)
: ActionSubscriber<string, string>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(ApplyOnlyEquipment)}";
public new void Invoke(string characterName, string stateBase64)
=> base.Invoke(characterName, stateBase64);
}
public sealed class ApplyOnlyEquipmentToCharacter(IDalamudPluginInterface pi)
: ActionSubscriber<ICharacter?, string>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(ApplyOnlyEquipmentToCharacter)}";
public new void Invoke(ICharacter? character, string stateBase64)
=> base.Invoke(character, stateBase64);
}
public sealed class ApplyOnlyCustomization(IDalamudPluginInterface pi)
: ActionSubscriber<string, string>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(ApplyOnlyCustomization)}";
public new void Invoke(string characterName, string stateBase64)
=> base.Invoke(characterName, stateBase64);
}
public sealed class ApplyOnlyCustomizationToCharacter(IDalamudPluginInterface pi)
: ActionSubscriber<ICharacter?, string>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(ApplyOnlyCustomizationToCharacter)}";
public new void Invoke(ICharacter? character, string stateBase64)
=> base.Invoke(character, stateBase64);
}
public sealed class ApplyAllLock(IDalamudPluginInterface pi)
: ActionSubscriber<string, string, uint>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(ApplyAllLock)}";
public new void Invoke(string characterName, string stateBase64, uint key)
=> base.Invoke(characterName, stateBase64, key);
}
public sealed class ApplyAllToCharacterLock(IDalamudPluginInterface pi)
: ActionSubscriber<ICharacter?, string, uint>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(ApplyAllToCharacterLock)}";
public new void Invoke(ICharacter? character, string stateBase64, uint key)
=> base.Invoke(character, stateBase64, key);
}
public sealed class ApplyOnlyEquipmentLock(IDalamudPluginInterface pi)
: ActionSubscriber<string, string, uint>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(ApplyOnlyEquipmentLock)}";
public new void Invoke(string characterName, string stateBase64, uint key)
=> base.Invoke(characterName, stateBase64, key);
}
public sealed class ApplyOnlyEquipmentToCharacterLock(IDalamudPluginInterface pi)
: ActionSubscriber<ICharacter?, string, uint>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(ApplyOnlyEquipmentToCharacterLock)}";
public new void Invoke(ICharacter? character, string stateBase64, uint key)
=> base.Invoke(character, stateBase64, key);
}
public sealed class ApplyOnlyCustomizationLock(IDalamudPluginInterface pi)
: ActionSubscriber<string, string, uint>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(ApplyOnlyCustomizationLock)}";
public new void Invoke(string characterName, string stateBase64, uint key)
=> base.Invoke(characterName, stateBase64, key);
}
public sealed class ApplyOnlyCustomizationToCharacterLock(IDalamudPluginInterface pi)
: ActionSubscriber<ICharacter?, string, uint>(pi, Label)
{
public const string Label = $"Glamourer.{nameof(ApplyOnlyCustomizationToCharacterLock)}";
public new void Invoke(ICharacter? character, string stateBase64, uint key)
=> base.Invoke(character, stateBase64, key);
}

View File

@@ -0,0 +1,51 @@
using Dalamud.Plugin;
using Glamourer.Api.Api;
using Glamourer.Api.Helpers;
namespace Glamourer.Api.IpcSubscribers;
/// <inheritdoc cref="IGlamourerApiBase.ApiVersion"/>
public sealed class ApiVersion(IDalamudPluginInterface pi)
: FuncSubscriber<(int, int)>(pi, Label)
{
/// <summary> The label. </summary>
public const string Label = $"Glamourer.{nameof(ApiVersion)}.V2";
/// <inheritdoc cref="IGlamourerApiBase.ApiVersion"/>
public new (int Major, int Minor) Invoke()
=> base.Invoke();
/// <summary> Create a provider. </summary>
public static FuncProvider<(int, int)> Provider(IDalamudPluginInterface pi, IGlamourerApiBase api)
=> new(pi, Label, () => api.ApiVersion);
}
/// <summary> Triggered when the Glamourer API is initialized and ready. </summary>
public static class Initialized
{
/// <summary> The label. </summary>
public const string Label = $"Glamourer.{nameof(Initialized)}";
/// <summary> Create a new event subscriber. </summary>
public static EventSubscriber Subscriber(IDalamudPluginInterface pi, params Action[] actions)
=> new(pi, Label, actions);
/// <summary> Create a provider. </summary>
public static EventProvider Provider(IDalamudPluginInterface pi)
=> new(pi, Label);
}
/// <summary> Triggered when the Glamourer API is fully disposed and unavailable. </summary>
public static class Disposed
{
/// <summary> The label. </summary>
public const string Label = $"Glamourer.{nameof(Disposed)}";
/// <summary> Create a new event subscriber. </summary>
public static EventSubscriber Subscriber(IDalamudPluginInterface pi, params Action[] actions)
=> new(pi, Label, actions);
/// <summary> Create a provider. </summary>
public static EventProvider Provider(IDalamudPluginInterface pi)
=> new(pi, Label);
}

View File

@@ -0,0 +1,311 @@
using Dalamud.Plugin;
using Glamourer.Api.Api;
using Glamourer.Api.Enums;
using Glamourer.Api.Helpers;
using Newtonsoft.Json.Linq;
namespace Glamourer.Api.IpcSubscribers;
/// <inheritdoc cref="IGlamourerApiState.GetState"/>
public sealed class GetState(IDalamudPluginInterface pi)
: FuncSubscriber<int, uint, (int, JObject?)>(pi, Label)
{
/// <summary> The label. </summary>
public const string Label = $"Glamourer.{nameof(GetState)}";
/// <inheritdoc cref="IGlamourerApiState.GetState"/>
public new (GlamourerApiEc, JObject?) Invoke(int objectIndex, uint key = 0)
{
var (ec, data) = base.Invoke(objectIndex, key);
return ((GlamourerApiEc)ec, data);
}
/// <summary> Create a provider. </summary>
public static FuncProvider<int, uint, (int, JObject?)> Provider(IDalamudPluginInterface pi, IGlamourerApiState api)
=> new(pi, Label, (a, b) =>
{
var (ec, data) = api.GetState(a, b);
return ((int)ec, data);
});
}
/// <inheritdoc cref="IGlamourerApiState.GetStateName"/>
public sealed class GetStateName(IDalamudPluginInterface pi)
: FuncSubscriber<string, uint, (int, JObject?)>(pi, Label)
{
/// <summary> The label. </summary>
public const string Label = $"Glamourer.{nameof(GetStateName)}";
/// <inheritdoc cref="IGlamourerApiState.GetStateName"/>
public new (GlamourerApiEc, JObject?) Invoke(string objectName, uint key = 0)
{
var (ec, data) = base.Invoke(objectName, key);
return ((GlamourerApiEc)ec, data);
}
/// <summary> Create a provider. </summary>
public static FuncProvider<string, uint, (int, JObject?)> Provider(IDalamudPluginInterface pi, IGlamourerApiState api)
=> new(pi, Label, (i, k) =>
{
var (ec, data) = api.GetStateName(i, k);
return ((int)ec, data);
});
}
/// <inheritdoc cref="IGlamourerApiState.GetStateBase64"/>
public sealed class GetStateBase64(IDalamudPluginInterface pi)
: FuncSubscriber<int, uint, (int, string?)>(pi, Label)
{
/// <summary> The label. </summary>
public const string Label = $"Glamourer.{nameof(GetStateBase64)}";
/// <inheritdoc cref="IGlamourerApiState.GetStateBase64"/>
public new (GlamourerApiEc, string?) Invoke(int objectIndex, uint key = 0)
{
var (ec, data) = base.Invoke(objectIndex, key);
return ((GlamourerApiEc)ec, data);
}
/// <summary> Create a provider. </summary>
public static FuncProvider<int, uint, (int, string?)> Provider(IDalamudPluginInterface pi, IGlamourerApiState api)
=> new(pi, Label, (a, b) =>
{
var (ec, data) = api.GetStateBase64(a, b);
return ((int)ec, data);
});
}
/// <inheritdoc cref="IGlamourerApiState.GetStateBase64Name"/>
public sealed class GetStateBase64Name(IDalamudPluginInterface pi)
: FuncSubscriber<string, uint, (int, string?)>(pi, Label)
{
/// <summary> The label. </summary>
public const string Label = $"Glamourer.{nameof(GetStateBase64Name)}";
/// <inheritdoc cref="IGlamourerApiState.GetStateBase64Name"/>
public new (GlamourerApiEc, string?) Invoke(string objectName, uint key = 0)
{
var (ec, data) = base.Invoke(objectName, key);
return ((GlamourerApiEc)ec, data);
}
/// <summary> Create a provider. </summary>
public static FuncProvider<string, uint, (int, string?)> Provider(IDalamudPluginInterface pi, IGlamourerApiState api)
=> new(pi, Label, (i, k) =>
{
var (ec, data) = api.GetStateBase64Name(i, k);
return ((int)ec, data);
});
}
/// <inheritdoc cref="IGlamourerApiState.ApplyState"/>
public sealed class ApplyState(IDalamudPluginInterface pi)
: FuncSubscriber<object, int, uint, ulong, int>(pi, Label)
{
/// <summary> The label. </summary>
public const string Label = $"Glamourer.{nameof(ApplyState)}";
/// <inheritdoc cref="IGlamourerApiState.ApplyState"/>
public GlamourerApiEc Invoke(JObject state, int objectIndex, uint key = 0, ApplyFlag flags = ApplyFlagEx.StateDefault)
=> (GlamourerApiEc)Invoke(state, objectIndex, key, (ulong)flags);
/// <inheritdoc cref="IGlamourerApiState.ApplyState"/>
public GlamourerApiEc Invoke(string base64State, int objectIndex, uint key = 0, ApplyFlag flags = ApplyFlagEx.StateDefault)
=> (GlamourerApiEc)Invoke(base64State, objectIndex, key, (ulong)flags);
/// <summary> Create a provider. </summary>
public static FuncProvider<object, int, uint, ulong, int> Provider(IDalamudPluginInterface pi, IGlamourerApiState api)
=> new(pi, Label, (a, b, c, d) => (int)api.ApplyState(a, b, c, (ApplyFlag)d));
}
/// <inheritdoc cref="IGlamourerApiState.ApplyStateName"/>
public sealed class ApplyStateName(IDalamudPluginInterface pi)
: FuncSubscriber<object, string, uint, ulong, int>(pi, Label)
{
/// <summary> The label. </summary>
public const string Label = $"Glamourer.{nameof(ApplyStateName)}";
/// <inheritdoc cref="IGlamourerApiState.ApplyState"/>
public GlamourerApiEc Invoke(JObject state, string objectName, uint key = 0, ApplyFlag flags = ApplyFlagEx.StateDefault)
=> (GlamourerApiEc)Invoke(state, objectName, key, (ulong)flags);
/// <inheritdoc cref="IGlamourerApiState.ApplyState"/>
public GlamourerApiEc Invoke(string base64State, string objectName, uint key = 0, ApplyFlag flags = ApplyFlagEx.StateDefault)
=> (GlamourerApiEc)Invoke(base64State, objectName, key, (ulong)flags);
/// <summary> Create a provider. </summary>
public static FuncProvider<object, string, uint, ulong, int> Provider(IDalamudPluginInterface pi, IGlamourerApiState api)
=> new(pi, Label, (a, b, c, d) => (int)api.ApplyStateName(a, b, c, (ApplyFlag)d));
}
/// <inheritdoc cref="IGlamourerApiState.RevertState"/>
public sealed class RevertState(IDalamudPluginInterface pi)
: FuncSubscriber<int, uint, ulong, int>(pi, Label)
{
/// <summary> The label. </summary>
public const string Label = $"Glamourer.{nameof(RevertState)}";
/// <inheritdoc cref="IGlamourerApiState.RevertState"/>
public GlamourerApiEc Invoke(int objectIndex, uint key = 0, ApplyFlag flags = ApplyFlagEx.RevertDefault)
=> (GlamourerApiEc)Invoke(objectIndex, key, (ulong)flags);
/// <summary> Create a provider. </summary>
public static FuncProvider<int, uint, ulong, int> Provider(IDalamudPluginInterface pi, IGlamourerApiState api)
=> new(pi, Label, (a, b, c) => (int)api.RevertState(a, b, (ApplyFlag)c));
}
/// <inheritdoc cref="IGlamourerApiState.RevertStateName"/>
public sealed class RevertStateName(IDalamudPluginInterface pi)
: FuncSubscriber<string, uint, ulong, int>(pi, Label)
{
/// <summary> The label. </summary>
public const string Label = $"Glamourer.{nameof(RevertStateName)}";
/// <inheritdoc cref="IGlamourerApiState.RevertStateName"/>
public GlamourerApiEc Invoke(string objectName, uint key = 0, ApplyFlag flags = ApplyFlagEx.RevertDefault)
=> (GlamourerApiEc)Invoke(objectName, key, (ulong)flags);
/// <summary> Create a provider. </summary>
public static FuncProvider<string, uint, ulong, int> Provider(IDalamudPluginInterface pi, IGlamourerApiState api)
=> new(pi, Label, (a, b, c) => (int)api.RevertStateName(a, b, (ApplyFlag)c));
}
/// <inheritdoc cref="IGlamourerApiState.UnlockState"/>
public sealed class UnlockState(IDalamudPluginInterface pi)
: FuncSubscriber<int, uint, int>(pi, Label)
{
/// <summary> The label. </summary>
public const string Label = $"Glamourer.{nameof(UnlockState)}";
/// <inheritdoc cref="IGlamourerApiState.UnlockState"/>
public new GlamourerApiEc Invoke(int objectIndex, uint key = 0)
=> (GlamourerApiEc)base.Invoke(objectIndex, key);
/// <summary> Create a provider. </summary>
public static FuncProvider<int, uint, int> Provider(IDalamudPluginInterface pi, IGlamourerApiState api)
=> new(pi, Label, (a, b) => (int)api.UnlockState(a, b));
}
/// <inheritdoc cref="IGlamourerApiState.UnlockStateName"/>
public sealed class UnlockStateName(IDalamudPluginInterface pi)
: FuncSubscriber<string, uint, int>(pi, Label)
{
/// <summary> The label. </summary>
public const string Label = $"Glamourer.{nameof(UnlockStateName)}";
/// <inheritdoc cref="IGlamourerApiState.UnlockStateName"/>
public new GlamourerApiEc Invoke(string objectName, uint key = 0)
=> (GlamourerApiEc)base.Invoke(objectName, key);
/// <summary> Create a provider. </summary>
public static FuncProvider<string, uint, int> Provider(IDalamudPluginInterface pi, IGlamourerApiState api)
=> new(pi, Label, (a, b) => (int)api.UnlockStateName(a, b));
}
/// <inheritdoc cref="IGlamourerApiState.UnlockAll"/>
public sealed class UnlockAll(IDalamudPluginInterface pi)
: FuncSubscriber<uint, int>(pi, Label)
{
/// <summary> The label. </summary>
public const string Label = $"Glamourer.{nameof(UnlockAll)}";
/// <inheritdoc cref="IGlamourerApiState.UnlockAll"/>
public new int Invoke(uint key)
=> base.Invoke(key);
/// <summary> Create a provider. </summary>
public static FuncProvider<uint, int> Provider(IDalamudPluginInterface pi, IGlamourerApiState api)
=> new(pi, Label, api.UnlockAll);
}
/// <inheritdoc cref="IGlamourerApiState.RevertToAutomation"/>
public sealed class RevertToAutomation(IDalamudPluginInterface pi)
: FuncSubscriber<int, uint, ulong, int>(pi, Label)
{
/// <summary> The label. </summary>
public const string Label = $"Glamourer.{nameof(RevertToAutomation)}.V2";
/// <inheritdoc cref="IGlamourerApiState.RevertToAutomation"/>
public GlamourerApiEc Invoke(int objectIndex, uint key = 0, ApplyFlag flags = ApplyFlagEx.RevertDefault)
=> (GlamourerApiEc)Invoke(objectIndex, key, (ulong)flags);
/// <summary> Create a provider. </summary>
public static FuncProvider<int, uint, ulong, int> Provider(IDalamudPluginInterface pi, IGlamourerApiState api)
=> new(pi, Label, (a, b, c) => (int)api.RevertToAutomation(a, b, (ApplyFlag)c));
}
/// <inheritdoc cref="IGlamourerApiState.RevertToAutomationName"/>
public sealed class RevertToAutomationName(IDalamudPluginInterface pi)
: FuncSubscriber<string, uint, ulong, int>(pi, Label)
{
/// <summary> The label. </summary>
public const string Label = $"Glamourer.{nameof(RevertToAutomationName)}";
/// <inheritdoc cref="IGlamourerApiState.RevertToAutomationName"/>
public GlamourerApiEc Invoke(string objectName, uint key = 0, ApplyFlag flags = ApplyFlagEx.RevertDefault)
=> (GlamourerApiEc)Invoke(objectName, key, (ulong)flags);
/// <summary> Create a provider. </summary>
public static FuncProvider<string, uint, ulong, int> Provider(IDalamudPluginInterface pi, IGlamourerApiState api)
=> new(pi, Label, (a, b, c) => (int)api.RevertToAutomationName(a, b, (ApplyFlag)c));
}
/// <inheritdoc cref="IGlamourerApiState.StateChanged" />
public static class StateChanged
{
/// <summary> The label. </summary>
public const string Label = $"Penumbra.{nameof(StateChanged)}.V2";
/// <summary> Create a new event subscriber. </summary>
public static EventSubscriber<nint> Subscriber(IDalamudPluginInterface pi, params Action<nint>[] actions)
=> new(pi, Label, actions);
/// <summary> Create a provider. </summary>
public static EventProvider<nint> Provider(IDalamudPluginInterface pi, IGlamourerApiState api)
=> new(pi, Label, (t => api.StateChanged += t, t => api.StateChanged -= t));
}
/// <inheritdoc cref="IGlamourerApiState.StateChangedWithType" />
public static class StateChangedWithType
{
/// <summary> The label. </summary>
public const string Label = $"Penumbra.{nameof(StateChangedWithType)}";
/// <summary> Create a new event subscriber. </summary>
public static EventSubscriber<nint, StateChangeType> Subscriber(IDalamudPluginInterface pi, params Action<nint, StateChangeType>[] actions)
=> new(pi, Label, actions);
/// <summary> Create a provider. </summary>
public static EventProvider<nint, StateChangeType> Provider(IDalamudPluginInterface pi, IGlamourerApiState api)
=> new(pi, Label, (t => api.StateChangedWithType += t, t => api.StateChangedWithType -= t));
}
/// <inheritdoc cref="IGlamourerApiState.StateFinalized" />
public static class StateFinalized
{
/// <summary> The label. </summary>
public const string Label = $"Penumbra.{nameof(StateFinalized)}";
/// <summary> Create a new event subscriber. </summary>
public static EventSubscriber<nint, StateFinalizationType> Subscriber(IDalamudPluginInterface pi, params Action<nint, StateFinalizationType>[] actions)
=> new(pi, Label, actions);
/// <summary> Create a provider. </summary>
public static EventProvider<nint, StateFinalizationType> Provider(IDalamudPluginInterface pi, IGlamourerApiState api)
=> new(pi, Label, (t => api.StateFinalized += t, t => api.StateFinalized -= t));
}
/// <inheritdoc cref="IGlamourerApiState.GPoseChanged" />
public static class GPoseChanged
{
/// <summary> The label. </summary>
public const string Label = $"Penumbra.{nameof(GPoseChanged)}";
/// <summary> Create a new event subscriber. </summary>
public static EventSubscriber<bool> Subscriber(IDalamudPluginInterface pi, params Action<bool>[] actions)
=> new(pi, Label, actions);
/// <summary> Create a provider. </summary>
public static EventProvider<bool> Provider(IDalamudPluginInterface pi, IGlamourerApiState api)
=> new(pi, Label, (t => api.GPoseChanged += t, t => api.GPoseChanged -= t));
}