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
This commit is contained in:
parent
88a225764a
commit
bb386d3bd7
|
@ -74,11 +74,13 @@ class FF1Context(CommonContext):
|
||||||
msg = args['text']
|
msg = args['text']
|
||||||
if ': !' not in msg:
|
if ': !' not in msg:
|
||||||
self._set_message(msg, SYSTEM_MESSAGE_ID)
|
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):
|
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"}
|
relevant = args.get("type", None) in {"Hint", "ItemSend"}
|
||||||
if relevant:
|
if relevant:
|
||||||
item = args["item"]
|
item = args["item"]
|
||||||
|
|
Loading…
Reference in New Issue