From bb386d3bd7e51c8e23384e0fc68ce1c109b434a8 Mon Sep 17 00:00:00 2001 From: TheBigSalarius <60804015+TheBigSalarius@users.noreply.github.com> Date: Fri, 9 Sep 2022 16:30:50 -0400 Subject: [PATCH] FF1: fix FF1Client messaging and scoped lua messaging with printjson Corrects the issue causing the client and lua messaging not displaying properly after the printjson changes --- FF1Client.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/FF1Client.py b/FF1Client.py index 6973c9f4..5a56d0dd 100644 --- a/FF1Client.py +++ b/FF1Client.py @@ -74,11 +74,13 @@ class FF1Context(CommonContext): msg = args['text'] if ': !' not in msg: self._set_message(msg, SYSTEM_MESSAGE_ID) - elif cmd == "ReceivedItems": - msg = f"Received {', '.join([self.item_names[item.item] for item in args['items']])}" - self._set_message(msg, SYSTEM_MESSAGE_ID) def on_print_json(self, args: dict): + if self.ui: + self.ui.print_json(copy.deepcopy(args["data"])) + else: + text = self.jsontotextparser(copy.deepcopy(args["data"])) + logger.info(text) relevant = args.get("type", None) in {"Hint", "ItemSend"} if relevant: item = args["item"]