CommonClient: fix color related crashes in --nogui mode

This commit is contained in:
Fabian Dill 2022-01-25 02:25:20 +01:00
parent ea0ff6cbf7
commit 0800cfccb6
2 changed files with 1 additions and 9 deletions

View File

@ -194,7 +194,7 @@ class JSONtoTextParser(metaclass=HandlerMeta):
def _handle_color(self, node: JSONMessagePart):
codes = node["color"].split(";")
buffer = "".join(color_code(code) for code in codes)
buffer = "".join(color_code(code) for code in codes if code in color_codes)
return buffer + self._handle_text(node) + color_code("reset")
def _handle_text(self, node: JSONMessagePart):

View File

@ -196,14 +196,6 @@ async def deathlink_kill_player(ctx: Context):
ctx.last_death_link = time.time()
def color_item(item_id: int, green: bool = False) -> str:
item_name = get_item_name_from_id(item_id)
item_colors = ['green' if green else 'cyan']
if item_name in Items.progression_items:
item_colors.append("white_bg")
return color(item_name, *item_colors)
SNES_RECONNECT_DELAY = 5
# LttP