V13 update pt2

This commit is contained in:
Litasa
2025-06-30 17:16:09 +00:00
committed by Vlyan
parent a9748bdf03
commit 1bc01d0741
12 changed files with 211 additions and 58 deletions

View File

@@ -90,7 +90,7 @@ export class GmToolbox extends HandlebarsApplicationMixin(ApplicationV2) {
* @override ApplicationV2
*/
async close(options) {
return;
return Promise.resolve(this);
}
/**

View File

@@ -116,17 +116,22 @@ export default class HooksL5r5e {
// Add title on button dice icon
html.find(".chat-control-icon")[0].title = game.i18n.localize("l5r5e.dice.dicepicker.title");
break;
}
}
case "settings":
// Add Changelog link
html.find("#game-details .system").append(
`<span><a href="${game.system.changelog}" target="_blank">Changelog</a>`
+ ` <a href="${game.i18n.localize("l5r5e.settings.wiki.link")}" target="_blank">${game.i18n.localize("l5r5e.settings.wiki.title")}</a>`
+ ` <a href="${game.i18n.localize("l5r5e.settings.custom-compendiums.link")}" target="_blank">${game.i18n.localize("l5r5e.settings.custom-compendiums.title")}</a>`
+ `</span>`
);
break;
}
static async activateSettings(app) {
const html = app.element
const pip = html.querySelector(".info .system .notification-pip");
html.querySelector(".info.system.l5r5e")?.remove();
const section = document.createElement("section");
section.className = "info system l5r5e";
const tpl = await foundry.applications.handlebars.renderTemplate(`${CONFIG.l5r5e.paths.templates}settings/logo.html`, {
SystemVersion: game.system.version
});
section.append(foundry.utils.parseHTML(tpl));
if ( pip ) section.querySelector(".system-info").insertAdjacentElement("beforeend", pip);
html.querySelector(".info").insertAdjacentElement("afterend", section);
}
/**

View File

@@ -260,6 +260,7 @@ Hooks.once("diceSoNiceReady", (dice3d) => HooksL5r5e.diceSoNiceReady(dice3d));
/* Hooks On */
/* ------------------------------------ */
Hooks.on("renderSidebarTab", (app, html, data) => HooksL5r5e.renderSidebarTab(app, html, data));
Hooks.on("activateSettings", async (app)=> HooksL5r5e.activateSettings(app));
Hooks.on("renderChatMessageHTML", (message, html, data) => HooksL5r5e.renderChatMessage(message, html, data));
Hooks.on("renderCombatTracker", (app, html, data) => HooksL5r5e.renderCombatTracker(app, html, data));
Hooks.on("renderCompendium", async (app, html, data) => HooksL5r5e.renderCompendium(app, html, data));