diff options
| -rw-r--r-- | asciifarm/client/gameclient.py | 17 | ||||
| -rw-r--r-- | asciifarm/client/keybindings.hy | 14 |
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") + |
