summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortroido <troido@hotmail.com>2017-12-30 15:35:38 +0100
committertroido <troido@hotmail.com>2017-12-30 15:35:38 +0100
commitf62cb51a6b69abb48b76db8b3166f94bcfe66ba2 (patch)
tree4cfa8355f28bca01334c6f1432a740a979bbd2cf
parent705bc3ea52c52f13bddf0946bdb77a5a3fef77c6 (diff)
keybinding docs now in keybindings file
-rw-r--r--asciifarm/client/gameclient.py17
-rw-r--r--asciifarm/client/keybindings.hy14
2 files changed, 18 insertions, 13 deletions
diff --git a/asciifarm/client/gameclient.py b/asciifarm/client/gameclient.py
index 565262d..9ba4b37 100644
--- a/asciifarm/client/gameclient.py
+++ b/asciifarm/client/gameclient.py
@@ -25,22 +25,14 @@ class Client:
self.connection = connection
self.logFile = logFile
- self.commands = importlib.import_module(".keybindings", __package__).commands
- self.controlsString = """\
-Default Controls:
- wasd or arrows:
- Move around
- e: Grab
- q: Drop
- E: Use
- r: Interact
- f: Attack
- t: Chat"""
+ keymodule = importlib.import_module(".keybindings", __package__)
+ self.commands = keymodule.commands
+ self.controlsString = keymodule.docs
self.display.showInfo(self.controlsString)
-
+
def send(self, data):
self.connection.send(json.dumps(data))
@@ -57,7 +49,6 @@ Default Controls:
threading.Thread(target=self.listen, daemon=True).start()
self.connection.send(json.dumps(["name", self.name]))
self.command_loop()
-
def listen(self):
self.connection.listen(self.update, self.close)
diff --git a/asciifarm/client/keybindings.hy b/asciifarm/client/keybindings.hy
index 579ca2c..a0f392d 100644
--- a/asciifarm/client/keybindings.hy
+++ b/asciifarm/client/keybindings.hy
@@ -26,3 +26,17 @@
(input ["attack" "east"])
(input ["attack" "west"])])
"t" (fn [client] (client.readString)) })
+
+(setv docs "\
+Controls:
+ wasd or arrows:
+ Move around
+ e: Grab
+ q: Drop
+ E: Use
+ r: Interact
+ f: Attack
+ t: Chat
+ z: Unequip
+ xcv: scroll")
+