CheckSaveFileVersion()

This commit is contained in:
ReznoRMichael 2021-02-15 21:24:04 +01:00
parent a87a063e1b
commit 7caeeb7863
3 changed files with 23 additions and 3 deletions

File diff suppressed because one or more lines are too long

View file

@ -88,6 +88,10 @@ function HKCheckCompletion(jsonObject) {
CheckCompletionPercent(HK.DIV_ID.intro, HKPlayerData.completionPercentage); CheckCompletionPercent(HK.DIV_ID.intro, HKPlayerData.completionPercentage);
// ---------------- Game Completion Status ----------------- //
CheckSaveFileVersion(HK.DIV_ID.intro, HKPlayerData.version);
// ---------------- Fleur Divide ----------------- // // ---------------- Fleur Divide ----------------- //
AppendHTML(HK.DIV_ID.intro, FLEUR_DIVIDE); AppendHTML(HK.DIV_ID.intro, FLEUR_DIVIDE);
@ -416,6 +420,18 @@ function CheckCompletionPercent(divId, completionPercentage) {
document.getElementById(divId.id).innerHTML += divStart + completionSymbol + textFill + divEnd; document.getElementById(divId.id).innerHTML += divStart + completionSymbol + textFill + divEnd;
} }
/**
* Reads the "version" string from the save file and appends it to the selected div ID element
* @param {object} divId ID of the HTML element for data appending
* @param {string} saveVersion Save File version in format 0.0.0.0
*/
function CheckSaveFileVersion(divId, saveVersion = HK.DIV_ID.intro.saveVersion) {
CurrentDataBlank();
let textFill = `Save Version:${pSpan}<b>${saveVersion}</b>${pSpan}`;
document.getElementById(divId.id).innerHTML += divStart + completionSymbol + textFill + divEnd;
}
/** /**
* Fills HTML with appropriate number of health mask images * Fills HTML with appropriate number of health mask images
* @param {object} divId ID of the HTML element for data appending * @param {object} divId ID of the HTML element for data appending
@ -1208,6 +1224,9 @@ function InitialHTMLPopulate(divIdObj) {
// Game Completion // Game Completion
CheckCompletionPercent(divIdObj.intro, 0); CheckCompletionPercent(divIdObj.intro, 0);
// Save File Version
CheckSaveFileVersion(divIdObj.intro);
// Fleur Divide // Fleur Divide
AppendHTML(divIdObj.intro, FLEUR_DIVIDE); AppendHTML(divIdObj.intro, FLEUR_DIVIDE);

View file

@ -8,7 +8,8 @@ const HK = {
intro: { intro: {
h2: "Game Status", h2: "Game Status",
id: "hk-intro", id: "hk-intro",
maxPercent: 112 maxPercent: 112,
saveVersion: "0.0.0.0"
}, },
hints: { hints: {
h2: "My friend Elderbug once told me about...", h2: "My friend Elderbug once told me about...",