Initial
This commit is contained in:
154
Penumbra.Api/IpcSubscribers/Collection.cs
Normal file
154
Penumbra.Api/IpcSubscribers/Collection.cs
Normal file
@@ -0,0 +1,154 @@
|
||||
using Dalamud.Plugin;
|
||||
using Penumbra.Api.Api;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Api.Helpers;
|
||||
|
||||
namespace Penumbra.Api.IpcSubscribers;
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiCollection.GetCollections"/>
|
||||
public sealed class GetCollections(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<Dictionary<Guid, string>>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GetCollections)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiCollection.GetCollections"/>
|
||||
public new Dictionary<Guid, string> Invoke()
|
||||
=> base.Invoke();
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<Dictionary<Guid, string>> Provider(IDalamudPluginInterface pi, IPenumbraApiCollection api)
|
||||
=> new(pi, Label, api.GetCollections);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiCollection.GetCollectionsByIdentifier"/>
|
||||
public sealed class GetCollectionsByIdentifier(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, List<(Guid Id, string Name)>>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GetCollectionsByIdentifier)}";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiCollection.GetCollectionsByIdentifier"/>
|
||||
public new List<(Guid Id, string Name)> Invoke(string name)
|
||||
=> base.Invoke(name);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<string, List<(Guid Id, string Name)>> Provider(IDalamudPluginInterface pi, IPenumbraApiCollection api)
|
||||
=> new(pi, Label, api.GetCollectionsByIdentifier);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiCollection.GetChangedItemsForCollection"/>
|
||||
public sealed class GetChangedItemsForCollection(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<Guid, Dictionary<string, object?>>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GetChangedItemsForCollection)}";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiCollection.GetChangedItemsForCollection"/>
|
||||
public new Dictionary<string, object?> Invoke(Guid collectionId)
|
||||
=> base.Invoke(collectionId);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<Guid, Dictionary<string, object?>> Provider(IDalamudPluginInterface pi, IPenumbraApiCollection api)
|
||||
=> new(pi, Label, api.GetChangedItemsForCollection);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiCollection.GetCollection"/>
|
||||
public sealed class GetCollection(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<byte, (Guid Id, string Name)?>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GetCollection)}";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiCollection.GetCollection"/>
|
||||
public (Guid Id, string Name)? Invoke(ApiCollectionType type)
|
||||
=> Invoke((byte)type);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<byte, (Guid Id, string Name)?> Provider(IDalamudPluginInterface pi, IPenumbraApiCollection api)
|
||||
=> new(pi, Label, b => api.GetCollection((ApiCollectionType)b));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiCollection.GetCollectionForObject"/>
|
||||
public sealed class GetCollectionForObject(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<int, (bool ObjectValid, bool IndividualSet, (Guid Id, string Name) EffectiveCollection)>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GetCollectionForObject)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiCollection.GetCollectionForObject"/>
|
||||
public new (bool ObjectValid, bool IndividualSet, (Guid Id, string Name) EffectiveCollection) Invoke(int gameObjectIdx)
|
||||
=> base.Invoke(gameObjectIdx);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<int, (bool ObjectValid, bool IndividualSet, (Guid Id, string Name) EffectiveCollection)>
|
||||
Provider(IDalamudPluginInterface pi, IPenumbraApiCollection api)
|
||||
=> new(pi, Label, api.GetCollectionForObject);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiCollection.SetCollection"/>
|
||||
public sealed class SetCollection(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<byte, Guid?, bool, bool, (int, (Guid Id, string Name)? OldCollection)>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(SetCollection)}";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiCollection.SetCollectionForObject"/>
|
||||
public (PenumbraApiEc, (Guid Id, string Name)? OldCollection) Invoke(ApiCollectionType type, Guid? collectionId,
|
||||
bool allowCreateNew = true, bool allowDelete = true)
|
||||
{
|
||||
var (ec, pair) = Invoke((byte)type, collectionId, allowCreateNew, allowDelete);
|
||||
return ((PenumbraApiEc)ec, pair);
|
||||
}
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<byte, Guid?, bool, bool, (int, (Guid Id, string Name)? OldCollection)>
|
||||
Provider(IDalamudPluginInterface pi, IPenumbraApiCollection api)
|
||||
=> new(pi, Label, (t, g, a, b) =>
|
||||
{
|
||||
var (ret, collection) = api.SetCollection((ApiCollectionType)t, g, a, b);
|
||||
return ((int)ret, collection);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiCollection.SetCollectionForObject"/>
|
||||
public sealed class SetCollectionForObject(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<int, Guid?, bool, bool, (int, (Guid Id, string Name)? OldCollection)>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(SetCollectionForObject)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiCollection.SetCollectionForObject"/>
|
||||
public new (PenumbraApiEc, (Guid Id, string Name)? OldCollection) Invoke(int gameObjectIdx, Guid? collectionId, bool allowCreateNew = true,
|
||||
bool allowDelete = true)
|
||||
{
|
||||
var (ec, pair) = base.Invoke(gameObjectIdx, collectionId, allowCreateNew, allowDelete);
|
||||
return ((PenumbraApiEc)ec, pair);
|
||||
}
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<int, Guid?, bool, bool, (int, (Guid Id, string Name)? OldCollection)>
|
||||
Provider(IDalamudPluginInterface pi, IPenumbraApiCollection api)
|
||||
=> new(pi, Label, (i, g, a, b) =>
|
||||
{
|
||||
var (ret, collection) = api.SetCollectionForObject(i, g, a, b);
|
||||
return ((int)ret, collection);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiCollection.CheckCurrentChangedItemFunc"/>
|
||||
public sealed class CheckCurrentChangedItemFunc(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<Func<string, (string ModDirectory, string ModName)[]>>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(CheckCurrentChangedItemFunc)}";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiCollection.CheckCurrentChangedItemFunc"/>
|
||||
public new Func<string, (string ModDirectory, string ModName)[]> Invoke()
|
||||
=> base.Invoke();
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<Func<string, (string ModDirectory, string ModName)[]>>
|
||||
Provider(IDalamudPluginInterface pi, IPenumbraApiCollection api)
|
||||
=> new(pi, Label, api.CheckCurrentChangedItemFunc);
|
||||
}
|
38
Penumbra.Api/IpcSubscribers/Editing.cs
Normal file
38
Penumbra.Api/IpcSubscribers/Editing.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using Dalamud.Plugin;
|
||||
using Penumbra.Api.Api;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Api.Helpers;
|
||||
|
||||
namespace Penumbra.Api.IpcSubscribers;
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiEditing.ConvertTextureFile"/>
|
||||
public sealed class ConvertTextureFile(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string, int, bool, Task>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(ConvertTextureFile)}";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiEditing.ConvertTextureFile"/>
|
||||
public Task Invoke(string inputFile, string outputFile, TextureType textureType, bool mipMaps = true)
|
||||
=> Invoke(inputFile, outputFile, (int)textureType, mipMaps);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<string, string, int, bool, Task> Provider(IDalamudPluginInterface pi, IPenumbraApiEditing api)
|
||||
=> new(pi, Label, (a, b, c, d) => api.ConvertTextureFile(a, b, (TextureType)c, d));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiEditing.ConvertTextureData"/>
|
||||
public sealed class ConvertTextureData(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<byte[], int, string, int, bool, Task>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(ConvertTextureData)}";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiEditing.ConvertTextureData"/>
|
||||
public Task Invoke(byte[] rgbaData, int width, string outputFile, TextureType textureType, bool mipMaps = true)
|
||||
=> Invoke(rgbaData, width, outputFile, (int)textureType, mipMaps);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<byte[], int, string, int, bool, Task> Provider(IDalamudPluginInterface pi, IPenumbraApiEditing api)
|
||||
=> new(pi, Label, (a, b, c, d, e) => api.ConvertTextureData(a, b, c, (TextureType)d, e));
|
||||
}
|
100
Penumbra.Api/IpcSubscribers/GameState.cs
Normal file
100
Penumbra.Api/IpcSubscribers/GameState.cs
Normal file
@@ -0,0 +1,100 @@
|
||||
using Dalamud.Plugin;
|
||||
using Penumbra.Api.Api;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Api.Helpers;
|
||||
|
||||
namespace Penumbra.Api.IpcSubscribers;
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiGameState.GetDrawObjectInfo"/>
|
||||
public sealed class GetDrawObjectInfo(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<nint, (nint, (Guid, string))>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GetDrawObjectInfo)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiGameState.GetDrawObjectInfo"/>
|
||||
public new (nint GameObject, (Guid Id, string Name) AssociatedCollection) Invoke(nint drawObjectAddress)
|
||||
=> base.Invoke(drawObjectAddress);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<nint, (nint, (Guid, string))> Provider(IDalamudPluginInterface pi, IPenumbraApiGameState api)
|
||||
=> new(pi, Label, api.GetDrawObjectInfo);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiGameState.GetCutsceneParentIndex"/>
|
||||
public sealed class GetCutsceneParentIndex(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<int, int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GetCutsceneParentIndex)}";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiGameState.GetCutsceneParentIndex"/>
|
||||
public new int Invoke(int actorIndex)
|
||||
=> base.Invoke(actorIndex);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<int, int> Provider(IDalamudPluginInterface pi, IPenumbraApiGameState api)
|
||||
=> new(pi, Label, api.GetCutsceneParentIndex);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiGameState.SetCutsceneParentIndex"/>
|
||||
public sealed class SetCutsceneParentIndex(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<int, int, int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(SetCutsceneParentIndex)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiGameState.SetCutsceneParentIndex"/>
|
||||
public new PenumbraApiEc Invoke(int copyIdx, int newParentIdx)
|
||||
=> (PenumbraApiEc)base.Invoke(copyIdx, newParentIdx);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<int, int, int> Provider(IDalamudPluginInterface pi, IPenumbraApiGameState api)
|
||||
=> new(pi, Label, (a, b) => (int) api.SetCutsceneParentIndex(a, b));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiGameState.CreatingCharacterBase"/>
|
||||
public static class CreatingCharacterBase
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(CreatingCharacterBase)}.V5";
|
||||
|
||||
/// <summary> Create a new event subscriber. </summary>
|
||||
public static EventSubscriber<nint, Guid, nint, nint, nint> Subscriber(IDalamudPluginInterface pi,
|
||||
params Action<nint, Guid, nint, nint, nint>[] actions)
|
||||
=> new(pi, Label, actions);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static EventProvider<nint, Guid, nint, nint, nint> Provider(IDalamudPluginInterface pi, IPenumbraApiGameState api)
|
||||
=> new(pi, Label, t => api.CreatingCharacterBase += t.Invoke, t => api.CreatingCharacterBase -= t.Invoke);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiGameState.CreatedCharacterBase"/>
|
||||
public static class CreatedCharacterBase
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(CreatedCharacterBase)}.V5";
|
||||
|
||||
/// <summary> Create a new event subscriber. </summary>
|
||||
public static EventSubscriber<nint, Guid, nint> Subscriber(IDalamudPluginInterface pi, params Action<nint, Guid, nint>[] actions)
|
||||
=> new(pi, Label, actions);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static EventProvider<nint, Guid, nint> Provider(IDalamudPluginInterface pi, IPenumbraApiGameState api)
|
||||
=> new(pi, Label, t => api.CreatedCharacterBase += t.Invoke, t => api.CreatedCharacterBase -= t.Invoke);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiGameState.GameObjectResourceResolved"/>
|
||||
public static class GameObjectResourcePathResolved
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GameObjectResourcePathResolved)}";
|
||||
|
||||
/// <summary> Create a new event subscriber. </summary>
|
||||
public static EventSubscriber<nint, string, string> Subscriber(IDalamudPluginInterface pi, params Action<nint, string, string>[] actions)
|
||||
=> new(pi, Label, actions);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static EventProvider<nint, string, string> Provider(IDalamudPluginInterface pi, IPenumbraApiGameState api)
|
||||
=> new(pi, Label, t => api.GameObjectResourceResolved += t.Invoke, t => api.GameObjectResourceResolved -= t.Invoke);
|
||||
}
|
99
Penumbra.Api/IpcSubscribers/Legacy/Collection.cs
Normal file
99
Penumbra.Api/IpcSubscribers/Legacy/Collection.cs
Normal file
@@ -0,0 +1,99 @@
|
||||
using Dalamud.Plugin;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Api.Helpers;
|
||||
|
||||
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
|
||||
|
||||
namespace Penumbra.Api.IpcSubscribers.Legacy;
|
||||
|
||||
public sealed class GetCollections(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<IList<string>>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(GetCollections)}";
|
||||
|
||||
public new IList<string> Invoke()
|
||||
=> base.Invoke();
|
||||
}
|
||||
|
||||
public sealed class GetCurrentCollectionName(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(GetCurrentCollectionName)}";
|
||||
|
||||
public new string Invoke()
|
||||
=> base.Invoke();
|
||||
}
|
||||
|
||||
public sealed class GetDefaultCollectionName(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(GetDefaultCollectionName)}";
|
||||
|
||||
public new string Invoke()
|
||||
=> base.Invoke();
|
||||
}
|
||||
|
||||
public sealed class GetInterfaceCollectionName(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(GetInterfaceCollectionName)}";
|
||||
|
||||
public new string Invoke()
|
||||
=> base.Invoke();
|
||||
}
|
||||
|
||||
public sealed class GetCharacterCollectionName(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, (string, bool)>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(GetCharacterCollectionName)}";
|
||||
|
||||
public new (string, bool) Invoke(string characterName)
|
||||
=> base.Invoke(characterName);
|
||||
}
|
||||
|
||||
public sealed class GetChangedItems(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, IReadOnlyDictionary<string, object?>>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(GetChangedItems)}";
|
||||
|
||||
public new IReadOnlyDictionary<string, object?> Invoke(string collectionName)
|
||||
=> base.Invoke(collectionName);
|
||||
}
|
||||
|
||||
public sealed class GetCollectionForType(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<ApiCollectionType, string>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(GetCollectionForType)}";
|
||||
|
||||
public new string Invoke(ApiCollectionType collectionType)
|
||||
=> base.Invoke(collectionType);
|
||||
}
|
||||
|
||||
public sealed class SetCollectionForType(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<ApiCollectionType, string, bool, bool, (PenumbraApiEc, string)>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(SetCollectionForType)}";
|
||||
|
||||
public new (PenumbraApiEc ErrorCode, string OldCollectionName) Invoke(ApiCollectionType collectionType, string collectionName,
|
||||
bool allowCreateNew = true, bool allowDelete = true)
|
||||
=> base.Invoke(collectionType, collectionName, allowCreateNew, allowDelete);
|
||||
}
|
||||
|
||||
public sealed class GetCollectionForObject(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<int, (bool, bool, string)>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(GetCollectionForObject)}";
|
||||
|
||||
public new (bool ObjectValid, bool IndividualSet, string CollectionName) Invoke(int objectIndex)
|
||||
=> base.Invoke(objectIndex);
|
||||
}
|
||||
|
||||
public sealed class SetCollectionForObject(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<int, string, bool, bool, (PenumbraApiEc, string)>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(SetCollectionForObject)}";
|
||||
|
||||
public new (PenumbraApiEc ErrorCode, string OldCollectionName) Invoke(int objectIndex, string collectionName, bool allowCreateNew = true,
|
||||
bool allowDelete = true)
|
||||
=> base.Invoke(objectIndex, collectionName, allowCreateNew, allowDelete);
|
||||
}
|
43
Penumbra.Api/IpcSubscribers/Legacy/GameState.cs
Normal file
43
Penumbra.Api/IpcSubscribers/Legacy/GameState.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using Dalamud.Plugin;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Api.Helpers;
|
||||
|
||||
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
|
||||
|
||||
namespace Penumbra.Api.IpcSubscribers.Legacy;
|
||||
|
||||
public sealed class GetDrawObjectInfo(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<nint, (nint, string)>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(GetDrawObjectInfo)}";
|
||||
|
||||
public new (nint GameObjectAddress, string CollectionName) Invoke(nint drawObjectAddress)
|
||||
=> base.Invoke(drawObjectAddress);
|
||||
}
|
||||
|
||||
public sealed class SetCutsceneParentIndex(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<int, int, PenumbraApiEc>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(SetCutsceneParentIndex)}";
|
||||
|
||||
public new PenumbraApiEc Invoke(int cutsceneObjectIndex, int newParentIndex)
|
||||
=> base.Invoke(cutsceneObjectIndex, newParentIndex);
|
||||
}
|
||||
|
||||
public static class CreatingCharacterBase
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(CreatingCharacterBase)}";
|
||||
|
||||
public static EventSubscriber<nint, string, nint, nint, nint> Subscriber(IDalamudPluginInterface pi,
|
||||
params Action<nint, string, nint, nint, nint>[] actions)
|
||||
=> new(pi, Label, actions);
|
||||
}
|
||||
|
||||
public static class CreatedCharacterBase
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(CreatedCharacterBase)}";
|
||||
|
||||
public static EventSubscriber<nint, string, nint> Subscriber(IDalamudPluginInterface pi,
|
||||
params Action<nint, string, nint>[] actions)
|
||||
=> new(pi, Label, actions);
|
||||
}
|
24
Penumbra.Api/IpcSubscribers/Legacy/Meta.cs
Normal file
24
Penumbra.Api/IpcSubscribers/Legacy/Meta.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Dalamud.Plugin;
|
||||
using Penumbra.Api.Helpers;
|
||||
|
||||
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
|
||||
|
||||
namespace Penumbra.Api.IpcSubscribers.Legacy;
|
||||
|
||||
public sealed class GetMetaManipulations(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(GetMetaManipulations)}";
|
||||
|
||||
public new string Invoke(string objectName)
|
||||
=> base.Invoke(objectName);
|
||||
}
|
||||
|
||||
public sealed class GetGameObjectMetaManipulations(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<int, string>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(GetGameObjectMetaManipulations)}";
|
||||
|
||||
public new string Invoke(int objectIndex)
|
||||
=> base.Invoke(objectIndex);
|
||||
}
|
92
Penumbra.Api/IpcSubscribers/Legacy/ModSettings.cs
Normal file
92
Penumbra.Api/IpcSubscribers/Legacy/ModSettings.cs
Normal file
@@ -0,0 +1,92 @@
|
||||
using Dalamud.Plugin;
|
||||
using Penumbra.Api.Api;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Api.Helpers;
|
||||
|
||||
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
|
||||
|
||||
namespace Penumbra.Api.IpcSubscribers.Legacy;
|
||||
|
||||
using CurrentSettings = ValueTuple<PenumbraApiEc, (bool, int, IDictionary<string, IList<string>>, bool)?>;
|
||||
|
||||
public sealed class GetAvailableModSettings(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string, IDictionary<string, (IList<string>, GroupType)>?>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(GetAvailableModSettings)}";
|
||||
|
||||
public new IDictionary<string, (IList<string>, GroupType)>? Invoke(string modDirectory, string modName = "")
|
||||
=> base.Invoke(modDirectory, modName);
|
||||
}
|
||||
|
||||
public sealed class GetCurrentModSettings(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string, string, bool, CurrentSettings>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(GetCurrentModSettings)}";
|
||||
|
||||
public new CurrentSettings Invoke(string collectionName, string modDirectory, string modName = "", bool ignoreInheritance = false)
|
||||
=> base.Invoke(collectionName, modDirectory, modName, ignoreInheritance);
|
||||
}
|
||||
|
||||
public sealed class TryInheritMod(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string, string, bool, PenumbraApiEc>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(TryInheritMod)}";
|
||||
|
||||
public PenumbraApiEc Invoke(string collectionName, string modDirectory, bool inherit, string modName = "")
|
||||
=> Invoke(collectionName, modDirectory, modName, inherit);
|
||||
}
|
||||
|
||||
public sealed class TrySetMod(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string, string, bool, PenumbraApiEc>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(TrySetMod)}";
|
||||
|
||||
public PenumbraApiEc Invoke(string collectionName, string modDirectory, bool enabled, string modName = "")
|
||||
=> Invoke(collectionName, modDirectory, modName, enabled);
|
||||
}
|
||||
|
||||
public sealed class TrySetModPriority(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string, string, int, PenumbraApiEc>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(TrySetModPriority)}";
|
||||
|
||||
public PenumbraApiEc Invoke(string collectionName, string modDirectory, int priority, string modName = "")
|
||||
=> Invoke(collectionName, modDirectory, modName, priority);
|
||||
}
|
||||
|
||||
public sealed class TrySetModSetting(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string, string, string, string, PenumbraApiEc>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(TrySetModSetting)}";
|
||||
|
||||
public new PenumbraApiEc Invoke(string collectionName, string modDirectory, string groupName, string setting, string modName = "")
|
||||
=> base.Invoke(collectionName, modDirectory, modName, groupName, setting);
|
||||
}
|
||||
|
||||
public sealed class TrySetModSettings(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string, string, string, IReadOnlyList<string>, PenumbraApiEc>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(TrySetModSettings)}";
|
||||
|
||||
public PenumbraApiEc Invoke(string collectionName, string modDirectory, string groupName, IReadOnlyList<string> settings,
|
||||
string modName = "")
|
||||
=> Invoke(collectionName, modDirectory, modName, groupName, settings);
|
||||
}
|
||||
|
||||
public static class ModSettingChanged
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(ModSettingChanged)}.V5";
|
||||
|
||||
public static EventSubscriber<ModSettingChange, string, string, bool> Subscriber(IDalamudPluginInterface pi,
|
||||
params Action<ModSettingChange, string, string, bool>[] actions)
|
||||
=> new(pi, Label, actions);
|
||||
}
|
||||
|
||||
public sealed class CopyModSettings(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string, string, PenumbraApiEc>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(CopyModSettings)}";
|
||||
|
||||
public new PenumbraApiEc Invoke(string collectionName, string modDirectoryFrom, string modDirectoryTo)
|
||||
=> base.Invoke(collectionName, modDirectoryFrom, modDirectoryTo);
|
||||
}
|
70
Penumbra.Api/IpcSubscribers/Legacy/Mods.cs
Normal file
70
Penumbra.Api/IpcSubscribers/Legacy/Mods.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
using Dalamud.Plugin;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Api.Helpers;
|
||||
|
||||
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
|
||||
|
||||
namespace Penumbra.Api.IpcSubscribers.Legacy;
|
||||
|
||||
public sealed class GetMods(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<IList<(string, string)>>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(GetMods)}";
|
||||
|
||||
public new IList<(string, string)> Invoke()
|
||||
=> base.Invoke();
|
||||
}
|
||||
|
||||
public sealed class ReloadMod(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string, PenumbraApiEc>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(ReloadMod)}";
|
||||
|
||||
public new PenumbraApiEc Invoke(string modDirectory, string modName = "")
|
||||
=> base.Invoke(modDirectory, modName);
|
||||
}
|
||||
|
||||
public sealed class InstallMod(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, PenumbraApiEc>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(InstallMod)}";
|
||||
|
||||
public new PenumbraApiEc Invoke(string modDirectory)
|
||||
=> base.Invoke(modDirectory);
|
||||
}
|
||||
|
||||
public sealed class AddMod(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, PenumbraApiEc>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(AddMod)}";
|
||||
|
||||
public new PenumbraApiEc Invoke(string modDirectory)
|
||||
=> base.Invoke(modDirectory);
|
||||
}
|
||||
|
||||
public sealed class DeleteMod(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string, PenumbraApiEc>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(DeleteMod)}";
|
||||
|
||||
public new PenumbraApiEc Invoke(string modDirectory, string modName = "")
|
||||
=> base.Invoke(modDirectory, modName);
|
||||
}
|
||||
|
||||
public sealed class GetModPath(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string, (PenumbraApiEc, string, bool)>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(GetModPath)}";
|
||||
|
||||
public new (PenumbraApiEc ErrorCode, string Path, bool IsDefault) Invoke(string modDirectory, string modName = "")
|
||||
=> base.Invoke(modDirectory, modName);
|
||||
}
|
||||
|
||||
public sealed class SetModPath(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string, string, PenumbraApiEc>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(SetModPath)}";
|
||||
|
||||
public new PenumbraApiEc Invoke(string modDirectory, string newPath, string modName = "")
|
||||
=> base.Invoke(modDirectory, modName, newPath);
|
||||
}
|
15
Penumbra.Api/IpcSubscribers/Legacy/PluginState.cs
Normal file
15
Penumbra.Api/IpcSubscribers/Legacy/PluginState.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using Dalamud.Plugin;
|
||||
using Penumbra.Api.Helpers;
|
||||
|
||||
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
|
||||
|
||||
namespace Penumbra.Api.IpcSubscribers.Legacy;
|
||||
|
||||
public class ApiVersions(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<(int Breaking, int Features)>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(ApiVersions)}";
|
||||
|
||||
public new (int Breaking, int Features) Invoke()
|
||||
=> base.Invoke();
|
||||
}
|
44
Penumbra.Api/IpcSubscribers/Legacy/Redraw.cs
Normal file
44
Penumbra.Api/IpcSubscribers/Legacy/Redraw.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using Dalamud.Game.ClientState.Objects.Types;
|
||||
using Dalamud.Plugin;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Api.Helpers;
|
||||
|
||||
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
|
||||
|
||||
namespace Penumbra.Api.IpcSubscribers.Legacy;
|
||||
|
||||
public sealed class RedrawAll(IDalamudPluginInterface pi)
|
||||
: ActionSubscriber<RedrawType>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(RedrawAll)}";
|
||||
|
||||
public new void Invoke(RedrawType type)
|
||||
=> base.Invoke(type);
|
||||
}
|
||||
|
||||
public sealed class RedrawObject(IDalamudPluginInterface pi)
|
||||
: ActionSubscriber<IGameObject, RedrawType>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(RedrawObject)}";
|
||||
|
||||
public new void Invoke(IGameObject gameObject, RedrawType type = RedrawType.Redraw)
|
||||
=> base.Invoke(gameObject, type);
|
||||
}
|
||||
|
||||
public sealed class RedrawObjectByIndex(IDalamudPluginInterface pi)
|
||||
: ActionSubscriber<int, RedrawType>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(RedrawObjectByIndex)}";
|
||||
|
||||
public new void Invoke(int gameObjectIndex, RedrawType type = RedrawType.Redraw)
|
||||
=> base.Invoke(gameObjectIndex, type);
|
||||
}
|
||||
|
||||
public sealed class RedrawObjectByName(IDalamudPluginInterface pi)
|
||||
: ActionSubscriber<string, RedrawType>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(RedrawObjectByName)}";
|
||||
|
||||
public new void Invoke(string gameObjectName, RedrawType type = RedrawType.Redraw)
|
||||
=> base.Invoke(gameObjectName, type);
|
||||
}
|
24
Penumbra.Api/IpcSubscribers/Legacy/Resolve.cs
Normal file
24
Penumbra.Api/IpcSubscribers/Legacy/Resolve.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Dalamud.Plugin;
|
||||
using Penumbra.Api.Helpers;
|
||||
|
||||
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
|
||||
|
||||
namespace Penumbra.Api.IpcSubscribers.Legacy;
|
||||
|
||||
public sealed class ResolveCharacterPath(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string, string>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(ResolveCharacterPath)}";
|
||||
|
||||
public new string Invoke(string gamePath, string characterName)
|
||||
=> base.Invoke(gamePath, characterName);
|
||||
}
|
||||
|
||||
public sealed class ReverseResolvePath(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string, string>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(ReverseResolvePath)}";
|
||||
|
||||
public new string Invoke(string gamePath, string characterName)
|
||||
=> base.Invoke(gamePath, characterName);
|
||||
}
|
83
Penumbra.Api/IpcSubscribers/Legacy/ResourceTree.cs
Normal file
83
Penumbra.Api/IpcSubscribers/Legacy/ResourceTree.cs
Normal file
@@ -0,0 +1,83 @@
|
||||
using Dalamud.Plugin;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Api.Helpers;
|
||||
using ResourceType = Penumbra.Api.Enums.ResourceType;
|
||||
|
||||
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
|
||||
|
||||
namespace Penumbra.Api.IpcSubscribers.Legacy;
|
||||
|
||||
public sealed class GetGameObjectResourcePaths(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<ushort[], IReadOnlyDictionary<string, string[]>?[]>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(GetGameObjectResourcePaths)}";
|
||||
|
||||
public new IReadOnlyDictionary<string, string[]>?[] Invoke(params ushort[] objectIndices)
|
||||
=> base.Invoke(objectIndices);
|
||||
}
|
||||
|
||||
public sealed class GetPlayerResourcePaths(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<IReadOnlyDictionary<ushort, IReadOnlyDictionary<string, string[]>>>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(GetPlayerResourcePaths)}";
|
||||
|
||||
public new IReadOnlyDictionary<ushort, IReadOnlyDictionary<string, string[]>> Invoke()
|
||||
=> base.Invoke();
|
||||
}
|
||||
|
||||
public sealed class GetGameObjectResourcesOfType(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<ResourceType, bool, ushort[], IReadOnlyDictionary<nint, (string, string, ChangedItemIcon)>?[]>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(GetGameObjectResourcesOfType)}";
|
||||
|
||||
public new IReadOnlyDictionary<nint, (string, string, ChangedItemIcon)>?[] Invoke(ResourceType type, bool withUiData = false,
|
||||
params ushort[] indices)
|
||||
=> base.Invoke(type, withUiData, indices);
|
||||
}
|
||||
|
||||
public sealed class GetPlayerResourcesOfType(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<ResourceType, bool, IReadOnlyDictionary<ushort, IReadOnlyDictionary<nint, (string, string, ChangedItemIcon)>>>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(GetPlayerResourcesOfType)}";
|
||||
|
||||
public new IReadOnlyDictionary<ushort, IReadOnlyDictionary<nint, (string, string, ChangedItemIcon)>> Invoke(ResourceType type,
|
||||
bool withUiData = false)
|
||||
=> base.Invoke(type, withUiData);
|
||||
}
|
||||
|
||||
public sealed class GetGameObjectResourceTrees(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<bool, ushort[], ResourceTree?[]>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(GetGameObjectResourceTrees)}";
|
||||
|
||||
public new ResourceTree?[] Invoke(bool withUiData = false, params ushort[] indices)
|
||||
=> base.Invoke(withUiData, indices);
|
||||
}
|
||||
|
||||
public sealed class GetPlayerResourceTrees(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<bool, IReadOnlyDictionary<ushort, ResourceTree>>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(GetPlayerResourceTrees)}";
|
||||
|
||||
public new IReadOnlyDictionary<ushort, ResourceTree> Invoke(bool withUiData = false)
|
||||
=> base.Invoke(withUiData);
|
||||
}
|
||||
|
||||
public record ResourceTree
|
||||
{
|
||||
public required string Name { get; init; }
|
||||
public required ushort RaceCode { get; init; }
|
||||
public required List<ResourceNode> Nodes { get; init; }
|
||||
}
|
||||
|
||||
public record ResourceNode
|
||||
{
|
||||
public required ResourceType Type { get; init; }
|
||||
public required ChangedItemIcon Icon { get; init; }
|
||||
public required string? Name { get; init; }
|
||||
public required string? GamePath { get; init; }
|
||||
public required string ActualPath { get; init; }
|
||||
public required nint ObjectAddress { get; init; }
|
||||
public required nint ResourceHandle { get; init; }
|
||||
public required List<ResourceNode> Children { get; init; }
|
||||
}
|
88
Penumbra.Api/IpcSubscribers/Legacy/Temporary.cs
Normal file
88
Penumbra.Api/IpcSubscribers/Legacy/Temporary.cs
Normal file
@@ -0,0 +1,88 @@
|
||||
using Dalamud.Plugin;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Api.Helpers;
|
||||
|
||||
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
|
||||
|
||||
namespace Penumbra.Api.IpcSubscribers.Legacy;
|
||||
|
||||
public sealed class CreateTemporaryCollection(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string, bool, (PenumbraApiEc, string)>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(CreateTemporaryCollection)}";
|
||||
|
||||
public new (PenumbraApiEc ErrorCode, string CollectionName) Invoke(string tag, string character, bool forceOverwrite)
|
||||
=> base.Invoke(tag, character, forceOverwrite);
|
||||
}
|
||||
|
||||
public sealed class RemoveTemporaryCollection(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, PenumbraApiEc>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(RemoveTemporaryCollection)}";
|
||||
|
||||
public new PenumbraApiEc Invoke(string collectionName)
|
||||
=> base.Invoke(collectionName);
|
||||
}
|
||||
|
||||
public sealed class CreateNamedTemporaryCollection(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, PenumbraApiEc>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(CreateNamedTemporaryCollection)}";
|
||||
|
||||
public new PenumbraApiEc Invoke(string collectionName)
|
||||
=> base.Invoke(collectionName);
|
||||
}
|
||||
|
||||
public sealed class RemoveTemporaryCollectionByName(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, PenumbraApiEc>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(RemoveTemporaryCollectionByName)}";
|
||||
|
||||
public new PenumbraApiEc Invoke(string collectionName)
|
||||
=> base.Invoke(collectionName);
|
||||
}
|
||||
|
||||
public sealed class AssignTemporaryCollection(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, int, bool, PenumbraApiEc>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(AssignTemporaryCollection)}";
|
||||
|
||||
public new PenumbraApiEc Invoke(string collectionName, int gameObjectIndex, bool force)
|
||||
=> base.Invoke(collectionName, gameObjectIndex, force);
|
||||
}
|
||||
|
||||
public sealed class AddTemporaryModAll(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, Dictionary<string, string>, string, int, PenumbraApiEc>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(AddTemporaryModAll)}";
|
||||
|
||||
public new PenumbraApiEc Invoke(string tag, Dictionary<string, string> files, string meta, int priority = 0)
|
||||
=> base.Invoke(tag, files, meta, priority);
|
||||
}
|
||||
|
||||
public sealed class AddTemporaryMod(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string, Dictionary<string, string>, string, int, PenumbraApiEc>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(AddTemporaryMod)}";
|
||||
|
||||
public new PenumbraApiEc Invoke(string tag, string collectionName, Dictionary<string, string> files, string meta, int priority = 0)
|
||||
=> base.Invoke(tag, collectionName, files, meta, priority);
|
||||
}
|
||||
|
||||
public sealed class RemoveTemporaryModAll(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, int, PenumbraApiEc>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(RemoveTemporaryModAll)}";
|
||||
|
||||
public new PenumbraApiEc Invoke(string tag, int priority = 0)
|
||||
=> base.Invoke(tag, priority);
|
||||
}
|
||||
|
||||
public sealed class RemoveTemporaryMod(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string, int, PenumbraApiEc>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(RemoveTemporaryMod)}";
|
||||
|
||||
public new PenumbraApiEc Invoke(string tag, string collectionName, int priority = 0)
|
||||
=> base.Invoke(tag, collectionName, priority);
|
||||
}
|
16
Penumbra.Api/IpcSubscribers/Legacy/Ui.cs
Normal file
16
Penumbra.Api/IpcSubscribers/Legacy/Ui.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Dalamud.Plugin;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Api.Helpers;
|
||||
|
||||
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
|
||||
|
||||
namespace Penumbra.Api.IpcSubscribers.Legacy;
|
||||
|
||||
public sealed class OpenMainWindow(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<TabType, string, string, PenumbraApiEc>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(OpenMainWindow)}";
|
||||
|
||||
public new PenumbraApiEc Invoke(TabType tab, string modName, string modDirectory = "")
|
||||
=> base.Invoke(tab, modName, modDirectory);
|
||||
}
|
37
Penumbra.Api/IpcSubscribers/Meta.cs
Normal file
37
Penumbra.Api/IpcSubscribers/Meta.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using Dalamud.Plugin;
|
||||
using Penumbra.Api.Api;
|
||||
using Penumbra.Api.Helpers;
|
||||
|
||||
namespace Penumbra.Api.IpcSubscribers;
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiMeta.GetPlayerMetaManipulations"/>
|
||||
public sealed class GetPlayerMetaManipulations(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GetPlayerMetaManipulations)}";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiMeta.GetPlayerMetaManipulations"/>
|
||||
public new string Invoke()
|
||||
=> base.Invoke();
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<string> Provider(IDalamudPluginInterface pi, IPenumbraApiMeta api)
|
||||
=> new(pi, Label, api.GetPlayerMetaManipulations);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiMeta.GetMetaManipulations"/>
|
||||
public sealed class GetMetaManipulations(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<int, string>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GetMetaManipulations)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiMeta.GetMetaManipulations"/>
|
||||
public new string Invoke(int gameObjectIdx)
|
||||
=> base.Invoke(gameObjectIdx);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<int, string> Provider(IDalamudPluginInterface pi, IPenumbraApiMeta api)
|
||||
=> new(pi, Label, api.GetMetaManipulations);
|
||||
}
|
218
Penumbra.Api/IpcSubscribers/ModSettings.cs
Normal file
218
Penumbra.Api/IpcSubscribers/ModSettings.cs
Normal file
@@ -0,0 +1,218 @@
|
||||
using Dalamud.Plugin;
|
||||
using Penumbra.Api.Api;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Api.Helpers;
|
||||
|
||||
namespace Penumbra.Api.IpcSubscribers;
|
||||
|
||||
using CurrentSettingsBase = ValueTuple<int, (bool, int, Dictionary<string, List<string>>, bool)?>;
|
||||
using CurrentSettings = ValueTuple<PenumbraApiEc, (bool, int, Dictionary<string, List<string>>, bool)?>;
|
||||
using CurrentSettingsTempBase = ValueTuple<int, (bool, int, Dictionary<string, List<string>>, bool, bool)?>;
|
||||
using CurrentSettingsTemp = ValueTuple<PenumbraApiEc, (bool, int, Dictionary<string, List<string>>, bool, bool)?>;
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiModSettings.GetAvailableModSettings"/>
|
||||
public sealed class GetAvailableModSettings(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string, IReadOnlyDictionary<string, (string[], int)>?>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GetAvailableModSettings)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiModSettings.GetAvailableModSettings"/>
|
||||
public new IReadOnlyDictionary<string, (string[], GroupType)>? Invoke(string modDirectory, string modName = "")
|
||||
=> AvailableModSettings.Create(base.Invoke(modDirectory, modName));
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<string, string, IReadOnlyDictionary<string, (string[], int)>?> Provider(IDalamudPluginInterface pi,
|
||||
IPenumbraApiModSettings api)
|
||||
=> new(pi, Label, (a, b) => api.GetAvailableModSettings(a, b)?.Original);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiModSettings.GetCurrentModSettings"/>
|
||||
public sealed class GetCurrentModSettings(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<Guid, string, string, bool, CurrentSettingsBase>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GetCurrentModSettings)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiModSettings.GetCurrentModSettings"/>
|
||||
public new CurrentSettings Invoke(Guid collectionId, string modDirectory, string modName = "", bool ignoreInheritance = false)
|
||||
{
|
||||
var (ret, t) = base.Invoke(collectionId, modDirectory, modName, ignoreInheritance);
|
||||
return ((PenumbraApiEc)ret, t);
|
||||
}
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<Guid, string, string, bool, CurrentSettingsBase> Provider(IDalamudPluginInterface pi,
|
||||
IPenumbraApiModSettings api)
|
||||
=> new(pi, Label, (a, b, c, d) =>
|
||||
{
|
||||
var (ret, t) = api.GetCurrentModSettings(a, b, c, d);
|
||||
return ((int)ret, t);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiModSettings.GetCurrentModSettingsWithTemp"/>
|
||||
public sealed class GetCurrentModSettingsWithTemp(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<Guid, string, string, bool, bool, int, CurrentSettingsTempBase>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GetCurrentModSettingsWithTemp)}";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiModSettings.GetCurrentModSettingsWithTemp"/>
|
||||
public new CurrentSettingsTemp Invoke(Guid collectionId, string modDirectory, string modName = "", bool ignoreInheritance = false,
|
||||
bool ignoreTemporary = false, int key = 0)
|
||||
{
|
||||
var (ret, t) = base.Invoke(collectionId, modDirectory, modName, ignoreInheritance, ignoreTemporary, key);
|
||||
return ((PenumbraApiEc)ret, t);
|
||||
}
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<Guid, string, string, bool, bool, int, CurrentSettingsTempBase> Provider(IDalamudPluginInterface pi,
|
||||
IPenumbraApiModSettings api)
|
||||
=> new(pi, Label, (a, b, c, d, e, f) =>
|
||||
{
|
||||
var (ret, t) = api.GetCurrentModSettingsWithTemp(a, b, c, d, e, f);
|
||||
return ((int)ret, t);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiModSettings.GetAllModSettings"/>
|
||||
public sealed class GetAllModSettings(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<Guid, bool, bool, int, (int, Dictionary<string, (bool, int, Dictionary<string, List<string>>, bool, bool)>?)>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GetAllModSettings)}";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiModSettings.GetAllModSettings"/>
|
||||
public new (PenumbraApiEc, Dictionary<string, (bool, int, Dictionary<string, List<string>>, bool, bool)>?) Invoke(Guid collectionId,
|
||||
bool ignoreInheritance = false, bool ignoreTemporary = false, int key = 0)
|
||||
{
|
||||
var (ret, t) = base.Invoke(collectionId, ignoreInheritance, ignoreTemporary, key);
|
||||
return ((PenumbraApiEc)ret, t);
|
||||
}
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<Guid, bool, bool, int, (int, Dictionary<string, (bool, int, Dictionary<string, List<string>>, bool, bool)>?)>
|
||||
Provider(IDalamudPluginInterface pi,
|
||||
IPenumbraApiModSettings api)
|
||||
=> new(pi, Label, (a, b, c, d) =>
|
||||
{
|
||||
var (ret, t) = api.GetAllModSettings(a, b, c, d);
|
||||
return ((int)ret, t);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiModSettings.TryInheritMod"/>
|
||||
public sealed class TryInheritMod(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<Guid, string, string, bool, int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(TryInheritMod)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiModSettings.TryInheritMod"/>
|
||||
public PenumbraApiEc Invoke(Guid collectionId, string modDirectory, bool inherit, string modName = "")
|
||||
=> (PenumbraApiEc)Invoke(collectionId, modDirectory, modName, inherit);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<Guid, string, string, bool, int> Provider(IDalamudPluginInterface pi, IPenumbraApiModSettings api)
|
||||
=> new(pi, Label, (a, b, c, d) => (int)api.TryInheritMod(a, b, c, d));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiModSettings.TrySetMod"/>
|
||||
public sealed class TrySetMod(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<Guid, string, string, bool, int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(TrySetMod)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiModSettings.TrySetMod"/>
|
||||
public PenumbraApiEc Invoke(Guid collectionId, string modDirectory, bool inherit, string modName = "")
|
||||
=> (PenumbraApiEc)Invoke(collectionId, modDirectory, modName, inherit);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<Guid, string, string, bool, int> Provider(IDalamudPluginInterface pi, IPenumbraApiModSettings api)
|
||||
=> new(pi, Label, (a, b, c, d) => (int)api.TrySetMod(a, b, c, d));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiModSettings.TrySetModPriority"/>
|
||||
public sealed class TrySetModPriority(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<Guid, string, string, int, int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(TrySetModPriority)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiModSettings.TrySetModPriority"/>
|
||||
public PenumbraApiEc Invoke(Guid collectionId, string modDirectory, int priority, string modName = "")
|
||||
=> (PenumbraApiEc)Invoke(collectionId, modDirectory, modName, priority);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<Guid, string, string, int, int> Provider(IDalamudPluginInterface pi, IPenumbraApiModSettings api)
|
||||
=> new(pi, Label, (a, b, c, d) => (int)api.TrySetModPriority(a, b, c, d));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiModSettings.TrySetModSetting"/>
|
||||
public sealed class TrySetModSetting(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<Guid, string, string, string, string, int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(TrySetModSetting)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiModSettings.TrySetModSetting"/>
|
||||
public new PenumbraApiEc Invoke(Guid collectionId, string modDirectory, string optionGroupName, string optionName, string modName = "")
|
||||
=> (PenumbraApiEc)base.Invoke(collectionId, modDirectory, modName, optionGroupName, optionName);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<Guid, string, string, string, string, int> Provider(IDalamudPluginInterface pi, IPenumbraApiModSettings api)
|
||||
=> new(pi, Label, (a, b, c, d, e) => (int)api.TrySetModSetting(a, b, c, d, e));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiModSettings.TrySetModSettings"/>
|
||||
public sealed class TrySetModSettings(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<Guid, string, string, string, IReadOnlyList<string>, int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(TrySetModSettings)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiModSettings.TrySetModSettings"/>
|
||||
public PenumbraApiEc Invoke(Guid collectionId, string modDirectory, string optionGroupName,
|
||||
IReadOnlyList<string> optionNames, string modName = "")
|
||||
=> (PenumbraApiEc)Invoke(collectionId, modDirectory, modName, optionGroupName, optionNames);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<Guid, string, string, string, IReadOnlyList<string>, int> Provider(IDalamudPluginInterface pi,
|
||||
IPenumbraApiModSettings api)
|
||||
=> new(pi, Label, (a, b, c, d, e) => (int)api.TrySetModSettings(a, b, c, d, e));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiModSettings.ModSettingChanged" />
|
||||
public static class ModSettingChanged
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(ModSettingChanged)}.V5";
|
||||
|
||||
/// <summary> Create a new event subscriber. </summary>
|
||||
public static EventSubscriber<ModSettingChange, Guid, string, bool> Subscriber(IDalamudPluginInterface pi,
|
||||
params Action<ModSettingChange, Guid, string, bool>[] actions)
|
||||
=> new(pi, Label, actions);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static EventProvider<ModSettingChange, Guid, string, bool> Provider(IDalamudPluginInterface pi, IPenumbraApiModSettings api)
|
||||
=> new(pi, Label, t => api.ModSettingChanged += t.Invoke, t => api.ModSettingChanged -= t.Invoke);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiModSettings.CopyModSettings"/>
|
||||
public sealed class CopyModSettings(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<Guid?, string, string, int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(CopyModSettings)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiModSettings.CopyModSettings"/>
|
||||
public new PenumbraApiEc Invoke(Guid? collectionId, string modDirectoryFrom, string modDirectoryTo)
|
||||
=> (PenumbraApiEc)base.Invoke(collectionId, modDirectoryFrom, modDirectoryTo);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<Guid?, string, string, int> Provider(IDalamudPluginInterface pi,
|
||||
IPenumbraApiModSettings api)
|
||||
=> new(pi, Label, (a, b, c) => (int)api.CopyModSettings(a, b, c));
|
||||
}
|
218
Penumbra.Api/IpcSubscribers/Mods.cs
Normal file
218
Penumbra.Api/IpcSubscribers/Mods.cs
Normal file
@@ -0,0 +1,218 @@
|
||||
using Dalamud.Plugin;
|
||||
using Penumbra.Api.Api;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Api.Helpers;
|
||||
|
||||
namespace Penumbra.Api.IpcSubscribers;
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiMods.GetModList"/>
|
||||
public sealed class GetModList(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<Dictionary<string, string>>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GetModList)}";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiMods.GetModList"/>
|
||||
public new Dictionary<string, string> Invoke()
|
||||
=> base.Invoke();
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<Dictionary<string, string>> Provider(IDalamudPluginInterface pi, IPenumbraApiMods api)
|
||||
=> new(pi, Label, api.GetModList);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiMods.InstallMod"/>
|
||||
public sealed class InstallMod(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(InstallMod)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiMods.InstallMod"/>
|
||||
public new PenumbraApiEc Invoke(string modFilePackagePath)
|
||||
=> (PenumbraApiEc)base.Invoke(modFilePackagePath);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<string, int> Provider(IDalamudPluginInterface pi, IPenumbraApiMods api)
|
||||
=> new(pi, Label, a => (int)api.InstallMod(a));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiMods.ReloadMod"/>
|
||||
public sealed class ReloadMod(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string, int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(ReloadMod)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiMods.ReloadMod"/>
|
||||
public new PenumbraApiEc Invoke(string modDirectory, string modName = "")
|
||||
=> (PenumbraApiEc)base.Invoke(modDirectory, modName);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<string, string, int> Provider(IDalamudPluginInterface pi, IPenumbraApiMods api)
|
||||
=> new(pi, Label, (a, b) => (int)api.ReloadMod(a, b));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiMods.AddMod"/>
|
||||
public sealed class AddMod(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(AddMod)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiMods.AddMod"/>
|
||||
public new PenumbraApiEc Invoke(string modDirectory)
|
||||
=> (PenumbraApiEc)base.Invoke(modDirectory);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<string, int> Provider(IDalamudPluginInterface pi, IPenumbraApiMods api)
|
||||
=> new(pi, Label, a => (int)api.AddMod(a));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiMods.DeleteMod"/>
|
||||
public sealed class DeleteMod(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string, int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(DeleteMod)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiMods.DeleteMod"/>
|
||||
public new PenumbraApiEc Invoke(string modDirectory, string modName = "")
|
||||
=> (PenumbraApiEc)base.Invoke(modDirectory, modName);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<string, string, int> Provider(IDalamudPluginInterface pi, IPenumbraApiMods api)
|
||||
=> new(pi, Label, (a, b) => (int)api.DeleteMod(a, b));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiMods.ModDeleted" />
|
||||
public static class ModDeleted
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(ModDeleted)}";
|
||||
|
||||
/// <summary> Create a new event subscriber. </summary>
|
||||
public static EventSubscriber<string> Subscriber(IDalamudPluginInterface pi, params Action<string>[] actions)
|
||||
=> new(pi, Label, actions);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static EventProvider<string> Provider(IDalamudPluginInterface pi, IPenumbraApiMods api)
|
||||
=> new(pi, Label, (t => api.ModDeleted += t, t => api.ModDeleted -= t));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiMods.ModAdded" />
|
||||
public static class ModAdded
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(ModAdded)}";
|
||||
|
||||
/// <summary> Create a new event subscriber. </summary>
|
||||
public static EventSubscriber<string> Subscriber(IDalamudPluginInterface pi, params Action<string>[] actions)
|
||||
=> new(pi, Label, actions);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static EventProvider<string> Provider(IDalamudPluginInterface pi, IPenumbraApiMods api)
|
||||
=> new(pi, Label, (t => api.ModAdded += t, t => api.ModAdded -= t));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiMods.ModMoved" />
|
||||
public static class ModMoved
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(ModMoved)}";
|
||||
|
||||
/// <summary> Create a new event subscriber. </summary>
|
||||
public static EventSubscriber<string, string> Subscriber(IDalamudPluginInterface pi, params Action<string, string>[] actions)
|
||||
=> new(pi, Label, actions);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static EventProvider<string, string> Provider(IDalamudPluginInterface pi, IPenumbraApiMods api)
|
||||
=> new(pi, Label, (t => api.ModMoved += t, t => api.ModMoved -= t));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiMods.GetModPath"/>
|
||||
public sealed class GetModPath(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string, (int, string, bool, bool)>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GetModPath)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiMods.GetModPath"/>
|
||||
public new (PenumbraApiEc, string FullPath, bool FullDefault, bool NameDefault) Invoke(string modDirectory, string modName = "")
|
||||
{
|
||||
var (ret, fullPath, fullDefault, nameDefault) = base.Invoke(modDirectory, modName);
|
||||
return ((PenumbraApiEc)ret, fullPath, fullDefault, nameDefault);
|
||||
}
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<string, string, (int, string, bool, bool)> Provider(IDalamudPluginInterface pi, IPenumbraApiMods api)
|
||||
=> new(pi, Label, (a, b) =>
|
||||
{
|
||||
var (ret, fullPath, fullDefault, nameDefault) = api.GetModPath(a, b);
|
||||
return ((int)ret, fullPath, fullDefault, nameDefault);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiMods.SetModPath"/>
|
||||
public sealed class SetModPath(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string, string, int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(SetModPath)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiMods.SetModPath"/>
|
||||
public new PenumbraApiEc Invoke(string modDirectory, string newPath, string modName = "")
|
||||
=> (PenumbraApiEc)base.Invoke(modDirectory, modName, newPath);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<string, string, string, int> Provider(IDalamudPluginInterface pi, IPenumbraApiMods api)
|
||||
=> new(pi, Label, (a, b, c) => (int)api.SetModPath(a, b, c));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiMods.GetChangedItems"/>
|
||||
public sealed class GetChangedItems(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string, Dictionary<string, object?>>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GetChangedItems)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiMods.GetChangedItems"/>
|
||||
public new Dictionary<string, object?> Invoke(string modDirectory, string modName)
|
||||
=> base.Invoke(modDirectory, modName);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<string, string, Dictionary<string, object?>> Provider(IDalamudPluginInterface pi, IPenumbraApiMods api)
|
||||
=> new(pi, Label, api.GetChangedItems);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiMods.GetChangedItemAdapterDictionary"/>
|
||||
public sealed class GetChangedItemAdapterDictionary(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<IReadOnlyDictionary<string, IReadOnlyDictionary<string, object?>>>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GetChangedItemAdapterDictionary)}";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiMods.GetChangedItemAdapterDictionary"/>
|
||||
public new IReadOnlyDictionary<string, IReadOnlyDictionary<string, object?>> Invoke()
|
||||
=> base.Invoke();
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<IReadOnlyDictionary<string, IReadOnlyDictionary<string, object?>>> Provider(IDalamudPluginInterface pi, IPenumbraApiMods api)
|
||||
=> new(pi, Label, api.GetChangedItemAdapterDictionary);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiMods.GetChangedItemAdapterList"/>
|
||||
public sealed class GetChangedItemAdapterList(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<IReadOnlyList<(string ModDirectory, IReadOnlyDictionary<string, object?> ChangedItems)>>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GetChangedItemAdapterList)}";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiMods.GetChangedItemAdapterList"/>
|
||||
public new IReadOnlyList<(string ModDirectory, IReadOnlyDictionary<string, object?> ChangedItems)> Invoke()
|
||||
=> base.Invoke();
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<IReadOnlyList<(string ModDirectory, IReadOnlyDictionary<string, object?> ChangedItems)>> Provider(IDalamudPluginInterface pi, IPenumbraApiMods api)
|
||||
=> new(pi, Label, api.GetChangedItemAdapterList);
|
||||
}
|
128
Penumbra.Api/IpcSubscribers/PluginState.cs
Normal file
128
Penumbra.Api/IpcSubscribers/PluginState.cs
Normal file
@@ -0,0 +1,128 @@
|
||||
using Dalamud.Plugin;
|
||||
using Penumbra.Api.Api;
|
||||
using Penumbra.Api.Helpers;
|
||||
|
||||
namespace Penumbra.Api.IpcSubscribers;
|
||||
|
||||
/// <summary>Triggered when the Penumbra API is initialized and ready.</summary>
|
||||
public static class Initialized
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{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 Penumbra API is fully disposed and unavailable.</summary>
|
||||
public static class Disposed
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{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);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiBase.ApiVersion"/>
|
||||
public class ApiVersion(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<(int Breaking, int Features)>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(ApiVersion)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiBase.ApiVersion"/>
|
||||
public new (int Breaking, int Features) Invoke()
|
||||
=> base.Invoke();
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<(int Breaking, int Features)> Provider(IDalamudPluginInterface pi, IPenumbraApiBase api)
|
||||
=> new(pi, Label, () => api.ApiVersion);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiPluginState.GetModDirectory"/>
|
||||
public class GetModDirectory(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GetModDirectory)}";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiPluginState.GetModDirectory"/>
|
||||
public new string Invoke()
|
||||
=> base.Invoke();
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<string> Provider(IDalamudPluginInterface pi, IPenumbraApiPluginState api)
|
||||
=> new(pi, Label, api.GetModDirectory);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiPluginState.GetConfiguration"/>
|
||||
public class GetConfiguration(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GetConfiguration)}";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiPluginState.GetConfiguration"/>
|
||||
public new string Invoke()
|
||||
=> base.Invoke();
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<string> Provider(IDalamudPluginInterface pi, IPenumbraApiPluginState api)
|
||||
=> new(pi, Label, api.GetConfiguration);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiPluginState.ModDirectoryChanged" />
|
||||
public static class ModDirectoryChanged
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(ModDirectoryChanged)}";
|
||||
|
||||
/// <summary> Create a new event subscriber. </summary>
|
||||
public static EventSubscriber<string, bool> Subscriber(IDalamudPluginInterface pi, params Action<string, bool>[] actions)
|
||||
=> new(pi, Label, actions);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static EventProvider<string, bool> Provider(IDalamudPluginInterface pi, IPenumbraApiPluginState api)
|
||||
=> new(pi, Label, (t => api.ModDirectoryChanged += t, t => api.ModDirectoryChanged -= t));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiPluginState.GetEnabledState"/>
|
||||
public class GetEnabledState(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<bool>(pi, Label)
|
||||
{
|
||||
public const string Label = $"Penumbra.{nameof(GetEnabledState)}";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiPluginState.GetEnabledState"/>
|
||||
public new bool Invoke()
|
||||
=> base.Invoke();
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<bool> Provider(IDalamudPluginInterface pi, IPenumbraApiPluginState api)
|
||||
=> new(pi, Label, api.GetEnabledState);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiPluginState.EnabledChange" />
|
||||
public static class EnabledChange
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(EnabledChange)}";
|
||||
|
||||
/// <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, IPenumbraApiPluginState api)
|
||||
=> new(pi, Label, (t => api.EnabledChange += t, t => api.EnabledChange -= t));
|
||||
}
|
53
Penumbra.Api/IpcSubscribers/Redraw.cs
Normal file
53
Penumbra.Api/IpcSubscribers/Redraw.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using Dalamud.Plugin;
|
||||
using Penumbra.Api.Api;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Api.Helpers;
|
||||
|
||||
namespace Penumbra.Api.IpcSubscribers;
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiRedraw.RedrawObject"/>
|
||||
public sealed class RedrawObject(IDalamudPluginInterface pi)
|
||||
: ActionSubscriber<int, int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(RedrawObject)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiRedraw.RedrawObject"/>
|
||||
public void Invoke(int gameObjectIndex, RedrawType setting = RedrawType.Redraw)
|
||||
=> base.Invoke(gameObjectIndex, (int)setting);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static ActionProvider<int, int> Provider(IDalamudPluginInterface pi, IPenumbraApiRedraw api)
|
||||
=> new(pi, Label, (a, b) => api.RedrawObject(a, (RedrawType)b));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiRedraw.RedrawAll"/>
|
||||
public sealed class RedrawAll(IDalamudPluginInterface pi)
|
||||
: ActionSubscriber<int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(RedrawAll)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiRedraw.RedrawAll"/>
|
||||
public void Invoke(RedrawType setting = RedrawType.Redraw)
|
||||
=> base.Invoke((int)setting);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static ActionProvider<int> Provider(IDalamudPluginInterface pi, IPenumbraApiRedraw api)
|
||||
=> new(pi, Label, a => api.RedrawAll((RedrawType)a));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiRedraw.GameObjectRedrawn" />
|
||||
public static class GameObjectRedrawn
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GameObjectRedrawn)}";
|
||||
|
||||
/// <summary> Create a new event subscriber. </summary>
|
||||
public static EventSubscriber<nint, int> Subscriber(IDalamudPluginInterface pi, params Action<nint, int>[] actions)
|
||||
=> new(pi, Label, actions);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static EventProvider<nint, int> Provider(IDalamudPluginInterface pi, IPenumbraApiRedraw api)
|
||||
=> new(pi, Label, t => api.GameObjectRedrawn += t.Invoke, t => api.GameObjectRedrawn -= t.Invoke);
|
||||
}
|
133
Penumbra.Api/IpcSubscribers/Resolve.cs
Normal file
133
Penumbra.Api/IpcSubscribers/Resolve.cs
Normal file
@@ -0,0 +1,133 @@
|
||||
using Dalamud.Plugin;
|
||||
using Penumbra.Api.Api;
|
||||
using Penumbra.Api.Helpers;
|
||||
|
||||
namespace Penumbra.Api.IpcSubscribers;
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResolve.ResolveDefaultPath"/>
|
||||
public sealed class ResolveDefaultPath(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(ResolveDefaultPath)}";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResolve.ResolveDefaultPath"/>
|
||||
public new string Invoke(string gamePath)
|
||||
=> base.Invoke(gamePath);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<string, string> Provider(IDalamudPluginInterface pi, IPenumbraApiResolve api)
|
||||
=> new(pi, Label, api.ResolveDefaultPath);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResolve.ResolveInterfacePath"/>
|
||||
public sealed class ResolveInterfacePath(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(ResolveInterfacePath)}";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResolve.ResolveInterfacePath"/>
|
||||
public new string Invoke(string gamePath)
|
||||
=> base.Invoke(gamePath);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<string, string> Provider(IDalamudPluginInterface pi, IPenumbraApiResolve api)
|
||||
=> new(pi, Label, api.ResolveInterfacePath);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResolve.ResolveGameObjectPath"/>
|
||||
public sealed class ResolveGameObjectPath(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, int, string>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(ResolveGameObjectPath)}";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResolve.ResolveGameObjectPath"/>
|
||||
public new string Invoke(string gamePath, int gameObjectIdx)
|
||||
=> base.Invoke(gamePath, gameObjectIdx);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<string, int, string> Provider(IDalamudPluginInterface pi, IPenumbraApiResolve api)
|
||||
=> new(pi, Label, api.ResolveGameObjectPath);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResolve.ResolvePlayerPath"/>
|
||||
public sealed class ResolvePlayerPath(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(ResolvePlayerPath)}";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResolve.ResolvePlayerPath"/>
|
||||
public new string Invoke(string gamePath)
|
||||
=> base.Invoke(gamePath);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<string, string> Provider(IDalamudPluginInterface pi, IPenumbraApiResolve api)
|
||||
=> new(pi, Label, api.ResolvePlayerPath);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResolve.ReverseResolveGameObjectPath"/>
|
||||
public sealed class ReverseResolveGameObjectPath(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, int, string[]>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(ReverseResolveGameObjectPath)}";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResolve.ReverseResolveGameObjectPath"/>
|
||||
public new string[] Invoke(string gamePath, int gameObjectIdx)
|
||||
=> base.Invoke(gamePath, gameObjectIdx);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<string, int, string[]> Provider(IDalamudPluginInterface pi, IPenumbraApiResolve api)
|
||||
=> new(pi, Label, api.ReverseResolveGameObjectPath);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResolve.ReverseResolvePlayerPath"/>
|
||||
public sealed class ReverseResolvePlayerPath(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, string[]>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(ReverseResolvePlayerPath)}";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResolve.ReverseResolvePlayerPath"/>
|
||||
public new string[] Invoke(string gamePath)
|
||||
=> base.Invoke(gamePath);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<string, string[]> Provider(IDalamudPluginInterface pi, IPenumbraApiResolve api)
|
||||
=> new(pi, Label, api.ReverseResolvePlayerPath);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResolve.ResolvePlayerPaths"/>
|
||||
public sealed class ResolvePlayerPaths(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string[], string[], (string[], string[][])>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(ResolvePlayerPaths)}";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResolve.ResolvePlayerPaths"/>
|
||||
public new (string[], string[][]) Invoke(string[] forward, string[] reverse)
|
||||
=> base.Invoke(forward, reverse);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<string[], string[], (string[], string[][])> Provider(IDalamudPluginInterface pi, IPenumbraApiResolve api)
|
||||
=> new(pi, Label, api.ResolvePlayerPaths);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResolve.ResolvePlayerPathsAsync"/>
|
||||
public sealed class ResolvePlayerPathsAsync(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string[], string[], Task<(string[], string[][])>>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(ResolvePlayerPathsAsync)}";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResolve.ResolvePlayerPathsAsync"/>
|
||||
public new Task<(string[], string[][])> Invoke(string[] forward, string[] reverse)
|
||||
=> base.Invoke(forward, reverse);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<string[], string[], Task<(string[], string[][])>> Provider(IDalamudPluginInterface pi, IPenumbraApiResolve api)
|
||||
=> new(pi, Label, api.ResolvePlayerPathsAsync);
|
||||
}
|
116
Penumbra.Api/IpcSubscribers/ResourceTree.cs
Normal file
116
Penumbra.Api/IpcSubscribers/ResourceTree.cs
Normal file
@@ -0,0 +1,116 @@
|
||||
using System.Linq;
|
||||
using Dalamud.Plugin;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Penumbra.Api.Api;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Api.Helpers;
|
||||
|
||||
namespace Penumbra.Api.IpcSubscribers;
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResourceTree.GetGameObjectResourcePaths"/>
|
||||
public sealed class GetGameObjectResourcePaths(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<ushort[], Dictionary<string, HashSet<string>>?[]>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GetGameObjectResourcePaths)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResourceTree.GetGameObjectResourcePaths"/>
|
||||
public new Dictionary<string, HashSet<string>>?[] Invoke(params ushort[] gameObjectIndices)
|
||||
=> base.Invoke(gameObjectIndices);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<ushort[], Dictionary<string, HashSet<string>>?[]> Provider(IDalamudPluginInterface pi,
|
||||
IPenumbraApiResourceTree api)
|
||||
=> new(pi, Label, api.GetGameObjectResourcePaths);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResourceTree.GetPlayerResourcePaths"/>
|
||||
public sealed class GetPlayerResourcePaths(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<Dictionary<ushort, Dictionary<string, HashSet<string>>>>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GetPlayerResourcePaths)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResourceTree.GetPlayerResourcePaths"/>
|
||||
public new Dictionary<ushort, Dictionary<string, HashSet<string>>> Invoke()
|
||||
=> base.Invoke();
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<Dictionary<ushort, Dictionary<string, HashSet<string>>>> Provider(IDalamudPluginInterface pi,
|
||||
IPenumbraApiResourceTree api)
|
||||
=> new(pi, Label, api.GetPlayerResourcePaths);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResourceTree.GetGameObjectResourcesOfType"/>
|
||||
public sealed class GetGameObjectResourcesOfType(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<uint, bool, ushort[], IReadOnlyDictionary<nint, (string, string, uint)>?[]>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GetGameObjectResourcesOfType)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResourceTree.GetGameObjectResourcesOfType"/>
|
||||
public IReadOnlyDictionary<nint, (string, string, ChangedItemIcon)>?[] Invoke(ResourceType type, bool withUiData = false,
|
||||
params ushort[] gameObjectIndices)
|
||||
=> Array.ConvertAll(Invoke((uint)type, withUiData, gameObjectIndices),
|
||||
d => (IReadOnlyDictionary<nint, (string, string, ChangedItemIcon)>?)GameResourceDict.Create(d));
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<uint, bool, ushort[], IReadOnlyDictionary<nint, (string, string, uint)>?[]> Provider(IDalamudPluginInterface pi,
|
||||
IPenumbraApiResourceTree api)
|
||||
=> new(pi, Label,
|
||||
(a, b, c) => Array.ConvertAll(api.GetGameObjectResourcesOfType((ResourceType)a, b, c), d => d?.Original));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResourceTree.GetPlayerResourcesOfType"/>
|
||||
public sealed class GetPlayerResourcesOfType(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<uint, bool, Dictionary<ushort, IReadOnlyDictionary<nint, (string, string, uint)>>>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GetPlayerResourcesOfType)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResourceTree.GetPlayerResourcesOfType"/>
|
||||
public Dictionary<ushort, IReadOnlyDictionary<nint, (string, string, ChangedItemIcon)>> Invoke(ResourceType type, bool withUiData = false)
|
||||
=> Invoke((uint)type, withUiData)
|
||||
.ToDictionary(kvp => kvp.Key, kvp => (IReadOnlyDictionary<nint, (string, string, ChangedItemIcon)>)new GameResourceDict(kvp.Value));
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<uint, bool, Dictionary<ushort, IReadOnlyDictionary<nint, (string, string, uint)>>> Provider(
|
||||
IDalamudPluginInterface pi,
|
||||
IPenumbraApiResourceTree api)
|
||||
=> new(pi, Label,
|
||||
(a, b) => api.GetPlayerResourcesOfType((ResourceType)a, b)
|
||||
.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.Original));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResourceTree.GetGameObjectResourceTrees"/>
|
||||
public sealed class GetGameObjectResourceTrees(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<bool, ushort[], JObject?[]>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GetGameObjectResourceTrees)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResourceTree.GetGameObjectResourceTrees"/>
|
||||
public new ResourceTreeDto?[] Invoke(bool withUiData = false, params ushort[] gameObjectIndices)
|
||||
=> Array.ConvertAll(base.Invoke(withUiData, gameObjectIndices), o => o?.ToObject<ResourceTreeDto>());
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<bool, ushort[], JObject?[]> Provider(IDalamudPluginInterface pi,
|
||||
IPenumbraApiResourceTree api)
|
||||
=> new(pi, Label, api.GetGameObjectResourceTrees);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResourceTree.GetPlayerResourceTrees"/>
|
||||
public sealed class GetPlayerResourceTrees(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<bool, Dictionary<ushort, JObject>>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(GetPlayerResourceTrees)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiResourceTree.GetPlayerResourceTrees"/>
|
||||
public new Dictionary<ushort, ResourceTreeDto> Invoke(bool withUiData = false)
|
||||
=> base.Invoke(withUiData).ToDictionary(kvp => kvp.Key, kvp => kvp.Value.ToObject<ResourceTreeDto>()!);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<bool, Dictionary<ushort, JObject>> Provider(IDalamudPluginInterface pi, IPenumbraApiResourceTree api)
|
||||
=> new(pi, Label, api.GetPlayerResourceTrees);
|
||||
}
|
276
Penumbra.Api/IpcSubscribers/Temporary.cs
Normal file
276
Penumbra.Api/IpcSubscribers/Temporary.cs
Normal file
@@ -0,0 +1,276 @@
|
||||
using Dalamud.Plugin;
|
||||
using Penumbra.Api.Api;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Api.Helpers;
|
||||
using PseudoModSetting =
|
||||
System.ValueTuple<bool, bool, int,
|
||||
System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IReadOnlyList<string>>>;
|
||||
|
||||
namespace Penumbra.Api.IpcSubscribers;
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.CreateTemporaryCollection"/>
|
||||
public sealed class CreateTemporaryCollection(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, Guid>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(CreateTemporaryCollection)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.CreateTemporaryCollection"/>
|
||||
public new Guid Invoke(string name = "")
|
||||
=> base.Invoke(name);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<string, Guid> Provider(IDalamudPluginInterface pi, IPenumbraApiTemporary api)
|
||||
=> new(pi, Label, api.CreateTemporaryCollection);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.DeleteTemporaryCollection"/>
|
||||
public sealed class DeleteTemporaryCollection(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<Guid, int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(DeleteTemporaryCollection)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.DeleteTemporaryCollection"/>
|
||||
public new PenumbraApiEc Invoke(Guid collectionId)
|
||||
=> (PenumbraApiEc)base.Invoke(collectionId);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<Guid, int> Provider(IDalamudPluginInterface pi, IPenumbraApiTemporary api)
|
||||
=> new(pi, Label, g => (int)api.DeleteTemporaryCollection(g));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.AssignTemporaryCollection"/>
|
||||
public sealed class AssignTemporaryCollection(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<Guid, int, bool, int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(AssignTemporaryCollection)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.AssignTemporaryCollection"/>
|
||||
public new PenumbraApiEc Invoke(Guid collectionId, int actorIndex, bool forceAssignment = true)
|
||||
=> (PenumbraApiEc)base.Invoke(collectionId, actorIndex, forceAssignment);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<Guid, int, bool, int> Provider(IDalamudPluginInterface pi, IPenumbraApiTemporary api)
|
||||
=> new(pi, Label, (a, b, c) => (int)api.AssignTemporaryCollection(a, b, c));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.AddTemporaryModAll"/>
|
||||
public sealed class AddTemporaryModAll(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, Dictionary<string, string>, string, int, int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(AddTemporaryModAll)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.AddTemporaryModAll"/>
|
||||
public new PenumbraApiEc Invoke(string tag, Dictionary<string, string> paths, string manipString, int priority)
|
||||
=> (PenumbraApiEc)base.Invoke(tag, paths, manipString, priority);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<string, Dictionary<string, string>, string, int, int> Provider(IDalamudPluginInterface pi,
|
||||
IPenumbraApiTemporary api)
|
||||
=> new(pi, Label, (a, b, c, d) => (int)api.AddTemporaryModAll(a, b, c, d));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.AddTemporaryMod"/>
|
||||
public sealed class AddTemporaryMod(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, Guid, Dictionary<string, string>, string, int, int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(AddTemporaryMod)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.AddTemporaryMod"/>
|
||||
public new PenumbraApiEc Invoke(string tag, Guid collectionId, Dictionary<string, string> paths, string manipString, int priority)
|
||||
=> (PenumbraApiEc)base.Invoke(tag, collectionId, paths, manipString, priority);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<string, Guid, Dictionary<string, string>, string, int, int> Provider(IDalamudPluginInterface pi,
|
||||
IPenumbraApiTemporary api)
|
||||
=> new(pi, Label, (a, b, c, d, e) => (int)api.AddTemporaryMod(a, b, c, d, e));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.RemoveTemporaryModAll"/>
|
||||
public sealed class RemoveTemporaryModAll(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, int, int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(RemoveTemporaryModAll)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.RemoveTemporaryModAll"/>
|
||||
public new PenumbraApiEc Invoke(string tag, int priority)
|
||||
=> (PenumbraApiEc)base.Invoke(tag, priority);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<string, int, int> Provider(IDalamudPluginInterface pi,
|
||||
IPenumbraApiTemporary api)
|
||||
=> new(pi, Label, (a, b) => (int)api.RemoveTemporaryModAll(a, b));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.RemoveTemporaryMod"/>
|
||||
public sealed class RemoveTemporaryMod(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<string, Guid, int, int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(RemoveTemporaryMod)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.RemoveTemporaryMod"/>
|
||||
public new PenumbraApiEc Invoke(string tag, Guid collectionId, int priority)
|
||||
=> (PenumbraApiEc)base.Invoke(tag, collectionId, priority);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<string, Guid, int, int> Provider(IDalamudPluginInterface pi, IPenumbraApiTemporary api)
|
||||
=> new(pi, Label, (a, b, c) => (int)api.RemoveTemporaryMod(a, b, c));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.SetTemporaryModSettings"/>
|
||||
public sealed class SetTemporaryModSettings(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<Guid, string, string, PseudoModSetting, string, int, int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(SetTemporaryModSettings)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.SetTemporaryModSettings"/>
|
||||
public PenumbraApiEc Invoke(Guid collectionId, string modDirectory, bool inherit, bool enabled, int priority,
|
||||
IReadOnlyDictionary<string, IReadOnlyList<string>> settings, string source, int key = 0, string modName = "")
|
||||
=> (PenumbraApiEc)Invoke(collectionId, modDirectory, modName, (inherit, enabled, priority, settings), source, key);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<Guid, string, string, PseudoModSetting, string, int, int> Provider(IDalamudPluginInterface pi,
|
||||
IPenumbraApiTemporary api)
|
||||
=> new(pi, Label, (a, b, c, d, e, f) => (int)api.SetTemporaryModSettings(a, b, c, d.Item1, d.Item2, d.Item3, d.Item4, e, f));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.SetTemporaryModSettingsPlayer"/>
|
||||
public sealed class SetTemporaryModSettingsPlayer(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<int, string, string, PseudoModSetting, string, int, int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(SetTemporaryModSettingsPlayer)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.SetTemporaryModSettingsPlayer"/>
|
||||
public PenumbraApiEc Invoke(int objectIndex, string modDirectory, bool inherit, bool enabled, int priority,
|
||||
IReadOnlyDictionary<string, IReadOnlyList<string>> settings, string source, int key = 0, string modName = "")
|
||||
=> (PenumbraApiEc)Invoke(objectIndex, modDirectory, modName, (inherit, enabled, priority, settings), source, key);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<int, string, string, PseudoModSetting, string, int, int> Provider(IDalamudPluginInterface pi,
|
||||
IPenumbraApiTemporary api)
|
||||
=> new(pi, Label, (a, b, c, d, e, f) => (int)api.SetTemporaryModSettingsPlayer(a, b, c, d.Item1, d.Item2, d.Item3, d.Item4, e, f));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.RemoveTemporaryModSettings"/>
|
||||
public sealed class RemoveTemporaryModSettings(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<Guid, string, string, int, int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(RemoveTemporaryModSettings)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.RemoveTemporaryModSettings"/>
|
||||
public PenumbraApiEc Invoke(Guid collectionId, string modDirectory, int key = 0, string modName = "")
|
||||
=> (PenumbraApiEc)base.Invoke(collectionId, modDirectory, modName, key);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<Guid, string, string, int, int> Provider(IDalamudPluginInterface pi, IPenumbraApiTemporary api)
|
||||
=> new(pi, Label, (a, b, c, d) => (int)api.RemoveTemporaryModSettings(a, b, c, d));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.RemoveTemporaryModSettingsPlayer"/>
|
||||
public sealed class RemoveTemporaryModSettingsPlayer(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<int, string, string, int, int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(RemoveTemporaryModSettingsPlayer)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.RemoveTemporaryModSettingsPlayer"/>
|
||||
public PenumbraApiEc Invoke(int objectIndex, string modDirectory, int key = 0, string modName = "")
|
||||
=> (PenumbraApiEc)base.Invoke(objectIndex, modDirectory, modName, key);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<int, string, string, int, int> Provider(IDalamudPluginInterface pi, IPenumbraApiTemporary api)
|
||||
=> new(pi, Label, (a, b, c, d) => (int)api.RemoveTemporaryModSettingsPlayer(a, b, c, d));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.RemoveAllTemporaryModSettings"/>
|
||||
public sealed class RemoveAllTemporaryModSettings(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<Guid, int, int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(RemoveAllTemporaryModSettings)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.RemoveAllTemporaryModSettings"/>
|
||||
public new PenumbraApiEc Invoke(Guid collectionId, int key = 0)
|
||||
=> (PenumbraApiEc)base.Invoke(collectionId, key);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<Guid, int, int> Provider(IDalamudPluginInterface pi, IPenumbraApiTemporary api)
|
||||
=> new(pi, Label, (a, b) => (int)api.RemoveAllTemporaryModSettings(a, b));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.RemoveAllTemporaryModSettingsPlayer"/>
|
||||
public sealed class RemoveAllTemporaryModSettingsPlayer(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<int, int, int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(RemoveAllTemporaryModSettingsPlayer)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.RemoveAllTemporaryModSettingsPlayer"/>
|
||||
public new PenumbraApiEc Invoke(int objectIndex, int key = 0)
|
||||
=> (PenumbraApiEc)base.Invoke(objectIndex, key);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<int, int, int> Provider(IDalamudPluginInterface pi, IPenumbraApiTemporary api)
|
||||
=> new(pi, Label, (a, b) => (int)api.RemoveAllTemporaryModSettingsPlayer(a, b));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.QueryTemporaryModSettings"/>
|
||||
public sealed class QueryTemporaryModSettings(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<Guid, string, string, int, (int, (bool, bool, int, Dictionary<string, List<string>>)?, string)>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(QueryTemporaryModSettings)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.QueryTemporaryModSettings"/>
|
||||
public PenumbraApiEc Invoke(Guid collectionId, string modDirectory,
|
||||
out (bool ForceInherit, bool Enabled, int Priority, Dictionary<string, List<string>> Settings)? settings, out string source,
|
||||
int key = 0, string modName = "")
|
||||
{
|
||||
(var ec, settings, source) = Invoke(collectionId, modDirectory, modName, key);
|
||||
return (PenumbraApiEc)ec;
|
||||
}
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<Guid, string, string, int, (int, (bool, bool, int, Dictionary<string, List<string>>)?, string)> Provider(
|
||||
IDalamudPluginInterface pi, IPenumbraApiTemporary api)
|
||||
=> new(pi, Label, (a, b, c, d) =>
|
||||
{
|
||||
var (ex, settings, source) = api.QueryTemporaryModSettings(a, b, c, d);
|
||||
return ((int)ex, settings, source);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.QueryTemporaryModSettingsPlayer"/>
|
||||
public sealed class QueryTemporaryModSettingsPlayer(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<int, string, string, int, (int, (bool, bool, int, Dictionary<string, List<string>>)?, string)>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(QueryTemporaryModSettingsPlayer)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiTemporary.QueryTemporaryModSettingsPlayer"/>
|
||||
public PenumbraApiEc Invoke(int objectIndex, string modDirectory,
|
||||
out (bool ForceInherit, bool Enabled, int Priority, Dictionary<string, List<string>> Settings)? settings, out string source,
|
||||
int key = 0, string modName = "")
|
||||
{
|
||||
(var ec, settings, source) = Invoke(objectIndex, modDirectory, modName, key);
|
||||
return (PenumbraApiEc)ec;
|
||||
}
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<int, string, string, int, (int, (bool, bool, int, Dictionary<string, List<string>>)?, string)> Provider(
|
||||
IDalamudPluginInterface pi, IPenumbraApiTemporary api)
|
||||
=> new(pi, Label, (a, b, c, d) =>
|
||||
{
|
||||
var (ex, settings, source) = api.QueryTemporaryModSettingsPlayer(a, b, c, d);
|
||||
return ((int)ex, settings, source);
|
||||
});
|
||||
}
|
130
Penumbra.Api/IpcSubscribers/Ui.cs
Normal file
130
Penumbra.Api/IpcSubscribers/Ui.cs
Normal file
@@ -0,0 +1,130 @@
|
||||
using Dalamud.Plugin;
|
||||
using Penumbra.Api.Api;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Api.Helpers;
|
||||
|
||||
namespace Penumbra.Api.IpcSubscribers;
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiUi.ChangedItemTooltip" />
|
||||
public static class ChangedItemTooltip
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(ChangedItemTooltip)}";
|
||||
|
||||
/// <summary> Create a new event subscriber. </summary>
|
||||
public static EventSubscriber<ChangedItemType, uint> Subscriber(IDalamudPluginInterface pi,
|
||||
params Action<ChangedItemType, uint>[] actions)
|
||||
=> new(pi, Label, actions);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static EventProvider<ChangedItemType, uint> Provider(IDalamudPluginInterface pi, IPenumbraApiUi api)
|
||||
=> new(pi, Label, (d => api.ChangedItemTooltip += d, d => api.ChangedItemTooltip -= d));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiUi.ChangedItemClicked" />
|
||||
public static class ChangedItemClicked
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(ChangedItemClicked)}";
|
||||
|
||||
/// <summary> Create a new event subscriber. </summary>
|
||||
public static EventSubscriber<MouseButton, ChangedItemType, uint> Subscriber(IDalamudPluginInterface pi,
|
||||
params Action<MouseButton, ChangedItemType, uint>[] actions)
|
||||
=> new(pi, Label, actions);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static EventProvider<MouseButton, ChangedItemType, uint> Provider(IDalamudPluginInterface pi, IPenumbraApiUi api)
|
||||
=> new(pi, Label, (d => api.ChangedItemClicked += d, d => api.ChangedItemClicked -= d));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiUi.PreSettingsTabBarDraw" />
|
||||
public static class PreSettingsTabBarDraw
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(PreSettingsTabBarDraw)}";
|
||||
|
||||
/// <summary> Create a new event subscriber. </summary>
|
||||
public static EventSubscriber<string, float, float> Subscriber(IDalamudPluginInterface pi, params Action<string, float, float>[] actions)
|
||||
=> new(pi, Label, actions);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static EventProvider<string, float, float> Provider(IDalamudPluginInterface pi, IPenumbraApiUi api)
|
||||
=> new(pi, Label, (d => api.PreSettingsTabBarDraw += d, d => api.PreSettingsTabBarDraw -= d));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiUi.PreSettingsPanelDraw" />
|
||||
public static class PreSettingsDraw
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(PreSettingsDraw)}";
|
||||
|
||||
/// <summary> Create a new event subscriber. </summary>
|
||||
public static EventSubscriber<string> Subscriber(IDalamudPluginInterface pi, params Action<string>[] actions)
|
||||
=> new(pi, Label, actions);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static EventProvider<string> Provider(IDalamudPluginInterface pi, IPenumbraApiUi api)
|
||||
=> new(pi, Label, (d => api.PreSettingsPanelDraw += d, d => api.PreSettingsPanelDraw -= d));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiUi.PostEnabledDraw" />
|
||||
public static class PostEnabledDraw
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(PostEnabledDraw)}";
|
||||
|
||||
/// <summary> Create a new event subscriber. </summary>
|
||||
public static EventSubscriber<string> Subscriber(IDalamudPluginInterface pi, params Action<string>[] actions)
|
||||
=> new(pi, Label, actions);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static EventProvider<string> Provider(IDalamudPluginInterface pi, IPenumbraApiUi api)
|
||||
=> new(pi, Label, (d => api.PostEnabledDraw += d, d => api.PostEnabledDraw -= d));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiUi.PostSettingsPanelDraw" />
|
||||
public static class PostSettingsDraw
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(PostSettingsDraw)}";
|
||||
|
||||
/// <summary> Create a new event subscriber. </summary>
|
||||
public static EventSubscriber<string> Subscriber(IDalamudPluginInterface pi, params Action<string>[] actions)
|
||||
=> new(pi, Label, actions);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static EventProvider<string> Provider(IDalamudPluginInterface pi, IPenumbraApiUi api)
|
||||
=> new(pi, Label, (d => api.PostSettingsPanelDraw += d, d => api.PostSettingsPanelDraw -= d));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiUi.OpenMainWindow"/>
|
||||
public sealed class OpenMainWindow(IDalamudPluginInterface pi)
|
||||
: FuncSubscriber<int, string, string, int>(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra.{nameof(OpenMainWindow)}.V5";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiUi.OpenMainWindow"/>
|
||||
public PenumbraApiEc Invoke(TabType tab, string modDirectory = "", string modName = "")
|
||||
=> (PenumbraApiEc)Invoke((int)tab, modDirectory, modName);
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static FuncProvider<int, string, string, int> Provider(IDalamudPluginInterface pi, IPenumbraApiUi api)
|
||||
=> new(pi, Label, (a, b, c) => (int)api.OpenMainWindow((TabType)a, b, c));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiUi.CloseMainWindow"/>
|
||||
public sealed class CloseMainWindow(IDalamudPluginInterface pi)
|
||||
: ActionSubscriber(pi, Label)
|
||||
{
|
||||
/// <summary> The label. </summary>
|
||||
public const string Label = $"Penumbra{nameof(CloseMainWindow)}";
|
||||
|
||||
/// <inheritdoc cref="IPenumbraApiUi.CloseMainWindow"/>
|
||||
public new void Invoke()
|
||||
=> base.Invoke();
|
||||
|
||||
/// <summary> Create a provider. </summary>
|
||||
public static ActionProvider Provider(IDalamudPluginInterface pi, IPenumbraApiUi api)
|
||||
=> new(pi, Label, api.CloseMainWindow);
|
||||
}
|
Reference in New Issue
Block a user