mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-24 00:00:13 +00:00
feat(ui): show keyring in inventory
This commit is contained in:
parent
800862c50a
commit
2c32b72f95
7 changed files with 152 additions and 10 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue