WebHost: Automatic !hint tracking
This commit is contained in:
parent
8696ee4c9e
commit
bca1a2d9e0
|
@ -199,7 +199,8 @@ class Context(Node):
|
|||
"rom_names": list(self.rom_names.items()),
|
||||
"received_items": tuple((k, v) for k, v in self.received_items.items()),
|
||||
"hints_used": tuple((key, value) for key, value in self.hints_used.items()),
|
||||
"hints": tuple((key, list(value)) for key, value in self.hints.items()),
|
||||
"hints": tuple(
|
||||
(key, list(hint.re_check(self, key[0]) for hint in value)) for key, value in self.hints.items()),
|
||||
"location_checks": tuple((key, tuple(value)) for key, value in self.location_checks.items()),
|
||||
"name_aliases": tuple((key, value) for key, value in self.name_aliases.items()),
|
||||
"client_game_state": tuple((key, value) for key, value in self.client_game_state.items()),
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<script type="application/ecmascript" src="{{ static_autoversion("tracker.js") }}"></script>
|
||||
{% endblock %}
|
||||
{% block body %}
|
||||
<div id="tracker-wrapper" data-tracker="{{ room.tracker }}">
|
||||
<div id="tracker-wrapper" data-tracker="{{ room.tracker|suuid }}">
|
||||
<div id="tracker-header-bar">
|
||||
<input placeholder="Search" id="search"/>
|
||||
{%- if video -%}<span><a target="_blank" href="https://multistream.me/
|
||||
|
@ -143,6 +143,36 @@
|
|||
</table>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% for team, hints in hints.items() %}
|
||||
{% if hints %}
|
||||
<div class="table-wrapper">
|
||||
<table class="table non-unique-item-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Finder</th>
|
||||
<th>Receiver</th>
|
||||
<th>Item</th>
|
||||
<th>Location</th>
|
||||
<th>Entrance</th>
|
||||
<th>Found</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{%- for hint in hints -%}
|
||||
<tr>
|
||||
<td>{{ player_names[team, hint.finding_player] }}</td>
|
||||
<td>{{ player_names[team, hint.receiving_player] }}</td>
|
||||
<td>{{ hint.item|item_name }}</td>
|
||||
<td>{{ hint.location|location_name }}</td>
|
||||
<td>{% if hint.entrance %}{{ hint.entrance }}{% else %}Vanilla{% endif %}</td>
|
||||
<td>{% if hint.found %}✔{% endif %}</td>
|
||||
</tr>
|
||||
{%- endfor -%}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -7,13 +7,18 @@ import logging
|
|||
from uuid import UUID
|
||||
|
||||
import Items
|
||||
import Regions
|
||||
from WebHostLib import app, cache, Room
|
||||
from Utils import Hint
|
||||
|
||||
|
||||
def get_id(item_name):
|
||||
return Items.item_table[item_name][3]
|
||||
|
||||
|
||||
app.jinja_env.filters["location_name"] = lambda location: Regions.lookup_id_to_name.get(location, location)
|
||||
app.jinja_env.filters['item_name'] = lambda id: Items.lookup_id_to_name.get(id, id)
|
||||
|
||||
icons = {
|
||||
"Progressive Sword":
|
||||
r"https://gamepedia.cursecdn.com/zelda_gamepedia_en/c/cc/ALttP_Master_Sword_Sprite.png?version=55869db2a20e157cd3b5c8f556097725",
|
||||
|
@ -263,6 +268,10 @@ def get_tracker(tracker: UUID):
|
|||
for playernumber in range(1, len(team) + 1)}
|
||||
for teamnumber, team in enumerate(names)}
|
||||
precollected_items = room.seed.multidata.get("precollected_items", None)
|
||||
hints = {team: set() for team in range(len(names))}
|
||||
for key, hintdata in room.multisave["hints"]:
|
||||
for hint in hintdata:
|
||||
hints[key[0]].add(Hint(*hint))
|
||||
|
||||
for (team, player), locations_checked in room.multisave.get("location_checks", {}):
|
||||
if precollected_items:
|
||||
|
@ -302,4 +311,5 @@ 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, big_key_locations = key_locations if use_door_tracker else big_key_locations)
|
||||
video=video, big_key_locations=key_locations if use_door_tracker else big_key_locations,
|
||||
hints=hints)
|
||||
|
|
Loading…
Reference in New Issue