-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
192 changed files
with
4,106 additions
and
4,104 deletions.
There are no files selected for viewing
Submodule OtterGui
updated
7 files
+54 −0 | Classes/EventWrapperBase.cs | |
+5 −4 | Classes/FrameworkManager.cs | |
+18 −0 | Text/Extended/TerminatedByteString.cs | |
+1 −1 | Text/ImUtf8.Menu.cs | |
+92 −0 | Text/ImUtf8.MenuItem.cs | |
+3 −3 | Text/ImUtf8.Selectable.cs | |
+286 −0 | Text/Widget/Changelog.cs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,43 @@ | ||
using Newtonsoft.Json.Linq; | ||
using OtterGui; | ||
using OtterGui.Services; | ||
using Penumbra.Collections; | ||
using Penumbra.GameData.Structs; | ||
using Penumbra.Interop.PathResolving; | ||
using Penumbra.Meta.Manipulations; | ||
|
||
namespace Penumbra.Api.Api; | ||
|
||
public class MetaApi(CollectionResolver collectionResolver, ApiHelpers helpers) : IPenumbraApiMeta, IApiService | ||
{ | ||
public const int CurrentVersion = 0; | ||
|
||
public string GetPlayerMetaManipulations() | ||
{ | ||
var collection = collectionResolver.PlayerCollection(); | ||
var set = collection.MetaCache?.Manipulations.ToArray() ?? []; | ||
return Functions.ToCompressedBase64(set, MetaManipulation.CurrentVersion); | ||
return CompressMetaManipulations(collection); | ||
} | ||
|
||
public string GetMetaManipulations(int gameObjectIdx) | ||
{ | ||
helpers.AssociatedCollection(gameObjectIdx, out var collection); | ||
var set = collection.MetaCache?.Manipulations.ToArray() ?? []; | ||
return Functions.ToCompressedBase64(set, MetaManipulation.CurrentVersion); | ||
return CompressMetaManipulations(collection); | ||
} | ||
|
||
internal static string CompressMetaManipulations(ModCollection collection) | ||
{ | ||
var array = new JArray(); | ||
if (collection.MetaCache is { } cache) | ||
{ | ||
MetaDictionary.SerializeTo(array, cache.GlobalEqp.Select(kvp => kvp.Key)); | ||
MetaDictionary.SerializeTo(array, cache.Imc.Select(kvp => new KeyValuePair<ImcIdentifier, ImcEntry>(kvp.Key, kvp.Value.Entry))); | ||
MetaDictionary.SerializeTo(array, cache.Eqp.Select(kvp => new KeyValuePair<EqpIdentifier, EqpEntry>(kvp.Key, kvp.Value.Entry))); | ||
MetaDictionary.SerializeTo(array, cache.Eqdp.Select(kvp => new KeyValuePair<EqdpIdentifier, EqdpEntry>(kvp.Key, kvp.Value.Entry))); | ||
MetaDictionary.SerializeTo(array, cache.Est.Select(kvp => new KeyValuePair<EstIdentifier, EstEntry>(kvp.Key, kvp.Value.Entry))); | ||
MetaDictionary.SerializeTo(array, cache.Rsp.Select(kvp => new KeyValuePair<RspIdentifier, RspEntry>(kvp.Key, kvp.Value.Entry))); | ||
MetaDictionary.SerializeTo(array, cache.Gmp.Select(kvp => new KeyValuePair<GmpIdentifier, GmpEntry>(kvp.Key, kvp.Value.Entry))); | ||
} | ||
|
||
return Functions.ToCompressedBase64(array, CurrentVersion); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.