Patch CI major id (2)

This commit is contained in:
b 2021-07-23 00:47:13 -07:00
parent 979830728c
commit d27a025b8e
4 changed files with 13 additions and 2 deletions

View file

@ -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);

View file

@ -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();
}

View file

@ -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);
}

View file

@ -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");