plugin-backend #1
@ -728,12 +728,14 @@ async function initialize_summary(summary_element, scene, checks, entrances) {
|
||||
summary_element.querySelector(".summary-title").textContent = scene;
|
||||
|
||||
const summary_checks = summary_element.querySelector(".summary-checks");
|
||||
summary_checks.dataset.checksCollected = parseInt(checks.collected + checks.found);
|
||||
summary_checks.dataset.checksCollected = parseInt(
|
||||
checks.collected + checks.found
|
||||
);
|
||||
summary_checks.dataset.checksRemaining = checks.remaining;
|
||||
summary_checks.dataset.checksTotal = checks.total;
|
||||
summary_checks.textContent = `Checks: ${parseInt(checks.collected + checks.found)}/${
|
||||
checks.total
|
||||
} (${checks.remaining})`;
|
||||
summary_checks.textContent = `Checks: ${parseInt(
|
||||
checks.collected + checks.found
|
||||
)}/${checks.total} (${checks.remaining})`;
|
||||
|
||||
const summary_entrances = summary_element.querySelector(".summary-entrances");
|
||||
summary_entrances.dataset.entrancesFound = entrances.found;
|
||||
@ -786,18 +788,22 @@ async function update_summary(scene, checks, entrances) {
|
||||
|
||||
// Make variables for whether checks or entrances updated
|
||||
const checks_changed =
|
||||
summary_checks.dataset.checksCollected != parseInt(checks.collected + checks.found);
|
||||
parseInt(summary_checks.dataset.checksCollected) !=
|
||||
parseInt(checks.collected + checks.found);
|
||||
const entrances_changed =
|
||||
summary_entrances.dataset.entrancesFound != entrances.found;
|
||||
parseInt(summary_entrances.dataset.entrancesFound) !=
|
||||
parseInt(entrances.found);
|
||||
|
||||
// Check for changes, and if so, update
|
||||
if (checks_changed) {
|
||||
summary_checks.dataset.checksCollected = parseInt(checks.collected + checks.found);
|
||||
summary_checks.dataset.checksCollected = parseInt(
|
||||
checks.collected + checks.found
|
||||
);
|
||||
summary_checks.dataset.checksRemaining = checks.remaining;
|
||||
summary_checks.dataset.checksTotal = checks.total;
|
||||
summary_checks.textContent = `Checks: ${parseInt(checks.collected + checks.found)}/${
|
||||
checks.total
|
||||
} (${checks.remaining})`;
|
||||
summary_checks.textContent = `Checks: ${parseInt(
|
||||
checks.collected + checks.found
|
||||
)}/${checks.total} (${checks.remaining})`;
|
||||
}
|
||||
if (entrances_changed) {
|
||||
summary_entrances.dataset.entrancesFound = entrances.found;
|
||||
@ -849,6 +855,7 @@ async function update_summary_list(data, changed) {
|
||||
collected: document.querySelector(
|
||||
`.summary[data-scene="${scene}"] .summary-checks`
|
||||
).dataset.checksCollected,
|
||||
found: 0,
|
||||
remaining: document.querySelector(
|
||||
`.summary[data-scene="${scene}"] .summary-checks`
|
||||
).dataset.checksRemaining,
|
||||
|
Loading…
Reference in New Issue
Block a user