Fix: aucune oeuvre connu

La fenêtre de jet se comporte correctement si le personnage
ne connait pas d'oeuvre
This commit is contained in:
2025-12-13 01:09:00 +01:00
parent 97cb730ab5
commit d6a492eef2
4 changed files with 20 additions and 10 deletions
+1
View File
@@ -15,6 +15,7 @@
- défense contre possession - défense contre possession
- correction du mode "méditation" quand le haut-rêvant ne connait pas de méditation - correction du mode "méditation" quand le haut-rêvant ne connait pas de méditation
- correction du mode "jeu" quand le personnage ne connait pas de jeux - correction du mode "jeu" quand le personnage ne connait pas de jeux
- correction du mode "oeuvre" quand le personnage ne connait pas d'oeuvres
- Corrections liées à Foundry v12/v13 - Corrections liées à Foundry v12/v13
- Fix ajout de notes dans le journal par un joueur (/chrono, ou clic sur le libelé de l'heure dans l'horloge) - Fix ajout de notes dans le journal par un joueur (/chrono, ou clic sur le libelé de l'heure dans l'horloge)
+1 -1
View File
@@ -76,7 +76,7 @@ export class RollPartOeuvre extends RollPartSelect {
async _onRender(rollDialog, context, options) { async _onRender(rollDialog, context, options) {
const selectOeuvre = rollDialog.element.querySelector(`roll-section[name="${this.code}"] select[name="select-oeuvre"]`) const selectOeuvre = rollDialog.element.querySelector(`roll-section[name="${this.code}"] select[name="select-oeuvre"]`)
selectOeuvre.addEventListener("change", e => { selectOeuvre?.addEventListener("change", e => {
const selectOptions = e.currentTarget.options const selectOptions = e.currentTarget.options
const index = selectOptions.selectedIndex const index = selectOptions.selectedIndex
this.$selectOeuvre(rollDialog.rollData, selectOptions[index]?.value) this.$selectOeuvre(rollDialog.rollData, selectOptions[index]?.value)
+4 -1
View File
@@ -10,7 +10,10 @@ export class RollTypeOeuvre extends RollType {
visible(rollData) { return rollData.active.actor.isPersonnage() } visible(rollData) { return rollData.active.actor.isPersonnage() }
title(rollData) { title(rollData) {
const current = rollData.current[PART_OEUVRE] const current = rollData.current[PART_OEUVRE]
return `${current.art.action} ${current.label}` if (current.art) {
return `${current.art.action} ${current.label}`
}
return 'interprête une oeuvre'
} }
onSelect(rollData) { onSelect(rollData) {
+14 -8
View File
@@ -2,15 +2,21 @@
<img src="{{current.oeuvre.img}}" data-tooltip="{{current.oeuvre.name}}" /> <img src="{{current.oeuvre.img}}" data-tooltip="{{current.oeuvre.name}}" />
</roll-part-img> </roll-part-img>
<roll-part-detail> <roll-part-detail>
<subline> {{#if refs.oeuvres}}
<select name="select-oeuvre" {{#if rollData.type.retry}}disabled{{/if}}> <subline>
{{selectOptions refs.oeuvres selected=current.key valueAttr="key" labelAttr="label"}} <select name="select-oeuvre" {{#if rollData.type.retry}}disabled{{/if}}>
</select> {{selectOptions refs.oeuvres selected=current.key valueAttr="key" labelAttr="label"}}
</select>
{{#if current.oeuvre}}
<selected-numeric-value>{{plusMoins current.value}}</selected-numeric-value>
{{/if}}
</subline>
{{#if current.oeuvre}} {{#if current.oeuvre}}
<selected-numeric-value>{{plusMoins current.value}}</selected-numeric-value> {{> (concat 'roll-oeuvre-' current.oeuvre.type)}}
{{/if}} {{/if}}
</subline> {{else}}
{{#if current.oeuvre}} <subline>
{{> (concat 'roll-oeuvre-' current.oeuvre.type)}} <p>Le personnage ne connait aucune &oelig;uvre à interpréter</p>
</subline>
{{/if}} {{/if}}
</roll-part-detail> </roll-part-detail>