locations now hidden by default

This commit is contained in:
ReznoRMichael 2020-09-06 02:11:23 +02:00
parent cdbed83138
commit 5f83608415
2 changed files with 8 additions and 14 deletions

View file

@ -332,7 +332,7 @@ function HKCheckCompletion(jsonObject) {
// Prevents wrong checkbox behaviour
CheckboxHintsToggle("hide");
CheckboxLocationsToggle("show");
CheckboxLocationsToggle("hide");
// Pre-Cleaning and filling initial data
PrefillHTML(DIV_ID);
@ -397,10 +397,6 @@ function HKCheckCompletion(jsonObject) {
document.getElementById(DIV_ID.intro.id).innerHTML += divStart + icon + textFill + divEnd;
}
// ---------------- Hints --------------------- //
// function CheckHints()
// ---------------- Bosses (Base Game) --------------------- //
if (HK_BOSSES_temp) CheckIfDataTrue(DIV_ID.bosses, HK_BOSSES_temp, HKPlayerData);
@ -544,7 +540,7 @@ function FillHTML(divId, textPrefix = "Unknown Completion Element: ", textSuffix
let b = ["<b>", "</b>"];
if (!textPrefix.length) b = ["", ""];
let span = ["<span class='location'>", "</span>"];
let span = ["<span class='location hidden'>", "</span>"];
if (divId === DIV_ID.hints) {
span[0] = "<span>";
icon = SYMBOL_INFO;
@ -856,7 +852,7 @@ function InitialHTMLPopulate(divIdObj) {
}
/**
* Toggles display of "hk-hints". On click or when called with a parameter
* Toggles display of "hk-hints". On click with no parameters or on demand when called with a parameter
* @param {string} param "hide", "show" or none (optional)
*/
function CheckboxHintsToggle(param) {
@ -884,6 +880,10 @@ function CheckboxHintsToggle(param) {
}
}
/**
* Toggles display of ".location" class. On click with no parameters or on demand when called with a parameter
* @param {string} param "hide", "show" or none (optional)
*/
function CheckboxLocationsToggle(param) {
let checkboxId = document.getElementById("checkbox-locations");
let allClassElements = document.querySelectorAll(".location");
@ -917,6 +917,4 @@ function CheckboxLocationsToggle(param) {
checkboxId.value = "locations-on";
}
}
}

View file

@ -25,13 +25,9 @@
<!-- To do:
- Upload a save file directly (option)
- Hide/Show locations checkbox (show = default)
- Hide/Show hints checkbox (hide = default)
- Calculate all % in all categories from save data
- Single Pale Ore locations? (required for completion)
- Single Keys/Pass locations? (required for completion)
- Spoiler-free hints where to go next? (ala Elderbug)
- Show hints only if not yet killed Hollow Knight
-->
<div id="content">
@ -58,7 +54,7 @@
<span class="checkmark"></span>Hints
</label>
<label for="checkbox-locations" class="checkbox-label">
<input type="checkbox" name="checkboxes" id="checkbox-locations" value="locations-on" onclick="CheckboxLocationsToggle();" checked>
<input type="checkbox" name="checkboxes" id="checkbox-locations" value="locations-off" onclick="CheckboxLocationsToggle();">
<span class="checkmark"></span>Locations
</label>
</div>