Fix: aucune méditation connue
Cas de haut-rêvant ne connaissant pas de méditations
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
- affichage des ajustements dans la fenêtre d'attaque avec arme à distance
|
- affichage des ajustements dans la fenêtre d'attaque avec arme à distance
|
||||||
- gestion des défenses contre les armes à distance
|
- gestion des défenses contre les armes à distance
|
||||||
- défense contre possession
|
- défense contre possession
|
||||||
|
- correction du mode "méditation" quand le haut-rêvant ne connait pas de méditation
|
||||||
- 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)
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { CARACS } from "../rdd-carac.js"
|
|||||||
import { RdDTimestamp } from "../time/rdd-timestamp.js"
|
import { RdDTimestamp } from "../time/rdd-timestamp.js"
|
||||||
import { TMRUtility } from "../tmr-utility.js"
|
import { TMRUtility } from "../tmr-utility.js"
|
||||||
import { ROLL_TYPE_MEDITATION } from "./roll-constants.mjs"
|
import { ROLL_TYPE_MEDITATION } from "./roll-constants.mjs"
|
||||||
import { PART_CARAC, RollPartCarac } from "./roll-part-carac.mjs"
|
import { PART_CARAC } from "./roll-part-carac.mjs"
|
||||||
import { PART_COMP } from "./roll-part-comp.mjs"
|
import { PART_COMP } from "./roll-part-comp.mjs"
|
||||||
import { RollPartSelect } from "./roll-part-select.mjs"
|
import { RollPartSelect } from "./roll-part-select.mjs"
|
||||||
import { ROLLDIALOG_SECTION, RollPart } from "./roll-part.mjs"
|
import { ROLLDIALOG_SECTION, RollPart } from "./roll-part.mjs"
|
||||||
@@ -70,7 +70,7 @@ export class RollPartMeditation extends RollPartSelect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getMalusEchecs(rollData) {
|
getMalusEchecs(rollData) {
|
||||||
return this.getCurrent(rollData).meditation.system.malus
|
return this.getCurrent(rollData).meditation?.system.malus ?? 0
|
||||||
}
|
}
|
||||||
|
|
||||||
getAjustements(rollData) {
|
getAjustements(rollData) {
|
||||||
@@ -90,16 +90,18 @@ export class RollPartMeditation extends RollPartSelect {
|
|||||||
|
|
||||||
$selectConditionMeditation(rollData) {
|
$selectConditionMeditation(rollData) {
|
||||||
const current = this.getCurrent(rollData)
|
const current = this.getCurrent(rollData)
|
||||||
current.heureMonde = RdDTimestamp.getWorldTime().heure
|
if (current.meditation){
|
||||||
current.heureMeditation = RdDTimestamp.findHeure(current.meditation.system.heure)?.heure
|
current.heureMonde = RdDTimestamp.getWorldTime().heure
|
||||||
current.isHeure = current.heureMeditation == current.heureMonde
|
current.heureMeditation = RdDTimestamp.findHeure(current.meditation.system.heure)?.heure
|
||||||
current.isTMR = Grammar.equalsInsensitive(current.meditation.system.tmr, TMRUtility.getTMRType(rollData.active.actor.system.reve.tmrpos.coord))
|
current.isHeure = current.heureMeditation == current.heureMonde
|
||||||
|
current.isTMR = Grammar.equalsInsensitive(current.meditation.system.tmr, TMRUtility.getTMRType(rollData.active.actor.system.reve.tmrpos.coord))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async _onRender(rollDialog, context, options) {
|
async _onRender(rollDialog, context, options) {
|
||||||
|
|
||||||
const selectMeditation = rollDialog.element.querySelector(`roll-section[name="${this.code}"] select[name="select-meditation"]`)
|
const selectMeditation = rollDialog.element.querySelector(`roll-section[name="${this.code}"] select[name="select-meditation"]`)
|
||||||
selectMeditation.addEventListener("change", e => {
|
selectMeditation?.addEventListener("change", e => {
|
||||||
const selectOptions = e.currentTarget.options
|
const selectOptions = e.currentTarget.options
|
||||||
const index = selectOptions.selectedIndex
|
const index = selectOptions.selectedIndex
|
||||||
this.$selectMeditation(rollDialog.rollData, selectOptions[index]?.value)
|
this.$selectMeditation(rollDialog.rollData, selectOptions[index]?.value)
|
||||||
@@ -111,7 +113,7 @@ export class RollPartMeditation extends RollPartSelect {
|
|||||||
|
|
||||||
setupListenerCondition(rollDialog, inputName) {
|
setupListenerCondition(rollDialog, inputName) {
|
||||||
const checkbox = rollDialog.element.querySelector(`roll-section[name="${this.code}"] input[name="${inputName}"]`)
|
const checkbox = rollDialog.element.querySelector(`roll-section[name="${this.code}"] input[name="${inputName}"]`)
|
||||||
checkbox.addEventListener("change", e => {
|
checkbox?.addEventListener("change", e => {
|
||||||
const current = this.getCurrent(rollDialog.rollData)
|
const current = this.getCurrent(rollDialog.rollData)
|
||||||
current[inputName] = e.currentTarget.checked
|
current[inputName] = e.currentTarget.checked
|
||||||
rollDialog.render()
|
rollDialog.render()
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export class RollTypeMeditation extends RollType {
|
|||||||
visible(rollData) { return rollData.active.actor.isHautRevant() }
|
visible(rollData) { return rollData.active.actor.isHautRevant() }
|
||||||
title(rollData) {
|
title(rollData) {
|
||||||
const current = rollData.current[PART_MEDITATION]
|
const current = rollData.current[PART_MEDITATION]
|
||||||
const theme = current?.meditation.system.theme
|
const theme = current?.meditation?.system.theme
|
||||||
return theme ? 'médite sur ' + theme : 'médite'
|
return theme ? 'médite sur ' + theme : 'médite'
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ export class RollTypeMeditation extends RollType {
|
|||||||
|
|
||||||
static async $onRollMeditation(rollData) {
|
static async $onRollMeditation(rollData) {
|
||||||
const actor = rollData.active.actor
|
const actor = rollData.active.actor
|
||||||
const meditation = rollData.current.meditation.meditation
|
const meditation = rollData.current.meditation?.meditation
|
||||||
const rolled = rollData.rolled
|
const rolled = rollData.rolled
|
||||||
if (meditation && rolled) {
|
if (meditation && rolled) {
|
||||||
if (rolled.isSuccess) {
|
if (rolled.isSuccess) {
|
||||||
|
|||||||
@@ -173,10 +173,10 @@ export class RdDTimestamp {
|
|||||||
}
|
}
|
||||||
filtered = DEFINITION_HEURES.filter(it => Grammar.toLowerCaseNoAccentNoSpace(it.label).includes(heure));
|
filtered = DEFINITION_HEURES.filter(it => Grammar.toLowerCaseNoAccentNoSpace(it.label).includes(heure));
|
||||||
if (filtered.length > 0) {
|
if (filtered.length > 0) {
|
||||||
filtered.sort(Misc.ascending(h => h.label.length));
|
filtered.sort(Misc.ascending(h => h.label.length))
|
||||||
return filtered[0]
|
return filtered[0]
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
<img src="{{current.meditation.img}}" data-tooltip="{{current.meditation.name}}" />
|
<img src="{{current.meditation.img}}" data-tooltip="{{current.meditation.name}}" />
|
||||||
</roll-part-img>
|
</roll-part-img>
|
||||||
<roll-part-detail>
|
<roll-part-detail>
|
||||||
|
{{#if refs.meditations}}
|
||||||
<subline>
|
<subline>
|
||||||
Rêve actuel: {{rollData.active.actor.system.reve.reve.value}}
|
Rêve actuel: {{rollData.active.actor.system.reve.reve.value}}
|
||||||
</subline>
|
</subline>
|
||||||
@@ -71,4 +72,9 @@
|
|||||||
<span name="veture">{{current.meditation.system.veture}}</span>
|
<span name="veture">{{current.meditation.system.veture}}</span>
|
||||||
</label>
|
</label>
|
||||||
</subline>
|
</subline>
|
||||||
|
{{else}}
|
||||||
|
<subline>
|
||||||
|
<p>Le haut-rêvant ne connait aucune méditation</p>
|
||||||
|
</subline>
|
||||||
|
{{/if}}
|
||||||
</roll-part-detail>
|
</roll-part-detail>
|
||||||
|
|||||||
Reference in New Issue
Block a user