Various fixes - WIP

This commit is contained in:
sladecraven 2022-05-01 00:46:24 +02:00
parent 580fdb996b
commit d83fd27193
3 changed files with 27 additions and 26 deletions

View File

@ -325,8 +325,8 @@ export class RdDActorSheet extends ActorSheet {
// Roll Weapon1
html.find('.arme-label a').click(async event => {
let arme = this._getEventArmeCombat(event);
this.actor.rollArme(duplicate(arme));
let arme = this._getEventArmeCombat(event)
this.actor.rollArme(duplicate(arme))
});
// Initiative pour l'arme
html.find('.arme-initiative a').click(async event => {
@ -517,6 +517,7 @@ export class RdDActorSheet extends ActorSheet {
const li = $(event.currentTarget)?.parents(".item")
let armeName = li.data("arme-name")
let compName = li.data('competence-name')
console.log("Searching for", armeName, compName)
const arme = this.armesList.find(a => a.name == armeName && a.system.competence == compName)
if (!arme) {
return { name: armeName, data: { competence: compName } }

View File

@ -6,7 +6,7 @@
</a>
{{#if data.isLevelUp}}
<span class="tooltiptext ttt-xp">Vous pouvez dépenser {{data.xpNext}} points d'Experience pour augmenter de 1 votre compétence {{name}}</span>
<span class="tooltiptext ttt-xp">Vous pouvez dépenser {{system.xpNext}} points d'Experience pour augmenter de 1 votre compétence {{name}}</span>
<a class="item-control competence-xp-augmenter" compname="{{name}}" title="Augmenter">
<i class="fas fa-arrow-alt-circle-up"></i>
</a>
@ -18,19 +18,19 @@
<span class="competence-xp tooltip">
<input class="competence-xp " type="text" compname="{{name}}" name="comp-xp-{{name}}"
value="{{numberFormat data.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 {{data.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>
{{#if (eq data.categorie 'draconic')}}
{{#if (eq system.categorie 'draconic')}}
<input class="competence-xp-sort" type="text" compname="{{name}}" name="comp-xp-sort-{{name}}"
value="{{numberFormat data.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}}/>
{{/if}}
{{#if @root.options.vueDetaillee}}
<div class="item-controls">
{{#if data.stressXpMax}}
{{#if system.stressXpMax}}
<a class="item-control competence-stress-augmenter" compname="{{name}}"
title="Dépenser {{data.stressXpMax}} points de stress {{#if data.isStressLevelUp}} pour augmenter d'un niveau {{/if}}">
<i class="fas fa-arrow-alt-circle-up allouer-stress{{#if data.isStressLevelUp}}-level-up{{/if}}"></i>
@ -39,7 +39,7 @@
<i class="far fa-circle"></i>
{{/if}}
<input class="competence-archetype niveau-archetype" type="text" compname="{{name}}" name="comp-archetype-{{name}}"
value="{{numberFormat data.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-control item-edit" title="Modifier"><i class="fas fa-edit"></i></a>
{{#if @root.options.isGM}}

View File

@ -286,7 +286,7 @@
</li>
{{#each combat as |arme key|}}
<li class="item flexrow list-item" data-item-id="{{arme._id}}"
data-arme-name="{{arme.name}}" data-competence-name="{{arme.data.competence}}" >
data-arme-name="{{arme.name}}" data-competence-name="{{arme.system.competence}}" >
<span class="arme-label">
<a>
{{#if arme.img}}
@ -295,10 +295,10 @@
<span>{{arme.name}}</span>
</a>
</span>
<span class="arme-initiative"><a>{{arme.data.initiative}}</a></span>
<span class="competence-label">{{arme.data.competence}}</span>
<span class="competence-value">{{numberFormat arme.data.niveau decimals=0 sign=true}}</span>
<span class="competence-value">{{numberFormat arme.data.dommagesReels decimals=0 sign=true}}</span>
<span class="arme-initiative"><a>{{arme.system.initiative}}</a></span>
<span class="competence-label">{{arme.system.competence}}</span>
<span class="competence-value">{{numberFormat arme.system.niveau decimals=0 sign=true}}</span>
<span class="competence-value">{{numberFormat arme.system.dommagesReels decimals=0 sign=true}}</span>
</li>
{{/each}}
{{#each esquives as |esq key|}}
@ -312,7 +312,7 @@
</span>
<span class="arme-initiative"></span>
<span class="competence-label"></span>
<span class="competence-value">{{numberFormat esq.data.niveau decimals=0 sign=true}}</span>
<span class="competence-value">{{numberFormat esq.system.niveau decimals=0 sign=true}}</span>
<span class="competence-value"></span>
</li>
{{/each}}
@ -334,7 +334,7 @@
{{#each maladiesPoisons as |maladie key|}}
<li class="item flexrow list-item" data-item-id="{{maladie._id}}">
<span class="competence-label">
{{#if (or @root.options.isGM maladie.data.identifie)}}
{{#if (or @root.options.isGM maladie.system.identifie)}}
{{maladie.name}}
{{else}}
Inconnue
@ -342,8 +342,8 @@
</span>
<span class="competence-label">{{maladie.type}}</span>
<span class="competence-label">
{{#if (or @root.options.isGM maladie.data.remedesconnus)}}
{{maladie.data.remedes}}
{{#if (or @root.options.isGM maladie.system.remedesconnus)}}
{{maladie.system.remedes}}
{{else}}
Remèdes Inconnus
{{/if}}
@ -368,7 +368,7 @@
<span class="competence-label">
{{possession.name}}
</span>
<span class="competence-label">{{possession.data.type}}</span>
<span class="competence-label">{{possession.system.type}}</span>
<div class="item-controls">
<a class="item-control item-edit" title="Modifier"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
@ -385,9 +385,9 @@
<ul class="item-list alterne-list">
{{#each taches as |tache id|}}
<li class="item flexrow list-item" data-item-id="{{tache._id}}"><span class="competence-title tache-label"><a>{{tache.name}}
({{tache.data.points_de_tache_courant}}{{#if
(or @root.options.isGM (not tache.data.cacher_points_de_tache))
}}/{{tache.data.points_de_tache}}{{/if}})</a></span>
({{tache.system.points_de_tache_courant}}{{#if
(or @root.options.isGM (not tache.system.cacher_points_de_tache))
}}/{{tache.system.points_de_tache}}{{/if}})</a></span>
<div class="item-controls flex-shrink">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
@ -417,7 +417,7 @@
<h3>Jeux :</h3>
<ul class="item-list alterne-list">
{{#each jeux as |jeu id|}}
<li class="item flexrow list-item" data-item-id="{{jeu._id}}"><span class="competence-title jeu-label"><a>{{jeu.name}} (base {{jeu.data.base}})</a></span>
<li class="item flexrow list-item" data-item-id="{{jeu._id}}"><span class="competence-title jeu-label"><a>{{jeu.name}} (base {{jeu.system.base}})</a></span>
<div class="item-controls flex-shrink">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
@ -516,7 +516,7 @@
{{#each signesdraconiques as |signe key|}}
<li class="item list-item flexrow" data-item-id="{{signe._id}}" data-attribute="{{key}}">
<span class="display-label flex-grow"> <a data-item-id="{{signe._id}}">{{signe.name}}</a></span>
<span class="flex-shrink">{{signe.data.difficulte}}</span>
<span class="flex-shrink">{{signe.system.difficulte}}</span>
<div class="item-controls flex-shrink">
<a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
</div>
@ -529,7 +529,7 @@
{{#each sorts as |sort key|}}
<li class="item list-item flexrow" data-item-id="{{sort._id}}" data-attribute="{{key}}">
<span class="display-label flex-grow"> <a data-item-id="{{sort._id}}">{{sort.name}}</a></span>
<span>{{sort.data.draconic}} / {{sort.data.difficulte}}</span>
<span>{{sort.system.draconic}} / {{sort.system.difficulte}}</span>
<div class="item-controls flex-shrink">
<a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
</div>
@ -557,7 +557,7 @@
<ul class="item-list">
{{#each meditations as |meditation key|}}
<li class="item flexrow" data-item-id="{{meditation._id}}" data-attribute="{{key}}">
<span class="meditation-label flex-grow"><a data-item-id="{{meditation._id}}">{{meditation.name}} - {{meditation.data.competence}}</a></span>
<span class="meditation-label flex-grow"><a data-item-id="{{meditation._id}}">{{meditation.name}} - {{meditation.system.competence}}</a></span>
<div class="item-controls flex-shrink">
<a class="item-control item-edit" title="Editer"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>