CommonClient: fix color related crashes in --nogui mode
This commit is contained in:
parent
ea0ff6cbf7
commit
0800cfccb6
|
@ -194,7 +194,7 @@ class JSONtoTextParser(metaclass=HandlerMeta):
|
||||||
|
|
||||||
def _handle_color(self, node: JSONMessagePart):
|
def _handle_color(self, node: JSONMessagePart):
|
||||||
codes = node["color"].split(";")
|
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")
|
return buffer + self._handle_text(node) + color_code("reset")
|
||||||
|
|
||||||
def _handle_text(self, node: JSONMessagePart):
|
def _handle_text(self, node: JSONMessagePart):
|
||||||
|
|
|
@ -196,14 +196,6 @@ async def deathlink_kill_player(ctx: Context):
|
||||||
ctx.last_death_link = time.time()
|
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
|
SNES_RECONNECT_DELAY = 5
|
||||||
|
|
||||||
# LttP
|
# LttP
|
||||||
|
|
Loading…
Reference in New Issue