Compare commits
No commits in common. "d4fddf86001b338b01f2b1a3903f056078d5b7b1" and "3359492f13bf8ebe999ec9b9c3107a43c0fa9b56" have entirely different histories.
d4fddf8600
...
3359492f13
@ -37,7 +37,8 @@ export class RdDActorSheet extends ActorSheet {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async getData() {
|
async getData() {
|
||||||
const objectData = Misc.data(this.object);
|
const objectData = Misc.data(this.object);
|
||||||
this.timerRecherche = undefined;
|
|
||||||
|
//this.actor.checkMonnaiePresence(this.actor.data.items); // Always check
|
||||||
|
|
||||||
let formData = {
|
let formData = {
|
||||||
title: this.title,
|
title: this.title,
|
||||||
@ -77,8 +78,8 @@ export class RdDActorSheet extends ActorSheet {
|
|||||||
};
|
};
|
||||||
|
|
||||||
formData.competences.forEach(item => {
|
formData.competences.forEach(item => {
|
||||||
item.visible = this.options.recherche
|
item.visible = this.options.cherchercompetence
|
||||||
? RdDItemCompetence.nomContientTexte(item, this.options.recherche.text)
|
? RdDItemCompetence.nomContientTexte(item, this.options.cherchercompetence)
|
||||||
: (!this.options.showCompNiveauBase || !RdDItemCompetence.isNiveauBase(item));
|
: (!this.options.showCompNiveauBase || !RdDItemCompetence.isNiveauBase(item));
|
||||||
RdDItemCompetence.levelUp(item, formData.data.compteurs.experience.value);
|
RdDItemCompetence.levelUp(item, formData.data.compteurs.experience.value);
|
||||||
});
|
});
|
||||||
@ -423,28 +424,12 @@ export class RdDActorSheet extends ActorSheet {
|
|||||||
this.options.editCaracComp = !this.options.editCaracComp;
|
this.options.editCaracComp = !this.options.editCaracComp;
|
||||||
this.render(true);
|
this.render(true);
|
||||||
});
|
});
|
||||||
|
html.find('.cherchercompetence').change(async event => {
|
||||||
html.find('.recherche')
|
this.options.cherchercompetence = event.currentTarget.value;
|
||||||
.each((index, field) => {
|
this.render(true);
|
||||||
if (this.options.recherche) {
|
});
|
||||||
field.focus();
|
|
||||||
field.setSelectionRange(this.options.recherche.start, this.options.recherche.end);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.keyup(async event => {
|
|
||||||
this.options.recherche = this._optionRecherche(event.currentTarget)
|
|
||||||
if (this.timerRecherche) {
|
|
||||||
clearTimeout(this.timerRecherche);
|
|
||||||
}
|
|
||||||
this.timerRecherche = setTimeout(() => {
|
|
||||||
this.timerRecherche = undefined;
|
|
||||||
this.render(true);
|
|
||||||
}, 500);
|
|
||||||
})
|
|
||||||
.change(async event =>
|
|
||||||
this.options.recherche = this._optionRecherche(event.currentTarget)
|
|
||||||
);
|
|
||||||
html.find('.vue-detaillee').click(async event => {
|
html.find('.vue-detaillee').click(async event => {
|
||||||
|
console.log("CONTROLS", this.options.vueDetaillee)
|
||||||
this.options.vueDetaillee = !this.options.vueDetaillee;
|
this.options.vueDetaillee = !this.options.vueDetaillee;
|
||||||
this.render(true);
|
this.render(true);
|
||||||
});
|
});
|
||||||
@ -530,17 +515,6 @@ export class RdDActorSheet extends ActorSheet {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_optionRecherche(target) {
|
|
||||||
if (!target.value?.length){
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
text: target.value,
|
|
||||||
start: target.selectionStart,
|
|
||||||
end: target.selectionEnd,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
_getEventArmeCombat(event) {
|
_getEventArmeCombat(event) {
|
||||||
const li = $(event.currentTarget)?.parents(".item");
|
const li = $(event.currentTarget)?.parents(".item");
|
||||||
let armeName = li.data("arme-name");
|
let armeName = li.data("arme-name");
|
||||||
|
@ -465,32 +465,34 @@ export class RdDUtility {
|
|||||||
/** Construit la structure récursive des conteneurs, avec imbrication potentielle
|
/** Construit la structure récursive des conteneurs, avec imbrication potentielle
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static buildConteneur(objet, profondeur) {
|
static buildConteneur(objet, niveau) {
|
||||||
if (!profondeur) profondeur = 1;
|
if (!niveau) niveau = 1;
|
||||||
objet.niveau = profondeur;
|
objet.niveau = niveau;
|
||||||
const isConteneur = objet.type == 'conteneur';
|
//console.log("OBJ:", objet);
|
||||||
const isOuvert = isConteneur && this.getAfficheContenu(objet._id);
|
let str = Handlebars.partials['systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-conteneur.html']({ item: objet });
|
||||||
const isVide = isConteneur && Misc.templateData(objet).contenu.length == 0;
|
if (objet.type == 'conteneur') {
|
||||||
const conteneur = Handlebars.partials['systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-conteneur.html']({
|
const afficherContenu = this.getAfficheContenu(objet._id);
|
||||||
item: objet,
|
str = str + RdDUtility.buildContenu(objet, niveau, afficherContenu);
|
||||||
vide: isVide,
|
}
|
||||||
ouvert: isOuvert
|
return str;
|
||||||
});
|
|
||||||
const contenu = isConteneur ? RdDUtility.buildContenu(objet, profondeur, isOuvert) : '';
|
|
||||||
return conteneur + contenu;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static buildContenu(objet, profondeur, afficherContenu) {
|
static buildContenu(objet, niveau, afficherContenu) {
|
||||||
if (!profondeur) profondeur = 1;
|
if (!niveau) niveau = 1;
|
||||||
objet.niveau = profondeur;
|
objet.niveau = niveau;
|
||||||
const display = afficherContenu ? 'item-display-show' : 'item-display-hide';
|
let strContenu = "";
|
||||||
//console.log("ITEM DISPLAYED", objet );
|
//console.log("ITEM DISPLAYED", objet );
|
||||||
let strContenu = `<ul class='item-list alterne-list ${display} list-item-margin${profondeur}'>`;
|
if (afficherContenu) {
|
||||||
for (let subItem of objet.subItems) {
|
strContenu = "<ul class='item-list alterne-list item-display-show list-item-margin" + niveau + "'>";
|
||||||
strContenu += this.buildConteneur(subItem, profondeur + 1);
|
} else {
|
||||||
|
strContenu = "<ul class='item-list alterne-list item-display-hide list-item-margin" + niveau + "'>";
|
||||||
}
|
}
|
||||||
return strContenu + "</ul>";
|
for (let subItem of objet.subItems) {
|
||||||
|
strContenu = strContenu + this.buildConteneur(subItem, niveau + 1);
|
||||||
|
}
|
||||||
|
strContenu = strContenu + "</ul>";
|
||||||
|
return strContenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
@ -806,23 +806,17 @@ ul, li {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.list-item-margin1 {
|
.list-item-margin1 {
|
||||||
margin-left: 0.5rem;
|
|
||||||
}
|
|
||||||
.list-item-margin2 {
|
|
||||||
margin-left: 1rem;
|
margin-left: 1rem;
|
||||||
}
|
}
|
||||||
.list-item-margin3 {
|
.list-item-margin2 {
|
||||||
margin-left: 1.5rem;
|
|
||||||
}
|
|
||||||
.list-item-margin4 {
|
|
||||||
margin-left: 2rem;
|
margin-left: 2rem;
|
||||||
}
|
}
|
||||||
.list-item-margin5 {
|
.list-item-margin3 {
|
||||||
margin-left: 2.5rem;
|
|
||||||
}
|
|
||||||
.list-item-margin6 {
|
|
||||||
margin-left: 3rem;
|
margin-left: 3rem;
|
||||||
}
|
}
|
||||||
|
.list-item-margin4 {
|
||||||
|
margin-left: 4rem;
|
||||||
|
}
|
||||||
|
|
||||||
.sheet-competence-img {
|
.sheet-competence-img {
|
||||||
width: 24px;
|
width: 24px;
|
||||||
|
@ -1,28 +1,9 @@
|
|||||||
<li class="item flexrow list-item" data-item-id="{{item._id}}" draggable="true">
|
<li class="item flexrow list-item" data-item-id="{{item._id}}" draggable="true">
|
||||||
{{#if (eq item.type 'conteneur')}}
|
|
||||||
<span class="sheet-competence-img conteneur-name">
|
|
||||||
{{#if vide}}
|
|
||||||
<i class="far fa-square"></i>
|
|
||||||
{{else}}
|
|
||||||
<a data-item-id="{{item._id}}">
|
|
||||||
{{#if ouvert}}
|
|
||||||
<i class="far fa-minus-square"></i>
|
|
||||||
<!-- <i class="far fa-caret-square-down"></i> -->
|
|
||||||
{{else}}
|
|
||||||
<i class="far fa-plus-square"></i>
|
|
||||||
<!-- <i class="fas fa-caret-square-right"></i> -->
|
|
||||||
{{/if}}
|
|
||||||
</a>
|
|
||||||
{{/if}}
|
|
||||||
</span>
|
|
||||||
<span class="item-name conteneur-name flex-grow">
|
|
||||||
<a data-item-id="{{item._id}}">
|
|
||||||
<img class="sheet-competence-img" src="{{item.img}}" title="{{item.name}}"/>
|
|
||||||
{{item.name}}
|
|
||||||
</a>
|
|
||||||
</span>
|
|
||||||
{{else}}
|
|
||||||
<img class="sheet-competence-img" src="{{item.img}}" title="{{item.name}}"/>
|
<img class="sheet-competence-img" src="{{item.img}}" title="{{item.name}}"/>
|
||||||
|
|
||||||
|
{{#if (eq item.type 'conteneur')}}
|
||||||
|
<span class="item-name conteneur-name flex-grow"><a data-item-id="{{item._id}}">+{{item.name}}</a></span>
|
||||||
|
{{else}}
|
||||||
<span class="item-name flex-grow">{{item.name}}</span>
|
<span class="item-name flex-grow">{{item.name}}</span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<span class="item-quantite">{{item.data.quantite}}
|
<span class="item-quantite">{{item.data.quantite}}
|
||||||
@ -49,4 +30,3 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@
|
|||||||
{{#if options.editCaracComp}}Verrouiller{{else}}Déverrouiller{{/if}}</a></span>
|
{{#if options.editCaracComp}}Verrouiller{{else}}Déverrouiller{{/if}}</a></span>
|
||||||
<span class="flexrow">
|
<span class="flexrow">
|
||||||
<i class="fas fa-search"></i>
|
<i class="fas fa-search"></i>
|
||||||
<input class="recherche" type="text" value="{{options.recherche.text}}" name="recherche"
|
<input class="cherchercompetence" type="text" value="{{options.cherchercompetence}}" name="cherchercompetence"
|
||||||
size="8" data-dtype="String" placeholder="chercher"/>
|
size="8" data-dtype="String" placeholder="chercher"/>
|
||||||
<span></span>
|
<span></span>
|
||||||
</span>
|
</span>
|
||||||
@ -690,7 +690,7 @@
|
|||||||
{{#each objets as |item id|}}
|
{{#each objets as |item id|}}
|
||||||
{{#unless item.estContenu}}
|
{{#unless item.estContenu}}
|
||||||
{{#if (ne item.type 'conteneur')}}
|
{{#if (ne item.type 'conteneur')}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-conteneur.html" item=item vide=true ouvert=true }}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-conteneur.html" item=item }}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
Loading…
Reference in New Issue
Block a user