From 0a9e8e0ac67b54f859b2e6a81dc1913cbe0dfb70 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Tue, 27 Apr 2021 00:30:46 +0200 Subject: [PATCH 1/3] =?UTF-8?q?Am=C3=A9lioration=20pr=C3=A9sentation=20ble?= =?UTF-8?q?ssures=20#173?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/rdd-utility.js | 2 + styles/simple.css | 18 +++ templates/actor-blessure-partial.html | 24 ++++ templates/actor-creature-sheet.html | 130 ++++++------------- templates/actor-liste-blessures-partial.html | 23 ++++ templates/actor-sheet.html | 103 +-------------- 6 files changed, 107 insertions(+), 193 deletions(-) create mode 100644 templates/actor-blessure-partial.html create mode 100644 templates/actor-liste-blessures-partial.html diff --git a/module/rdd-utility.js b/module/rdd-utility.js index e6d5c403..be7eb64b 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -101,6 +101,8 @@ export class RdDUtility { 'systems/foundryvtt-reve-de-dragon/templates/actor-entite-sheet.html', 'systems/foundryvtt-reve-de-dragon/templates/actor-vehicule-sheet.html', 'systems/foundryvtt-reve-de-dragon/templates/actor-sheet-competence-partial.html', + 'systems/foundryvtt-reve-de-dragon/templates/actor-liste-blessures-partial.html', + 'systems/foundryvtt-reve-de-dragon/templates/actor-blessure-partial.html', //Items 'systems/foundryvtt-reve-de-dragon/templates/item-competence-sheet.html', 'systems/foundryvtt-reve-de-dragon/templates/item-competencecreature-sheet.html', diff --git a/styles/simple.css b/styles/simple.css index c76e8e8a..c62b90e0 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -627,6 +627,24 @@ ul, li { padding: 0.125rem; flex: 1 1 5rem; } + +.table-row { + margin: 0.125rem; + border-radius: 0; + padding: 0.125rem; + flex: 1 1 5rem; +} + +.alterne-row > .row-item:hover { + background: rgba(100, 100, 50, 0.25); +} +.alterne-row > .row-item:nth-child(even) { + background: rgba(80, 60, 0, 0.10); +} +.alterne-row > .row-item:nth-child(odd) { + background: rgb(160, 130, 100, 0.05); +} + .item-display-show { display: block; } diff --git a/templates/actor-blessure-partial.html b/templates/actor-blessure-partial.html new file mode 100644 index 00000000..b08f50f7 --- /dev/null +++ b/templates/actor-blessure-partial.html @@ -0,0 +1,24 @@ + + + {{title}} + + + {{#if bless.active}} + + {{else}} + + {{/if}} + + + + + + + + + + + + + + diff --git a/templates/actor-creature-sheet.html b/templates/actor-creature-sheet.html index 339e7c61..a96bf07f 100644 --- a/templates/actor-creature-sheet.html +++ b/templates/actor-creature-sheet.html @@ -139,101 +139,47 @@ {{!-- blessures Tab --}}
- Blessures Légeres : -
- {{#each data.blessures.legeres.liste as |bless key|}} -
  • - {{#if bless.active}}{{else}}{{/if}} - Premiers soins - - Soins complets - - Jours - - - Loc. -
  • - {{/each}} -
    - Blessures Graves : -
    - {{#each data.blessures.graves.liste as |bless key|}} -
  • - {{#if bless.active}}{{else}}{{/if}} - Premiers soins - - Soins complets - - Jours - - - Loc. -
  • - {{/each}} -
    - Blessure Critique : -
    - {{#each data.blessures.critiques.liste as |bless key|}} -
  • - {{#if bless.active}}{{else}}{{/if}} - Premiers soins - - Soins complets - - Jours - - - Loc. -
  • - - {{/each}} -
    -
    + {{!-- Liste de blessures --}} + {{> "systems/foundryvtt-reve-de-dragon/templates/actor-liste-blessures-partial.html" this}} + - {{!-- Equipment Tab --}} -
    - Encombrement total/max : {{numberFormat calc.encTotal decimals=2}} / {{data.attributs.encombrement.value}} {{calc.surEncombrementMessage}} - - Créer un objet - {{#if options.isGM}} - - Vider tout les conteneurs - {{/if}} - +
    {{!-- Biography Tab --}}
    diff --git a/templates/actor-liste-blessures-partial.html b/templates/actor-liste-blessures-partial.html new file mode 100644 index 00000000..ea58f23b --- /dev/null +++ b/templates/actor-liste-blessures-partial.html @@ -0,0 +1,23 @@ +

    Blessures:

    + + + + + + + + + + + + {{#each data.blessures.legeres.liste as |bless key|}} + {{> "systems/foundryvtt-reve-de-dragon/templates/actor-blessure-partial.html" bless=bless key=key gravite="legere" title="Légère"}} + {{/each}} + {{#each data.blessures.graves.liste as |bless key|}} + {{> "systems/foundryvtt-reve-de-dragon/templates/actor-blessure-partial.html" bless=bless key=key gravite="grave" title="Grave"}} + {{/each}} + {{#each data.blessures.critiques.liste as |bless key|}} + {{> "systems/foundryvtt-reve-de-dragon/templates/actor-blessure-partial.html" bless=bless key=key gravite="legere" title="Critique"}} + {{/each}} + +
    GravitéLocalisationPremiers soinsSoins completsAge (jours)
    \ No newline at end of file diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index f3cb0920..346778d3 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -365,108 +365,9 @@
    - {{!-- Liste de blessures --}} -

    Blessures:

    -
    -

    Légères:

    -
      - {{#each data.blessures.legeres.liste as |bless key|}} -
    • -
        -
      • - {{#if bless.active}} - - {{else}} - - {{/if}} -
      • -
      • - Premiers soins - -
      • -
      • - Soins complets - -
      • -
      • - Jours - -
      • -
      • - Loc. - -
      • -
      -
    • - {{/each}} -
    -

    Graves :

    -
      - {{#each data.blessures.graves.liste as |bless key|}} -
    • -
        -
      • - {{#if bless.active}} - - {{else}} - - {{/if}} -
      • -
      • - Premiers soins - -
      • -
      • - Soins complets - -
      • -
      • - Jours - -
      • -
      • - Loc. - -
      • -
      -
    • - {{/each}} -
    -

    Critique :

    -
      - {{#each data.blessures.critiques.liste as |bless key|}} -
    • -
        -
      • - {{#if bless.active}} - - {{else}} - - {{/if}} -
      • -
      • - Premiers soins - -
      • -
      • - Soins complets - -
      • -
      • - Jours - -
      • -
      • - Loc. - -
      • -
      -
    • - {{/each}} -
    -
    -
    + {{> "systems/foundryvtt-reve-de-dragon/templates/actor-liste-blessures-partial.html" this}} + {{!-- Connaissances Tab --}}
    From 78d4b48aae818422db026273877cc8f6c435b07e Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Wed, 28 Apr 2021 00:30:31 +0200 Subject: [PATCH 2/3] =?UTF-8?q?Am=C3=A9lioration=20des=20blessures=20#173?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Conflicts: # templates/chat-resultat-encaissement.html --- styles/simple.css | 15 ++++++++++++++- templates/actor-blessure-partial.html | 18 +++++++++--------- templates/actor-liste-blessures-partial.html | 7 +++++-- templates/chat-resultat-encaissement.html | 2 +- 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/styles/simple.css b/styles/simple.css index c62b90e0..ee5dde37 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -365,6 +365,20 @@ table {border: 1px solid #7a7971;} border-bottom: 1px solid #BBB; } +.blessure-inactive{ + color:rgba(150, 150, 150, 0.4) +} +.blessure-active-legere{ + color:rgba(60, 60, 60, 0.9); + text-shadow: rgba(60, 60, 60, 0.7); +} +.blessure-active-grave{ + color:rgba(218, 126, 21, 0.9); +} +.blessure-active-critique{ + color:rgba(173, 36, 26, 0.9); + +} .foundryvtt-reve-de-dragon .items-list .item .item-image { -webkit-box-flex: 0; -ms-flex: 0 0 24px; @@ -630,7 +644,6 @@ ul, li { .table-row { margin: 0.125rem; - border-radius: 0; padding: 0.125rem; flex: 1 1 5rem; } diff --git a/templates/actor-blessure-partial.html b/templates/actor-blessure-partial.html index b08f50f7..fd9afe68 100644 --- a/templates/actor-blessure-partial.html +++ b/templates/actor-blessure-partial.html @@ -1,24 +1,24 @@ - - {{title}} - {{#if bless.active}} - + + {{!-- --}} + {{!-- --}} {{else}} - + {{!-- --}} + {{/if}} - + - + - + - + diff --git a/templates/actor-liste-blessures-partial.html b/templates/actor-liste-blessures-partial.html index ea58f23b..16465ca7 100644 --- a/templates/actor-liste-blessures-partial.html +++ b/templates/actor-liste-blessures-partial.html @@ -2,7 +2,7 @@ - + @@ -10,14 +10,17 @@ + {{#each data.blessures.legeres.liste as |bless key|}} {{> "systems/foundryvtt-reve-de-dragon/templates/actor-blessure-partial.html" bless=bless key=key gravite="legere" title="Légère"}} {{/each}} + {{#each data.blessures.graves.liste as |bless key|}} {{> "systems/foundryvtt-reve-de-dragon/templates/actor-blessure-partial.html" bless=bless key=key gravite="grave" title="Grave"}} {{/each}} + {{#each data.blessures.critiques.liste as |bless key|}} - {{> "systems/foundryvtt-reve-de-dragon/templates/actor-blessure-partial.html" bless=bless key=key gravite="legere" title="Critique"}} + {{> "systems/foundryvtt-reve-de-dragon/templates/actor-blessure-partial.html" bless=bless key=key gravite="critique" title="Critique"}} {{/each}}
    Gravité Localisation Premiers soins Soins complets
    Légères
    Graves
    Critiques
    \ No newline at end of file diff --git a/templates/chat-resultat-encaissement.html b/templates/chat-resultat-encaissement.html index 8e1621f6..849297f5 100644 --- a/templates/chat-resultat-encaissement.html +++ b/templates/chat-resultat-encaissement.html @@ -16,7 +16,7 @@
    - Je d'encaissement de {{roll.total}} + Jet d'encaissement de {{roll.total}} {{#unless (eq armure 0)}}, l'armure a protègé de {{armure}} {{#unless (eq penetration 0)}}(pénétration de {{penetration}}) {{/unless}} {{/unless}}, total: {{total}} From c786757db0a212cd43ae9e0d685140dc8970bf1c Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Wed, 28 Apr 2021 00:43:06 +0200 Subject: [PATCH 3/3] Fix: oubli correction tmr multiples --- module/misc.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/module/misc.js b/module/misc.js index 72335ae4..85c490af 100644 --- a/module/misc.js +++ b/module/misc.js @@ -116,6 +116,13 @@ export class Misc { return Misc.data(it)?.data ?? {} } + static connectedGMOrUser(ownerId = undefined) { + if (ownerId && game.user.id == ownerId){ + return ownerId; + } + return (game.user.isGM ? game.user.id : game.users.entities.find(u => u.isGM && u.active)?.id) ?? game.user.id; + } + static isElectedUser() { return game.user.id == Misc.connectedGMOrUser(); }