Controle visibilite

Ne pas afficher les boutons non accessibles
This commit is contained in:
Vincent Vandemeulebrouck 2022-12-29 02:24:18 +01:00
parent 2062ff0777
commit 26808d7b49
3 changed files with 81 additions and 66 deletions

View File

@ -21,19 +21,20 @@
{{!-- Sheet Tab Navigation --}}
<nav class="sheet-tabs tabs" data-group="primary">
{{#if options.isObserver}}
<a class="item" data-tab="carac">Carac.</a>
<a class="item" data-tab="competences">Compétences</a>
<a class="item" data-tab="combat">Combat</a>
<a class="item" data-tab="connaissances">Savoirs&Taches</a>
<a class="item" data-tab="hautreve">Haut-Rêve</a>
{{/if}}
<a class="item" data-tab="items">Équipement</a>
<a class="item" data-tab="description">Description</a>
</nav>
{{!-- Sheet Body --}}
<section class="sheet-body">
{{!-- Carac Tab --}}
{{#if options.isObserver}}{{!-- Carac Tab --}}
<div class="tab items" data-group="primary" data-tab="carac">
<div class="flexrow">
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/vue-detaillee.html"}}
@ -48,8 +49,8 @@
</div>
</div>
</div>
{{!-- Compétences Tab --}}
{{/if}}
{{#if options.isObserver}}{{!-- Compétences Tab --}}
<div class="tab competences" data-group="primary" data-tab="competences">
<div class="flexrow">
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/vue-detaillee.html"}}
@ -84,25 +85,25 @@
</div>
</div>
</div>
{{!-- Combat Tab --}}
{{/if}}
{{#if options.isObserver}}{{!-- Combat Tab --}}
<div class="tab combat" data-group="primary" data-tab="combat">
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/combat.html"}}<hr>
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/blessures.html"}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/maladies-poisons.html"}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/possessions.html"}}
</div>
{{/if}}
{{!-- Connaissances Tab --}}
{{#if options.isObserver}}{{!-- Connaissances Tab --}}
<div class="tab connaissances" data-group="primary" data-tab="connaissances">
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/taches.html"}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/oeuvres.html"}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/jeux.html"}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/alchimie.html"}}
</div>
{{!-- hautreve Tab --}}
{{/if}}
{{#if options.isObserver}}{{!-- hautreve Tab --}}
<div class="tab hautreve " data-group="primary" data-tab="hautreve" style="height:200px">
<div>
{{#if system.attributs.hautrevant.value}}
@ -116,6 +117,7 @@
<br><br>
</div>
</div>
{{/if}}
{{!-- Equipment Tab --}}
<div class="tab items" data-group="primary" data-tab="items">

View File

@ -1,3 +1,4 @@
{{#if (or @root.options.isObserver (ne item.type 'monnaie'))}}
<li class="item flexrow list-item" data-item-id="{{item._id}}" draggable="true">
<span class="equipement-nom {{#if (eq item.type 'conteneur')}}conteneur-name{{/if}} ">
{{#if (eq item.type 'conteneur')}}
@ -20,6 +21,7 @@
</span>
<span class="equipement-detail">{{numberFormat item.system.encTotal decimals=2}}</span>
<span class="equipement-actions item-controls">
{{#if @root.options.isOwner}}
{{#unless item.estContenu}}
{{#if (or (eq item.type 'arme') (eq item.type 'armure') )}}
<a class="item-equip" title="Equiper">{{#if item.system.equipe}}<i class="fas fa-hand-rock"></i>{{else}}<i class="far fa-hand-paper"></i>{{/if}}</a>
@ -31,10 +33,13 @@
{{#if (ne item.system.quantite 0)}}
<a class="item-vendre" title="Vendre ou donner"><i class="fas fa-comments-dollar"></i></a>
{{/if}}
{{/if}}
<a class="item-montrer" title="Montrer"><i class="fas fa-comment"></i></a>
{{#if @root.options.isOwner}}
{{#if item.system.actionPrincipale}}
<a class="item-action">{{item.system.actionPrincipale}}</a>
{{/if}}
{{/if}}
</span>
</li>
{{/if}}

View File

@ -1,3 +1,4 @@
{{#if @root.options.isObserver}}
<span class="item-name"><h4>Argent et Monnaies (fortune: {{calc.fortune.sols}} sols {{calc.fortune.deniers}} deniers)</h4></span>
<ul class="item-list alterne-list">
{{#each monnaie as |piece id|}}
@ -7,19 +8,26 @@
<span class="equipement-valeur {{#unless (gt piece.system.cout 0)}}field-error{{/unless}}">
({{piece.system.cout}} Sols)
</span>
{{#if @root.options.isOwner}}
<span class="equipement-button item-controls">
<a class="monnaie-moins"><i class="fas fa-minus-square"></i></a>
</span>
{{/if}}
<span class="equipement-detail">
<span>{{piece.system.quantite}}</span>
</span>
{{#if @root.options.isOwner}}
<span class="equipement-button item-controls">
<a class="monnaie-plus"><i class="fas fa-plus-square"></i></a>
</span>
{{/if}}
<span class="equipement-actions item-controls">
{{#if @root.options.isOwner}}
<a class="item-edit" title="Editer"><i class="fas fa-edit"></i></a>
<a class="item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
{{/if}}
</span>
</li>
{{/each}}
</ul>
{{/if}}