mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-02-21 23:37:47 +01:00
ResourceTree IPC: Remove mergeSameCollection.
This commit is contained in:
parent
d7205344eb
commit
22966e648d
4 changed files with 12 additions and 44 deletions
|
|
@ -1408,10 +1408,9 @@ public class IpcTester : IDisposable
|
|||
private readonly DalamudPluginInterface _pi;
|
||||
private readonly IObjectTable _objects;
|
||||
|
||||
private string _gameObjectIndices = "0";
|
||||
private bool _mergeSameCollection = false;
|
||||
private ResourceType _type = ResourceType.Mtrl;
|
||||
private bool _withUIData = false;
|
||||
private string _gameObjectIndices = "0";
|
||||
private ResourceType _type = ResourceType.Mtrl;
|
||||
private bool _withUIData = false;
|
||||
|
||||
private (string, IReadOnlyDictionary<string, string[]>?)[]? _lastGameObjectResourcePaths;
|
||||
private (string, IReadOnlyDictionary<string, string[]>?)[]? _lastPlayerResourcePaths;
|
||||
|
|
@ -1431,7 +1430,6 @@ public class IpcTester : IDisposable
|
|||
return;
|
||||
|
||||
ImGui.InputText("GameObject indices", ref _gameObjectIndices, 511);
|
||||
ImGui.Checkbox("Merge entries that use the same collection", ref _mergeSameCollection);
|
||||
ImGuiUtil.GenericEnumCombo("Resource type", ImGui.CalcItemWidth(), _type, out _type, Enum.GetValues<ResourceType>());
|
||||
ImGui.Checkbox("Also get names and icons", ref _withUIData);
|
||||
|
||||
|
|
@ -1443,7 +1441,7 @@ public class IpcTester : IDisposable
|
|||
if (ImGui.Button("Get##GameObjectResourcePaths"))
|
||||
{
|
||||
var gameObjects = GetSelectedGameObjects();
|
||||
var resourcePaths = Ipc.GetGameObjectResourcePaths.Subscriber(_pi).Invoke(gameObjects, _mergeSameCollection);
|
||||
var resourcePaths = Ipc.GetGameObjectResourcePaths.Subscriber(_pi).Invoke(gameObjects);
|
||||
|
||||
_lastGameObjectResourcePaths = gameObjects
|
||||
.Select(GameObjectToString)
|
||||
|
|
@ -1456,7 +1454,7 @@ public class IpcTester : IDisposable
|
|||
DrawIntro(Ipc.GetPlayerResourcePaths.Label, "Get local player resource paths");
|
||||
if (ImGui.Button("Get##PlayerResourcePaths"))
|
||||
{
|
||||
_lastPlayerResourcePaths = Ipc.GetPlayerResourcePaths.Subscriber(_pi).Invoke(_mergeSameCollection)
|
||||
_lastPlayerResourcePaths = Ipc.GetPlayerResourcePaths.Subscriber(_pi).Invoke()
|
||||
.Select(pair => (GameObjectToString(pair.Key), (IReadOnlyDictionary<string, string[]>?)pair.Value))
|
||||
.ToArray();
|
||||
|
||||
|
|
|
|||
|
|
@ -1016,19 +1016,19 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
|||
};
|
||||
// @formatter:on
|
||||
|
||||
public IReadOnlyDictionary<string, string[]>?[] GetGameObjectResourcePaths(ushort[] gameObjects, bool mergeSameCollection)
|
||||
public IReadOnlyDictionary<string, string[]>?[] GetGameObjectResourcePaths(ushort[] gameObjects)
|
||||
{
|
||||
var characters = gameObjects.Select(index => _dalamud.Objects[index]).OfType<Character>();
|
||||
var resourceTrees = _resourceTreeFactory.FromCharacters(characters, false, false);
|
||||
var pathDictionaries = ResourceTreeApiHelper.GetResourcePathDictionaries(resourceTrees, mergeSameCollection);
|
||||
var pathDictionaries = ResourceTreeApiHelper.GetResourcePathDictionaries(resourceTrees);
|
||||
|
||||
return Array.ConvertAll(gameObjects, obj => pathDictionaries.TryGetValue(obj, out var pathDict) ? pathDict : null);
|
||||
}
|
||||
|
||||
public IReadOnlyDictionary<ushort, IReadOnlyDictionary<string, string[]>> GetPlayerResourcePaths(bool mergeSameCollection)
|
||||
public IReadOnlyDictionary<ushort, IReadOnlyDictionary<string, string[]>> GetPlayerResourcePaths()
|
||||
{
|
||||
var resourceTrees = _resourceTreeFactory.FromObjectTable(true, false, false);
|
||||
var pathDictionaries = ResourceTreeApiHelper.GetResourcePathDictionaries(resourceTrees, mergeSameCollection);
|
||||
var pathDictionaries = ResourceTreeApiHelper.GetResourcePathDictionaries(resourceTrees);
|
||||
|
||||
return pathDictionaries.AsReadOnly();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,8 +119,8 @@ public class PenumbraIpcProviders : IDisposable
|
|||
internal readonly FuncProvider<string, string, int, PenumbraApiEc> RemoveTemporaryMod;
|
||||
|
||||
// Resource Tree
|
||||
internal readonly FuncProvider<ushort[], bool, IReadOnlyDictionary<string, string[]>?[]> GetGameObjectResourcePaths;
|
||||
internal readonly FuncProvider<bool, IReadOnlyDictionary<ushort, IReadOnlyDictionary<string, string[]>>> GetPlayerResourcePaths;
|
||||
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, IReadOnlyDictionary<ushort, IReadOnlyDictionary<nint, (string, string, ChangedItemIcon)>>> GetPlayerResourcesOfType;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue