mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-02-21 15:27:51 +01:00
Move IPC Arguments around.
This commit is contained in:
parent
a241b933ca
commit
ea79469abd
5 changed files with 12 additions and 9 deletions
|
|
@ -1465,7 +1465,7 @@ public class IpcTester : IDisposable
|
|||
if (ImGui.Button("Get##GameObjectResourcesOfType"))
|
||||
{
|
||||
var gameObjects = GetSelectedGameObjects();
|
||||
var resourcesOfType = Ipc.GetGameObjectResourcesOfType.Subscriber(_pi).Invoke(gameObjects, _type, _withUIData);
|
||||
var resourcesOfType = Ipc.GetGameObjectResourcesOfType.Subscriber(_pi).Invoke(_type, _withUIData, gameObjects);
|
||||
|
||||
_lastGameObjectResourcesOfType = gameObjects
|
||||
.Select(GameObjectToString)
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ using Penumbra.Interop.Services;
|
|||
using Penumbra.UI;
|
||||
using TextureType = Penumbra.Api.Enums.TextureType;
|
||||
using Penumbra.Interop.ResourceTree;
|
||||
using System.Collections.Immutable;
|
||||
|
||||
namespace Penumbra.Api;
|
||||
|
||||
|
|
@ -1033,7 +1032,8 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
|||
return pathDictionaries.AsReadOnly();
|
||||
}
|
||||
|
||||
public IReadOnlyDictionary<nint, (string, string, ChangedItemIcon)>?[] GetGameObjectResourcesOfType(ushort[] gameObjects, ResourceType type, bool withUIData)
|
||||
public IReadOnlyDictionary<nint, (string, string, ChangedItemIcon)>?[] GetGameObjectResourcesOfType(ResourceType type, 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);
|
||||
|
|
@ -1042,9 +1042,11 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
|||
return Array.ConvertAll(gameObjects, obj => resDictionaries.TryGetValue(obj, out var resDict) ? resDict : null);
|
||||
}
|
||||
|
||||
public IReadOnlyDictionary<ushort, IReadOnlyDictionary<nint, (string, string, ChangedItemIcon)>> GetPlayerResourcesOfType(ResourceType type, bool withUIData)
|
||||
public IReadOnlyDictionary<ushort, IReadOnlyDictionary<nint, (string, string, ChangedItemIcon)>> GetPlayerResourcesOfType(ResourceType type,
|
||||
bool withUIData)
|
||||
{
|
||||
var resourceTrees = _resourceTreeFactory.FromObjectTable(ResourceTreeFactory.Flags.LocalPlayerRelatedOnly | (withUIData ? ResourceTreeFactory.Flags.WithUIData : 0));
|
||||
var resourceTrees = _resourceTreeFactory.FromObjectTable(ResourceTreeFactory.Flags.LocalPlayerRelatedOnly
|
||||
| (withUIData ? ResourceTreeFactory.Flags.WithUIData : 0));
|
||||
var resDictionaries = ResourceTreeApiHelper.GetResourcesOfType(resourceTrees, type);
|
||||
|
||||
return resDictionaries.AsReadOnly();
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ public class PenumbraIpcProviders : IDisposable
|
|||
// Resource Tree
|
||||
internal readonly FuncProvider<ushort[], IReadOnlyDictionary<string, string[]>?[]> GetGameObjectResourcePaths;
|
||||
internal readonly FuncProvider<IReadOnlyDictionary<ushort, IReadOnlyDictionary<string, string[]>>> GetPlayerResourcePaths;
|
||||
internal readonly FuncProvider<ushort[], ResourceType, bool, IReadOnlyDictionary<nint, (string, string, ChangedItemIcon)>?[]> GetGameObjectResourcesOfType;
|
||||
internal readonly FuncProvider<ResourceType, bool, ushort[], IReadOnlyDictionary<nint, (string, string, ChangedItemIcon)>?[]> GetGameObjectResourcesOfType;
|
||||
internal readonly FuncProvider<ResourceType, bool, IReadOnlyDictionary<ushort, IReadOnlyDictionary<nint, (string, string, ChangedItemIcon)>>> GetPlayerResourcesOfType;
|
||||
|
||||
public PenumbraIpcProviders(DalamudServices dalamud, IPenumbraApi api, ModManager modManager, CollectionManager collections,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue