#63 Jet d'éthylisme
This commit is contained in:
parent
374b360afb
commit
f4bb541bb7
@ -20,7 +20,8 @@ export class RdDActorSheet extends ActorSheet {
|
|||||||
//height: 720,
|
//height: 720,
|
||||||
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
|
editCaracComp: false,
|
||||||
|
cacherCompetencesNiveauBase: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,6 +29,14 @@ export class RdDActorSheet extends ActorSheet {
|
|||||||
getData() {
|
getData() {
|
||||||
let data = super.getData();
|
let data = super.getData();
|
||||||
|
|
||||||
|
// Gestion du lock/unlock des zones éditables (carac+compétences)
|
||||||
|
data.data.editCaracComp = this.options.editCaracComp;
|
||||||
|
data.data.lockUnlockText = (this.options.editCaracComp) ? "Bloquer" : "Débloquer";
|
||||||
|
// Gestion de l'affichage total/partiel des compétences
|
||||||
|
data.data.cacherCompetencesNiveauBase = this.options.cacherCompetencesNiveauBase;
|
||||||
|
data.data.showHideCompetenceText = (this.options.cacherCompetencesNiveauBase) ? "Cacher Comp." : "Montrer Comp." ;
|
||||||
|
|
||||||
|
let compCategorieNiveau = RdDUtility.getLevelCategory(); // recup catégorie
|
||||||
data.itemsByType = RdDUtility.buildItemsClassification(data.items);
|
data.itemsByType = RdDUtility.buildItemsClassification(data.items);
|
||||||
// Competence per category
|
// Competence per category
|
||||||
data.competenceByCategory = {};
|
data.competenceByCategory = {};
|
||||||
@ -41,7 +50,11 @@ export class RdDActorSheet extends ActorSheet {
|
|||||||
data.competenceByCategory[item.data.categorie] = list;
|
data.competenceByCategory[item.data.categorie] = list;
|
||||||
}
|
}
|
||||||
if (!RdDUtility.isTronc( item.name ) ) // Ignorer les compétences 'troncs' à ce stade
|
if (!RdDUtility.isTronc( item.name ) ) // Ignorer les compétences 'troncs' à ce stade
|
||||||
competenceXPTotal += RdDUtility.computeCompetenceXPCost(item)
|
competenceXPTotal += RdDUtility.computeCompetenceXPCost(item);
|
||||||
|
item.data.afficherCompetence = true;
|
||||||
|
if ( data.data.cacherCompetencesNiveauBase && (Number(item.data.niveau) == Number(compCategorieNiveau[item.data.categorie]) ) ) {
|
||||||
|
item.data.afficherCompetence = false;
|
||||||
|
}
|
||||||
list.push(item);
|
list.push(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -103,10 +116,6 @@ export class RdDActorSheet extends ActorSheet {
|
|||||||
data.ajustementsConditions = CONFIG.RDD.ajustementsConditions;
|
data.ajustementsConditions = CONFIG.RDD.ajustementsConditions;
|
||||||
data.difficultesLibres = CONFIG.RDD.difficultesLibres;
|
data.difficultesLibres = CONFIG.RDD.difficultesLibres;
|
||||||
|
|
||||||
// Gestion du lock/unlock des zones éditables (carac+compétences)
|
|
||||||
data.data.editCaracComp = this.options.editCaracComp;
|
|
||||||
data.data.lockUnlockText = (this.options.editCaracComp) ? "Bloquer" : "Débloquer";
|
|
||||||
|
|
||||||
// low is normal, this the base used to compute the grid.
|
// low is normal, this the base used to compute the grid.
|
||||||
data.data.fatigue = {
|
data.data.fatigue = {
|
||||||
malus: RdDUtility.calculMalusFatigue(data.data.sante.fatigue.value, data.data.sante.endurance.max),
|
malus: RdDUtility.calculMalusFatigue(data.data.sante.fatigue.value, data.data.sante.endurance.max),
|
||||||
@ -351,10 +360,14 @@ export class RdDActorSheet extends ActorSheet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Gestion du bouton lock/unlock
|
// Gestion du bouton lock/unlock
|
||||||
html.find('.lock-unlock-sheet a').click((event) => {
|
html.find('.lock-unlock-sheet').click((event) => {
|
||||||
this.options.editCaracComp = !this.options.editCaracComp;
|
this.options.editCaracComp = !this.options.editCaracComp;
|
||||||
this.render(true);
|
this.render(true);
|
||||||
});
|
});
|
||||||
|
html.find('.show-hide-competences').click((event) => {
|
||||||
|
this.options.cacherCompetencesNiveauBase = !this.options.cacherCompetencesNiveauBase;
|
||||||
|
this.render(true);
|
||||||
|
});
|
||||||
|
|
||||||
// On pts de reve change
|
// On pts de reve change
|
||||||
html.find('.pointsreve-value').change((event) => {
|
html.find('.pointsreve-value').change((event) => {
|
||||||
|
@ -52,8 +52,9 @@
|
|||||||
<a id="ptreve-actuel-plus">+</a>
|
<a id="ptreve-actuel-plus">+</a>
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
<li class="lock-unlock-sheet">
|
<li>
|
||||||
<label><a>{{data.lockUnlockText}}</a></label>
|
<label><a class="lock-unlock-sheet">{{data.lockUnlockText}}</a></label>
|
||||||
|
<label><a class="show-hide-competences">{{data.showHideCompetenceText}}</a></label>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="flex-group-center flex-actions-bar">
|
<div class="flex-group-center flex-actions-bar">
|
||||||
@ -168,6 +169,7 @@
|
|||||||
</header>
|
</header>
|
||||||
<ul class="item-list alterne-list">
|
<ul class="item-list alterne-list">
|
||||||
{{#each data.competenceByCategory.generale as |comp key|}}
|
{{#each data.competenceByCategory.generale as |comp key|}}
|
||||||
|
{{#if data.afficherCompetence}}
|
||||||
<li class="item flexrow list-item" 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>
|
||||||
@ -178,6 +180,7 @@
|
|||||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
{{/if}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@ -186,6 +189,7 @@
|
|||||||
</header>
|
</header>
|
||||||
<ul class="item-list alterne-list">
|
<ul class="item-list alterne-list">
|
||||||
{{#each data.competenceByCategory.particuliere as |comp key|}}
|
{{#each data.competenceByCategory.particuliere as |comp key|}}
|
||||||
|
{{#if data.afficherCompetence}}
|
||||||
<li class="item flexrow list-item" 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>
|
||||||
@ -196,6 +200,7 @@
|
|||||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
{{/if}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
<header class="competence-header flexrow">
|
<header class="competence-header flexrow">
|
||||||
@ -203,6 +208,7 @@
|
|||||||
</header>
|
</header>
|
||||||
<ul class="item-list alterne-list">
|
<ul class="item-list alterne-list">
|
||||||
{{#each data.competenceByCategory.specialisee as |comp key|}}
|
{{#each data.competenceByCategory.specialisee as |comp key|}}
|
||||||
|
{{#if data.afficherCompetence}}
|
||||||
<li class="item flexrow list-item" 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>
|
||||||
@ -213,7 +219,8 @@
|
|||||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/if}}
|
||||||
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -223,6 +230,7 @@
|
|||||||
</header>
|
</header>
|
||||||
<ul class="item-list alterne-list">
|
<ul class="item-list alterne-list">
|
||||||
{{#each data.competenceByCategory.melee as |comp key|}}
|
{{#each data.competenceByCategory.melee as |comp key|}}
|
||||||
|
{{#if data.afficherCompetence}}
|
||||||
<li class="item flexrow list-item" 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>
|
||||||
@ -233,7 +241,8 @@
|
|||||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/if}}
|
||||||
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<header class="competence-header flexrow">
|
<header class="competence-header flexrow">
|
||||||
@ -241,6 +250,7 @@
|
|||||||
</header>
|
</header>
|
||||||
<ul class="item-list alterne-list">
|
<ul class="item-list alterne-list">
|
||||||
{{#each data.competenceByCategory.tir as |comp key|}}
|
{{#each data.competenceByCategory.tir as |comp key|}}
|
||||||
|
{{#if data.afficherCompetence}}
|
||||||
<li class="item flexrow list-item" 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>
|
||||||
@ -251,6 +261,7 @@
|
|||||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
{{/if}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@ -259,6 +270,7 @@
|
|||||||
</header>
|
</header>
|
||||||
<ul class="item-list alterne-list">
|
<ul class="item-list alterne-list">
|
||||||
{{#each data.competenceByCategory.lancer as |comp key|}}
|
{{#each data.competenceByCategory.lancer as |comp key|}}
|
||||||
|
{{#if data.afficherCompetence}}
|
||||||
<li class="item flexrow list-item" 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>
|
||||||
@ -269,6 +281,7 @@
|
|||||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
{{/if}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@ -277,6 +290,7 @@
|
|||||||
</header>
|
</header>
|
||||||
<ul class="item-list alterne-list">
|
<ul class="item-list alterne-list">
|
||||||
{{#each data.competenceByCategory.connaissance as |comp key|}}
|
{{#each data.competenceByCategory.connaissance as |comp key|}}
|
||||||
|
{{#if data.afficherCompetence}}
|
||||||
<li class="item flexrow list-item" 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>
|
||||||
@ -287,6 +301,7 @@
|
|||||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
{{/if}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@ -295,16 +310,18 @@
|
|||||||
</header>
|
</header>
|
||||||
<ul class="item-list alterne-list">
|
<ul class="item-list alterne-list">
|
||||||
{{#each data.competenceByCategory.draconic as |comp key|}}
|
{{#each data.competenceByCategory.draconic as |comp key|}}
|
||||||
<li class="item flexrow list-item" data-item-id="{{comp._id}}">
|
{{#if data.afficherCompetence}}
|
||||||
<img class="sheet-competence-img" src="{{comp.img}}"/>
|
<li class="item flexrow list-item" data-item-id="{{comp._id}}">
|
||||||
<span class="competence-label" name="data.competenceByCategory.draconic[{{key}}].name"><a>{{comp.name}}</a></span>
|
<img class="sheet-competence-img" src="{{comp.img}}"/>
|
||||||
<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}}/>
|
<span class="competence-label" name="data.competenceByCategory.draconic[{{key}}].name"><a>{{comp.name}}</a></span>
|
||||||
<input class="competence-xp" type="text" name="data.competenceByCategory.draconic[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" 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}}/>
|
||||||
<div class="item-controls">
|
<input class="competence-xp" type="text" name="data.competenceByCategory.draconic[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/>
|
||||||
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
|
<div class="item-controls">
|
||||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
|
||||||
</div>
|
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||||
</li>
|
</div>
|
||||||
|
</li>
|
||||||
|
{{/if}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
<div>
|
<div>
|
||||||
|
Loading…
Reference in New Issue
Block a user