Add ResourceTree ipc structure

This commit is contained in:
Asriel Camora 2023-11-28 12:33:19 -08:00
parent 0f03e0484c
commit d647a62e82
No known key found for this signature in database
GPG key ID: 92B8372B278DDE41
4 changed files with 15 additions and 10 deletions

View file

@ -1075,7 +1075,7 @@ public class PenumbraApi : IDisposable, IPenumbraApi
return resDictionaries.AsReadOnly();
}
public IEnumerable<Ipc.ResourceNode>?[] GetGameObjectResourceTrees(bool withUIData, params ushort[] gameObjects)
public Ipc.ResourceTree?[] GetGameObjectResourceTrees(bool withUIData, params ushort[] gameObjects)
{
var characters = gameObjects.Select(index => _dalamud.Objects[index]).OfType<Character>();
var resourceTrees = _resourceTreeFactory.FromCharacters(characters, withUIData ? ResourceTreeFactory.Flags.WithUiData : 0);
@ -1084,7 +1084,7 @@ public class PenumbraApi : IDisposable, IPenumbraApi
return Array.ConvertAll(gameObjects, obj => resDictionary.TryGetValue(obj, out var nodes) ? nodes : null);
}
public IReadOnlyDictionary<ushort, IEnumerable<Ipc.ResourceNode>> GetPlayerResourceTrees(bool withUIData)
public IReadOnlyDictionary<ushort, Ipc.ResourceTree> GetPlayerResourceTrees(bool withUIData)
{
var resourceTrees = _resourceTreeFactory.FromObjectTable(ResourceTreeFactory.Flags.LocalPlayerRelatedOnly
| (withUIData ? ResourceTreeFactory.Flags.WithUiData : 0));

View file

@ -130,8 +130,8 @@ public class PenumbraIpcProviders : IDisposable
FuncProvider<ResourceType, bool, IReadOnlyDictionary<ushort, IReadOnlyDictionary<nint, (string, string, ChangedItemIcon)>>>
GetPlayerResourcesOfType;
internal readonly FuncProvider<bool, ushort[], IEnumerable<Ipc.ResourceNode>?[]> GetGameObjectResourceTrees;
internal readonly FuncProvider<bool, IReadOnlyDictionary<ushort, IEnumerable<Ipc.ResourceNode>>> GetPlayerResourceTrees;
internal readonly FuncProvider<bool, ushort[], Ipc.ResourceTree?[]> GetGameObjectResourceTrees;
internal readonly FuncProvider<bool, IReadOnlyDictionary<ushort, Ipc.ResourceTree>> GetPlayerResourceTrees;
public PenumbraIpcProviders(DalamudServices dalamud, IPenumbraApi api, ModManager modManager, CollectionManager collections,
TempModManager tempMods, TempCollectionManager tempCollections, SaveService saveService, Configuration config)