From ea79469abde85a4d8f8ebfeda3ae9c7334f19bec Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Mon, 18 Sep 2023 17:06:16 +0200 Subject: [PATCH] Move IPC Arguments around. --- Penumbra/Api/IpcTester.cs | 2 +- Penumbra/Api/PenumbraApi.cs | 10 ++++++---- Penumbra/Api/PenumbraIpcProviders.cs | 2 +- Penumbra/Configuration.cs | 2 +- Penumbra/UI/Tabs/ConfigTabBar.cs | 5 +++-- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Penumbra/Api/IpcTester.cs b/Penumbra/Api/IpcTester.cs index 86719160..0abf0cf5 100644 --- a/Penumbra/Api/IpcTester.cs +++ b/Penumbra/Api/IpcTester.cs @@ -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) diff --git a/Penumbra/Api/PenumbraApi.cs b/Penumbra/Api/PenumbraApi.cs index 4a31199c..49fa40db 100644 --- a/Penumbra/Api/PenumbraApi.cs +++ b/Penumbra/Api/PenumbraApi.cs @@ -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?[] GetGameObjectResourcesOfType(ushort[] gameObjects, ResourceType type, bool withUIData) + public IReadOnlyDictionary?[] GetGameObjectResourcesOfType(ResourceType type, bool withUIData, + params ushort[] gameObjects) { var characters = gameObjects.Select(index => _dalamud.Objects[index]).OfType(); 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> GetPlayerResourcesOfType(ResourceType type, bool withUIData) + public IReadOnlyDictionary> 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(); diff --git a/Penumbra/Api/PenumbraIpcProviders.cs b/Penumbra/Api/PenumbraIpcProviders.cs index aca57aac..87de6a0c 100644 --- a/Penumbra/Api/PenumbraIpcProviders.cs +++ b/Penumbra/Api/PenumbraIpcProviders.cs @@ -121,7 +121,7 @@ public class PenumbraIpcProviders : IDisposable // Resource Tree internal readonly FuncProvider?[]> GetGameObjectResourcePaths; internal readonly FuncProvider>> GetPlayerResourcePaths; - internal readonly FuncProvider?[]> GetGameObjectResourcesOfType; + internal readonly FuncProvider?[]> GetGameObjectResourcesOfType; internal readonly FuncProvider>> GetPlayerResourcesOfType; public PenumbraIpcProviders(DalamudServices dalamud, IPenumbraApi api, ModManager modManager, CollectionManager collections, diff --git a/Penumbra/Configuration.cs b/Penumbra/Configuration.cs index 0206d0ae..7c9ae665 100644 --- a/Penumbra/Configuration.cs +++ b/Penumbra/Configuration.cs @@ -6,7 +6,7 @@ using OtterGui.Classes; using OtterGui.Filesystem; using OtterGui.Widgets; using Penumbra.Api.Enums; -using Penumbra.GameData.Enums; +using Penumbra.Enums; using Penumbra.Import.Structs; using Penumbra.Interop.Services; using Penumbra.Mods; diff --git a/Penumbra/UI/Tabs/ConfigTabBar.cs b/Penumbra/UI/Tabs/ConfigTabBar.cs index 60339893..ee66ca86 100644 --- a/Penumbra/UI/Tabs/ConfigTabBar.cs +++ b/Penumbra/UI/Tabs/ConfigTabBar.cs @@ -3,6 +3,7 @@ using OtterGui.Widgets; using Penumbra.Api.Enums; using Penumbra.Mods; using Penumbra.Services; +using Watcher = Penumbra.UI.ResourceWatcher.ResourceWatcher; namespace Penumbra.UI.Tabs; @@ -17,7 +18,7 @@ public class ConfigTabBar : IDisposable public readonly EffectiveTab Effective; public readonly DebugTab Debug; public readonly ResourceTab Resource; - public readonly ResourceWatcher Watcher; + public readonly Watcher Watcher; public readonly OnScreenTab OnScreenTab; public readonly ITab[] Tabs; @@ -26,7 +27,7 @@ public class ConfigTabBar : IDisposable public TabType SelectTab = TabType.None; public ConfigTabBar(CommunicatorService communicator, SettingsTab settings, ModsTab mods, CollectionsTab collections, - ChangedItemsTab changedItems, EffectiveTab effective, DebugTab debug, ResourceTab resource, ResourceWatcher watcher, + ChangedItemsTab changedItems, EffectiveTab effective, DebugTab debug, ResourceTab resource, Watcher watcher, OnScreenTab onScreenTab) { _communicator = communicator;