With compendiums + talent management

This commit is contained in:
2022-11-05 10:03:23 +01:00
parent 6551a93791
commit 3718749519
17 changed files with 629 additions and 285 deletions

View File

@ -185,7 +185,7 @@ export class HawkmoonItemSheet extends ItemSheet {
html.find('#add-automation').click(ev => {
let autom = duplicate(this.object.system.automations)
autom.push( { eventtype: "on-drop", name: "Automatisation 1", script: "", id: randomID(16) })
autom.push( { eventtype: "on-drop", name: "Automatisation 1", competence: "", minLevel: 0, id: randomID(16) })
this.object.update( { 'system.automations': autom })
})
html.find('.delete-automation').click(ev => {
@ -196,9 +196,8 @@ export class HawkmoonItemSheet extends ItemSheet {
this.object.update( { 'system.automations': autom })
})
html.find('.automation-edit-field').change(ev => {
const li = $(ev.currentTarget).parents(".automation-item")
let index = li.data("automation-index")
let field = li.data("automation-field")
let index = $(ev.currentTarget).data("automation-index")
let field = $(ev.currentTarget).data("automation-field")
let auto = duplicate(this.object.system.automations)
auto[index][field] = ev.currentTarget.value
auto[index].id = auto[index].id || randomID(16)