RC-76 | Crypt Application Setup
This commit is contained in:
parent
98eb389a13
commit
9e12737429
3 changed files with 50 additions and 0 deletions
3
Apps/CryptApp/main.hbs
Normal file
3
Apps/CryptApp/main.hbs
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
<div>
|
||||||
|
Hello
|
||||||
|
</div>
|
||||||
43
module/Apps/CryptApp.mjs
Normal file
43
module/Apps/CryptApp.mjs
Normal 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
|
||||||
|
};
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { CryptApp } from "../Apps/CryptApp.mjs";
|
||||||
import { Logger } from "../utils/Logger.mjs";
|
import { Logger } from "../utils/Logger.mjs";
|
||||||
|
|
||||||
Hooks.once(`ready`, () => {
|
Hooks.once(`ready`, () => {
|
||||||
|
|
@ -17,4 +18,7 @@ Hooks.once(`ready`, () => {
|
||||||
ui.sidebar.expand();
|
ui.sidebar.expand();
|
||||||
if (game.paused) { game.togglePause() };
|
if (game.paused) { game.togglePause() };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
CONFIG.ui.crypt = new CryptApp();
|
||||||
|
CONFIG.ui.crypt.render({ force: true });
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue