Update WebUI to show unique items as a different color, and with a drop-shadow

This commit is contained in:
Chris Wilson
2021-02-02 22:58:22 -05:00
parent cf49cd5e4b
commit db6642f290
10 changed files with 10181 additions and 5819 deletions

View File

@@ -939,7 +939,8 @@ async def process_server_cmd(ctx: Context, cmd, args):
player_sent, location, player_recvd, item = args
ctx.ui_node.notify_item_sent(ctx.player_names[player_sent], ctx.player_names[player_recvd],
get_item_name_from_id(item), get_location_name_from_address(location),
player_sent == ctx.slot, player_recvd == ctx.slot)
player_sent == ctx.slot, player_recvd == ctx.slot,
True if get_item_name_from_id(item) in Items.progression_items else False)
item = color_item(item, player_sent == ctx.slot)
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')
@@ -950,7 +951,8 @@ async def process_server_cmd(ctx: Context, cmd, args):
elif cmd == 'ItemFound':
found = ReceivedItem(*args)
ctx.ui_node.notify_item_found(ctx.player_names[found.player], get_item_name_from_id(found.item),
get_location_name_from_address(found.location), found.player == ctx.slot)
get_location_name_from_address(found.location), found.player == ctx.slot,
True if get_item_name_from_id(found.item) in Items.progression_items else False)
item = color_item(found.item, found.player == ctx.slot)
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, color(get_location_name_from_address(found.location),
@@ -1086,7 +1088,8 @@ class ClientCommandProcessor(CommandProcessor):
for index, item in enumerate(self.ctx.items_received, 1):
self.ctx.ui_node.notify_item_received(self.ctx.player_names[item.player], get_item_name_from_id(item.item),
get_location_name_from_address(item.location), index,
len(self.ctx.items_received))
len(self.ctx.items_received),
True if get_item_name_from_id(item.item) in Items.progression_items else False)
logging.info('%s from %s (%s) (%d/%d in list)' % (
color(get_item_name_from_id(item.item), 'red', 'bold'),
color(self.ctx.player_names[item.player], 'yellow'),
@@ -1344,7 +1347,8 @@ async def game_watcher(ctx : Context):
item = ctx.items_received[recv_index]
ctx.ui_node.notify_item_received(ctx.player_names[item.player], get_item_name_from_id(item.item),
get_location_name_from_address(item.location), recv_index + 1,
len(ctx.items_received))
len(ctx.items_received),
True if get_item_name_from_id(item.item) in Items.progression_items else False)
logging.info('Received %s from %s (%s) (%d/%d in list)' % (
color(get_item_name_from_id(item.item), 'red', 'bold'), color(ctx.player_names[item.player], 'yellow'),
get_location_name_from_address(item.location), recv_index + 1, len(ctx.items_received)))