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

@ -45,6 +45,23 @@ bool Inventory::clearEquipSlot(EquipSlot slot) {
return true;
}
const ItemSlot& Inventory::getKeyringSlot(int index) const {
if (index < 0 || index >= KEYRING_SLOTS) return EMPTY_SLOT;
return keyring_[index];
}
bool Inventory::setKeyringSlot(int index, const ItemDef& item) {
if (index < 0 || index >= KEYRING_SLOTS) return false;
keyring_[index].item = item;
return true;
}
bool Inventory::clearKeyringSlot(int index) {
if (index < 0 || index >= KEYRING_SLOTS) return false;
keyring_[index].item = ItemDef{};
return true;
}
int Inventory::getBagSize(int bagIndex) const {
if (bagIndex < 0 || bagIndex >= NUM_BAG_SLOTS) return 0;
return bags[bagIndex].size;