-
-
-

- Tunic Transition Tracker
-
-
-
-
Overview
-
-
Checks: {{ totals.Checks.Undiscovered }}/{{ totals.Checks.Total }}
-
Entrances: {{ totals.Entrances.Undiscovered }}/{{ totals.Entrances.Total }}
+ {% if debug != '' %}
+
+
+

+ Tunic Transition Tracker
-
- Breakdown
-
- {% for scene, scene_totals in totals.items %}
- {% if scene != 'Entrances' and scene != 'Checks' %}
-
+
Overview
+
+
Checks: {{ totals.Checks.Undiscovered }}/{{ totals.Checks.Total }}
+
Entrances: {{ totals.Entrances.Undiscovered }}/{{ totals.Entrances.Total }}
+
+
+
+ Breakdown
+
+ {% for scene, scene_totals in totals.items %}
+ {% if scene != 'Entrances' and scene != 'Checks' %}
+ {% if scene_totals.Checks.Undiscovered > 0 and scene_totals.Entrances.Undiscovered > 0 %}
+
+
{{ scene }}:
+
Checks: {{ scene_totals.Checks.Undiscovered }}/{{ scene_totals.Checks.Total }}
+
Entrances: {{ scene_totals.Entrances.Undiscovered }}/{{ scene_totals.Entrances.Total }}
+
{% elif scene_totals.Checks.Undiscovered > 0 %}
-
+
+
{{ scene }}:
+
Checks: {{ scene_totals.Checks.Undiscovered }}/{{ scene_totals.Checks.Total }}
+
Entrances: {{ scene_totals.Entrances.Undiscovered }}/{{ scene_totals.Entrances.Total }}
+
{% elif scene_totals.Entrances.Undiscovered > 0 %}
-
- {% endif %}">
-
{{ scene }}:
-
Checks: {{ scene_totals.Checks.Undiscovered }}/{{ scene_totals.Checks.Total }}
-
Entrances: {{ scene_totals.Entrances.Undiscovered }}/{{ scene_totals.Entrances.Total }}
-
- {% endif %}
- {% endfor %}
+
+
{{ scene }}:
+
Checks: {{ scene_totals.Checks.Undiscovered }}/{{ scene_totals.Checks.Total }}
+
Entrances: {{ scene_totals.Entrances.Undiscovered }}/{{ scene_totals.Entrances.Total }}
+
+ {% endif %}
+ {% endif %}
+ {% endfor %}
+
+
+
+
+
{{ scene }}
+
+
+
+
Checks: {{ scene_data.Totals.Checks.Undiscovered }}/{{ scene_data.Totals.Checks.Total }}
+
+
+
+
+
+
+
Entrances: {{ scene_data.Totals.Entrances.Undiscovered }}/{{ scene_data.Totals.Entrances.Total }}
+
+
+
+
+
+
+
+
+ Tracker Debug
+
+
+
+
+
Spoiler Seed: {{ debug.SpoilerSeed }}
+
Archipelago: {{ debug.Archipelago }}
+
Randomized: {{ debug.Randomized }}
+
Hex Quest: {{ debug.HexQuest }}
+
Entrance Randomizer: {{ debug.EntranceRando }}
+
Fixed Shops: {{ debug.FixedShops }}
+
-
-
{{ scene }}
-
-
-
-
Checks: {{ scene_data.Totals.Checks.Undiscovered }}/{{ scene_data.Totals.Checks.Total }}
-
-
-
-
-
-
-
Entrances: {{ scene_data.Totals.Entrances.Undiscovered }}/{{ scene_data.Totals.Entrances.Total }}
-
-
-
-
-
-
-
-
- Tracker Debug
-
-
-
-
-
Spoiler Seed: {{ debug.SpoilerSeed }}
-
Archipelago: {{ debug.Archipelago }}
-
Randomized: {{ debug.Randomized }}
-
Hex Quest: {{ debug.HexQuest }}
-
Entrance Randomizer: {{ debug.EntranceRando }}
-
Fixed Shops: {{ debug.FixedShops }}
-
-
-
-
+ {% endif %}
{% endblock %}
diff --git a/tunictracker/tracker/views.py b/tunictracker/tracker/views.py
index ee32664..465c689 100644
--- a/tunictracker/tracker/views.py
+++ b/tunictracker/tracker/views.py
@@ -9,7 +9,19 @@ import requests
def index(request):
- tracker_output = loads(requests.get('http://localhost:8000/spoiler').text)
+ request_data = None
+ try:
+ request_data = requests.get('http://localhost:8000/spoiler').text
+ except:
+ context = {
+ "debug": "",
+ "totals": "",
+ "scene": "",
+ "scene_data": ""
+ }
+ template = loader.get_template("tracker/index.html")
+ return HttpResponse(template.render(context, request))
+ tracker_output = loads()
# with open('spoiler.json', 'r') as t:
# tracker_output = loads(t.read())
tracker_debug = tracker_output["Debug"]
@@ -38,7 +50,7 @@ def index(request):
for i, check in enumerate(temp_tracker_checks.keys()):
temp_data = {
"Check": temp_tracker_checks[check],
- "CheckNum": floor(int(i)%3)
+ "CheckNum": floor(int(i) % 3)
}
temp_tracker_checks[check] = temp_data
tracker_current_scene_data["Checks"] = temp_tracker_checks
@@ -46,7 +58,7 @@ def index(request):
for i, entrance in enumerate(temp_tracker_entrances.keys()):
temp_data = {
"Entrance": temp_tracker_entrances[entrance],
- "EntranceNum": floor(int(i)%3)
+ "EntranceNum": floor(int(i) % 3)
}
temp_tracker_entrances[entrance] = temp_data
tracker_current_scene_data["Entrances"] = temp_tracker_entrances