Foundry v13 migration
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user