diff options
| author | troido <troido@hotmail.com> | 2017-12-30 12:49:28 +0100 |
|---|---|---|
| committer | troido <troido@hotmail.com> | 2017-12-30 12:49:28 +0100 |
| commit | 705bc3ea52c52f13bddf0946bdb77a5a3fef77c6 (patch) | |
| tree | 00cabf5e7b0003d3750aa6e57544ef1416d8543b /asciifarm/client/display/display.py | |
| parent | b63f38d654814d6be7a56ee7c8c6c6567755e0b4 (diff) | |
added equipment display
Diffstat (limited to 'asciifarm/client/display/display.py')
| -rw-r--r-- | asciifarm/client/display/display.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/asciifarm/client/display/display.py b/asciifarm/client/display/display.py index 79991af..1a2dca0 100644 --- a/asciifarm/client/display/display.py +++ b/asciifarm/client/display/display.py @@ -49,6 +49,8 @@ class Display: setwin(self.inventoryPad, "inventory") self.groundPad = InventoryPad("Ground") setwin(self.groundPad, "ground") + self.equipment = InventoryPad("Equipment") + setwin(self.equipment, "equipment") self.messagePad = MessagePad() setwin(self.messagePad, "msg") self.textInput = TextInput() @@ -58,7 +60,7 @@ class Display: #self.changed = False - self.update() + self.update(True) def getWidget(self, name): if name in self.widgets: @@ -93,6 +95,14 @@ class Display: self.inventoryPad.setInventory(items) #self.change() + def setEquipment(self, slots): + self.equipment.setInventory( + sorted([ + slot + ": " + (item if item else "") + for slot, item in slots.items() + ]) + ) + def setGround(self, items): self.groundPad.setInventory(items) #self.change() |
