mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-13 12:14:17 +01:00
add GetPlayerMetaManipulations
This commit is contained in:
parent
78bb869e67
commit
b9ae348529
3 changed files with 42 additions and 18 deletions
|
|
@ -137,6 +137,10 @@ public interface IPenumbraApi : IPenumbraApiBase
|
|||
// Note that success does only imply a successful call, not a successful mod load.
|
||||
public PenumbraApiEc AddMod( string modDirectory );
|
||||
|
||||
// Obtain a base64 encoded, zipped json-string with a prepended version-byte of the current manipulations
|
||||
// for the collection currently associated with the player.
|
||||
public string GetPlayerMetaManipulations();
|
||||
|
||||
// Obtain a base64 encoded, zipped json-string with a prepended version-byte of the current manipulations
|
||||
// for the given collection associated with the character name, or the default collection.
|
||||
public string GetMetaManipulations( string characterName );
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ namespace Penumbra.Api;
|
|||
public class PenumbraApi : IDisposable, IPenumbraApi
|
||||
{
|
||||
public (int, int) ApiVersion
|
||||
=> ( 4, 10 );
|
||||
=> ( 4, 11 );
|
||||
|
||||
private Penumbra? _penumbra;
|
||||
private Lumina.GameData? _lumina;
|
||||
|
|
@ -525,6 +525,14 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
|||
};
|
||||
}
|
||||
|
||||
public string GetPlayerMetaManipulations()
|
||||
{
|
||||
CheckInitialized();
|
||||
var collection = PathResolver.PlayerCollection();
|
||||
var set = collection.MetaCache?.Manipulations.ToArray() ?? Array.Empty< MetaManipulation >();
|
||||
return Functions.ToCompressedBase64( set, MetaManipulation.CurrentVersion );
|
||||
}
|
||||
|
||||
public string GetMetaManipulations( string characterName )
|
||||
{
|
||||
CheckInitialized();
|
||||
|
|
|
|||
|
|
@ -433,6 +433,7 @@ public partial class PenumbraIpc
|
|||
public const string LabelProviderCurrentCollectionName = "Penumbra.GetCurrentCollectionName";
|
||||
public const string LabelProviderDefaultCollectionName = "Penumbra.GetDefaultCollectionName";
|
||||
public const string LabelProviderCharacterCollectionName = "Penumbra.GetCharacterCollectionName";
|
||||
public const string LabelProviderGetPlayerMetaManipulations = "Penumbra.GetPlayerMetaManipulations";
|
||||
public const string LabelProviderGetMetaManipulations = "Penumbra.GetMetaManipulations";
|
||||
|
||||
internal ICallGateProvider< IList< (string, string) > >? ProviderGetMods;
|
||||
|
|
@ -440,6 +441,7 @@ public partial class PenumbraIpc
|
|||
internal ICallGateProvider< string >? ProviderCurrentCollectionName;
|
||||
internal ICallGateProvider< string >? ProviderDefaultCollectionName;
|
||||
internal ICallGateProvider< string, (string, bool) >? ProviderCharacterCollectionName;
|
||||
internal ICallGateProvider< string >? ProviderGetPlayerMetaManipulations;
|
||||
internal ICallGateProvider< string, string >? ProviderGetMetaManipulations;
|
||||
|
||||
private void InitializeDataProviders( DalamudPluginInterface pi )
|
||||
|
|
@ -451,7 +453,7 @@ public partial class PenumbraIpc
|
|||
}
|
||||
catch( Exception e )
|
||||
{
|
||||
PluginLog.Error( $"Error registering IPC provider for {LabelProviderChangedItemClick}:\n{e}" );
|
||||
PluginLog.Error( $"Error registering IPC provider for {LabelProviderGetMods}:\n{e}" );
|
||||
}
|
||||
|
||||
try
|
||||
|
|
@ -461,7 +463,7 @@ public partial class PenumbraIpc
|
|||
}
|
||||
catch( Exception e )
|
||||
{
|
||||
PluginLog.Error( $"Error registering IPC provider for {LabelProviderChangedItemClick}:\n{e}" );
|
||||
PluginLog.Error( $"Error registering IPC provider for {LabelProviderGetCollections}:\n{e}" );
|
||||
}
|
||||
|
||||
try
|
||||
|
|
@ -471,7 +473,7 @@ public partial class PenumbraIpc
|
|||
}
|
||||
catch( Exception e )
|
||||
{
|
||||
PluginLog.Error( $"Error registering IPC provider for {LabelProviderChangedItemClick}:\n{e}" );
|
||||
PluginLog.Error( $"Error registering IPC provider for {LabelProviderCurrentCollectionName}:\n{e}" );
|
||||
}
|
||||
|
||||
try
|
||||
|
|
@ -481,7 +483,7 @@ public partial class PenumbraIpc
|
|||
}
|
||||
catch( Exception e )
|
||||
{
|
||||
PluginLog.Error( $"Error registering IPC provider for {LabelProviderChangedItemClick}:\n{e}" );
|
||||
PluginLog.Error( $"Error registering IPC provider for {LabelProviderDefaultCollectionName}:\n{e}" );
|
||||
}
|
||||
|
||||
try
|
||||
|
|
@ -491,7 +493,17 @@ public partial class PenumbraIpc
|
|||
}
|
||||
catch( Exception e )
|
||||
{
|
||||
PluginLog.Error( $"Error registering IPC provider for {LabelProviderChangedItemClick}:\n{e}" );
|
||||
PluginLog.Error( $"Error registering IPC provider for {LabelProviderCharacterCollectionName}:\n{e}" );
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
ProviderGetPlayerMetaManipulations = pi.GetIpcProvider< string >( LabelProviderGetPlayerMetaManipulations );
|
||||
ProviderGetPlayerMetaManipulations.RegisterFunc( Api.GetPlayerMetaManipulations );
|
||||
}
|
||||
catch( Exception e )
|
||||
{
|
||||
PluginLog.Error( $"Error registering IPC provider for {LabelProviderGetPlayerMetaManipulations}:\n{e}" );
|
||||
}
|
||||
|
||||
try
|
||||
|
|
@ -501,7 +513,7 @@ public partial class PenumbraIpc
|
|||
}
|
||||
catch( Exception e )
|
||||
{
|
||||
PluginLog.Error( $"Error registering IPC provider for {LabelProviderChangedItemClick}:\n{e}" );
|
||||
PluginLog.Error( $"Error registering IPC provider for {LabelProviderGetMetaManipulations}:\n{e}" );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue