Regrouper vue détaillée avec dévérouiller

This commit is contained in:
Vincent Vandemeulebrouck 2022-09-27 22:38:49 +02:00
parent 5d36ea9e0c
commit 322506250b
4 changed files with 25 additions and 33 deletions

View File

@ -29,7 +29,6 @@ export class RdDActorSheet extends ActorSheet {
width: 640, width: 640,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "carac" }], tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "carac" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }], dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editCaracComp: false,
showCompNiveauBase: false, showCompNiveauBase: false,
vueDetaillee: false vueDetaillee: false
}); });
@ -387,7 +386,7 @@ export class RdDActorSheet extends ActorSheet {
this.actor.updateCompetenceStress(RdDSheetUtility.getItemId(event)); this.actor.updateCompetenceStress(RdDSheetUtility.getItemId(event));
}); });
if (this.options.editCaracComp) { if (this.options.vueDetaillee) {
// On carac change // On carac change
html.find('.carac-value').change(async event => { html.find('.carac-value').change(async event => {
let caracName = event.currentTarget.name.replace(".value", "").replace("system.carac.", ""); let caracName = event.currentTarget.name.replace(".value", "").replace("system.carac.", "");
@ -424,10 +423,6 @@ export class RdDActorSheet extends ActorSheet {
this.options.showCompNiveauBase = !this.options.showCompNiveauBase; this.options.showCompNiveauBase = !this.options.showCompNiveauBase;
this.render(true); this.render(true);
}); });
html.find('.lock-unlock-sheet').click(async event => {
this.options.editCaracComp = !this.options.editCaracComp;
this.render(true);
});
html.find('.recherche') html.find('.recherche')
.each((index, field) => { .each((index, field) => {

View File

@ -93,9 +93,10 @@
{{!-- Carac Tab --}} {{!-- Carac Tab --}}
<div class="tab items" data-group="primary" data-tab="carac"> <div class="tab items" data-group="primary" data-tab="carac">
<div class="flexrow"> <div class="flexrow">
<span><a class="lock-unlock-sheet"><img class="small-button-container" <span><a class="vue-detaillee">
src="systems/foundryvtt-reve-de-dragon/icons/{{#if options.editCaracComp}}unlocked.svg{{else}}locked.svg{{/if}}" alt="blocker/débloquer" <i class="fas {{#if options.vueDetaillee}}fa-eye-slash{{else}}fa-eye{{/if}}"></i>
>{{#if options.editCaracComp}}Verrouiller{{else}}Déverrouiller{{/if}}</a></span> {{#if options.vueDetaillee}}Vue simplifiée{{else}}Vue détaillée{{/if}}</a>
</span>
</div> </div>
<div class="grid grid-2col"> <div class="grid grid-2col">
<div class="flex-group-left flexcol"> <div class="flex-group-left flexcol">
@ -108,7 +109,7 @@
{{/if}} {{/if}}
{{#if (eq key 'taille')}} {{#if (eq key 'taille')}}
<span class="carac-label" name="system.carac.{{key}}.label">{{carac.label}}</span> <span class="carac-label" name="system.carac.{{key}}.label">{{carac.label}}</span>
<input class="carac-value" type="text" name="system.carac.{{key}}.value" value="{{carac.value}}" data-dtype="{{carac.type}}" {{#unless @root.options.editCaracComp}}disabled{{/unless}} /> <input class="carac-value" type="text" name="system.carac.{{key}}.value" value="{{carac.value}}" data-dtype="{{carac.type}}" {{#unless @root.options.vueDetaillee}}disabled{{/unless}} />
<label class="carac-xp"/> <label class="carac-xp"/>
{{else}} {{else}}
{{#if carac.derivee}} {{#if carac.derivee}}
@ -125,9 +126,9 @@
{{else}} {{else}}
<span class="carac-label tooltip" name="system.carac.{{key}}.label"><a name={{key}}>{{carac.label}}</a></span> <span class="carac-label tooltip" name="system.carac.{{key}}.label"><a name={{key}}>{{carac.label}}</a></span>
{{/if}} {{/if}}
<input class="carac-value" type="text" name="system.carac.{{key}}.value" value="{{carac.value}}" data-dtype="{{carac.type}}" {{#unless @root.options.editCaracComp}}disabled{{/unless}} /> <input class="carac-value" type="text" name="system.carac.{{key}}.value" value="{{carac.value}}" data-dtype="{{carac.type}}" {{#unless @root.options.vueDetaillee}}disabled{{/unless}} />
<span class="carac-xp tooltip"> <span class="carac-xp tooltip">
<input class="carac-xp" type="text" name="system.carac.{{key}}.xp" value="{{carac.xp}}" data-dtype="number" {{#unless @root.options.editCaracComp}}disabled{{/unless}} /> <input class="carac-xp" type="text" name="system.carac.{{key}}.xp" value="{{carac.xp}}" data-dtype="number" {{#unless @root.options.vueDetaillee}}disabled{{/unless}} />
<span class="tooltiptext ttt-xp">Vous devez acquérir {{carac.xpNext}} points d'Experience pour augmenter de 1 votre {{carac.label}}</span> <span class="tooltiptext ttt-xp">Vous devez acquérir {{carac.xpNext}} points d'Experience pour augmenter de 1 votre {{carac.label}}</span>
</span> </span>
{{#if carac.isLevelUp}} {{#if carac.isLevelUp}}
@ -149,7 +150,7 @@
<ul class="carac-list"> <ul class="carac-list">
<li class="caracteristique flexrow list-item"> <li class="caracteristique flexrow list-item">
<span class="carac-label" name="beaute">Beauté&nbsp;:</span> <span class="carac-label" name="beaute">Beauté&nbsp;:</span>
<input class="description-value" type="text" name="system.beaute" value="{{system.beaute}}" data-dtype="String" {{#unless @root.options.editCaracComp}}disabled{{/unless}}/> <input class="description-value" type="text" name="system.beaute" value="{{system.beaute}}" data-dtype="String" {{#unless @root.options.vueDetaillee}}disabled{{/unless}}/>
<label class="carac-xp"/> <label class="carac-xp"/>
</li> </li>
{{#each system.attributs as |attr key|}} {{#each system.attributs as |attr key|}}
@ -211,21 +212,19 @@
{{!-- Compétences Tab --}} {{!-- Compétences Tab --}}
<div class="tab competences" data-group="primary" data-tab="competences"> <div class="tab competences" data-group="primary" data-tab="competences">
<div class="grid grid-4col"> <div class="flexrow">
<span><a class="lock-unlock-sheet"><img class="small-button-container" <span><a class="vue-detaillee">
src="systems/foundryvtt-reve-de-dragon/icons/{{#if options.editCaracComp}}unlocked.svg{{else}}locked.svg{{/if}}" alt="blocker/débloquer"> <i class="fas {{#if options.vueDetaillee}}fa-eye-slash{{else}}fa-eye{{/if}}"></i>
{{#if options.editCaracComp}}Verrouiller{{else}}Déverrouiller{{/if}}</a></span> {{#if options.vueDetaillee}}Vue simplifiée{{else}}Vue détaillée{{/if}}</a>
<span>
<input class="recherche flex-grow" type="text" value="{{options.recherche.text}}" name="recherche"
size="8" data-dtype="String" placeholder="chercher"/>
</span> </span>
<span><a class="show-hide-competences"><img class="small-button-container" <span><a class="show-hide-competences"><img class="small-button-container"
src="systems/foundryvtt-reve-de-dragon/icons/{{#if options.showCompNiveauBase}}no-filter.svg{{else}}filter.svg{{/if}}" alt="filter/montrer tout"> src="systems/foundryvtt-reve-de-dragon/icons/{{#if options.showCompNiveauBase}}no-filter.svg{{else}}filter.svg{{/if}}" alt="filter/montrer tout">
{{#if options.showCompNiveauBase}}Montrer tout{{else}}Filtrer{{/if}}</a> {{#if options.showCompNiveauBase}}Montrer tout{{else}}Filtrer{{/if}}</a>
</span> </span>
<span><a class="vue-detaillee"> <span class="flexrow">
<i class="fas {{#if options.vueDetaillee}}fa-eye-slash{{else}}fa-eye{{/if}}"></i> <i class="fas fa-search flex-shrink"></i>
{{#if options.vueDetaillee}}Vue simplifiée{{else}}Vue détaillée{{/if}}</a> <input class="recherche flex-grow" type="text" value="{{options.recherche.text}}" name="recherche"
size="8" data-dtype="String" placeholder="chercher"/>
</span> </span>
</div> </div>
<div class="grid grid-2col"> <div class="grid grid-2col">

View File

@ -6,7 +6,6 @@
<ul class="item-list alterne-list competence-list"> <ul class="item-list alterne-list competence-list">
{{#if @root.options.vueDetaillee}} {{#if @root.options.vueDetaillee}}
<li class="item flexrow list-item "> <li class="item flexrow list-item ">
<span class="competence-label"></span> <span class="competence-label"></span>
<span class="competence-value" >Niv.</span> <span class="competence-value" >Niv.</span>
<span class="competence-xp">xp</span> <span class="competence-xp">xp</span>
@ -15,7 +14,7 @@
{{/if}} {{/if}}
<div class="item-controls"> <div class="item-controls">
<i class="far fa-arrow-alt-circle-up"></i> <i class="far fa-arrow-alt-circle-up"></i>
<span class="competence-archetype">Arch</span> <span class="competence-archetype">Arch.</span>
<i class="far fa-edit"></i> <i class="far fa-edit"></i>
{{#if @root.options.isGM}} {{#if @root.options.isGM}}
<i class="far fa-trash"></i> <i class="far fa-trash"></i>

View File

@ -14,19 +14,19 @@
<input class="competence-value" type="text" compname="{{name}}" name="comp-value-{{name}}" <input class="competence-value" type="text" compname="{{name}}" name="comp-value-{{name}}"
value="{{numberFormat system.niveau decimals=0 sign=true}}" data-dtype="number" value="{{numberFormat system.niveau decimals=0 sign=true}}" data-dtype="number"
{{#unless @root.options.editCaracComp}}disabled{{/unless}} /> {{#unless @root.options.vueDetaillee}}disabled{{/unless}} />
{{#if @root.options.vueDetaillee}}
<span class="competence-xp tooltip"> <span class="competence-xp tooltip">
<input class="competence-xp " type="text" compname="{{name}}" name="comp-xp-{{name}}" <input class="competence-xp " type="text" compname="{{name}}" name="comp-xp-{{name}}"
value="{{numberFormat system.xp decimals=0 sign=false}}" data-dtype="number" value="{{numberFormat system.xp decimals=0 sign=false}}" data-dtype="number"/>
{{#unless @root.options.editCaracComp}}disabled{{/unless}} />
<span class="tooltiptext left-competence ttt-xp">Vous devez acquérir {{system.xpNext}} points d'Experience pour augmenter de 1 votre compétence {{name}}</span> <span class="tooltiptext left-competence ttt-xp">Vous devez acquérir {{system.xpNext}} points d'Experience pour augmenter de 1 votre compétence {{name}}</span>
</span> </span>
{{/if}}
{{#if (eq system.categorie 'draconic')}} {{#if (eq system.categorie 'draconic')}}
<input class="competence-xp-sort" type="text" compname="{{name}}" name="comp-xp-sort-{{name}}" <input class="competence-xp-sort" type="text" compname="{{name}}" name="comp-xp-sort-{{name}}"
value="{{numberFormat system.xp_sort decimals=0 sign=false}}" data-dtype="number" value="{{numberFormat system.xp_sort decimals=0 sign=false}}" data-dtype="number"
{{#unless @root.options.editCaracComp}}disabled{{/unless}}/> {{#unless @root.options.vueDetaillee}}disabled{{/unless}}/>
{{/if}} {{/if}}
{{#if @root.options.vueDetaillee}} {{#if @root.options.vueDetaillee}}
<div class="item-controls"> <div class="item-controls">
@ -39,8 +39,7 @@
<i class="far fa-circle"></i> <i class="far fa-circle"></i>
{{/if}} {{/if}}
<input class="competence-archetype niveau-archetype" type="text" compname="{{name}}" name="comp-archetype-{{name}}" <input class="competence-archetype niveau-archetype" type="text" compname="{{name}}" name="comp-archetype-{{name}}"
value="{{numberFormat system.niveau_archetype decimals=0 sign=true}}" data-dtype="number" value="{{numberFormat system.niveau_archetype decimals=0 sign=true}}" data-dtype="number"/>
{{#unless @root.options.editCaracComp}}disabled{{/unless}} />
<a class="item-edit" title="Modifier"><i class="fas fa-edit"></i></a> <a class="item-edit" title="Modifier"><i class="fas fa-edit"></i></a>
{{#if @root.options.isGM}} {{#if @root.options.isGM}}
<a class="item-delete" title="Supprimer"><i class="fas fa-trash"></i></a> <a class="item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>