RC-76 | Crypt Application Setup

This commit is contained in:
Oliver-Akins 2025-01-01 01:55:44 -07:00
parent 98eb389a13
commit 9e12737429
3 changed files with 50 additions and 0 deletions

43
module/Apps/CryptApp.mjs Normal file
View file

@ -0,0 +1,43 @@
import { filePath } from "../consts.mjs";
import { GenericAppMixin } from "./GenericApp.mjs";
import { Logger } from "../utils/Logger.mjs";
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
export class CryptApp extends GenericAppMixin(HandlebarsApplicationMixin(ApplicationV2)) {
// #region Options
static DEFAULT_OPTIONS = {
window: {
title: `Crypt Overview`,
frame: true,
positioned: true,
resizable: false,
minimizable: true,
},
actions: {},
};
static PARTS = {
main: {
template: filePath(`Apps/CryptApp/main.hbs`),
},
};
// #endregion
// #region Lifecycle
async _renderFrame(options) {
const frame = await super._renderFrame(options);
this.window.close.remove(); // Prevent closing
return frame;
}
async _preparePartContext(partId, ctx, opts) {
ctx = await super._preparePartContext(partId, ctx, opts);
Logger.log(`Context`, ctx);
return ctx;
};
// #endregion
// #region Actions
// #endregion
};

View file

@ -1,3 +1,4 @@
import { CryptApp } from "../Apps/CryptApp.mjs";
import { Logger } from "../utils/Logger.mjs";
Hooks.once(`ready`, () => {
@ -17,4 +18,7 @@ Hooks.once(`ready`, () => {
ui.sidebar.expand();
if (game.paused) { game.togglePause() };
};
CONFIG.ui.crypt = new CryptApp();
CONFIG.ui.crypt.render({ force: true });
});