diff --git a/src/module/dialog/party-sheet.js b/src/module/dialog/party-sheet.js index 5e527fb..35dbc0f 100644 --- a/src/module/dialog/party-sheet.js +++ b/src/module/dialog/party-sheet.js @@ -89,11 +89,13 @@ export class AcksPartySheet extends FormApplication { }).render(true); } - async _selectActors(ev) { + async _selectActors(event) { + event.preventDefault(); + const template = "/systems/acks/templates/apps/party-select.html"; const templateData = { - actors: this.object.entities - } + actors: this.object.documents, + }; const content = await renderTemplate(template, templateData); new Dialog({ title: "Select Party Characters", @@ -106,7 +108,7 @@ export class AcksPartySheet extends FormApplication { let checks = html.find("input[data-action='select-actor']"); checks.each(async (_, c) => { let key = c.getAttribute('name'); - await this.object.entities[key].setFlag('acks', 'party', c.checked); + await this.object.documents[key].setFlag('acks', 'party', c.checked); }); }, }, @@ -117,12 +119,13 @@ export class AcksPartySheet extends FormApplication { /** @override */ activateListeners(html) { super.activateListeners(html); + html .find(".item-controls .item-control .select-actors") .click(this._selectActors.bind(this)); - - html.find(".item-controls .item-control .deal-xp").click(this._dealXP.bind(this)); - + + html.find(".item-controls .item-control .deal-xp").click(this._dealXP.bind(this)); + html.find("a.resync").click(() => this.render(true)); html.find(".field-img button[data-action='open-sheet']").click((ev) => { diff --git a/src/module/party.js b/src/module/party.js index 94ea77a..f3c5f2a 100644 --- a/src/module/party.js +++ b/src/module/party.js @@ -9,7 +9,6 @@ export const addControl = (object, html) => { } export const showPartySheet = (object) => { - event.preventDefault(); new AcksPartySheet(object, { top: window.screen.height / 2 - 180, left:window.screen.width / 2 - 140, diff --git a/src/templates/apps/party-sheet.html b/src/templates/apps/party-sheet.html index 6966fe4..9735961 100644 --- a/src/templates/apps/party-sheet.html +++ b/src/templates/apps/party-sheet.html @@ -15,10 +15,10 @@ {{/if}}
    - {{#each data.entities as |e|}} {{#if e.data.flags.acks.party}} -
  1. + {{#each data.documents as |actor|}} {{#if actor.data.flags.acks.party}} +
  2. - +
    @@ -26,17 +26,17 @@
    - {{e.name}} + {{actor.name}}
    - {{e.data.data.hp.value}}/{{e.data.data.hp.max}} + {{actor.data.data.hp.value}}/{{actor.data.data.hp.max}}
    - {{#if @root.settings.ascending}}{{e.data.data.aac.value}} - {{e.data.data.aac.naked}} - {{else}}{{e.data.data.ac.value}} {{e.data.data.ac.naked}} + {{#if @root.settings.ascending}}{{actor.data.data.aac.value}} + {{actor.data.data.aac.naked}} + {{else}}{{actor.data.data.ac.value}} {{actor.data.data.ac.naked}} {{/if}}
    @@ -44,40 +44,40 @@
    {{#unless @root.settings.ascending}} - {{e.data.data.thac0.value}} + {{actor.data.data.thac0.value}} {{else}} - {{e.data.data.thac0.throw}} + {{actor.data.data.thac0.throw}} {{/unless}}
    - {{#if (eq e.data.type 'character')}} + {{#if (eq actor.data.type 'character')}}
    - {{add e.data.data.scores.str.mod e.data.data.thac0.mod.melee}} + {{add actor.data.data.scores.str.mod actor.data.data.thac0.mod.melee}}
    - {{add e.data.data.scores.dex.mod e.data.data.thac0.mod.missile}} + {{add actor.data.data.scores.dex.mod actor.data.data.thac0.mod.missile}}
    {{/if}}
    - {{e.data.data.movement.encounter}} {{e.data.data.movement.base}} + {{actor.data.data.movement.encounter}} {{actor.data.data.movement.base}}
    - {{#if (eq e.data.type 'character')}} + {{#if (eq actor.data.type 'character')}}
    - {{roundWeight e.data.data.encumbrance.value}}k + {{roundWeight actor.data.data.encumbrance.value}}k
    {{/if}}
    - {{#each e.data.data.saves as |s i|}} + {{#each actor.data.data.saves as |s i|}} {{lookup @root.config.saves_short i}} {{s.value}} {{/each}} - {{#if (eq e.data.type 'character')}}{{mod e.data.data.scores.wis.mod}}{{/if}} + {{#if (eq actor.data.type 'character')}}{{mod actor.data.data.scores.wis.mod}}{{/if}}