HKReadTextArea() runs from event
This commit is contained in:
parent
aed97eeb47
commit
8a365f6a84
4 changed files with 31 additions and 41 deletions
File diff suppressed because one or more lines are too long
|
|
@ -195,7 +195,7 @@
|
||||||
<!-- <button id="save-area-file" class="button" onclick="">Load Save</button> -->
|
<!-- <button id="save-area-file" class="button" onclick="">Load Save</button> -->
|
||||||
<!-- <input id="save-area-file" class="" type="file" name="file" accept=".dat,.bak*" onchange="LoadSaveFile(this)"> -->
|
<!-- <input id="save-area-file" class="" type="file" name="file" accept=".dat,.bak*" onchange="LoadSaveFile(this)"> -->
|
||||||
<!-- <button id="save-area-read" class="button" onclick="HKReadTextArea('save-area');">Analyze Text</button> -->
|
<!-- <button id="save-area-read" class="button" onclick="HKReadTextArea('save-area');">Analyze Text</button> -->
|
||||||
<button id="save-area-read" class="button" onclick="HKReadTextArea('save-area');">Analyze Text</button>
|
<button id="save-area-read" class="button">Analyze Text</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="checkboxes">
|
<div class="checkboxes">
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@
|
||||||
<!-- <button id="save-area-file" class="button" onclick="">Load Save</button> -->
|
<!-- <button id="save-area-file" class="button" onclick="">Load Save</button> -->
|
||||||
<!-- <input id="save-area-file" class="" type="file" name="file" accept=".dat,.bak*" onchange="LoadSaveFile(this)"> -->
|
<!-- <input id="save-area-file" class="" type="file" name="file" accept=".dat,.bak*" onchange="LoadSaveFile(this)"> -->
|
||||||
<!-- <button id="save-area-read" class="button" onclick="HKReadTextArea('save-area');">Analyze Text</button> -->
|
<!-- <button id="save-area-read" class="button" onclick="HKReadTextArea('save-area');">Analyze Text</button> -->
|
||||||
<button id="save-area-read" class="button" onclick="HKReadTextArea('save-area');">Analyze Text</button>
|
<button id="save-area-read" class="button">Analyze Text</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="checkboxes">
|
<div class="checkboxes">
|
||||||
|
|
|
||||||
|
|
@ -634,8 +634,7 @@ function CheckGodmasterDoors(divId, dataObject, playerData) {
|
||||||
if (playerData.hasOwnProperty("bossDoorStateTier" + (i + 1)) === false) {
|
if (playerData.hasOwnProperty("bossDoorStateTier" + (i + 1)) === false) {
|
||||||
CurrentDataBlank();
|
CurrentDataBlank();
|
||||||
FillHTML(divId, `<del>${dataObject[pantheon[i]].name}</del>`, `<del>${dataObject[pantheon[i]].spoiler}</del>`);
|
FillHTML(divId, `<del>${dataObject[pantheon[i]].name}</del>`, `<del>${dataObject[pantheon[i]].spoiler}</del>`);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
(playerData["bossDoorStateTier" + (i + 1)].completed === true) ? CurrentDataTrue(divId): CurrentDataFalse();
|
(playerData["bossDoorStateTier" + (i + 1)].completed === true) ? CurrentDataTrue(divId): CurrentDataFalse();
|
||||||
FillHTML(divId, dataObject[pantheon[i]].name, dataObject[pantheon[i]].spoiler);
|
FillHTML(divId, dataObject[pantheon[i]].name, dataObject[pantheon[i]].spoiler);
|
||||||
}
|
}
|
||||||
|
|
@ -758,8 +757,7 @@ function CheckAdditionalThings(divId, dataObject, playerData, worldData, sceneDa
|
||||||
textPrefix = `<del>${dataObject[i].name}</del>`;
|
textPrefix = `<del>${dataObject[i].name}</del>`;
|
||||||
textSuffix = `<del>${textSuffix}</del>`;
|
textSuffix = `<del>${textSuffix}</del>`;
|
||||||
break;
|
break;
|
||||||
}
|
} else if (playerData.zoteDead === true || (playerData.zoteRescuedBuzzer === false && playerData.hasWalljump === true)) {
|
||||||
else if (playerData.zoteDead === true || (playerData.zoteRescuedBuzzer === false && playerData.hasWalljump === true)) {
|
|
||||||
textPrefix = `<del>${textPrefix}</del>`;
|
textPrefix = `<del>${textPrefix}</del>`;
|
||||||
textSuffix = `<del>${textSuffix}</del>`;
|
textSuffix = `<del>${textSuffix}</del>`;
|
||||||
}
|
}
|
||||||
|
|
@ -849,8 +847,7 @@ function CheckAdditionalThings(divId, dataObject, playerData, worldData, sceneDa
|
||||||
CurrentDataBlank();
|
CurrentDataBlank();
|
||||||
textPrefix = `<del>${textPrefix}</del>`;
|
textPrefix = `<del>${textPrefix}</del>`;
|
||||||
textSuffix = `<del>${textSuffix}</del>`;
|
textSuffix = `<del>${textSuffix}</del>`;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
(playerData[i].completed === true) ? CurrentDataTrue(): CurrentDataFalse();
|
(playerData[i].completed === true) ? CurrentDataTrue(): CurrentDataFalse();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -872,8 +869,7 @@ function CheckAdditionalThings(divId, dataObject, playerData, worldData, sceneDa
|
||||||
textPrefix = `<del>${textPrefix}</del>`;
|
textPrefix = `<del>${textPrefix}</del>`;
|
||||||
textSuffix = `<del>${textSuffix}</del>`;
|
textSuffix = `<del>${textSuffix}</del>`;
|
||||||
break;
|
break;
|
||||||
}
|
} else if (playerData.zoteDead === true || (playerData.zoteRescuedBuzzer === false && playerData.hasWalljump === true)) {
|
||||||
else if (playerData.zoteDead === true || (playerData.zoteRescuedBuzzer === false && playerData.hasWalljump === true)) {
|
|
||||||
textPrefix = `<del>${textPrefix}</del>`;
|
textPrefix = `<del>${textPrefix}</del>`;
|
||||||
textSuffix = `<del>${textSuffix}</del>`;
|
textSuffix = `<del>${textSuffix}</del>`;
|
||||||
}
|
}
|
||||||
|
|
@ -886,28 +882,23 @@ function CheckAdditionalThings(divId, dataObject, playerData, worldData, sceneDa
|
||||||
textPrefix = dataObject[i].nameNeglect;
|
textPrefix = dataObject[i].nameNeglect;
|
||||||
textSuffix = dataObject[i].spoilerNeglect;
|
textSuffix = dataObject[i].spoilerNeglect;
|
||||||
CurrentDataTrue();
|
CurrentDataTrue();
|
||||||
}
|
} else if (playerData.killedZote === true) {
|
||||||
else if (playerData.killedZote === true) {
|
|
||||||
textPrefix = dataObject[i].nameRivalry;
|
textPrefix = dataObject[i].nameRivalry;
|
||||||
textSuffix = dataObject[i].spoilerRivalry;
|
textSuffix = dataObject[i].spoilerRivalry;
|
||||||
CurrentDataTrue();
|
CurrentDataTrue();
|
||||||
}
|
} else if (playerData.zoteRescuedBuzzer === false) {
|
||||||
else if (playerData.zoteRescuedBuzzer === false) {
|
|
||||||
if (playerData.hasWalljump === false) {
|
if (playerData.hasWalljump === false) {
|
||||||
textPrefix = dataObject[i].nameTrappedVengefly;
|
textPrefix = dataObject[i].nameTrappedVengefly;
|
||||||
textSuffix = dataObject[i].spoilerTrappedVengefly;
|
textSuffix = dataObject[i].spoilerTrappedVengefly;
|
||||||
}
|
} else if (playerData.hasWalljump === true) {
|
||||||
else if (playerData.hasWalljump === true) {
|
|
||||||
textPrefix = dataObject[i].nameNotRescuedVengefly;
|
textPrefix = dataObject[i].nameNotRescuedVengefly;
|
||||||
textSuffix = dataObject[i].spoilerNotRescuedVengefly;
|
textSuffix = dataObject[i].spoilerNotRescuedVengefly;
|
||||||
}
|
}
|
||||||
}
|
} else if (playerData.zoteRescuedBuzzer === true) {
|
||||||
else if (playerData.zoteRescuedBuzzer === true) {
|
|
||||||
if (playerData.zoteRescuedDeepnest === false) {
|
if (playerData.zoteRescuedDeepnest === false) {
|
||||||
textPrefix = dataObject[i].nameTrappedDeepnest;
|
textPrefix = dataObject[i].nameTrappedDeepnest;
|
||||||
textSuffix = dataObject[i].spoilerTrappedDeepnest;
|
textSuffix = dataObject[i].spoilerTrappedDeepnest;
|
||||||
}
|
} else if (playerData.zoteRescuedDeepnest === true) {
|
||||||
else if (playerData.zoteRescuedDeepnest === true) {
|
|
||||||
if (playerData.killedZote === false) {
|
if (playerData.killedZote === false) {
|
||||||
textPrefix = dataObject[i].nameColosseum;
|
textPrefix = dataObject[i].nameColosseum;
|
||||||
textSuffix = dataObject[i].spoilerColosseum;
|
textSuffix = dataObject[i].spoilerColosseum;
|
||||||
|
|
@ -921,17 +912,14 @@ function CheckAdditionalThings(divId, dataObject, playerData, worldData, sceneDa
|
||||||
textPrefix = dataObject[i].namePurity;
|
textPrefix = dataObject[i].namePurity;
|
||||||
textSuffix = dataObject[i].spoilerPurity;
|
textSuffix = dataObject[i].spoilerPurity;
|
||||||
CurrentDataTrue();
|
CurrentDataTrue();
|
||||||
}
|
} else if (playerData.nailsmithConvoArt === true) {
|
||||||
else if (playerData.nailsmithConvoArt === true) {
|
|
||||||
textPrefix = dataObject[i].nameHappyCouple;
|
textPrefix = dataObject[i].nameHappyCouple;
|
||||||
textSuffix = dataObject[i].spoilerHappyCouple;
|
textSuffix = dataObject[i].spoilerHappyCouple;
|
||||||
CurrentDataTrue();
|
CurrentDataTrue();
|
||||||
}
|
} else if (playerData.nailsmithSpared === true) {
|
||||||
else if (playerData.nailsmithSpared === true) {
|
|
||||||
textPrefix = dataObject[i].nameSheoHutWaiting;
|
textPrefix = dataObject[i].nameSheoHutWaiting;
|
||||||
textSuffix = dataObject[i].spoilerSheoHutWaiting;
|
textSuffix = dataObject[i].spoilerSheoHutWaiting;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
textPrefix = dataObject[i].nameUpgradeNail;
|
textPrefix = dataObject[i].nameUpgradeNail;
|
||||||
textSuffix = dataObject[i].spoilerUpgradeNail;
|
textSuffix = dataObject[i].spoilerUpgradeNail;
|
||||||
}
|
}
|
||||||
|
|
@ -1015,11 +1003,10 @@ function CheckAdditionalThings(divId, dataObject, playerData, worldData, sceneDa
|
||||||
|
|
||||||
if (!countTotal) {
|
if (!countTotal) {
|
||||||
console.log("%cAll Geo Rocks Broken!", "color: #16c60c; font-weight: 700;");
|
console.log("%cAll Geo Rocks Broken!", "color: #16c60c; font-weight: 700;");
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
console.groupCollapsed(`%cUnbroken Geo Rocks (${countTotal}):`, "color: #16c60c; font-weight: 700;");
|
console.groupCollapsed(`%cUnbroken Geo Rocks (${countTotal}):`, "color: #16c60c; font-weight: 700;");
|
||||||
|
|
||||||
for (let i = 0, length = geoRocksLog.length; i < length; i++ ) {
|
for (let i = 0, length = geoRocksLog.length; i < length; i++) {
|
||||||
console.log(geoRocksLog[i]);
|
console.log(geoRocksLog[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1050,7 +1037,7 @@ function CheckAdditionalThings(divId, dataObject, playerData, worldData, sceneDa
|
||||||
} else if (worldData[i].sceneName === "Ruins2_11" && worldData[i].id === "Grub Bottle (2)") {
|
} else if (worldData[i].sceneName === "Ruins2_11" && worldData[i].id === "Grub Bottle (2)") {
|
||||||
continue;
|
continue;
|
||||||
} else { */
|
} else { */
|
||||||
rescuedGrubsSceneList.push(worldData[i].sceneName);
|
rescuedGrubsSceneList.push(worldData[i].sceneName);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1062,8 +1049,7 @@ function CheckAdditionalThings(divId, dataObject, playerData, worldData, sceneDa
|
||||||
|
|
||||||
if (!length) {
|
if (!length) {
|
||||||
console.log("%cAll Grubs Rescued!", "color: #16c60c; font-weight: 700;");
|
console.log("%cAll Grubs Rescued!", "color: #16c60c; font-weight: 700;");
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
console.groupCollapsed(`%cUnrescued Grubs (${length}):`, "color: #16c60c; font-weight: 700;");
|
console.groupCollapsed(`%cUnrescued Grubs (${length}):`, "color: #16c60c; font-weight: 700;");
|
||||||
|
|
||||||
for (let i = 0; i < length; i++) {
|
for (let i = 0; i < length; i++) {
|
||||||
|
|
@ -1090,8 +1076,7 @@ function CheckMrMushroomState(divId, dataObject, mrMushroomState = 0) {
|
||||||
(mrMushroomState > i) ? CurrentDataTrue(): CurrentDataFalse();
|
(mrMushroomState > i) ? CurrentDataTrue(): CurrentDataFalse();
|
||||||
FillHTML(divId, `${dataObject.name} #${i}`, dataObject["spoiler" + i]);
|
FillHTML(divId, `${dataObject.name} #${i}`, dataObject["spoiler" + i]);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
CurrentDataFalse();
|
CurrentDataFalse();
|
||||||
for (let i = 1; i <= 7; i++) {
|
for (let i = 1; i <= 7; i++) {
|
||||||
FillHTML(divId, `${dataObject.name} #${i}`, dataObject["spoiler" + i]);
|
FillHTML(divId, `${dataObject.name} #${i}`, dataObject["spoiler" + i]);
|
||||||
|
|
@ -1175,6 +1160,7 @@ function CheckHintsTrue(divId, dataObject, playerData, worldData) {
|
||||||
*/
|
*/
|
||||||
function HKReadTextArea(textAreaId = "") {
|
function HKReadTextArea(textAreaId = "") {
|
||||||
|
|
||||||
|
console.log("HKReadTextArea()");
|
||||||
// refresh and prepare document for filling with data from the save
|
// refresh and prepare document for filling with data from the save
|
||||||
InitialHTMLPopulate(HK.DIV_ID);
|
InitialHTMLPopulate(HK.DIV_ID);
|
||||||
|
|
||||||
|
|
@ -1454,8 +1440,6 @@ function TranslateMapName(mapCode, dictionary = MAP) {
|
||||||
return translation;
|
return translation;
|
||||||
}
|
}
|
||||||
|
|
||||||
export { HKReadTextArea };
|
|
||||||
|
|
||||||
// Make functions global so they can be used on click and change events (for Webpack)
|
// Make functions global so they can be used on click and change events (for Webpack)
|
||||||
// window.InitialHTMLPopulate = InitialHTMLPopulate;
|
// window.InitialHTMLPopulate = InitialHTMLPopulate;
|
||||||
|
|
||||||
|
|
@ -1476,4 +1460,10 @@ document.getElementById("save-location-input").addEventListener("mouseout", () =
|
||||||
window.CheckboxSpoilersToggle = CheckboxSpoilersToggle;
|
window.CheckboxSpoilersToggle = CheckboxSpoilersToggle;
|
||||||
window.CheckboxHintsToggle = CheckboxHintsToggle;
|
window.CheckboxHintsToggle = CheckboxHintsToggle;
|
||||||
|
|
||||||
document.getElementById("save-area-read").addEventListener("click", HKReadTextArea("save-area"));
|
document.getElementById("save-area-read").addEventListener("click", () => {
|
||||||
|
HKReadTextArea("save-area");
|
||||||
|
}, false);
|
||||||
|
|
||||||
|
export {
|
||||||
|
HKReadTextArea
|
||||||
|
};
|
||||||
Loading…
Reference in a new issue