ApplicationV2 GM Toolbox and GM Monitor

This commit is contained in:
Litasa
2025-05-01 12:05:54 +00:00
committed by Vlyan
parent 79979acfc1
commit 9d8c1431be
18 changed files with 958 additions and 575 deletions

View File

@@ -401,12 +401,22 @@ export class HelpersL5r5e {
});
}
static getApplication(appId) {
const app = Object.values(ui.windows).find((e) => e.id === appId);
if(app)
return app;
const appV2 = foundry.applications.instances.get(appId)
if(appV2)
return appV2;
}
/**
* Notify Applications using Difficulty settings that the values was changed
*/
static notifyDifficultyChange() {
["l5r5e-dice-picker-dialog", "l5r5e-gm-toolbox"].forEach((appId) => {
const app = Object.values(ui.windows).find((e) => e.id === appId);
["l5r5e-dice-picker-dialog"].forEach((appId) => {
const app = this.getApplication(appId);
if (app && typeof app.refresh === "function") {
app.refresh();
}
@@ -419,9 +429,7 @@ export class HelpersL5r5e {
*/
static refreshLocalAndSocket(appId) {
game.l5r5e.sockets.refreshAppId(appId);
Object.values(ui.windows)
.find((e) => e.id === appId)
?.refresh();
this.getApplication(appId)?.refresh();
}
/**