swap scenedata to worlddata

This commit is contained in:
ReznoRMichael 2021-02-19 15:42:13 +01:00
parent 7740c54777
commit 54ab809498
3 changed files with 24 additions and 22 deletions

View file

@ -600,8 +600,9 @@ function CheckWorldDataTrue(divId, idText, dataObject, worldData) {
* Verifies if the data in a specific object are true or false, or checks what values they have, and appends HTML accordingly. * Verifies if the data in a specific object are true or false, or checks what values they have, and appends HTML accordingly.
* @param {object} divId ID of the HTML element for data appending * @param {object} divId ID of the HTML element for data appending
* @param {object} dataObject Object containing data to be verified * @param {object} dataObject Object containing data to be verified
* @param {object} playerData Reference/pointer to specific data where to search * @param {object} playerData Reference/pointer to specific data where to search (playerData)
* @param {object} worldData Reference/pointer to specific data where to search * @param {object} worldData Reference/pointer to specific data where to search (sceneData)
* @param {object} sceneData Reference/pointer to specific data where to search (sceneData.persistentBoolItems)
*/ */
@ -1044,9 +1045,9 @@ function CheckAdditionalThings(divId, dataObject, playerData, worldData, sceneDa
return countTotal; return countTotal;
} }
/** /**
* Counts the amount of in-game items Activated or Not Activated. Logs to console all the Not Activated IDs and Map locations. * Counts the amount of in-game Interactables Activated or Not Activated. Logs to console all the Not Activated IDs and Map locations.
* @param {number} arrayLength How many items the Items array is currently storing (for iteration) * @param {number} arrayLength How many items the Interactables array is currently storing (for iteration)
* @param {string} mode Choose which Items to count (notActivated or activated) * @param {string} mode Choose which Interactables to count (notActivated or activated)
*/ */
@ -1057,16 +1058,16 @@ function CheckAdditionalThings(divId, dataObject, playerData, worldData, sceneDa
if (mode === "notActivated") { if (mode === "notActivated") {
for (var _i11 = 0; _i11 < arrayLength; _i11++) { for (var _i11 = 0; _i11 < arrayLength; _i11++) {
if (sceneData.persistentBoolItems[_i11].activated === false && sceneData.persistentBoolItems[_i11].semiPersistent === false) { if (worldData[_i11].activated === false && worldData[_i11].semiPersistent === false) {
countTotal++; countTotal++;
itemsLog.push("#".concat(countTotal, " ").concat(sceneData.persistentBoolItems[_i11].id, " \uD83D\uDDFA\uFE0F ").concat((0,_hk_functions_js__WEBPACK_IMPORTED_MODULE_2__.TranslateMapName)(sceneData.persistentBoolItems[_i11].sceneName), " \u2328\uFE0F ").concat(sceneData.persistentBoolItems[_i11].sceneName)); itemsLog.push("#".concat(countTotal, " ").concat(worldData[_i11].id, " \uD83D\uDDFA\uFE0F ").concat((0,_hk_functions_js__WEBPACK_IMPORTED_MODULE_2__.TranslateMapName)(worldData[_i11].sceneName), " \u2328\uFE0F ").concat(worldData[_i11].sceneName));
} }
} }
if (!countTotal) { if (!countTotal) {
console.log("%cAll Items Activated!", "color: #16c60c; font-weight: 700;"); console.log("%cAll Interactables Activated!", "color: #16c60c; font-weight: 700;");
} else { } else {
console.groupCollapsed("%cNot Activated Items (".concat(countTotal, "):"), "color: #16c60c; font-weight: 700;"); console.groupCollapsed("%cNot Activated Interactables (".concat(countTotal, "):"), "color: #16c60c; font-weight: 700;");
for (var _i12 = 0, length = itemsLog.length; _i12 < length; _i12++) { for (var _i12 = 0, length = itemsLog.length; _i12 < length; _i12++) {
console.log(itemsLog[_i12]); console.log(itemsLog[_i12]);
@ -1076,7 +1077,7 @@ function CheckAdditionalThings(divId, dataObject, playerData, worldData, sceneDa
} }
} else { } else {
for (var _i13 = 0; _i13 < arrayLength; _i13++) { for (var _i13 = 0; _i13 < arrayLength; _i13++) {
if (sceneData.persistentBoolItems[_i13].activated === true) countTotal++; if (worldData[_i13].activated === true) countTotal++;
} }
} }

File diff suppressed because one or more lines are too long

View file

@ -686,8 +686,9 @@ function CheckWorldDataTrue(divId, idText, dataObject, worldData) {
* Verifies if the data in a specific object are true or false, or checks what values they have, and appends HTML accordingly. * Verifies if the data in a specific object are true or false, or checks what values they have, and appends HTML accordingly.
* @param {object} divId ID of the HTML element for data appending * @param {object} divId ID of the HTML element for data appending
* @param {object} dataObject Object containing data to be verified * @param {object} dataObject Object containing data to be verified
* @param {object} playerData Reference/pointer to specific data where to search * @param {object} playerData Reference/pointer to specific data where to search (playerData)
* @param {object} worldData Reference/pointer to specific data where to search * @param {object} worldData Reference/pointer to specific data where to search (sceneData)
* @param {object} sceneData Reference/pointer to specific data where to search (sceneData.persistentBoolItems)
*/ */
function CheckAdditionalThings(divId, dataObject, playerData, worldData, sceneData) { function CheckAdditionalThings(divId, dataObject, playerData, worldData, sceneData) {
@ -1076,9 +1077,9 @@ function CheckAdditionalThings(divId, dataObject, playerData, worldData, sceneDa
} }
/** /**
* Counts the amount of in-game items Activated or Not Activated. Logs to console all the Not Activated IDs and Map locations. * Counts the amount of in-game Interactables Activated or Not Activated. Logs to console all the Not Activated IDs and Map locations.
* @param {number} arrayLength How many items the Items array is currently storing (for iteration) * @param {number} arrayLength How many items the Interactables array is currently storing (for iteration)
* @param {string} mode Choose which Items to count (notActivated or activated) * @param {string} mode Choose which Interactables to count (notActivated or activated)
*/ */
function CountItems(arrayLength, mode = "notActivated") { function CountItems(arrayLength, mode = "notActivated") {
@ -1087,17 +1088,17 @@ function CheckAdditionalThings(divId, dataObject, playerData, worldData, sceneDa
if (mode === "notActivated") { if (mode === "notActivated") {
for (let i = 0; i < arrayLength; i++) { for (let i = 0; i < arrayLength; i++) {
if (sceneData.persistentBoolItems[i].activated === false && if (worldData[i].activated === false &&
sceneData.persistentBoolItems[i].semiPersistent === false) { worldData[i].semiPersistent === false) {
countTotal++; countTotal++;
itemsLog.push(`#${countTotal} ${sceneData.persistentBoolItems[i].id} 🗺️ ${TranslateMapName(sceneData.persistentBoolItems[i].sceneName)} ⌨️ ${sceneData.persistentBoolItems[i].sceneName}`); itemsLog.push(`#${countTotal} ${worldData[i].id} 🗺️ ${TranslateMapName(worldData[i].sceneName)} ⌨️ ${worldData[i].sceneName}`);
} }
} }
if (!countTotal) { if (!countTotal) {
console.log("%cAll Items Activated!", "color: #16c60c; font-weight: 700;"); console.log("%cAll Interactables Activated!", "color: #16c60c; font-weight: 700;");
} else { } else {
console.groupCollapsed(`%cNot Activated Items (${countTotal}):`, "color: #16c60c; font-weight: 700;"); console.groupCollapsed(`%cNot Activated Interactables (${countTotal}):`, "color: #16c60c; font-weight: 700;");
for (let i = 0, length = itemsLog.length; i < length; i++) { for (let i = 0, length = itemsLog.length; i < length; i++) {
console.log(itemsLog[i]); console.log(itemsLog[i]);
@ -1107,7 +1108,7 @@ function CheckAdditionalThings(divId, dataObject, playerData, worldData, sceneDa
} }
} else { } else {
for (let i = 0; i < arrayLength; i++) { for (let i = 0; i < arrayLength; i++) {
if (sceneData.persistentBoolItems[i].activated === true) countTotal++; if (worldData[i].activated === true) countTotal++;
} }
} }