textarea placeholder, check jsonObject properties

This commit is contained in:
ReznoRMichael 2020-09-15 01:23:03 +02:00
parent d7c59bd223
commit 20e3ef0d37
3 changed files with 24 additions and 5 deletions

View file

@ -332,6 +332,19 @@ function HKCheckCompletion(jsonObject) {
CheckboxHintsToggle("hide");
CheckboxLocationsToggle("hide");
let HKPlayerData;
let HKWorldItems;
if (jsonObject.hasOwnProperty("playerData")) {
HKPlayerData = jsonObject.playerData;
} else return false;
if (jsonObject.hasOwnProperty("sceneData")) {
if (jsonObject.sceneData.hasOwnProperty("persistentBoolItems")) {
HKWorldItems = jsonObject.sceneData.persistentBoolItems;
} else return false;
} else return false;
// Pre-Cleaning and filling initial data (h2, id) needed for FillHTML()
PrefillHTML(DIV_ID);
@ -361,9 +374,6 @@ function HKCheckCompletion(jsonObject) {
// Deep Clone const spells multi-layer object (used for destructive functions)
let HK_SPELLS_temp = JSON.parse(JSON.stringify(HK_SPELLS));
let HKPlayerData = jsonObject.playerData;
let HKWorldItems = jsonObject.sceneData.persistentBoolItems;
// ================================================================================== //
// ---------------- Time Played ----------------- //
@ -380,7 +390,7 @@ function HKCheckCompletion(jsonObject) {
// ---------------- Gruz Mother and Mawlek (World Map) --------------------- //
CheckWorldDataTrue(DIV_ID.bosses, "Battle Scene", HK_BOSSES_WORLD_temp, HKWorldItems);
if (HKWorldItems) CheckWorldDataTrue(DIV_ID.bosses, "Battle Scene", HK_BOSSES_WORLD_temp, HKWorldItems);
// ---------------- Charms --------------------- //
@ -464,6 +474,8 @@ function HKCheckCompletion(jsonObject) {
// finish and show benchmark
let countEnd = new Date();
console.info("HKCheckCompletion() time (ms) =", countEnd - countBegin);
return true;
}
/**

View file

@ -50,7 +50,7 @@
</p>
<div>
<textarea name="save-area" id="save-area"></textarea>
<textarea name="save-area" id="save-area" autofocus spellcheck="false" placeholder="Paste (Ctrl + V) your decoded save here..."></textarea>
<div class="buttons">

View file

@ -107,11 +107,18 @@ h2 {
textarea {
font-family: 'Consolas', monospace;
font-size: 0.8rem;
text-align: left;
background-color: rgba(0, 0, 0, 0);
color: #fff;
border: 1px solid #e3ebf7;
}
textarea::placeholder {
color: rgba(255, 255, 255, 0.5);
font-size: 1rem;
text-align: center;
}
#save-area {
width: 100%;
height: calc(0.1 * 100vh);