This commit is contained in:
2022-02-21 10:12:27 +01:00
parent 6962d6fc04
commit 58c3fbcd42
8 changed files with 131 additions and 96 deletions

View File

@@ -28,7 +28,7 @@ export class ItemSheetKH extends ItemSheet {
data.dtypes = ["String", "Number", "Boolean"];
if (data?.data?.modifications) {
for (let attr of Object.values(data.data.modifications)) {
for (let attr of Object.values(data.modifications)) {
attr.isCheckbox = attr.dtype === "Boolean";
}
}
@@ -51,11 +51,19 @@ export class ItemSheetKH extends ItemSheet {
}
// Retrieve any created skills as well
for (let item of game.items.entities) {
game.items.forEach((item) => {
if(item.data.type === "skill" && item.data.data.type.value === "combat") {
skillList.push(item.data)
}
});
/*
for (let item of game.items.entities) {
if(item.data.type === "skill" && item.data.type.value === "combat") {
skillList.push(item.data)
}
}
*/
this.position.width = 530;
this.position.height = 750;
@@ -89,12 +97,21 @@ export class ItemSheetKH extends ItemSheet {
}
}
// Retrieve any created skills as well
game.items.forEach((item) => {
if(item.data.type === "skill") {
skillList.push(item.data)
}
});
/*
// Retrieve any created skills as well
for (let item of game.items.entities) {
if(item.data.data.type === "skill") {
if(item.data.type === "skill") {
skillList.push(item.data)
}
}
*/
this.position.width = 450;
this.position.height = 605;
@@ -115,12 +132,21 @@ export class ItemSheetKH extends ItemSheet {
}
}
// Retrieve any created skills as well
game.items.forEach((item) => {
if(item.data.type === "skill" && item.data.data.type.value === "combat") {
skillList.push(item.data)
}
});
/*
// Retrieve any created skills as well
for (let item of game.items.entities) {
if(item.data.type === "skill" && item.data.data.type.value === "combat") {
skillList.push(item.data)
}
}
*/
this.position.width = 530;
this.position.height = 750;
break;
@@ -148,11 +174,11 @@ export class ItemSheetKH extends ItemSheet {
const clickedName = $(ev.currentTarget).data("name");
if(clickedName === "equipped") {
const equppiedValue = this.item.data.data.equipable.equipped;
const equppiedValue = this.item.data.equipable.equipped;
this.item.update({ "data.equipped.equipped": !equppiedValue });
} else {
const clickedValue = (this.item.data.data[clickedName].value == undefined ? false : this.item.data.data[clickedName].value);
const clickedValue = (this.item.data[clickedName].value == undefined ? false : this.item.data[clickedName].value);
let dataName = "data." + clickedName + ".value"
let tempData = {}
@@ -176,7 +202,7 @@ export class ItemSheetKH extends ItemSheet {
event.preventDefault();
const a = event.currentTarget;
const action = a.dataset.action;
const attrs = this.object.data.data.modifications;
const attrs = this.object.data.modifications;
const form = this.form;
// Add new modification