improve colors

This commit is contained in:
Fabian Dill 2020-05-18 10:02:28 +02:00
parent c8343df81e
commit 2c8d127550
1 changed files with 7 additions and 5 deletions

View File

@ -748,13 +748,15 @@ async def process_server_cmd(ctx : Context, cmd, args):
player_sent = color(ctx.player_names[player_sent], 'yellow' if player_sent != ctx.slot else 'magenta') player_sent = color(ctx.player_names[player_sent], 'yellow' if player_sent != ctx.slot else 'magenta')
player_recvd = color(ctx.player_names[player_recvd], 'yellow' if player_recvd != ctx.slot else 'magenta') player_recvd = color(ctx.player_names[player_recvd], 'yellow' if player_recvd != ctx.slot else 'magenta')
logging.info( logging.info(
'%s sent %s to %s (%s)' % (player_sent, item, player_recvd, get_location_name_from_address(location))) '%s sent %s to %s (%s)' % (player_sent, item, player_recvd, color(get_location_name_from_address(location),
'blue_bg', 'white')))
elif cmd == 'ItemFound': elif cmd == 'ItemFound':
found = ReceivedItem(*args) found = ReceivedItem(*args)
item = color(get_item_name_from_id(found.item), 'cyan' if found.player != ctx.slot else 'green') item = color(get_item_name_from_id(found.item), 'cyan' if found.player != ctx.slot else 'green')
player_sent = color(ctx.player_names[found.player], 'yellow' if found.player != ctx.slot else 'magenta') player_sent = color(ctx.player_names[found.player], 'yellow' if found.player != ctx.slot else 'magenta')
logging.info('%s found %s (%s)' % (player_sent, item, get_location_name_from_address(found.location))) logging.info('%s found %s (%s)' % (player_sent, item, color(get_location_name_from_address(found.location),
'blue_bg', 'white')))
elif cmd == 'Hint': elif cmd == 'Hint':
hints = [Utils.Hint(*hint) for hint in args] hints = [Utils.Hint(*hint) for hint in args]
@ -765,10 +767,10 @@ async def process_server_cmd(ctx : Context, cmd, args):
player_recvd = color(ctx.player_names[hint.receiving_player], player_recvd = color(ctx.player_names[hint.receiving_player],
'yellow' if hint.receiving_player != ctx.slot else 'magenta') 'yellow' if hint.receiving_player != ctx.slot else 'magenta')
text = f"[Hint]: {player_recvd}'s {item} can be found " \ text = f"[Hint]: {player_recvd}'s {item} can be found " \
f"at {color(get_location_name_from_address(hint.location), 'blue_bg')} in {player_find}'s World" f"at {color(get_location_name_from_address(hint.location), 'blue_bg', 'white')} in {player_find}'s World"
if hint.entrance: if hint.entrance:
text += " at " + color(hint.entrance, 'cyan_bg') text += " at " + color(hint.entrance, 'white_bg', 'black')
logging.info(text + (". (found)" if hint.found else ".")) logging.info(text + (f". {color('(found)', 'green_bg')} " if hint.found else "."))
elif cmd == "AliasUpdate": elif cmd == "AliasUpdate":
ctx.player_names = {p: n for p, n in args} ctx.player_names = {p: n for p, n in args}
elif cmd == 'Print': elif cmd == 'Print':