From 3daaa234fddb7861d85c50ac74a8e1c606d98127 Mon Sep 17 00:00:00 2001 From: ReznoRMichael Date: Thu, 24 Sep 2020 01:08:13 +0200 Subject: [PATCH] show Geo amount --- HKCheckCompletion.js | 30 ++++++++++++++++++++++++++++-- loadJson.js | 2 +- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/HKCheckCompletion.js b/HKCheckCompletion.js index e91b989..241fc33 100644 --- a/HKCheckCompletion.js +++ b/HKCheckCompletion.js @@ -423,6 +423,10 @@ function HKCheckCompletion(jsonObject) { CheckCompletionPercent(DIV_ID.intro, HKPlayerData); + // ---------------- Geo Amount ----------------- // + + CheckGeo(DIV_ID.intro, HKPlayerData.geo); + // ---------------- Bosses (Base Game) --------------------- // CheckIfDataTrue(DIV_ID.bosses, HK_BOSSES_temp, HKPlayerData); @@ -680,6 +684,19 @@ function CheckCompletionPercent(divId, playerData) { } } +/** + * Fills HTML with the Geo value of the save file + * @param {object} divId ID of the HTML element for data appending + * @param {number} geoValue Number of total Geo value + */ +function CheckGeo(divId, geoValue) { + + let icon = SYMBOL_INFO; + let textFill = "Geo Amount: " + geoValue + ""; + + document.getElementById(divId.id).innerHTML += divStart + icon + textFill + divEnd; +} + /** * Verifies if the data in a specific object is true or false, and appends HTML accordingly. Destructive function. * @param {string} divId ID of the HTML element for data appending @@ -914,18 +931,27 @@ function ObjectLength(object) { * @param {object} divIdObj JavaScript Object containing all HTML IDs to populate */ function InitialHTMLPopulate(divIdObj) { + + let icon = ""; + let textFill = ""; + PrefillHTML(divIdObj); CurrentDataFalse(); // Play Time - let icon = ""; - let textFill = "Time Played: 0 h 00 min 00 sec"; + icon = ""; + textFill = "Time Played: 0 h 00 min 00 sec"; document.getElementById(divIdObj.intro.id).innerHTML += divStart + icon + textFill + divEnd; // Game Completion textFill = "Game Completion: 0 % (out of " + divIdObj.intro.maxPercent + " %)"; document.getElementById(divIdObj.intro.id).innerHTML += divStart + completionSymbol + textFill + divEnd; + // Geo + icon = SYMBOL_INFO; + textFill = "Geo Amount: 0"; + document.getElementById(divIdObj.intro.id).innerHTML += divStart + icon + textFill + divEnd; + // First Hint Only FillHTML(divIdObj.hints, HK_HINTS.fireballLevel[0], HK_HINTS.fireballLevel[1]); diff --git a/loadJson.js b/loadJson.js index 5ce3025..a23056f 100644 --- a/loadJson.js +++ b/loadJson.js @@ -44,7 +44,7 @@ function loadJSON(filename, callback) { xobj.send(null); } -loadJSON("save/" + fileName[6], +loadJSON("save/" + fileName[8], function JSONparse(response) { // Parse JSON string into object jsonObj = JSON.parse(response);