PC sheet review + dialog rolls update
All checks were successful
Release Creation / build (release) Successful in 1m3s

This commit is contained in:
2025-05-25 14:35:18 +02:00
parent 585b9a1ab5
commit ff180ddd2e
25 changed files with 287 additions and 237 deletions

View File

@@ -32,7 +32,9 @@ export default class HellbornActorSheet extends HandlebarsApplicationMixin(found
editImage: HellbornActorSheet.#onEditImage,
toggleSheet: HellbornActorSheet.#onToggleSheet,
edit: HellbornActorSheet.#onItemEdit,
delete: HellbornActorSheet.#onItemDelete
delete: HellbornActorSheet.#onItemDelete,
updateCheckboxArray: HellbornActorSheet.#onUpdateCheckboxArray,
},
}
@@ -184,6 +186,18 @@ export default class HellbornActorSheet extends HandlebarsApplicationMixin(found
return fp.browse()
}
static #onUpdateCheckboxArray(event, target) {
console.log("Update checkbox array", event, target)
let arrayName = target.dataset.name
let arrayIdx = Number(target.dataset.index)
let dataPath = `system.mortality.${arrayName}`
let tab = foundry.utils.duplicate(this.document.system.mortality[arrayName])
tab[arrayIdx] = target.checked
this.actor.update( { [dataPath]: tab } )
// Dump
console.log("Array name", arrayName, arrayIdx, target.checked, dataPath)
}
/**
* Edit an existing item within the Actor
* Start with the uuid, if it's not found, fallback to the id (as Embedded item in the actor)