Fix set bonus display

This commit is contained in:
b 2021-03-16 15:43:44 -07:00
parent 90c324dff6
commit 1be0d6b782

View file

@ -232,10 +232,13 @@ function displaySetBonuses(parent_id,build) {
mock_item.set("fixID", true);
mock_item.set("displayName", setName+" Set: "+count+"/"+sets[setName].items.length);
let mock_minRolls = new Map();
let mock_maxRolls = new Map();
mock_item.set("minRolls", mock_minRolls);
mock_item.set("maxRolls", mock_maxRolls);
for (const id in bonus) {
if (rolledIDs.includes(id)) {
mock_minRolls.set(id, bonus[id]);
mock_maxRolls.set(id, bonus[id]);
}
else {
mock_item.set(id, bonus[id]);
@ -243,6 +246,7 @@ function displaySetBonuses(parent_id,build) {
}
mock_item.set("powders", []);
displayExpandedItem(mock_item, set_elem.id);
console.log(mock_item);
}
}
@ -630,7 +634,6 @@ function displayExpandedItem(item, parent_id){
let img = document.createElement("img");
if (item && item.has("type")) {
img.src = "/media/items/generic-" + item.get("type") + ".png";
}
img.alt = item.get("type");
img.style = " z=index: 1;max-width: 64px; max-height: 64px; position: relative; top: 50%; transform: translateY(-50%);";
let bckgrd = document.createElement("p");
@ -639,6 +642,7 @@ function displayExpandedItem(item, parent_id){
bckgrd.classList.add("itemp");
active_elem.appendChild(bckgrd);
bckgrd.appendChild(img);
}
} else if (id === "lore") {
p_elem.style = "font-style: italic";
p_elem.classList.add("lore");