Foundry v13 migration

This commit is contained in:
2025-05-01 23:27:51 +02:00
parent 965fc02eb3
commit 6b22dade9c
32 changed files with 105 additions and 122 deletions

View File

@@ -36,7 +36,7 @@ export class EcrymeUtility {
/* -------------------------------------------- */
static async init() {
Hooks.on('renderChatLog', (log, html, data) => EcrymeUtility.chatListeners(html));
Hooks.on("getChatLogEntryContext", (html, options) => EcrymeUtility.chatMenuManager(html, options));
Hooks.on("getChatMessageContextOptions", (html, options) => EcrymeUtility.chatMenuManager(html, options));
this.rollDataStore = {}
this.defenderStore = {}
@@ -273,20 +273,17 @@ export class EcrymeUtility {
let canTranscendRoll = []
for (let i = 1; i <= 10; i++) {
canTranscendRoll[i] = function (li) {
let message = game.messages.get(li.attr("data-message-id"))
let message = game.messages.get($(li).attr("data-message-id"))
let rollData = message.getFlag("world", "rolldata")
//console.log(">>>>>>>>>>>>>>>>>>>>>>>>>> Menu !!!!", rollData)
if (rollData.skill && rollData.skill.value >= i && !rollData.transcendUsed && rollData.spec) {
return true
}
return false
return (rollData?.skill?.value >= i && !rollData.transcendUsed && rollData.spec)
}
options.push({
name: game.i18n.localize("ECRY.chat.spectranscend") + i,
icon: '<i class="fas fa-plus-square"></i>',
condition: canTranscendRoll[i],
callback: li => {
let message = game.messages.get(li.attr("data-message-id"))
let message = game.messages.get($(li).attr("data-message-id"))
let rollData = message.getFlag("world", "rolldata")
EcrymeUtility.transcendFromSpec(rollData, i).catch("Error on Transcend")
}