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:
@@ -76,7 +76,7 @@ export class RollPartOeuvre extends RollPartSelect {
|
||||
async _onRender(rollDialog, context, options) {
|
||||
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 index = selectOptions.selectedIndex
|
||||
this.$selectOeuvre(rollDialog.rollData, selectOptions[index]?.value)
|
||||
|
||||
@@ -10,7 +10,10 @@ export class RollTypeOeuvre extends RollType {
|
||||
visible(rollData) { return rollData.active.actor.isPersonnage() }
|
||||
title(rollData) {
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user