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(); } 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..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; @@ -627,6 +641,23 @@ ul, li { padding: 0.125rem; flex: 1 1 5rem; } + +.table-row { + margin: 0.125rem; + 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..fd9afe68 --- /dev/null +++ b/templates/actor-blessure-partial.html @@ -0,0 +1,24 @@ + + + {{#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..16465ca7 --- /dev/null +++ b/templates/actor-liste-blessures-partial.html @@ -0,0 +1,26 @@ +

    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="critique" title="Critique"}} + {{/each}} + +
    LocalisationPremiers soinsSoins completsAge (jours)
    Légères
    Graves
    Critiques
    \ 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:

    - -

    Graves :

    - -

    Critique :

    - -
    -
    + {{> "systems/foundryvtt-reve-de-dragon/templates/actor-liste-blessures-partial.html" this}} + {{!-- Connaissances Tab --}}
    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}}