daggerheart/module/applications/ui/presetTemplates.mjs

67 lines
1.6 KiB
JavaScript

const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
/**
*
* @extends ApplicationV2
* @mixes HandlebarsApplication
*/
export default class PresetTemplates extends HandlebarsApplicationMixin(ApplicationV2) {
constructor(options = {}) {
super(options);
}
/** @inheritDoc */
static DEFAULT_OPTIONS = {
id: 'presetTemplates',
classes: [],
tag: 'div',
window: {
frame: true,
title: 'Preset Templates',
positioned: true,
resizable: true,
minimizable: true
},
actions: {
},
position: {
width: 222,
height: 222
// top: "200px",
// left: "120px"
}
};
/** @override */
static PARTS = {
resources: {
root: true,
template: 'systems/daggerheart/templates/ui/presetTemplates.hbs'
}
};
/* -------------------------------------------- */
/* Rendering */
/* -------------------------------------------- */
/** @override */
async _prepareContext(_options) {
// Return the data for rendering
return { };
}
/** @override */
async _preFirstRender(context, options) {
options.position =
game.user.getFlag(CONFIG.DH.id, 'app.presetTemplates.position') ?? PresetTemplates.DEFAULT_OPTIONS.position;
}
/** @override */
async _preRender(context, options) {
}
_onPosition(position) {
game.user.setFlag(CONFIG.DH.id, 'app.presetTemplates.position', position);
}
}