keybinding docs now in keybindings file

This commit is contained in:
troido 2017-12-30 15:35:38 +01:00
parent 602638cbd8
commit 97b3cc0b9e
2 changed files with 18 additions and 13 deletions

View File

@ -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)

View File

@ -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")