summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortroido <troido@hotmail.com>2018-01-15 23:12:11 +0100
committertroido <troido@hotmail.com>2018-01-15 23:12:11 +0100
commitd0a4b8dd97d960eaf1922e773f6dc376ec96f8d9 (patch)
treeb318d7edaae6d02e80438ecc42295d5dcc09ae14
parent450ed6d4064bf83a4630ecc017346c87d5133f2b (diff)
provided code to set title of list menu
-rw-r--r--asciifarm/client/display/inventorypad.py3
-rw-r--r--asciifarm/client/inputhandling.hy5
-rw-r--r--asciifarm/keybindings/keybindings.hy1
3 files changed, 7 insertions, 2 deletions
diff --git a/asciifarm/client/display/inventorypad.py b/asciifarm/client/display/inventorypad.py
index cbfeff1..fd600e6 100644
--- a/asciifarm/client/display/inventorypad.py
+++ b/asciifarm/client/display/inventorypad.py
@@ -23,6 +23,9 @@ class InventoryPad:
self.items = items
self.widget.change()
+ def setTitle(self, title):
+ self.title = title
+
def getNumItems(self):
return len(self.items)
diff --git a/asciifarm/client/inputhandling.hy b/asciifarm/client/inputhandling.hy
index 64b67e7..9c3e254 100644
--- a/asciifarm/client/inputhandling.hy
+++ b/asciifarm/client/inputhandling.hy
@@ -10,7 +10,7 @@
(setv self.connection connection)
(setv self.commands None))
- (defn readCommands [self commandsstring]
+ (defn readCommands [self commandsstring] (do
(setv self.commands
(dict-comp
(str key)
@@ -20,7 +20,8 @@
(fn [handler]
(fn [] ~value))))
self)
- [[key value] (.items (read-str commandsstring))])))
+ [[key value] (.items (read-str commandsstring))]))
+ ((.get self.commands "init" (fn [])))))
(defn runCommand [self commandstring]
(try
diff --git a/asciifarm/keybindings/keybindings.hy b/asciifarm/keybindings/keybindings.hy
index bf4b214..5813362 100644
--- a/asciifarm/keybindings/keybindings.hy
+++ b/asciifarm/keybindings/keybindings.hy
@@ -53,4 +53,5 @@ Controls:
z: Unequip
xcv: scroll
ctrl-c: close client"
+;; init ((. (self.display.getWidget "inventory") setTitle) "Inventory (c)")
}