Revision of the gear tab:

- Use of flexboxes in two columns for better display
- Introduction of item containers for the different storage of items
This commit is contained in:
Ender
2023-12-31 11:00:17 +01:00
parent 6baf9a0269
commit a9d7bbb5b2
15 changed files with 465 additions and 165 deletions
+42
View File
@@ -32,6 +32,7 @@ export class M5Character extends Actor {
defensiveWeapons?: boolean;
armor?: boolean;
items?: boolean;
containers?: boolean;
spells?: boolean;
effects?: boolean;
kampfkuenste?: boolean;
@@ -85,6 +86,7 @@ export class M5Character extends Actor {
defensiveWeapons: {},
armor: {},
items: {},
containers: {},
effects: {},
},
spells: {},
@@ -171,6 +173,7 @@ export class M5Character extends Actor {
if (item.system.magic) {
label += "*";
}
let icon = item.img;
let rollable = false;
// console.log(item.system.rolls.formulas.map((p) => p.enabled));
@@ -182,9 +185,48 @@ export class M5Character extends Actor {
}
ret.gear.items[item.id] = {
label: label,
icon: icon,
magic: item.system.magic,
calc: item.system.calc,
equipped: item.system?.equipped,
weight: item.system.weight || 0,
containerId: item.system.containerId || "",
value: item.system.value || 0,
currency: item.system.currency || "",
quantity: item.system.quantity || 0,
rollExist: rollable,
};
});
}
if (!skip?.containers) {
context.items
?.filter((item) => item.type === "container")
.forEach((item) => {
item.prepareDerivedData();
let label = item.name;
if (item.system.magic) {
label += "*";
}
let icon = item.img;
let rollable = false;
// console.log(item.system.rolls.formulas.map((p) => p.enabled));
for (let key in item.system.rolls.formulas) {
rollable = item.system.rolls.formulas[key].enabled;
if (rollable) {
break;
}
}
ret.gear.containers[item.id] = {
label: label,
icon: icon,
magic: item.system.magic,
calc: item.system.calc,
equipped: item.system?.equipped,
weight: item.system.weight || 0,
containerId: item.system.containerId || "",
value: item.system.value || 0,
currency: item.system.currency || "",
quantity: item.system.quantity || 0,