From 2a9ee760c64254f85e31a6c2b069c2fae19c0e93 Mon Sep 17 00:00:00 2001 From: Haselnussbomber Date: Mon, 4 Nov 2024 16:28:06 +0100 Subject: [PATCH] Add IGameInventory.GetInventoryItems (#2008) --- Dalamud/Game/Inventory/GameInventory.cs | 3 +++ Dalamud/Plugin/Services/IGameInventory.cs | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/Dalamud/Game/Inventory/GameInventory.cs b/Dalamud/Game/Inventory/GameInventory.cs index 0ddf0dcaf..02412c551 100644 --- a/Dalamud/Game/Inventory/GameInventory.cs +++ b/Dalamud/Game/Inventory/GameInventory.cs @@ -403,6 +403,9 @@ internal class GameInventoryPluginScoped : IInternalDisposableService, IGameInve /// public event IGameInventory.InventoryChangedDelegate? ItemMergedExplicit; + /// + public ReadOnlySpan GetInventoryItems(GameInventoryType type) => GameInventoryItem.GetReadOnlySpanOfInventory(type); + /// void IInternalDisposableService.DisposeService() { diff --git a/Dalamud/Plugin/Services/IGameInventory.cs b/Dalamud/Plugin/Services/IGameInventory.cs index a1b1114d7..0dff1ff03 100644 --- a/Dalamud/Plugin/Services/IGameInventory.cs +++ b/Dalamud/Plugin/Services/IGameInventory.cs @@ -103,4 +103,11 @@ public interface IGameInventory /// public event InventoryChangedDelegate ItemMergedExplicit; + + /// + /// Gets all item slots of the specified inventory type. + /// + /// The type of inventory to get the items for. + /// A read-only span of all items in the specified inventory type. + public ReadOnlySpan GetInventoryItems(GameInventoryType type); }