code cleaning

This commit is contained in:
ReznoRMichael 2022-01-20 15:10:52 +01:00
parent a777a8255f
commit 198d1f5fcc
3 changed files with 39 additions and 46 deletions

View file

@ -1066,10 +1066,10 @@ function CheckAdditionalThings(section, dataObject, playerData, worldData, scene
} }
} }
} }
/* if (i === "grubsCollected") {
if (i === "grubsCollected") {
LogMissingGrubs(); LogMissingGrubs();
} } */
/* textPrefix += `: ${countTotal}`; */ /* textPrefix += `: ${countTotal}`; */
@ -1708,46 +1708,39 @@ function CheckAdditionalThings(section, dataObject, playerData, worldData, scene
* Compares and logs all unrescued Grubs in a list: IDs and map locations * Compares and logs all unrescued Grubs in a list: IDs and map locations
*/ */
/* function LogMissingGrubs() {
function LogMissingGrubs() { let rescuedGrubsSceneList = [];
var rescuedGrubsSceneList = []; for (let i = 0, length = worldData.length; i < length; i++) {
if (worldData[i].id.includes("Grub Bottle")) {
for (var _i6 = 0, _length = worldData.length; _i6 < _length; _i6++) { if (worldData[i].activated === true) {
if (worldData[_i6].id.includes("Grub Bottle")) {
if (worldData[_i6].activated === true) {
// There are 3 duplicates of the same map scene name from older game save files. Prevents adding duplicates // There are 3 duplicates of the same map scene name from older game save files. Prevents adding duplicates
// if (worldData[i].sceneName === "Ruins2_11" && worldData[i].id === "Grub Bottle (1)") {
/* if (worldData[i].sceneName === "Ruins2_11" && worldData[i].id === "Grub Bottle (1)") { // continue;
continue; // } 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[_i6].sceneName); // } // }
} }
} }
} // Filtering the reference database Grub list to include only the missing values }
// Filtering the reference database Grub list to include only the missing values
let missingGrubsList = section.grubsList.filter(x => !rescuedGrubsSceneList.includes(x));
var missingGrubsList = section.grubsList.filter(function (x) { let length = missingGrubsList.length;
return !rescuedGrubsSceneList.includes(x); if (!length) {
});
var length = missingGrubsList.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 (".concat(length, "):"), "color: #16c60c; font-weight: 700;"); console.groupCollapsed(`%cUnrescued Grubs (${length}):`, "color: #16c60c; font-weight: 700;");
for (let i = 0; i < length; i++) {
for (var _i7 = 0; _i7 < length; _i7++) { console.log(`#${section.grubsList.indexOf(missingGrubsList[i]) + 1} 🗺️ ${TranslateMapName(missingGrubsList[i])} ⌨️ ${missingGrubsList[i]}`);
console.log("#".concat(section.grubsList.indexOf(missingGrubsList[_i7]) + 1, " \uD83D\uDDFA\uFE0F ").concat((0,_hk_functions_js__WEBPACK_IMPORTED_MODULE_2__.TranslateMapName)(missingGrubsList[_i7]), " \u2328\uFE0F ").concat(missingGrubsList[_i7]));
} }
console.groupEnd();
console.groupEnd();
} }
return false;
} */
} // end function CheckAdditionalThings()
return false;
}
}
/** /**
* Checks and fills all the 7 locations of Mr Mushroom. * Checks and fills all the 7 locations of Mr Mushroom.
* @param {object} section ID of the HTML element for data appending * @param {object} section ID of the HTML element for data appending

File diff suppressed because one or more lines are too long

View file

@ -1230,9 +1230,9 @@ function CheckAdditionalThings(section, dataObject, playerData, worldData, scene
} }
} }
if (i === "grubsCollected") { /* if (i === "grubsCollected") {
LogMissingGrubs(); LogMissingGrubs();
} } */
/* textPrefix += `: ${countTotal}`; */ /* textPrefix += `: ${countTotal}`; */
@ -1902,7 +1902,7 @@ function CheckAdditionalThings(section, dataObject, playerData, worldData, scene
/** /**
* Compares and logs all unrescued Grubs in a list: IDs and map locations * Compares and logs all unrescued Grubs in a list: IDs and map locations
*/ */
function LogMissingGrubs() { /* function LogMissingGrubs() {
let rescuedGrubsSceneList = []; let rescuedGrubsSceneList = [];
@ -1910,11 +1910,11 @@ function CheckAdditionalThings(section, dataObject, playerData, worldData, scene
if (worldData[i].id.includes("Grub Bottle")) { if (worldData[i].id.includes("Grub Bottle")) {
if (worldData[i].activated === true) { if (worldData[i].activated === true) {
// There are 3 duplicates of the same map scene name from older game save files. Prevents adding duplicates // There are 3 duplicates of the same map scene name from older game save files. Prevents adding duplicates
/* if (worldData[i].sceneName === "Ruins2_11" && worldData[i].id === "Grub Bottle (1)") { // if (worldData[i].sceneName === "Ruins2_11" && worldData[i].id === "Grub Bottle (1)") {
continue; // continue;
} 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);
// } // }
} }
@ -1938,8 +1938,8 @@ function CheckAdditionalThings(section, dataObject, playerData, worldData, scene
} }
return false; return false;
} } */
} } // end function CheckAdditionalThings()
/** /**
* Checks and fills all the 7 locations of Mr Mushroom. * Checks and fills all the 7 locations of Mr Mushroom.