From d27a025b8e820a2611101afdbfbd0c310a8dba85 Mon Sep 17 00:00:00 2001 From: b Date: Fri, 23 Jul 2021 00:47:13 -0700 Subject: [PATCH] Patch CI major id (2) --- build.js | 4 +++- custom.js | 4 +++- customizer.js | 6 ++++++ display.js | 1 + 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/build.js b/build.js index 758a2eb..c3cb69b 100644 --- a/build.js +++ b/build.js @@ -508,7 +508,9 @@ class Build{ } } if (item.get("majorIds")) { - major_ids.add(item.get("majorIds")); + for (const major_id of item.get("majorIds")) { + major_ids.add(major_id); + } } } statMap.set("activeMajorIDs", major_ids); diff --git a/custom.js b/custom.js index d9cce93..1cae53a 100644 --- a/custom.js +++ b/custom.js @@ -51,12 +51,14 @@ function encodeCustom(custom, verbose) { let damages = ["nDam", "eDam", "tDam", "wDam", "fDam", "aDam"]; //"nDam_", "eDam_", "tDam_", "wDam_", "fDam_", "aDam_" let val = custom.get(id); if (id == "majorIds") { + console.log(val); if (val.length > 0) { val = val[0]; } else { val = ""; } + console.log(val); } if (typeof(val) === "string" && val !== "") { @@ -192,7 +194,7 @@ class Custom{ constructor(statMap){ this.statMap = statMap; // TODO patch - this.statMap.set("majorIds", [this.statMap.get("majorIds")]); + // this.statMap.set("majorIds", [this.statMap.get("majorIds")]); this.initCustomStats(); } diff --git a/customizer.js b/customizer.js index 1eeaa2c..695a1f7 100644 --- a/customizer.js +++ b/customizer.js @@ -151,6 +151,12 @@ function calculateCustom() { } else if (input.classList.contains("string-input")) { if(rolledIDs.includes(id)) { statMap.get(rollMap).set(id, input.value); + } else if (id == "majorIds") { + if (input.value === "") { + statMap.set(id, []); + } else { + statMap.set(id, [input.value]); + } } else { statMap.set(id, input.value); } diff --git a/display.js b/display.js index b3f38db..2c60797 100644 --- a/display.js +++ b/display.js @@ -596,6 +596,7 @@ function displayExpandedItem(item, parent_id){ p_elem.textContent = "Set: " + item.get(id).toString(); active_elem.appendChild(p_elem); } else if (id === "majorIds") { + console.log(item.get(id)); for (let majorID of item.get(id)) { let p_elem = document.createElement("p"); p_elem.classList.add("itemp");