Added spell codes to the holy cross codes panel, logic for whether a code has been entered.
This commit is contained in:
parent
c521c24602
commit
8e7c65303d
@ -1,4 +1,8 @@
|
|||||||
{
|
{
|
||||||
|
"Default": {
|
||||||
|
"Speedrunner Code": "RULDDRULU",
|
||||||
|
"Seeking Spell": "ULURDL"
|
||||||
|
},
|
||||||
"Cathedral": {
|
"Cathedral": {
|
||||||
"Secret Legend Door": "LULURULURDRRURDLDRDLDL"
|
"Secret Legend Door": "LULURULURDRRURDLDRDLDL"
|
||||||
},
|
},
|
||||||
@ -61,6 +65,12 @@
|
|||||||
"Secret Gathering Place": {
|
"Secret Gathering Place": {
|
||||||
"Waterfall Fairy": "DRURURULULURURULDLDLDRDLDRDRUR"
|
"Waterfall Fairy": "DRURURULULURURULDLDLDRDLDRDRUR"
|
||||||
},
|
},
|
||||||
|
"Spells": {
|
||||||
|
"Healing Spell": "DRDLURU",
|
||||||
|
"Dynamite": "DRURULULDLDR",
|
||||||
|
"Fire Bomb": "LURDRURDRURDL",
|
||||||
|
"Ice Bomb": "LDRURDLURDLUL"
|
||||||
|
},
|
||||||
"West Garden": {
|
"West Garden": {
|
||||||
"Sword Door": "DRULUR",
|
"Sword Door": "DRULUR",
|
||||||
"Tiles Fairy": "URULURULURDRULRLURULURULU",
|
"Tiles Fairy": "URULURULURDRULRLURULURULU",
|
||||||
|
@ -5,7 +5,7 @@ window.onload = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
async function refresh_elements() {
|
async function refresh_elements() {
|
||||||
fetch("http://192.168.1.101:8000/spoiler")
|
fetch("http://localhost:8000/spoiler")
|
||||||
.then((response) => response.json())
|
.then((response) => response.json())
|
||||||
.then(
|
.then(
|
||||||
(data) => {
|
(data) => {
|
||||||
@ -233,7 +233,6 @@ async function refresh_elements() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Replace with new data.
|
// Replace with new data.
|
||||||
// console.log(new_summary_list);
|
|
||||||
document
|
document
|
||||||
.getElementById("overview")
|
.getElementById("overview")
|
||||||
.querySelector(".summary-list")
|
.querySelector(".summary-list")
|
||||||
@ -242,17 +241,9 @@ async function refresh_elements() {
|
|||||||
.getElementById("overview")
|
.getElementById("overview")
|
||||||
.querySelector(".breakdown-list")
|
.querySelector(".breakdown-list")
|
||||||
.replaceWith(new_breakdown_list.cloneNode(true));
|
.replaceWith(new_breakdown_list.cloneNode(true));
|
||||||
// document
|
|
||||||
// .getElementById("breakdown-current")
|
|
||||||
// .replaceWith(
|
|
||||||
// document.getElementById("breakdown-current").cloneNode(true)
|
|
||||||
// );
|
|
||||||
document
|
document
|
||||||
.getElementById("debug-block")
|
.getElementById("debug-block")
|
||||||
.replaceWith(new_debug_block.cloneNode(true));
|
.replaceWith(new_debug_block.cloneNode(true));
|
||||||
|
|
||||||
// Debug
|
|
||||||
// console.log("We have data.");
|
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
document.getElementById("status-block").classList.remove("hidden");
|
document.getElementById("status-block").classList.remove("hidden");
|
||||||
|
@ -57,5 +57,9 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pt-4">{% include "tracker/codes/index.html" %}</div>
|
{% if current_scene.title != scene_title %}
|
||||||
|
<div class="pt-4 hidden">{% include "tracker/codes/index.html" %}</div>
|
||||||
|
{% else %}
|
||||||
|
<div class="pt-4">{% include "tracker/codes/index.html" %}</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
18
tunictracker/tracker/templates/tracker/codes/block.html
Normal file
18
tunictracker/tracker/templates/tracker/codes/block.html
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<ul class="flex flex-col p-2 rounded-md bg-bluelight-translucent-dark max-w-full {% if is_entered %}hidden{% endif %}">
|
||||||
|
<div class="p-2">{{ name }}:</div>
|
||||||
|
<div class="p-2 m-auto justify-center align-top">
|
||||||
|
<div class="max-w-64">
|
||||||
|
{% for arrow in code %}
|
||||||
|
{% if arrow == "U" %}
|
||||||
|
⬆️
|
||||||
|
{% elif arrow == "D" %}
|
||||||
|
⬇️
|
||||||
|
{% elif arrow == "L" %}
|
||||||
|
⬅️
|
||||||
|
{% elif arrow == "R" %}
|
||||||
|
➡️
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ul>
|
@ -1,30 +1,17 @@
|
|||||||
<div class="flex flex-col max-w-full text-lg rounded-md ring-4 bg-bluelight-translucent ring-bluelight-dark justify-start p-4 {% if not codes %}hidden{% endif %}">
|
<div class="flex flex-col max-w-full text-lg rounded-md ring-4 bg-bluelight-translucent ring-bluelight-dark justify-start p-4 {{ is_hidden }}">
|
||||||
Holy Cross Codes
|
Holy Cross Codes
|
||||||
<div class="flex flex-col space-y-2" id="codes-block">
|
<div class="flex flex-col space-y-2">
|
||||||
<ul class="flex flex-col space-y-2 rounded-md hidden">
|
<ul class="flex flex-col space-y-4 rounded-md" id="codes-block">
|
||||||
</ul>
|
|
||||||
<ul class="flex flex-col space-y-4 rounded-md">
|
|
||||||
<ul class="flex flex-col p-2 rounded-md bg-bluelight-translucent-dark w-full hidden">
|
<ul class="flex flex-col p-2 rounded-md bg-bluelight-translucent-dark w-full hidden">
|
||||||
</ul>
|
</ul>
|
||||||
{% for name, code in codes.items %}
|
{% for name, code in default_codes.items %}
|
||||||
<ul class="flex flex-col p-2 rounded-md bg-bluelight-translucent-dark w-full">
|
{% include "tracker/codes/block.html" with is_entered=false %}
|
||||||
<div class="p-2">{{ name }}:</div>
|
{% endfor %}
|
||||||
<div class="p-2 m-auto justify-center align-top">
|
{% for name, code in spell_codes.items %}
|
||||||
<div class="max-w-64">
|
{% include "tracker/codes/block.html" with is_entered=false %}
|
||||||
{% for arrow in code %}
|
{% endfor %}
|
||||||
{% if arrow == "U" %}
|
{% for name, code_tuple in current_codes.items %}
|
||||||
⬆️
|
{% include "tracker/codes/block.html" with code=code_tuple.0 is_entered=code_tuple.1 %}
|
||||||
{% elif arrow == "D" %}
|
|
||||||
⬇️
|
|
||||||
{% elif arrow == "L" %}
|
|
||||||
⬅️
|
|
||||||
{% elif arrow == "R" %}
|
|
||||||
➡️
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</ul>
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -35,7 +35,11 @@
|
|||||||
<div class="p-4 flex flex-col space-y-4 breakdown-list">
|
<div class="p-4 flex flex-col space-y-4 breakdown-list">
|
||||||
{% include "tracker/breakdown/block.html" with extra_classes="hidden" %}
|
{% include "tracker/breakdown/block.html" with extra_classes="hidden" %}
|
||||||
{% for scene_title, scene_data in scenes.items %}
|
{% for scene_title, scene_data in scenes.items %}
|
||||||
{% include "tracker/breakdown/block.html" %}
|
{% if scene_title == current_scene.title %}
|
||||||
|
{% include "tracker/breakdown/block.html" with extra_classes="hidden" %}
|
||||||
|
{% else %}
|
||||||
|
{% include "tracker/breakdown/block.html" %}
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</details>
|
</details>
|
||||||
@ -45,8 +49,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<details class="group p-2 flex max-w-full rounded-md ring-4 bg-bluelight-translucent ring-bluelight-dark">
|
<details class="group p-2 flex max-w-full rounded-md ring-4 bg-bluelight-translucent ring-bluelight-dark">
|
||||||
<summary class="justify-start p-2">Tracker Debug</summary>
|
<summary class="justify-start p-2">Tracker Debug</summary>
|
||||||
<div class="p-2 flex flex-col space-y-2"
|
<div class="p-2 flex flex-col space-y-2" id="debug-block">
|
||||||
id="debug-block">
|
|
||||||
<ul class="p-2 rounded-md bg-bluelight-translucent hidden">
|
<ul class="p-2 rounded-md bg-bluelight-translucent hidden">
|
||||||
</ul>
|
</ul>
|
||||||
{% for name, value in debug.items %}
|
{% for name, value in debug.items %}
|
||||||
|
@ -39,25 +39,30 @@ def index(request):
|
|||||||
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["Current"]["Scene"]
|
tracker_current_scene = tracker_output["Current"]["Scene"]
|
||||||
tracker_current_scane_data = tracker_output["Scenes"][tracker_current_scene]
|
tracker_current_scene_data = tracker_output["Scenes"][tracker_current_scene]
|
||||||
tracker_scenes = tracker_output["Scenes"]
|
tracker_scenes = tracker_output["Scenes"]
|
||||||
tracker_codes = tracker_output["Codes"]
|
tracker_codes = tracker_output["Codes"]
|
||||||
try:
|
try:
|
||||||
current_cross_codes = cross_codes[tracker_current_scene]
|
current_cross_codes = cross_codes[tracker_current_scene]
|
||||||
except:
|
for k, v in cross_codes[tracker_current_scene].items():
|
||||||
|
current_cross_codes[k] = (
|
||||||
|
v, tracker_codes[tracker_current_scene][k])
|
||||||
|
except Exception as e:
|
||||||
current_cross_codes = {}
|
current_cross_codes = {}
|
||||||
|
print(e)
|
||||||
template = loader.get_template("tracker/index.html")
|
template = loader.get_template("tracker/index.html")
|
||||||
context = {
|
context = {
|
||||||
"server_address": server_address,
|
"server_address": server_address,
|
||||||
"is_hidden": is_hidden,
|
"is_hidden": is_hidden,
|
||||||
"debug": tracker_debug,
|
"debug": tracker_debug,
|
||||||
"codes": current_cross_codes,
|
"default_codes": cross_codes["Default"],
|
||||||
"codes_entered": tracker_codes,
|
"spell_codes": cross_codes["Spells"],
|
||||||
|
"current_codes": current_cross_codes,
|
||||||
"totals": tracker_totals,
|
"totals": tracker_totals,
|
||||||
"scenes": tracker_scenes,
|
"scenes": tracker_scenes,
|
||||||
"current_scene": {
|
"current_scene": {
|
||||||
"title": tracker_current_scene,
|
"title": tracker_current_scene,
|
||||||
"data": tracker_current_scane_data
|
"data": tracker_current_scene_data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return HttpResponse(template.render(context, request))
|
return HttpResponse(template.render(context, request))
|
||||||
|
Loading…
Reference in New Issue
Block a user