From 20e3ef0d37b845329eb691899d029d84b5fa9a68 Mon Sep 17 00:00:00 2001
From: ReznoRMichael
Date: Tue, 15 Sep 2020 01:23:03 +0200
Subject: [PATCH] textarea placeholder, check jsonObject properties
---
HKCheckCompletion.js | 20 ++++++++++++++++----
index.html | 2 +-
style.css | 7 +++++++
3 files changed, 24 insertions(+), 5 deletions(-)
diff --git a/HKCheckCompletion.js b/HKCheckCompletion.js
index 317db28..ec794d7 100644
--- a/HKCheckCompletion.js
+++ b/HKCheckCompletion.js
@@ -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;
}
/**
diff --git a/index.html b/index.html
index 59d9a01..c708ad4 100644
--- a/index.html
+++ b/index.html
@@ -50,7 +50,7 @@
-
+
diff --git a/style.css b/style.css
index 046fb04..1ff7f09 100644
--- a/style.css
+++ b/style.css
@@ -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);