Patch CI major id (2)
This commit is contained in:
parent
979830728c
commit
d27a025b8e
4 changed files with 13 additions and 2 deletions
4
build.js
4
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);
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue