}
}
+void Inventory::RemoveAll(const Item *item) {
+ Remove(item, 255);
+}
+
Inventory::Entry *Inventory::FindItem(const Item *item) {
for (int i(0); i < MaxItems(); ++i) {
if (item == ItemAt(i)) {
public:
bool Add(const Item *, int count = 1);
void Remove(const Item *, int count = 1);
+ void RemoveAll(const Item *);
int MaxItems() const { return 96; }
} else if (itemMenu.SelectedIndex() == itemMenu.SecondaryIndex()) {
switch (menu.Selected()) {
case CHOICE_USE:
- // TODO: implement item use
+ if (itemMenu.Selected()->CanUseOnStatusScreen()) {
+ // TODO: implement item use
+ }
+ itemMenu.SetActive();
break;
case CHOICE_SORT:
// invalid state, recover
itemMenu.SetInactive();
break;
case CHOICE_DROP:
- // TODO: implement item drop
+ if (itemMenu.Selected()->CanDrop()) {
+ parent->Game().state->inventory.RemoveAll(itemMenu.Selected());
+ itemMenu.ClearEntry(itemMenu.SelectedIndex());
+ }
+ itemMenu.SetActive();
break;
}
} else {