using Dalamud.Plugin; using Penumbra.Api.Api; using Penumbra.Api.Enums; using Penumbra.Api.Helpers; using PseudoModSetting = System.ValueTuple>>; namespace Penumbra.Api.IpcSubscribers; /// public sealed class CreateTemporaryCollection(IDalamudPluginInterface pi) : FuncSubscriber(pi, Label) { /// The label. public const string Label = $"Penumbra.{nameof(CreateTemporaryCollection)}.V5"; /// public new Guid Invoke(string name = "") => base.Invoke(name); /// Create a provider. public static FuncProvider Provider(IDalamudPluginInterface pi, IPenumbraApiTemporary api) => new(pi, Label, api.CreateTemporaryCollection); } /// public sealed class DeleteTemporaryCollection(IDalamudPluginInterface pi) : FuncSubscriber(pi, Label) { /// The label. public const string Label = $"Penumbra.{nameof(DeleteTemporaryCollection)}.V5"; /// public new PenumbraApiEc Invoke(Guid collectionId) => (PenumbraApiEc)base.Invoke(collectionId); /// Create a provider. public static FuncProvider Provider(IDalamudPluginInterface pi, IPenumbraApiTemporary api) => new(pi, Label, g => (int)api.DeleteTemporaryCollection(g)); } /// public sealed class AssignTemporaryCollection(IDalamudPluginInterface pi) : FuncSubscriber(pi, Label) { /// The label. public const string Label = $"Penumbra.{nameof(AssignTemporaryCollection)}.V5"; /// public new PenumbraApiEc Invoke(Guid collectionId, int actorIndex, bool forceAssignment = true) => (PenumbraApiEc)base.Invoke(collectionId, actorIndex, forceAssignment); /// Create a provider. public static FuncProvider Provider(IDalamudPluginInterface pi, IPenumbraApiTemporary api) => new(pi, Label, (a, b, c) => (int)api.AssignTemporaryCollection(a, b, c)); } /// public sealed class AddTemporaryModAll(IDalamudPluginInterface pi) : FuncSubscriber, string, int, int>(pi, Label) { /// The label. public const string Label = $"Penumbra.{nameof(AddTemporaryModAll)}.V5"; /// public new PenumbraApiEc Invoke(string tag, Dictionary paths, string manipString, int priority) => (PenumbraApiEc)base.Invoke(tag, paths, manipString, priority); /// Create a provider. public static FuncProvider, string, int, int> Provider(IDalamudPluginInterface pi, IPenumbraApiTemporary api) => new(pi, Label, (a, b, c, d) => (int)api.AddTemporaryModAll(a, b, c, d)); } /// public sealed class AddTemporaryMod(IDalamudPluginInterface pi) : FuncSubscriber, string, int, int>(pi, Label) { /// The label. public const string Label = $"Penumbra.{nameof(AddTemporaryMod)}.V5"; /// public new PenumbraApiEc Invoke(string tag, Guid collectionId, Dictionary paths, string manipString, int priority) => (PenumbraApiEc)base.Invoke(tag, collectionId, paths, manipString, priority); /// Create a provider. public static FuncProvider, string, int, int> Provider(IDalamudPluginInterface pi, IPenumbraApiTemporary api) => new(pi, Label, (a, b, c, d, e) => (int)api.AddTemporaryMod(a, b, c, d, e)); } /// public sealed class RemoveTemporaryModAll(IDalamudPluginInterface pi) : FuncSubscriber(pi, Label) { /// The label. public const string Label = $"Penumbra.{nameof(RemoveTemporaryModAll)}.V5"; /// public new PenumbraApiEc Invoke(string tag, int priority) => (PenumbraApiEc)base.Invoke(tag, priority); /// Create a provider. public static FuncProvider Provider(IDalamudPluginInterface pi, IPenumbraApiTemporary api) => new(pi, Label, (a, b) => (int)api.RemoveTemporaryModAll(a, b)); } /// public sealed class RemoveTemporaryMod(IDalamudPluginInterface pi) : FuncSubscriber(pi, Label) { /// The label. public const string Label = $"Penumbra.{nameof(RemoveTemporaryMod)}.V5"; /// public new PenumbraApiEc Invoke(string tag, Guid collectionId, int priority) => (PenumbraApiEc)base.Invoke(tag, collectionId, priority); /// Create a provider. public static FuncProvider Provider(IDalamudPluginInterface pi, IPenumbraApiTemporary api) => new(pi, Label, (a, b, c) => (int)api.RemoveTemporaryMod(a, b, c)); } /// public sealed class SetTemporaryModSettings(IDalamudPluginInterface pi) : FuncSubscriber(pi, Label) { /// The label. public const string Label = $"Penumbra.{nameof(SetTemporaryModSettings)}.V5"; /// public PenumbraApiEc Invoke(Guid collectionId, string modDirectory, bool inherit, bool enabled, int priority, IReadOnlyDictionary> settings, string source, int key = 0, string modName = "") => (PenumbraApiEc)Invoke(collectionId, modDirectory, modName, (inherit, enabled, priority, settings), source, key); /// Create a provider. public static FuncProvider 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)); } /// public sealed class SetTemporaryModSettingsPlayer(IDalamudPluginInterface pi) : FuncSubscriber(pi, Label) { /// The label. public const string Label = $"Penumbra.{nameof(SetTemporaryModSettingsPlayer)}.V5"; /// public PenumbraApiEc Invoke(int objectIndex, string modDirectory, bool inherit, bool enabled, int priority, IReadOnlyDictionary> settings, string source, int key = 0, string modName = "") => (PenumbraApiEc)Invoke(objectIndex, modDirectory, modName, (inherit, enabled, priority, settings), source, key); /// Create a provider. public static FuncProvider 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)); } /// public sealed class RemoveTemporaryModSettings(IDalamudPluginInterface pi) : FuncSubscriber(pi, Label) { /// The label. public const string Label = $"Penumbra.{nameof(RemoveTemporaryModSettings)}.V5"; /// public PenumbraApiEc Invoke(Guid collectionId, string modDirectory, int key = 0, string modName = "") => (PenumbraApiEc)base.Invoke(collectionId, modDirectory, modName, key); /// Create a provider. public static FuncProvider Provider(IDalamudPluginInterface pi, IPenumbraApiTemporary api) => new(pi, Label, (a, b, c, d) => (int)api.RemoveTemporaryModSettings(a, b, c, d)); } /// public sealed class RemoveTemporaryModSettingsPlayer(IDalamudPluginInterface pi) : FuncSubscriber(pi, Label) { /// The label. public const string Label = $"Penumbra.{nameof(RemoveTemporaryModSettingsPlayer)}.V5"; /// public PenumbraApiEc Invoke(int objectIndex, string modDirectory, int key = 0, string modName = "") => (PenumbraApiEc)base.Invoke(objectIndex, modDirectory, modName, key); /// Create a provider. public static FuncProvider Provider(IDalamudPluginInterface pi, IPenumbraApiTemporary api) => new(pi, Label, (a, b, c, d) => (int)api.RemoveTemporaryModSettingsPlayer(a, b, c, d)); } /// public sealed class RemoveAllTemporaryModSettings(IDalamudPluginInterface pi) : FuncSubscriber(pi, Label) { /// The label. public const string Label = $"Penumbra.{nameof(RemoveAllTemporaryModSettings)}.V5"; /// public new PenumbraApiEc Invoke(Guid collectionId, int key = 0) => (PenumbraApiEc)base.Invoke(collectionId, key); /// Create a provider. public static FuncProvider Provider(IDalamudPluginInterface pi, IPenumbraApiTemporary api) => new(pi, Label, (a, b) => (int)api.RemoveAllTemporaryModSettings(a, b)); } /// public sealed class RemoveAllTemporaryModSettingsPlayer(IDalamudPluginInterface pi) : FuncSubscriber(pi, Label) { /// The label. public const string Label = $"Penumbra.{nameof(RemoveAllTemporaryModSettingsPlayer)}.V5"; /// public new PenumbraApiEc Invoke(int objectIndex, int key = 0) => (PenumbraApiEc)base.Invoke(objectIndex, key); /// Create a provider. public static FuncProvider Provider(IDalamudPluginInterface pi, IPenumbraApiTemporary api) => new(pi, Label, (a, b) => (int)api.RemoveAllTemporaryModSettingsPlayer(a, b)); } /// public sealed class QueryTemporaryModSettings(IDalamudPluginInterface pi) : FuncSubscriber>)?, string)>(pi, Label) { /// The label. public const string Label = $"Penumbra.{nameof(QueryTemporaryModSettings)}.V5"; /// public PenumbraApiEc Invoke(Guid collectionId, string modDirectory, out (bool ForceInherit, bool Enabled, int Priority, Dictionary> Settings)? settings, out string source, int key = 0, string modName = "") { (var ec, settings, source) = Invoke(collectionId, modDirectory, modName, key); return (PenumbraApiEc)ec; } /// Create a provider. public static FuncProvider>)?, 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); }); } /// public sealed class QueryTemporaryModSettingsPlayer(IDalamudPluginInterface pi) : FuncSubscriber>)?, string)>(pi, Label) { /// The label. public const string Label = $"Penumbra.{nameof(QueryTemporaryModSettingsPlayer)}.V5"; /// public PenumbraApiEc Invoke(int objectIndex, string modDirectory, out (bool ForceInherit, bool Enabled, int Priority, Dictionary> Settings)? settings, out string source, int key = 0, string modName = "") { (var ec, settings, source) = Invoke(objectIndex, modDirectory, modName, key); return (PenumbraApiEc)ec; } /// Create a provider. public static FuncProvider>)?, 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); }); }