Charakterbogen anpassen #7 (#9)

- Use of flexboxes in two columns for better display
- Introduction of item containers for the different storage of items

Co-authored-by: Ender <harald@drueppels.de>
Co-authored-by: Byroks <byroks@gmail.com>
Reviewed-on: Byroks/foundry-vtt-system-midgard5#9
Reviewed-by: Byroks <byroks@gmail.com>
This commit was merged in pull request #9.
This commit is contained in:
2024-01-03 15:57:15 +01:00
co-authored by Ender Byroks
parent 6baf9a0269
commit b945f22710
15 changed files with 466 additions and 166 deletions
+43 -1
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: {},
@@ -148,7 +150,7 @@ export class M5Character extends Actor {
const aggregate = new M5ModAggregate(data, ret);
context.items
?.filter((item) => (item.type === "item" || item.type === "effect" || item.type === "armor") && item.system.equipped)
?.filter((item) => (item.type === "item" || item.type === "effect" || item.type === "armor" || item.type === "container") && item.system.equipped)
.forEach((item) => {
const mods = item.system.mods;
//console.log("Actor item mods", mods)
@@ -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,