Mark equipped items and allow unequipping
This commit is contained in:
parent
88471f4361
commit
519504fc32
|
@ -176,7 +176,8 @@ class PlayerInventoryDisplay(MenuDisplay):
|
||||||
selection = f"[{rep}]" if i == self.menu.position \
|
selection = f"[{rep}]" if i == self.menu.position \
|
||||||
and self.selected else f" {rep} "
|
and self.selected else f" {rep} "
|
||||||
self.addstr(self.pad, i + 1, 0, selection
|
self.addstr(self.pad, i + 1, 0, selection
|
||||||
+ " " + item.translated_name.capitalize()
|
+ " " + ("[E]" if item.equipped else "")
|
||||||
|
+ item.translated_name.capitalize()
|
||||||
+ (f" ({item.description})" if item.description else "")
|
+ (f" ({item.description})" if item.description else "")
|
||||||
+ (": " + str(item.price) + " Hazels"
|
+ (": " + str(item.price) + " Hazels"
|
||||||
if self.store_mode else ""))
|
if self.store_mode else ""))
|
||||||
|
|
|
@ -309,7 +309,8 @@ class Game:
|
||||||
if key == KeyValues.USE:
|
if key == KeyValues.USE:
|
||||||
self.inventory_menu.validate().use()
|
self.inventory_menu.validate().use()
|
||||||
elif key == KeyValues.EQUIP:
|
elif key == KeyValues.EQUIP:
|
||||||
self.inventory_menu.validate().equip()
|
item = self.inventory_menu.validate()
|
||||||
|
item.unequip() if item.equipped else item.equip()
|
||||||
elif key == KeyValues.DROP:
|
elif key == KeyValues.DROP:
|
||||||
self.inventory_menu.validate().drop()
|
self.inventory_menu.validate().drop()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue