creation des spec depuis skill

This commit is contained in:
rwanoux
2024-05-14 09:58:08 +02:00
parent ff03badcdd
commit a62b067f3d
3 changed files with 39 additions and 9 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
### fiche de perso ### fiche de perso
-[ ] création de spécialitées depuis le (+) des compétences -[X] création de spécialitées depuis le (+) des compétences
-[ ] fixer les cases hexas , comprtement chelou , piste = un click à l'air d'envoyer 2 update, verifier le onChange -[ ] fixer les cases hexas , comprtement chelou , piste = un click à l'air d'envoyer 2 update, verifier le onChange
-[ ] dialog d'edition des min-max -[ ] dialog d'edition des min-max
+25 -4
View File
@@ -109,17 +109,26 @@ export class VermineCharacterSheet extends VermineActorSheet {
/** @override */ /** @override */
activateListeners(html) { activateListeners(html) {
super.activateListeners(html); super.activateListeners(html);
// Choose Totem //desactiver les inputs si mode jeu
html.find('.chooseTotem').click(this._onTotemButton.bind(this));
html.find('.ability .rollable').click(this._onRoll.bind(this));
html.find('[data-totem-name]').click(this._onClickTotemDice.bind(this));
if (!this.actor.flags.world?.editMode) { if (!this.actor.flags.world?.editMode) {
this.disableInputs(html) this.disableInputs(html)
} }
// Choose Totem
html.find('.chooseTotem').click(this._onTotemButton.bind(this));
//activer lest jets
html.find('.ability .rollable').click(this._onRoll.bind(this));
//gérer les dés totems
html.find('[data-totem-name]').click(this._onClickTotemDice.bind(this));
//creation de specialités
html.find('i.add-specialty').click(this.addSpecialty.bind(this))
} }
//mode jeu/edit en mode jeu on bloque les selects et input
disableInputs(html) { disableInputs(html) {
for (let input of html.find('input')) { for (let input of html.find('input')) {
//préserver le toggle mode jeu/ mode edit
if (input.name != "flags.world.editMode") { if (input.name != "flags.world.editMode") {
input.setAttribute('disabled', true) input.setAttribute('disabled', true)
} }
@@ -129,6 +138,18 @@ export class VermineCharacterSheet extends VermineActorSheet {
select.setAttribute('disabled', true) select.setAttribute('disabled', true)
} }
} }
async addSpecialty(ev) {
let skillName = ev.target.closest('.ability').querySelector('label').dataset.label;
let itemData = {
name: `spécialité, ${skillName}`,
type: 'specialty',
system: {
skill: skillName
}
}
let spec = await this.actor.createEmbeddedDocuments("Item", [itemData]);
spec[0].sheet.render(true)
}
async _onClickTotemDice(ev) { async _onClickTotemDice(ev) {
let el = ev.currentTarget; let el = ev.currentTarget;
let totem = el.dataset.totemName; let totem = el.dataset.totemName;
+13 -4
View File
@@ -102,8 +102,10 @@
{{#iflteq @minorwoundmax @root.system.minorWound.value }} {{#iflteq @minorwoundmax @root.system.minorWound.value }}
checked checked
{{/iflteq}} {{/iflteq}}
"
" /> {{#iflteq @minorwoundmax @root.system.minorWound.value }}
checked="true"
{{/iflteq}} />
</div> </div>
{{/repeat}} {{/repeat}}
</div> </div>
@@ -124,7 +126,11 @@
checked checked
{{/iflteq}} {{/iflteq}}
" /> "
{{#iflteq @minorwoundmax @root.system.majorWound.value }}
checked="true"
{{/iflteq}} />
</div> </div>
{{/repeat}} {{/repeat}}
@@ -146,7 +152,10 @@
checked checked
{{/iflteq}} {{/iflteq}}
" /> "
{{#iflteq @minorwoundmax @root.system.deadlyWound.value }}
checked="true"
{{/iflteq}} />
</div> </div>
{{/repeat}} {{/repeat}}