From 550f9b7b4cbf7ddacc88c2762893d8860566bfdf Mon Sep 17 00:00:00 2001 From: troido Date: Wed, 22 Apr 2020 12:06:17 +0200 Subject: show options list specially --- asciifarmclient/gameclient.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/asciifarmclient/gameclient.py b/asciifarmclient/gameclient.py index 5f61c36..b78a693 100644 --- a/asciifarmclient/gameclient.py +++ b/asciifarmclient/gameclient.py @@ -132,8 +132,18 @@ class Client: text, type = msg[1:3] self.log(text, type) if msgType == "messages": - for type, text in msg[1]: - self.log(text, type) + for message in msg[1]: + type = message[0] + text = message[1] + arg = None + if len(message) > 2: + arg = message[2] + if type == "options": + self.log(arg["description"]) + for (command, description) in arg["options"]: + self.log("/q {:<24} - {}".format(command, description)) + else: + self.log(text, type) if msgType == "options": if msg[1] != None: description, options = msg[1] -- cgit