FIx v13/v14
Some checks failed
Release Creation / build (release) Failing after 1m17s

This commit is contained in:
2026-04-14 00:56:25 +02:00
parent 8bfbdedf43
commit 63c0153860
24 changed files with 103 additions and 98 deletions

View File

@@ -383,7 +383,7 @@ export class CelestopolRoll extends Roll {
puiserRessources: effectivePuiser,
nbDice: (!isResistance && useFortune) ? 1 : nbDice,
formula,
rollMode: rollContext.visibility ?? "publicroll",
rollMode: rollContext.visibility ?? "public",
rollMoonDie: effectiveMoon,
moonDieResult,
moonFace,
@@ -634,11 +634,20 @@ export class CelestopolRoll extends Roll {
/** @override */
async toMessage(messageData = {}, { messageMode, rollMode, create = true } = {}) {
if (rollMode) {
messageMode = Roll._mapLegacyRollMode(rollMode)
const modernToLegacyRollMode = {
public: CONST.DICE_ROLL_MODES.PUBLIC,
gm: CONST.DICE_ROLL_MODES.PRIVATE,
blind: CONST.DICE_ROLL_MODES.BLIND,
self: CONST.DICE_ROLL_MODES.SELF,
ic: CONST.DICE_ROLL_MODES.PUBLIC,
}
messageMode ||= game.settings.get("core", "messageMode")
if (!this._evaluated) await this.evaluate({ allowInteractive: messageMode !== "blind" })
let effectiveRollMode = rollMode ?? messageMode ?? game.settings.get("core", "rollMode") ?? CONST.DICE_ROLL_MODES.PUBLIC
effectiveRollMode = modernToLegacyRollMode[effectiveRollMode] ?? effectiveRollMode
if (!Object.values(CONST.DICE_ROLL_MODES).includes(effectiveRollMode)) {
effectiveRollMode = game.settings.get("core", "rollMode") ?? CONST.DICE_ROLL_MODES.PUBLIC
}
if (!this._evaluated) await this.evaluate({ allowInteractive: effectiveRollMode !== CONST.DICE_ROLL_MODES.BLIND })
const skillLocalized = this.skillLabel ? game.i18n.localize(this.skillLabel) : ""
const statLocalized = this.options.statLabel
@@ -650,7 +659,7 @@ export class CelestopolRoll extends Roll {
actorUuid: this.options.actorUuid ?? null,
actorId: this.options.actorId ?? null,
})
const content = await this.render({ isPrivate: messageMode !== "public" })
const content = await this.render({ isPrivate: effectiveRollMode !== CONST.DICE_ROLL_MODES.PUBLIC })
const chatData = foundry.utils.mergeObject({
author: game.user.id,
content,
@@ -660,13 +669,9 @@ export class CelestopolRoll extends Roll {
speaker: speakerActor ? ChatMessage.getSpeaker({ actor: speakerActor }) : undefined,
style: CONST.CHAT_MESSAGE_STYLES.OTHER,
}, messageData)
const cls = foundry.utils.getDocumentClass("ChatMessage")
const msg = new cls(chatData)
msg.applyMode(messageMode)
if (create) return cls.create(msg)
return msg.toObject()
ChatMessage.applyRollMode(chatData, effectiveRollMode)
if (create) return ChatMessage.create(chatData)
return chatData
}
/**