Currency and slot amount

This commit is contained in:
Zeffuro
2025-12-20 13:59:56 +01:00
parent 819e1fecfd
commit 167761244a
5 changed files with 134 additions and 2 deletions
+8
View File
@@ -0,0 +1,8 @@
namespace AetherBags.Currency;
public class CurrencyInfo
{
public required int Amount { get; set; }
public required uint ItemId { get; set; }
public required uint IconId { get; set; }
}
+14
View File
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using AetherBags.Currency;
using Dalamud.Game.Inventory;
using FFXIVClientStructs.FFXIV.Client.Game;
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
@@ -108,6 +109,19 @@ public static unsafe class InventoryState
};
}
private static uint GetEmptyItemSlots() => InventoryManager.Instance()->GetEmptySlotsInBag();
private static uint GetUsedItemSlots() => 140 - GetEmptyItemSlots();
public static string GetEmptyItemSlotsString() => $"{GetUsedItemSlots()}/140";
public static CurrencyInfo GetCurrencyInfo(uint itemId)
{
return new CurrencyInfo
{
Amount = InventoryManager.Instance()->GetInventoryItemCount(1),
ItemId = itemId,
IconId = Services.DataManager.GetExcelSheet<Item>().GetRow(itemId).Icon
};
}
}