Tracker: Only show AT and HC big key in DoorRando

This commit is contained in:
Fabian Dill 2020-07-19 21:15:55 +02:00
parent 4b155677fa
commit 611a38be67
2 changed files with 22 additions and 11 deletions

View File

@ -112,14 +112,14 @@
<th rowspan="2">#</th>
<th rowspan="2">Name</th>
{% for area in ordered_areas %}
{% set colspan = (3 if area in key_locations else 1) %}
{% if area in icons %}
<th colspan="{{ colspan }}" style="text-align: center"><img class="alttp-sprite"
src="{{ icons[area] }}"
alt="{{ area }}"></th>
{% else %}
<th colspan="{{ colspan }}">{{ area }}</th>
{% set colspan = 1 %}
{% if area in key_locations %}
{% set colspan = colspan + 1 %}
{% endif %}
{% if area in big_key_locations %}
{% set colspan = colspan + 1 %}
{% endif %}
<th colspan="{{ colspan }}">{{ area }}</th>
{% endfor %}
<th rowspan="2">Last Activity</th>
</tr>
@ -130,6 +130,8 @@
{% if area in key_locations %}
<th style="text-align: center"><img class="alttp-sprite"
src="{{ icons["Small Key"] }}" alt="Small Key"></th>
{% endif %}
{% if area in big_key_locations %}
<th style="text-align: center"><img class="alttp-sprite"
src="{{ icons["Big Key"] }}" alt="Big Key"></th>
{% endif %}
@ -152,6 +154,8 @@
{% endif %}
{% if area in key_locations %}
<td>{{ inventory[team][player][small_key_ids[area]] }}</td>
{% endif %}
{% if area in big_key_locations %}
<td>{% if inventory[team][player][big_key_ids[area]] %}✔️{% endif %}</td>
{% endif %}
{% endfor %}

View File

@ -148,6 +148,8 @@ key_locations = {"Desert Palace", "Eastern Palace", "Hyrule Castle", "Agahnims T
"Thieves Town", "Skull Woods", "Ice Palace", "Misery Mire", "Turtle Rock", "Palace of Darkness",
"Ganons Tower"}
big_key_locations = {"Desert Palace", "Eastern Palace", "Tower of Hera", "Swamp Palace", "Thieves Town", "Skull Woods",
"Ice Palace", "Misery Mire", "Turtle Rock", "Palace of Darkness", "Ganons Tower"}
location_to_area = {}
for area, locations in default_locations.items():
for location in locations:
@ -206,8 +208,13 @@ def get_static_room_data(room: Room):
# in > 100 players this can take a bit of time and is the main reason for the cache
locations = {tuple(k): tuple(v) for k, v in multidata['locations']}
names = multidata["names"]
_multidata_cache[room.seed.id] = locations, names
return locations, names
use_door_tracker = False
if "tags" in multidata:
use_door_tracker = "DR" in multidata.tags
result = locations, names, use_door_tracker
_multidata_cache[room.seed.id] = result
return result
@app.route('/tracker/<uuid:tracker>')
@ -216,7 +223,7 @@ def get_tracker(tracker: UUID):
room = Room.get(tracker=tracker)
if not room:
abort(404)
locations, names = get_static_room_data(room)
locations, names, use_door_tracker = get_static_room_data(room)
inventory = {teamnumber: {playernumber: collections.Counter() for playernumber in range(1, len(team) + 1)}
for teamnumber, team in enumerate(names)}
@ -264,4 +271,4 @@ def get_tracker(tracker: UUID):
multi_items=multi_items, checks_done=checks_done, ordered_areas=ordered_areas,
checks_in_area=checks_in_area, activity_timers=activity_timers,
key_locations=key_locations, small_key_ids=small_key_ids, big_key_ids=big_key_ids,
video=video)
video=video, big_key_locations = key_locations if use_door_tracker else big_key_locations)