Added panel in current breakdown for holy cross codes. Need to add logic for whether they have been entered, need to add live update.
This commit is contained in:
parent
3e34ac33e0
commit
c521c24602
69
tunictracker/tracker/data/holy_cross_codes.json
Normal file
69
tunictracker/tracker/data/holy_cross_codes.json
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
{
|
||||||
|
"Cathedral": {
|
||||||
|
"Secret Legend Door": "LULURULURDRRURDLDRDLDL"
|
||||||
|
},
|
||||||
|
"Caustic Light Cave": {
|
||||||
|
"Casting Light Fairy": "RULURDRURDLDR"
|
||||||
|
},
|
||||||
|
"Cube Cave": {
|
||||||
|
"Cube Fairy": "RRRRUUUURRRUUURRUURU"
|
||||||
|
},
|
||||||
|
"East Forest": {
|
||||||
|
"Dancer Fairy": "UDUDLRLRDLUR",
|
||||||
|
"Obelisk Fairy": "DRDLULDLURULURURULURDRDRDLDRDLU"
|
||||||
|
},
|
||||||
|
"Eastern Vault Fortress": {
|
||||||
|
"Candles Fairy": "RLDRUL"
|
||||||
|
},
|
||||||
|
"Hourglass Cave": {
|
||||||
|
"Hourglass Door": "RULURULUURDLDRDLDR",
|
||||||
|
"Hourglass Fairy": "LURURDRURULLLURU"
|
||||||
|
},
|
||||||
|
"Library Hall": {
|
||||||
|
"Library Fairy": "URDRULURULURDLDRURDRULURULULDRDLDRDL"
|
||||||
|
},
|
||||||
|
"Lower Mountain": {
|
||||||
|
"Top Of Mountain Door": "ULDLULDLURURULURDRULULURULDLURUULURDRDRURDLDRURRDRURDRURRDLDLDRDRDLLDRDLDRURDRURRDDLURULDLULULURRULU"
|
||||||
|
},
|
||||||
|
"Maze Cave": {
|
||||||
|
"Maze Fairy": "ULDLURDRURDLULU"
|
||||||
|
},
|
||||||
|
"Old House": {
|
||||||
|
"Old House Door": "ULDRDL",
|
||||||
|
"Old House Fairy": "UURDDRUURDDD"
|
||||||
|
},
|
||||||
|
"Overworld": {
|
||||||
|
"Back To Work Treasure": "RDLULLDRRDD",
|
||||||
|
"Compass Fairy": "LRDUUDRLURDLUDRL",
|
||||||
|
"Fire Wand Obelisk Page": "URDLDRUL",
|
||||||
|
"Fountain Cross Door": "URDLDLU",
|
||||||
|
"Fountain Fairy": "DLLDURD",
|
||||||
|
"Lower Flower Fairy": "URDLDLDLU",
|
||||||
|
"Moss Fairy": "URULDRURULDLDRULURDRD",
|
||||||
|
"Power Up Treasure": "UDRUDLUDLRDLRU",
|
||||||
|
"Sacred Geometry Treasure": "DLLUURRLDRUD",
|
||||||
|
"Southeast Cross Door": "DRULUR",
|
||||||
|
"Upper Flowers Fairy": "ULDLDLDLURDRRDR",
|
||||||
|
"Vintage Treasure": "DRRRRRRRRRRRLLLLLLLLLLLL"
|
||||||
|
},
|
||||||
|
"Patrol Cave": {
|
||||||
|
"Patrol Fairy": "DDRURDLDRURDD"
|
||||||
|
},
|
||||||
|
"Quarry": {
|
||||||
|
"Quarry Fairy": "URDLURULDLURRD"
|
||||||
|
},
|
||||||
|
"Ruined Passage": {
|
||||||
|
"Ruined Passage Door": "LURULDLURDRULURD"
|
||||||
|
},
|
||||||
|
"Sealed Temple": {
|
||||||
|
"Temple Fairy": "URULURULURDRUUL"
|
||||||
|
},
|
||||||
|
"Secret Gathering Place": {
|
||||||
|
"Waterfall Fairy": "DRURURULULURURULDLDLDRDLDRDRUR"
|
||||||
|
},
|
||||||
|
"West Garden": {
|
||||||
|
"Sword Door": "DRULUR",
|
||||||
|
"Tiles Fairy": "URULURULURDRULRLURULURULU",
|
||||||
|
"Tree Fairy": "LDRLUD"
|
||||||
|
}
|
||||||
|
}
|
@ -1,18 +1,22 @@
|
|||||||
|
var current_hash = "";
|
||||||
|
|
||||||
window.onload = () => {
|
window.onload = () => {
|
||||||
//
|
|
||||||
// let overview = document.getElementById("overview");
|
|
||||||
// let breakdown_current = document.getElementById("breakdown-current");
|
|
||||||
const refresh_interval = setInterval(refresh_elements, 500);
|
const refresh_interval = setInterval(refresh_elements, 500);
|
||||||
};
|
};
|
||||||
|
|
||||||
async function refresh_elements() {
|
async function refresh_elements() {
|
||||||
fetch("http://localhost:8000/spoiler")
|
fetch("http://192.168.1.101:8000/spoiler")
|
||||||
.then((response) => response.json())
|
.then((response) => response.json())
|
||||||
.then(
|
.then(
|
||||||
(data) => {
|
(data) => {
|
||||||
// Attempt to receive response JSON.
|
// Attempt to receive response JSON.
|
||||||
const response_object = JSON.parse(JSON.stringify(data));
|
const response_object = JSON.parse(JSON.stringify(data));
|
||||||
document.getElementById("status-block").classList.add("hidden")
|
document.getElementById("status-block").classList.add("hidden");
|
||||||
|
if (response_object.Debug.Hash == current_hash) {
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
current_hash = response_object.Debug.Hash;
|
||||||
|
}
|
||||||
|
|
||||||
// Parse out data from the back-end into variables.
|
// Parse out data from the back-end into variables.
|
||||||
const overview_checks_undiscovered =
|
const overview_checks_undiscovered =
|
||||||
@ -23,6 +27,8 @@ async function refresh_elements() {
|
|||||||
const overview_entrances_total = response_object.Totals.Entrances.Total;
|
const overview_entrances_total = response_object.Totals.Entrances.Total;
|
||||||
const current_scene_name = response_object.Current.Scene;
|
const current_scene_name = response_object.Current.Scene;
|
||||||
const all_scenes = response_object.Scenes;
|
const all_scenes = response_object.Scenes;
|
||||||
|
const debug_info = response_object.Debug;
|
||||||
|
const cross_codes = response_object.Codes;
|
||||||
|
|
||||||
// Refresh elements with new data from the back end.
|
// Refresh elements with new data from the back end.
|
||||||
|
|
||||||
@ -42,6 +48,10 @@ async function refresh_elements() {
|
|||||||
.querySelector(".breakdown-list")
|
.querySelector(".breakdown-list")
|
||||||
.firstElementChild.cloneNode(true);
|
.firstElementChild.cloneNode(true);
|
||||||
breakdown_block.classList.remove("hidden");
|
breakdown_block.classList.remove("hidden");
|
||||||
|
let debug_item = document
|
||||||
|
.getElementById("debug-block")
|
||||||
|
.firstElementChild.cloneNode(true);
|
||||||
|
debug_item.classList.remove("hidden");
|
||||||
let new_breakdown_list = document
|
let new_breakdown_list = document
|
||||||
.getElementById("overview")
|
.getElementById("overview")
|
||||||
.querySelector(".breakdown-list")
|
.querySelector(".breakdown-list")
|
||||||
@ -50,10 +60,14 @@ async function refresh_elements() {
|
|||||||
.getElementById("overview")
|
.getElementById("overview")
|
||||||
.querySelector(".summary-list")
|
.querySelector(".summary-list")
|
||||||
.cloneNode(true);
|
.cloneNode(true);
|
||||||
|
let new_debug_block = document
|
||||||
|
.getElementById("debug-block")
|
||||||
|
.cloneNode(true);
|
||||||
|
|
||||||
// Clear out the current lists.
|
// Clear out the current lists.
|
||||||
new_breakdown_list.innerHTML = "";
|
new_breakdown_list.innerHTML = "";
|
||||||
new_summary_list.firstElementChild.innerHTML = "";
|
new_summary_list.firstElementChild.innerHTML = "";
|
||||||
|
new_debug_block.innerHTML = "";
|
||||||
|
|
||||||
// Set content to updated data.
|
// Set content to updated data.
|
||||||
overview_checks_title.textContent = `Checks: ${overview_checks_undiscovered}/${overview_checks_total}`;
|
overview_checks_title.textContent = `Checks: ${overview_checks_undiscovered}/${overview_checks_total}`;
|
||||||
@ -213,6 +227,10 @@ async function refresh_elements() {
|
|||||||
);
|
);
|
||||||
new_breakdown_list.appendChild(breakdown_block.cloneNode(true));
|
new_breakdown_list.appendChild(breakdown_block.cloneNode(true));
|
||||||
});
|
});
|
||||||
|
Object.keys(debug_info).forEach((item) => {
|
||||||
|
debug_item.textContent = `${item}: ${debug_info[item]}`;
|
||||||
|
new_debug_block.appendChild(debug_item.cloneNode(true));
|
||||||
|
});
|
||||||
|
|
||||||
// Replace with new data.
|
// Replace with new data.
|
||||||
// console.log(new_summary_list);
|
// console.log(new_summary_list);
|
||||||
@ -224,17 +242,20 @@ 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("breakdown-current")
|
.getElementById("debug-block")
|
||||||
.replaceWith(
|
.replaceWith(new_debug_block.cloneNode(true));
|
||||||
document.getElementById("breakdown-current").cloneNode(true)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Debug
|
// Debug
|
||||||
// console.log("We have data.");
|
// console.log("We have data.");
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
document.getElementById("status-block").classList.remove("hidden")
|
document.getElementById("status-block").classList.remove("hidden");
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -57,4 +57,5 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="pt-4">{% include "tracker/codes/index.html" %}</div>
|
||||||
</div>
|
</div>
|
||||||
|
31
tunictracker/tracker/templates/tracker/codes/index.html
Normal file
31
tunictracker/tracker/templates/tracker/codes/index.html
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<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 %}">
|
||||||
|
Holy Cross Codes
|
||||||
|
<div class="flex flex-col space-y-2" id="codes-block">
|
||||||
|
<ul class="flex flex-col space-y-2 rounded-md hidden">
|
||||||
|
</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>
|
||||||
|
{% for name, code in codes.items %}
|
||||||
|
<ul class="flex flex-col p-2 rounded-md bg-bluelight-translucent-dark w-full">
|
||||||
|
<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>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -43,35 +43,17 @@
|
|||||||
<div id="breakdown-current">
|
<div id="breakdown-current">
|
||||||
{% include "tracker/breakdown/block.html" with scene_title=current_scene.title scene_data=current_scene.data %}
|
{% include "tracker/breakdown/block.html" with scene_title=current_scene.title scene_data=current_scene.data %}
|
||||||
</div>
|
</div>
|
||||||
<details class="group 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 pl-4 pr-4 flex flex-col space-y-2">
|
<div class="p-2 flex flex-col space-y-2"
|
||||||
<div>
|
id="debug-block">
|
||||||
<ul>
|
<ul class="p-2 rounded-md bg-bluelight-translucent hidden">
|
||||||
Name: {{ debug.Name }}
|
</ul>
|
||||||
|
{% for name, value in debug.items %}
|
||||||
|
<ul class="p-2 rounded-md bg-bluelight-translucent">
|
||||||
|
{{ name }}: {{ value }}
|
||||||
</ul>
|
</ul>
|
||||||
<ul>
|
{% endfor %}
|
||||||
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>
|
</div>
|
||||||
</details>
|
</details>
|
||||||
</div>
|
</div>
|
||||||
|
@ -31,16 +31,28 @@ def index(request):
|
|||||||
is_hidden = False
|
is_hidden = False
|
||||||
except:
|
except:
|
||||||
return
|
return
|
||||||
|
with open('tracker/data/holy_cross_codes.json', 'r') as t:
|
||||||
|
try:
|
||||||
|
cross_codes = loads(t.read())
|
||||||
|
except:
|
||||||
|
return
|
||||||
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_scane_data = tracker_output["Scenes"][tracker_current_scene]
|
||||||
tracker_scenes = tracker_output["Scenes"]
|
tracker_scenes = tracker_output["Scenes"]
|
||||||
|
tracker_codes = tracker_output["Codes"]
|
||||||
|
try:
|
||||||
|
current_cross_codes = cross_codes[tracker_current_scene]
|
||||||
|
except:
|
||||||
|
current_cross_codes = {}
|
||||||
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,
|
||||||
|
"codes_entered": tracker_codes,
|
||||||
"totals": tracker_totals,
|
"totals": tracker_totals,
|
||||||
"scenes": tracker_scenes,
|
"scenes": tracker_scenes,
|
||||||
"current_scene": {
|
"current_scene": {
|
||||||
|
@ -129,4 +129,4 @@ TAILWIND_APP_NAME = 'werefoxtheme'
|
|||||||
|
|
||||||
INTERNAL_IPS = [
|
INTERNAL_IPS = [
|
||||||
"127.0.0.1",
|
"127.0.0.1",
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user