Compare commits

..

2 Commits

Author SHA1 Message Date
4dd9e43638 Ooops wrong monitor. 2024-03-02 19:54:20 -06:00
6f06455cf6 Organized elements more. Added overview panel. 2024-03-02 19:45:57 -06:00
4 changed files with 85 additions and 1099 deletions

2
.gitignore vendored
View File

@ -5,3 +5,5 @@ TunicTransitionTracker
settings.json settings.json
**/db.sqlite3 **/db.sqlite3
**/node_modules/** **/node_modules/**
**/dist/**
spoiler.json

View File

@ -3,71 +3,90 @@
{% block content %} {% block content %}
<div class="container monospace"> <div class="container monospace">
<div class="m-4 pl-2 pr-2 ring-4 rounded-md text-[#eee] bg-bluelight-translucent-dark ring-bluelight-dark"> <div class="m-4 ring-4 rounded-md text-[#eee] bg-bluelight-translucent-dark ring-bluelight-dark">
<div class="flex flex-col"> <div class="p-4 flex flex-col space-y-4">
<div class="flex pt-4 text-2xl mx-2"> <div class="flex pt-4 text-2xl mx-2">
<span class="relative inline-block align-middle h-8 w-8"><img src="{% static 'tracker/images/neofox_flag_trans_256.png' %}" alt="A trans pride fox emoji." /></span> <span class="relative inline-block align-middle h-8 w-8"><img src="{% static 'tracker/images/neofox_flag_trans_256.png' %}" alt="A trans pride fox emoji." /></span>
&nbsp;Tunic Transition Tracker &nbsp;Tunic Transition Tracker
</div> </div>
<hr class="m-2 mb-0 border-2 border-[#2fd5ff27] rounded-md" /> <hr class="border-2 border-bluelight-translucent-dark rounded-md" />
<div class="flex mx-3 my-2 text-xl"> <div class="p-4 flex flex-col max-w-full space-y-2 md:space-y-4 text-md rounded-md ring-4 bg-bluelight-translucent ring-bluelight-dark">
Checks: {{ totals.Checks.Undiscovered }}/{{ totals.Checks.Total }} Entrances: {{ totals.Entrances.Undiscovered }}/{{ totals.Entrances.Total }} <div class="text-lg">Overview</div>
<br />Current Area: {{ scene }} <div class="flex flex-col md:flex-row md:space-x-4 space-y-2 md:space-y-0">
</div> <div class="flex basis-1/2">Checks: {{ totals.Checks.Undiscovered }}/{{ totals.Checks.Total }}</div>
<div class="mx-4 mb-4 p-1 flex flex-col space-y-4"> <div class="flex basis-1/2">Entrances: {{ totals.Entrances.Undiscovered }}/{{ totals.Entrances.Total }}</div>
<details open class="px-4 max-w-full rounded-md ring-4 bg-bluelight-translucent ring-[#2fd5ff10] text-[#eee]"> </div>
<summary class="justify-start p-2 text-lg">Checks: {{ scene_data.Totals.Checks.Undiscovered }}/{{ scene_data.Totals.Checks.Total }} Entrances: {{ scene_data.Totals.Entrances.Undiscovered }}/{{ scene_data.Totals.Entrances.Total }}</summary> <hr class="border-2 border-bluelight-translucent-dark rounded-md" />
<hr class="mb-2 border-2 border-[#2fd5ff27] rounded-md" /> <details class="group p-2 flex flex-col space-y-4 rounded-md ring-4 bg-bluelight-translucent ring-bluelight-dark">
<div class="flex flex-row justify-center space-x-4"> <summary class="text-lg">Breakdown</summary>
<div class="my-2 flex flex-col basis-1/2 space-y-2 overflow-x-auto"> <div class="grid gap-4 md:grid-cols-3 grid-flow-row">
<div class="text-md">Checks</div> {% for scene, scene_totals in totals.items %}
<hr class="border-2 border-[#2fd5ff27] rounded-md" /> {% if scene != 'Entrances' and scene != 'Checks' %}
</div> <div class="p-2 flex flex-col rounded-md ring-4 ring-bluelight-dark bg-opacity-50 {% if scene_totals.Checks.Undiscovered > 0 and scene_totals.Entrances.Undiscovered > 0 %}bg-green-900{% elif scene_totals.Checks.Undiscovered > 0 %}bg-yellow-900{% elif scene_totals.Entrances.Undiscovered > 0 %}bg-blue-900{% else %}{% endif %}">
<div class="my-2 flex flex-col basis-1/2 space-y-2 overflow-x-auto"> <div>{{ scene }}:</div>
<div class="text-md">Entrances</div> <div>Checks: {{ scene_totals.Checks.Undiscovered }}/{{ scene_totals.Checks.Total }}</div>
<hr class="border-2 border-[#2fd5ff27] rounded-md" /> <div>Entrances: {{ scene_totals.Entrances.Undiscovered }}/{{ scene_totals.Entrances.Total }}</div>
</div> </div>
{% endif %}
{% endfor %}
</div> </div>
<div class="flex flex-row justify-center space-x-4"> </details>
<div class="pb-4 flex flex-col basis-1/2 space-y-2 overscroll-x-auto"> </div>
<div class="p-4 flex flex-col max-w-full rounded-md ring-4 bg-bluelight-translucent ring-bluelight-dark">
<div class="flex text-lg">{{ scene }}</div>
<div class="flex flex-col md:flex-row justify-center md:space-x-4">
<div class="flex flex-col basis-1/2 overflow-hidden">
<div class="my-2 flex flex-col space-y-2">
<div class="text-md">Checks: {{ scene_data.Totals.Checks.Undiscovered }}/{{ scene_data.Totals.Checks.Total }}</div>
<hr class="border-2 border-bluelight-translucent-dark rounded-md" />
</div>
<div class="pb-4 flex flex-col space-y-2 overflow-x-scroll">
{% for check_name, check in scene_data.Checks.items %} {% for check_name, check in scene_data.Checks.items %}
{% if not check.Check %} {% if not check.Check %}
<ul class="min-w-max bg-bluelight-translucent rounded-sm px-1">❌ {{ check_name }}</ul> <ul class="min-w-max bg-bluelight-translucent rounded-md px-1">❌ {{ check_name }}</ul>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</div> </div>
<div class="pb-4 flex flex-col basis-1/2 space-y-2 overflow-x-auto"> </div>
<div class="flex flex-col basis-1/2 overflow-hidden">
<div class="my-2 flex flex-col space-y-2">
<div class="text-md">Entrances: {{ scene_data.Totals.Entrances.Undiscovered }}/{{ scene_data.Totals.Entrances.Total }}</div>
<hr class="border-2 border-bluelight-translucent-dark rounded-md" />
</div>
<div class="pb-4 flex flex-col space-y-2 overflow-x-scroll">
{% for entrance_origin, entrance_destination in scene_data.Entrances.items %} {% for entrance_origin, entrance_destination in scene_data.Entrances.items %}
{% if not entrance_destination.Entrance != '' %} {% if not entrance_destination.Entrance != '' %}
<ul class="min-w-max bg-bluelight-translucent rounded-sm px-1">❌ {{ entrance_origin }} -> {{ entrance_destination.Entrance }}</ul> <ul class="min-w-max bg-bluelight-translucent rounded-md px-1">❌ {{ entrance_origin }} -> {{ entrance_destination.Entrance }}</ul>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
</details>
<div class="pb-4 flex flex-col space-y-2 overscroll-x-auto">
{% for entrance_origin, entrance_destination in scene_data.Entrances.items %}
{% if entrance_destination.Entrance %}
<ul class="min-w-max bg-bluelight rounded-sm px-1">✔️ {{ entrance_origin }} -> {{ entrance_destination.Entrance }}</ul>
{% endif %}
{% endfor %}
</div> </div>
<details class="group flex max-w-full rounded-md ring-4 bg-bluelight-translucent ring-[#2fd5ff10] text-[#eee]"> <div class="overflow-x-scroll">
<summary class="justify-start p-2">Tracker Debug</summary> <div class="flex flex-col space-y-2 mx-auto min-w-max">
<div class="p-2 pl-4 pr-4 flex flex-col space-y-2"> {% for entrance_origin, entrance_destination in scene_data.Entrances.items %}
<div> {% if entrance_destination.Entrance %}
<ul>Name: {{ debug.Name }}</ul> <ul class="bg-bluelight rounded-md px-1">✔️ {{ entrance_origin }} -> {{ entrance_destination.Entrance }}</ul>
<ul>Seed: {{ debug.Seed }}</ul> {% endif %}
<ul>Spoiler Seed: {{ debug.SpoilerSeed }}</ul> {% endfor %}
<ul>Archipelago: {{ debug.Archipelago }}</ul>
<ul>Randomized: {{ debug.Randomized }}</ul>
<ul>Hex Quest: {{ debug.HexQuest }}</ul>
<ul>Entrance Randomizer: {{ debug.EntranceRando }}</ul>
<ul>Fixed Shops: {{ debug.FixedShops }}</ul>
</div>
</div> </div>
</details> </div>
</div> </div>
<details class="group flex max-w-full rounded-md ring-4 bg-bluelight-translucent ring-bluelight-dark">
<summary class="justify-start p-2">Tracker Debug</summary>
<div class="p-2 pl-4 pr-4 flex flex-col space-y-2">
<div>
<ul>Name: {{ debug.Name }}</ul>
<ul>Seed: {{ debug.Seed }}</ul>
<ul>Spoiler Seed: {{ debug.SpoilerSeed }}</ul>
<ul>Archipelago: {{ debug.Archipelago }}</ul>
<ul>Randomized: {{ debug.Randomized }}</ul>
<ul>Hex Quest: {{ debug.HexQuest }}</ul>
<ul>Entrance Randomizer: {{ debug.EntranceRando }}</ul>
<ul>Fixed Shops: {{ debug.FixedShops }}</ul>
</div>
</div>
</details>
</div> </div>
</div> </div>
</div> </div>

View File

@ -10,13 +10,30 @@ import requests
def index(request): def index(request):
tracker_output = loads(requests.get('http://localhost:8000/spoiler').text) tracker_output = loads(requests.get('http://localhost:8000/spoiler').text)
# with open('structure_final_final_v10.json', 'r') as t: # with open('spoiler.json', 'r') as t:
# tracker_output = loads(t.read()) # tracker_output = loads(t.read())
tracker_debug = tracker_output["Debug"] tracker_debug = tracker_output["Debug"]
tracker_totals = tracker_output["Totals"] tracker_totals = tracker_output["Totals"]
tracker_current_scene = tracker_output["Scene"] tracker_current_scene = tracker_output["Scene"]
tracker_current_scene_data = tracker_output["Scenes"][tracker_current_scene] tracker_current_scene_data = tracker_output["Scenes"][tracker_current_scene]
template = loader.get_template("tracker/index.html") template = loader.get_template("tracker/index.html")
for i in tracker_output["Scenes"]:
if i != tracker_current_scene:
checks_total = tracker_output["Scenes"][i]["Totals"]["Checks"]["Total"]
checks_undiscovered = tracker_output["Scenes"][i]["Totals"]["Checks"]["Undiscovered"]
entrances_total = tracker_output["Scenes"][i]["Totals"]["Entrances"]["Total"]
entrances_undiscovered = tracker_output["Scenes"][i]["Totals"]["Entrances"]["Undiscovered"]
temp_data = {
"Checks": {
"Total": checks_total,
"Undiscovered": checks_undiscovered
},
"Entrances": {
"Total": entrances_total,
"Undiscovered": entrances_undiscovered
}
}
tracker_totals[i] = temp_data
temp_tracker_checks = tracker_current_scene_data["Checks"] temp_tracker_checks = tracker_current_scene_data["Checks"]
for i, check in enumerate(temp_tracker_checks.keys()): for i, check in enumerate(temp_tracker_checks.keys()):
temp_data = { temp_data = {

File diff suppressed because it is too large Load Diff