#3 Améliorations fiche

This commit is contained in:
sladecraven 2020-11-24 18:39:27 +01:00
parent ba66f79f63
commit d3111f6d28
6 changed files with 37 additions and 36 deletions

View File

@ -72,7 +72,7 @@ export class RdDActorSheet extends ActorSheet {
// To avoid armour and so on... // To avoid armour and so on...
data.data.combat = duplicate( RdDUtility.checkNull(data.itemsByType['arme'])); data.data.combat = duplicate( RdDUtility.checkNull(data.itemsByType['arme']));
data.data.combat = RdDUtility.finalizeArmeList( data.data.combat ) data.data.combat = RdDUtility.finalizeArmeList( data.data.combat, data.competenceByCategory );
if (data.competenceByCategory && data.competenceByCategory.melee) { if (data.competenceByCategory && data.competenceByCategory.melee) {
//Specific case for Esquive and Corps à Corps //Specific case for Esquive and Corps à Corps

View File

@ -28,10 +28,10 @@ export class RdDDice {
case "blindroll": //GM only case "blindroll": //GM only
blind = true; blind = true;
case "gmroll": //GM + rolling player case "gmroll": //GM + rolling player
whisper = ChatUtility.getUsersIds(user => user.isGM); whisper = ChatUtility.getUsers(user => user.isGM);
break; break;
case "roll": //everybody case "roll": //everybody
whisper = ChatUtility.getUsersIds(user => user.active); whisper = ChatUtility.getUsers(user => user.active);
break; break;
case "selfroll": case "selfroll":
whisper = [game.user._id]; whisper = [game.user._id];

View File

@ -339,7 +339,7 @@ export class RdDUtility {
/* -------------------------------------------- */ /* -------------------------------------------- */
/** Retourne une liste triée d'armes avec le split arme1 main / arme 2 main */ /** Retourne une liste triée d'armes avec le split arme1 main / arme 2 main */
static finalizeArmeList( armeList ) { static finalizeArmeList( armeList, competenceByCategory ) {
// Gestion des armes 1/2 mains // Gestion des armes 1/2 mains
let arme2mains = []; // Tableau contenant la duplication des armes 1m/2m let arme2mains = []; // Tableau contenant la duplication des armes 1m/2m
for (const arme of armeList) { for (const arme of armeList) {
@ -348,7 +348,7 @@ export class RdDUtility {
let arme2main = duplicate(arme); let arme2main = duplicate(arme);
arme2main.data.dommages = arme2main.data.dommages.split("/")[1]; // Existence temporaire uniquement dans la liste des armes, donc OK arme2main.data.dommages = arme2main.data.dommages.split("/")[1]; // Existence temporaire uniquement dans la liste des armes, donc OK
arme2main.data.competence = arme2main.data.competence.replace(" 1 main", " 2 mains"); // Replace ! arme2main.data.competence = arme2main.data.competence.replace(" 1 main", " 2 mains"); // Replace !
for ( const melee of data.competenceByCategory.melee ) { for ( const melee of competenceByCategory.melee ) {
if (melee.name == arme2main.data.competence ) if (melee.name == arme2main.data.competence )
arme2main.data.niveau = melee.data.niveau arme2main.data.niveau = melee.data.niveau
} }

View File

@ -463,22 +463,23 @@ section.sheet-body:after, section.sheet-body div:after {
/* Global UI elements */ /* Global UI elements */
/* ======================================== */ /* ======================================== */
.inventory-list > .list-combat:nth-child(even) { .alterne-list > .list-item:nth-child(even) {
background-color: #7b733b29; background-color:#7b733b29;
background: #7b733b29; background: #7b733b29;
} }
.inventory-list > .list-combat:nth-child(odd) { .alterne-list > .list-item:nth-child(odd) {
background-color: #9e856a0d; background-color: #9e856a0d;
background: #9e856a0d; background: #9e856a0d;
} }
.carac-label {
.list-combat { font-weight: bold;
}
.list-item {
margin: 2px 2px 2px 2px; margin: 2px 2px 2px 2px;
box-shadow: inset 0px 0px 1px #00000096; box-shadow: inset 0px 0px 1px #00000096;
border-radius: 5px; border-radius: 5px;
padding: 2px 5px 0px 5px; padding: 2px 5px 0px 5px;
} }
.sheet-competence-img { .sheet-competence-img {
width: 24px; width: 24px;
height: 24px; height: 24px;

View File

@ -2,7 +2,7 @@
"name": "foundryvtt-reve-de-dragon", "name": "foundryvtt-reve-de-dragon",
"title": "Rêve de Dragon", "title": "Rêve de Dragon",
"description": "Rêve de Dragon RPG for FoundryVTT", "description": "Rêve de Dragon RPG for FoundryVTT",
"version": "0.9.84", "version": "0.9.85",
"minimumCoreVersion": "0.7.5", "minimumCoreVersion": "0.7.5",
"compatibleCoreVersion": "0.7.6", "compatibleCoreVersion": "0.7.6",
"templateVersion": 48, "templateVersion": 48,

View File

@ -109,9 +109,9 @@
<div class="tab items" data-group="primary" data-tab="carac"> <div class="tab items" data-group="primary" data-tab="carac">
<div class="grid grid-2col"> <div class="grid grid-2col">
<div class="flex-group-left flexcol"> <div class="flex-group-left flexcol">
<ol class="carac-list"> <ol class="carac-list alterne-list">
{{#each data.carac as |carac key|}} {{#each data.carac as |carac key|}}
<li class="competence flexrow" data-attribute="{{key}}"> <li class="competence flexrow list-item" data-attribute="{{key}}">
{{#if carac.isTaille}} {{#if carac.isTaille}}
<span class="carac-label flexrow" name="data.carac.{{key}}.label">{{carac.label}}</span> <span class="carac-label flexrow" name="data.carac.{{key}}.label">{{carac.label}}</span>
{{else}} {{else}}
@ -155,9 +155,9 @@
<header class="competence-header flexrow"> <header class="competence-header flexrow">
<span class="competence-title">Compétences de base</span> <span class="competence-title">Compétences de base</span>
</header> </header>
<ol class="item-list"> <ol class="item-list alterne-list">
{{#each data.competenceByCategory.generale as |comp key|}} {{#each data.competenceByCategory.generale as |comp key|}}
<li class="item flexrow" data-item-id="{{comp._id}}"> <li class="item flexrow list-item" data-item-id="{{comp._id}}">
<img class="sheet-competence-img" src="{{comp.img}}"/> <img class="sheet-competence-img" src="{{comp.img}}"/>
<span class="competence-label" name="data.competenceByCategory.generale[{{key}}].name"><a>{{comp.name}}</a></span> <span class="competence-label" name="data.competenceByCategory.generale[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.generale[{{key}}].data.value" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/> <input class="competence-value" type="text" name="data.competenceByCategory.generale[{{key}}].data.value" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/>
@ -173,9 +173,9 @@
<header class="competence-header flexrow"> <header class="competence-header flexrow">
<span class="competence-title">Compétences Particulières</span> <span class="competence-title">Compétences Particulières</span>
</header> </header>
<ol class="item-list"> <ol class="item-list alterne-list">
{{#each data.competenceByCategory.particuliere as |comp key|}} {{#each data.competenceByCategory.particuliere as |comp key|}}
<li class="item flexrow" data-item-id="{{comp._id}}"> <li class="item flexrow list-item" data-item-id="{{comp._id}}">
<img class="sheet-competence-img" src="{{comp.img}}"/> <img class="sheet-competence-img" src="{{comp.img}}"/>
<span class="competence-label" name="data.competenceByCategory.particuliere[{{key}}].name"><a>{{comp.name}}</a></span> <span class="competence-label" name="data.competenceByCategory.particuliere[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.particuliere[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/> <input class="competence-value" type="text" name="data.competenceByCategory.particuliere[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/>
@ -190,9 +190,9 @@
<header class="competence-header flexrow"> <header class="competence-header flexrow">
<span class="competence-title">Compétences Spécialisées</span> <span class="competence-title">Compétences Spécialisées</span>
</header> </header>
<ol class="item-list"> <ol class="item-list alterne-list">
{{#each data.competenceByCategory.specialisee as |comp key|}} {{#each data.competenceByCategory.specialisee as |comp key|}}
<li class="item flexrow" data-item-id="{{comp._id}}"> <li class="item flexrow list-item" data-item-id="{{comp._id}}">
<img class="sheet-competence-img" src="{{comp.img}}"/> <img class="sheet-competence-img" src="{{comp.img}}"/>
<span class="competence-label" name="data.competenceByCategory.specialisee[{{key}}].name"><a>{{comp.name}}</a></span> <span class="competence-label" name="data.competenceByCategory.specialisee[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.specialisee[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/> <input class="competence-value" type="text" name="data.competenceByCategory.specialisee[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/>
@ -210,9 +210,9 @@
<header class="competence-header flexrow"> <header class="competence-header flexrow">
<span class="competence-title">Compétences De Mêlée</span> <span class="competence-title">Compétences De Mêlée</span>
</header> </header>
<ol class="item-list"> <ol class="item-list alterne-list">
{{#each data.competenceByCategory.melee as |comp key|}} {{#each data.competenceByCategory.melee as |comp key|}}
<li class="item flexrow" data-item-id="{{comp._id}}"> <li class="item flexrow list-item" data-item-id="{{comp._id}}">
<img class="sheet-competence-img" src="{{comp.img}}"/> <img class="sheet-competence-img" src="{{comp.img}}"/>
<span class="competence-label" name="data.competenceByCategory.melee[{{key}}].name"><a>{{comp.name}}</a></span> <span class="competence-label" name="data.competenceByCategory.melee[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.melee[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/> <input class="competence-value" type="text" name="data.competenceByCategory.melee[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/>
@ -228,9 +228,9 @@
<header class="competence-header flexrow"> <header class="competence-header flexrow">
<span class="competence-title">Compétences De Tir</span> <span class="competence-title">Compétences De Tir</span>
</header> </header>
<ol class="item-list"> <ol class="item-list alterne-list">
{{#each data.competenceByCategory.tir as |comp key|}} {{#each data.competenceByCategory.tir as |comp key|}}
<li class="item flexrow" data-item-id="{{comp._id}}"> <li class="item flexrow list-item" data-item-id="{{comp._id}}">
<img class="sheet-competence-img" src="{{comp.img}}"/> <img class="sheet-competence-img" src="{{comp.img}}"/>
<span class="competence-label" name="data.competenceByCategory.tir[{{key}}].name"><a>{{comp.name}}</a></span> <span class="competence-label" name="data.competenceByCategory.tir[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.tir[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/> <input class="competence-value" type="text" name="data.competenceByCategory.tir[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/>
@ -246,9 +246,9 @@
<header class="competence-header flexrow"> <header class="competence-header flexrow">
<span class="competence-title">Compétences De Lancer</span> <span class="competence-title">Compétences De Lancer</span>
</header> </header>
<ol class="item-list"> <ol class="item-list alterne-list">
{{#each data.competenceByCategory.lancer as |comp key|}} {{#each data.competenceByCategory.lancer as |comp key|}}
<li class="item flexrow" data-item-id="{{comp._id}}"> <li class="item flexrow list-item" data-item-id="{{comp._id}}">
<img class="sheet-competence-img" src="{{comp.img}}"/> <img class="sheet-competence-img" src="{{comp.img}}"/>
<span class="competence-label" name="data.competenceByCategory.lancer[{{key}}].name"><a>{{comp.name}}</a></span> <span class="competence-label" name="data.competenceByCategory.lancer[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.lancer[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"{{#unless @root.data.editCaracComp}}disabled{{/unless}}/> <input class="competence-value" type="text" name="data.competenceByCategory.lancer[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"{{#unless @root.data.editCaracComp}}disabled{{/unless}}/>
@ -264,9 +264,9 @@
<header class="competence-header flexrow"> <header class="competence-header flexrow">
<span class="competence-title">Connaissances</span> <span class="competence-title">Connaissances</span>
</header> </header>
<ol class="item-list"> <ol class="item-list alterne-list">
{{#each data.competenceByCategory.connaissance as |comp key|}} {{#each data.competenceByCategory.connaissance as |comp key|}}
<li class="item flexrow" data-item-id="{{comp._id}}"> <li class="item flexrow list-item" data-item-id="{{comp._id}}">
<img class="sheet-competence-img" src="{{comp.img}}"/> <img class="sheet-competence-img" src="{{comp.img}}"/>
<span class="competence-label" name="data.competenceByCategory.connaissance[{{key}}].name"><a>{{comp.name}}</a></span> <span class="competence-label" name="data.competenceByCategory.connaissance[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.connaissance[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/> <input class="competence-value" type="text" name="data.competenceByCategory.connaissance[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/>
@ -282,9 +282,9 @@
<header class="competence-header flexrow"> <header class="competence-header flexrow">
<span class="competence-title">Draconic</span> <span class="competence-title">Draconic</span>
</header> </header>
<ol class="item-list"> <ol class="item-list alterne-list">
{{#each data.competenceByCategory.draconic as |comp key|}} {{#each data.competenceByCategory.draconic as |comp key|}}
<li class="item flexrow" data-item-id="{{comp._id}}"> <li class="item flexrow list-item" data-item-id="{{comp._id}}">
<img class="sheet-competence-img" src="{{comp.img}}"/> <img class="sheet-competence-img" src="{{comp.img}}"/>
<span class="competence-label" name="data.competenceByCategory.draconic[{{key}}].name"><a>{{comp.name}}</a></span> <span class="competence-label" name="data.competenceByCategory.draconic[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.draconic[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/> <input class="competence-value" type="text" name="data.competenceByCategory.draconic[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/>
@ -311,7 +311,7 @@
{{!-- Combat Tab --}} {{!-- Combat Tab --}}
<div class="tab combat" data-group="primary" data-tab="combat"> <div class="tab combat" data-group="primary" data-tab="combat">
<ol class="item-list inventory-list"> <ol class="item-list alterne-list">
<li class="competence-header flexrow"> <li class="competence-header flexrow">
<span class="competence-title competence-label">Armes</span> <span class="competence-title competence-label">Armes</span>
<span class="competence-title competence-label">Comp.</span> <span class="competence-title competence-label">Comp.</span>
@ -319,7 +319,7 @@
<span class="competence-title competence-value">+dom</span> <span class="competence-title competence-value">+dom</span>
</li> </li>
{{#each data.combat as |arme key|}} {{#each data.combat as |arme key|}}
<li class="item flexrow list-combat" data-item-id="{{arme._id}}"> <li class="item flexrow list-item" data-item-id="{{arme._id}}">
<span class="arme-label competence-label" name="data.armes[{{key}}].name"><a data-competence-name="{{arme.data.competence}}">{{arme.name}}</a></span> <span class="arme-label competence-label" name="data.armes[{{key}}].name"><a data-competence-name="{{arme.data.competence}}">{{arme.name}}</a></span>
<span class="competence-label" name="data.armes[{{key}}].data.competence">{{arme.data.competence}}</span> <span class="competence-label" name="data.armes[{{key}}].data.competence">{{arme.data.competence}}</span>
<span class="competence-value" name="data.armes[{{key}}].data.niveau">{{numberFormat arme.data.niveau decimals=0 sign=true}}</span> <span class="competence-value" name="data.armes[{{key}}].data.niveau">{{numberFormat arme.data.niveau decimals=0 sign=true}}</span>
@ -332,9 +332,9 @@
{{!-- Compteurs/Blessures Tab --}} {{!-- Compteurs/Blessures Tab --}}
<div class="tab blessurescompteurs" data-group="primary" data-tab="blessurescompteurs"> <div class="tab blessurescompteurs" data-group="primary" data-tab="blessurescompteurs">
<div class="flex-group-left flexrow"> <div class="flex-group-left flexrow">
<ol class="item-list"> <ol class="item-list alterne-list">
{{#each data.compteurs as |compteur key|}} {{#each data.compteurs as |compteur key|}}
<li class="item flexrow"> <li class="item flexrow list-item">
<span class="arme-label">{{compteur.label}}</span> <span class="arme-label">{{compteur.label}}</span>
{{#if compteur.isInput}} {{#if compteur.isInput}}
<input class="stress-value stress-style compteur-edit" id="{{key}}-edit" type="text" name="{{key}}" value="{{compteur.value}}" data-dtype="number"/> <input class="stress-value stress-style compteur-edit" id="{{key}}-edit" type="text" name="{{key}}" value="{{compteur.value}}" data-dtype="number"/>
@ -353,9 +353,9 @@
</div> </div>
<div class="flex-group-left flexcol competence-column"> <div class="flex-group-left flexcol competence-column">
<span class="blessures-title">Blessures Légeres :</span> <span class="blessures-title">Blessures Légeres :</span>
<div class="blessure-data"> <div class="blessure-data alterne-list">
{{#each data.blessures.legeres.liste as |bless key|}} {{#each data.blessures.legeres.liste as |bless key|}}
<li class="item flexrow blessure-data" data-blessure-type="legere" data-attribute={{key}} data-blessure-index="{{key}}"> <li class="item flexrow blessure-data list-item" data-blessure-type="legere" data-attribute={{key}} data-blessure-index="{{key}}">
<a class="item-control blessure-control" title="Blessure Légère" data-blessure-active="{{bless.active}}">{{#if bless.active}}<i class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a> <a class="item-control blessure-control" title="Blessure Légère" data-blessure-active="{{bless.active}}">{{#if bless.active}}<i class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
Premiers soins <input class="blessures-soins" type="text" name='premiers_soins' data-dtype="number" value="{{this.premiers_soins}}"/> - Premiers soins <input class="blessures-soins" type="text" name='premiers_soins' data-dtype="number" value="{{this.premiers_soins}}"/> -
Soins complets <input class="blessures-soins" type="text" name='soins_complets' data-dtype="number" value="{{this.soins_complets}}"/> - Soins complets <input class="blessures-soins" type="text" name='soins_complets' data-dtype="number" value="{{this.soins_complets}}"/> -