From ff6c4749212f1966d7b95f206ec5e8d8ba6e58bf Mon Sep 17 00:00:00 2001 From: sladecraven Date: Mon, 20 Jul 2020 12:02:07 +0200 Subject: [PATCH] Add queue/souffle templates --- RdD.geany | 25 ++++++++++++---------- module/actor-sheet.js | 8 +++++++ module/actor.js | 8 +++++++ module/rdd-utility.js | 4 ++++ system.json | 4 ++-- template.json | 10 ++++----- templates/actor-sheet.html | 2 +- templates/item-ombre-sheet.html | 23 ++++++++++++++++++++ templates/item-queue-sheet.html | 23 ++++++++++++++++++++ templates/item-queues-sheet.html | 35 +++++++++++++++++++++++++++++++ templates/item-souffle-sheet.html | 23 ++++++++++++++++++++ templates/item-tete-sheet.html | 23 ++++++++++++++++++++ 12 files changed, 169 insertions(+), 19 deletions(-) create mode 100644 templates/item-ombre-sheet.html create mode 100644 templates/item-queue-sheet.html create mode 100644 templates/item-queues-sheet.html create mode 100644 templates/item-souffle-sheet.html create mode 100644 templates/item-tete-sheet.html diff --git a/RdD.geany b/RdD.geany index 188e6e09..423c7d72 100644 --- a/RdD.geany +++ b/RdD.geany @@ -28,17 +28,20 @@ long_line_behaviour=1 long_line_column=72 [files] -current_page=7 -FILE_NAME_0=5905;JSON;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplate.json;0;2 -FILE_NAME_1=6606;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Factor-sheet.js;0;2 -FILE_NAME_2=0;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Frdd-utility.js;0;2 -FILE_NAME_3=516;JSON;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fsystem.json;0;2 -FILE_NAME_4=20398;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Factor-sheet.html;0;2 -FILE_NAME_5=4675;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Frdd-tmr-dialog.js;0;2 -FILE_NAME_6=590;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Fdialog-tmr.html;0;2 -FILE_NAME_7=10285;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Factor.js;0;2 -FILE_NAME_8=135;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Frdd-main.js;0;2 -FILE_NAME_9=7463;CSS;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fstyles%2Fsimple.css;0;2 +current_page=6 +FILE_NAME_0=6578;JSON;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplate.json;0;2 +FILE_NAME_1=5025;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Factor-sheet.js;0;2 +FILE_NAME_2=17984;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Factor-sheet.html;0;2 +FILE_NAME_3=22671;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Frdd-utility.js;0;2 +FILE_NAME_4=7804;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Frdd-tmr-dialog.js;0;2 +FILE_NAME_5=872;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Fdialog-tmr.html;0;2 +FILE_NAME_6=12332;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Factor.js;0;2 +FILE_NAME_7=135;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Frdd-main.js;0;2 +FILE_NAME_8=7463;CSS;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fstyles%2Fsimple.css;0;2 +FILE_NAME_9=7413;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Ftmr-utility.js;0;2 +FILE_NAME_10=0;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Fitem-arme-sheet.html;0;2 +FILE_NAME_11=0;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Fsort-draconic.html;0;2 +FILE_NAME_12=164;JSON;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fsystem.json;0;2 [VTE] last_dir=/home/sigmar diff --git a/module/actor-sheet.js b/module/actor-sheet.js index 2820cfec..723e5462 100644 --- a/module/actor-sheet.js +++ b/module/actor-sheet.js @@ -123,6 +123,14 @@ export class RdDActorSheet extends ActorSheet { li.slideUp(200, () => this.render(false)); }); + // Equip Inventory Item + html.find('.blessure-legere-control').click(ev => { + let index = event.currentTarget.attributes['data-blessure-index'].value; + let active = event.currentTarget.attributes['data-blessure-active'].value; + this.actor.manageBlessureLegere(index, active); + this.render(true); + }); + // Equip Inventory Item html.find('.item-equip').click(ev => { const li = $(ev.currentTarget).parents(".item"); diff --git a/module/actor.js b/module/actor.js index 32a9a946..65504e6f 100644 --- a/module/actor.js +++ b/module/actor.js @@ -337,6 +337,14 @@ export class RdDActor extends Actor { await this.update( {"data.sante": sante } ); } + /* -------------------------------------------- */ + async manageBlessureLegere( index ) { + let legeres = duplicate(this.data.data.blessures.legeres); + let blessure = legeres.liste[index]; + blessure.active = !blessure.active; + console.log("Blessure update", index, blessure ); + await this.update( { "data.blessures.legeres": legeres } ); + } /* -------------------------------------------- */ manageBlessures( blessuresData ) diff --git a/module/rdd-utility.js b/module/rdd-utility.js index ae5edcc2..39db0e07 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -88,6 +88,10 @@ export class RdDUtility { 'systems/foundryvtt-reve-de-dragon/templates/item-tache-sheet.html', 'systems/foundryvtt-reve-de-dragon/templates/item-potion-sheet.html', 'systems/foundryvtt-reve-de-dragon/templates/item-rentontresTMR-sheet.html', + 'systems/foundryvtt-reve-de-dragon/templates/item-queue-sheet.html', + 'systems/foundryvtt-reve-de-dragon/templates/item-souffle-sheet.html', + 'systems/foundryvtt-reve-de-dragon/templates/item-tete-sheet.html', + 'systems/foundryvtt-reve-de-dragon/templates/item-ombre-sheet.html', 'systems/foundryvtt-reve-de-dragon/templates/competence-categorie.html', 'systems/foundryvtt-reve-de-dragon/templates/competence-carac-defaut.html', 'systems/foundryvtt-reve-de-dragon/templates/competence-base.html', diff --git a/system.json b/system.json index dbcd2fd6..cc3bf914 100644 --- a/system.json +++ b/system.json @@ -2,10 +2,10 @@ "name": "foundryvtt-reve-de-dragon", "title": "Rêve de Dragon", "description": "L'implémentation de Rêve de Dragon pour FoundryVTT", - "version": "0.7.14", + "version": "0.7.15", "minimumCoreVersion": "0.6.0", "compatibleCoreVersion": "0.6.2", - "templateVersion": 19, + "templateVersion": 20, "author": "LeRatierBretonnien", "esmodules": [ "module/rdd-main.js", "module/hook-renderChatLog.js" ], "styles": ["styles/simple.css"], diff --git a/template.json b/template.json index 858e19b0..70fdb594 100644 --- a/template.json +++ b/template.json @@ -312,7 +312,7 @@ } }, "Item": { - "types": ["objet", "arme", "armure", "conteneur", "competence", "sort", "herbe", "ingredient", "livre", "potion", "munition", "rencontresTMR", "queues", "ombres", "souffles", "tetes"], + "types": ["objet", "arme", "armure", "conteneur", "competence", "sort", "herbe", "ingredient", "livre", "potion", "munition", "rencontresTMR", "queue", "ombre", "souffle", "tete"], "objet": { "description": "", "quantite": 1, @@ -424,18 +424,18 @@ "rencontresTMR": { "description": "" }, - "queues": { + "queue": { "description": "", "refoulement": 0 }, - "ombres": { + "ombre": { "description": "", "refoulement": 2 }, - "souffles": { + "souffle": { "description": "" }, - "tetes": { + "tete": { "description": "" } } diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index f38ed54c..2cd0526a 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -273,7 +273,7 @@
{{#each data.blessures.legeres.liste as |bless key|}}
  • - {{#if bless.active}}{{else}}{{/if}} + {{#if bless.active}}{{else}}{{/if}} Premiers soins - Soins complets - Jours - diff --git a/templates/item-ombre-sheet.html b/templates/item-ombre-sheet.html new file mode 100644 index 00000000..d6f1fdeb --- /dev/null +++ b/templates/item-ombre-sheet.html @@ -0,0 +1,23 @@ +
    +
    + +
    +

    +
    +
    + + {{!-- Sheet Body --}} +
    +
    + + +
    +
    + Description : +
    +
    + {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} +
    +
    + +
    diff --git a/templates/item-queue-sheet.html b/templates/item-queue-sheet.html new file mode 100644 index 00000000..d6f1fdeb --- /dev/null +++ b/templates/item-queue-sheet.html @@ -0,0 +1,23 @@ +
    +
    + +
    +

    +
    +
    + + {{!-- Sheet Body --}} +
    +
    + + +
    +
    + Description : +
    +
    + {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} +
    +
    + +
    diff --git a/templates/item-queues-sheet.html b/templates/item-queues-sheet.html new file mode 100644 index 00000000..e76c942d --- /dev/null +++ b/templates/item-queues-sheet.html @@ -0,0 +1,35 @@ +
    +
    + +
    +

    +
    +
    + + {{!-- Sheet Body --}} +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + Description : +
    +
    + {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} +
    +
    + +
    diff --git a/templates/item-souffle-sheet.html b/templates/item-souffle-sheet.html new file mode 100644 index 00000000..d6f1fdeb --- /dev/null +++ b/templates/item-souffle-sheet.html @@ -0,0 +1,23 @@ +
    +
    + +
    +

    +
    +
    + + {{!-- Sheet Body --}} +
    +
    + + +
    +
    + Description : +
    +
    + {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} +
    +
    + +
    diff --git a/templates/item-tete-sheet.html b/templates/item-tete-sheet.html new file mode 100644 index 00000000..d6f1fdeb --- /dev/null +++ b/templates/item-tete-sheet.html @@ -0,0 +1,23 @@ +
    +
    + +
    +

    +
    +
    + + {{!-- Sheet Body --}} +
    +
    + + +
    +
    + Description : +
    +
    + {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} +
    +
    + +