feat(ui): show keyring in inventory

This commit is contained in:
Kelsi 2026-03-14 08:42:25 -07:00
parent 800862c50a
commit 2c32b72f95
7 changed files with 152 additions and 10 deletions

View file

@ -69,6 +69,7 @@ struct ItemSlot {
class Inventory {
public:
static constexpr int BACKPACK_SLOTS = 16;
static constexpr int KEYRING_SLOTS = 32;
static constexpr int NUM_EQUIP_SLOTS = 23;
static constexpr int NUM_BAG_SLOTS = 4;
static constexpr int MAX_BAG_SIZE = 36;
@ -88,6 +89,12 @@ public:
bool setEquipSlot(EquipSlot slot, const ItemDef& item);
bool clearEquipSlot(EquipSlot slot);
// Keyring
const ItemSlot& getKeyringSlot(int index) const;
bool setKeyringSlot(int index, const ItemDef& item);
bool clearKeyringSlot(int index);
int getKeyringSize() const { return KEYRING_SLOTS; }
// Extra bags
int getBagSize(int bagIndex) const;
void setBagSize(int bagIndex, int size);
@ -123,6 +130,7 @@ public:
private:
std::array<ItemSlot, BACKPACK_SLOTS> backpack{};
std::array<ItemSlot, KEYRING_SLOTS> keyring_{};
std::array<ItemSlot, NUM_EQUIP_SLOTS> equipment{};
struct BagData {