Use references to my apps and Database via a CONFIG object that contains all of them rather than only the DB

This commit is contained in:
Oliver-Akins 2025-05-03 21:45:39 -06:00
parent d79597d1e2
commit c5c1c67efe
4 changed files with 19 additions and 16 deletions

View file

@ -1,6 +1,4 @@
import { filePath } from "../consts.mjs";
import { StatsViewer } from "./StatsViewer.mjs";
import { TableCreator } from "./TableCreator.mjs";
const { HandlebarsApplicationMixin } = foundry.applications.api;
const { AbstractSidebarTab } = foundry.applications.sidebar;
@ -34,7 +32,7 @@ export class StatSidebar extends HandlebarsApplicationMixin(AbstractSidebarTab)
async _prepareContext(options) {
const ctx = await super._prepareContext(options);
const db = CONFIG.StatsDatabase;
const db = CONFIG.stats.db;
ctx.tableCount = db.getTables().length;
@ -63,13 +61,13 @@ export class StatSidebar extends HandlebarsApplicationMixin(AbstractSidebarTab)
/** @this {StatSidebar} */
static async #openStats() {
const app = new StatsViewer();
const app = new CONFIG.stats.viewer;
app.render({ force: true });
};
/** @this {StatSidebar} */
static async #createTable() {
const app = new TableCreator;
const app = new CONFIG.stats.creator;
app.render({ force: true });
};
};