From a8a10c0ad3633fae2eb2647640b45debd3354c05 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Sat, 22 Feb 2025 18:35:44 -0700 Subject: [PATCH] Add the files for the Application classes --- module/Apps/EffectManager/EffectManager.mjs | 54 +++++++++++++++++++++ module/Apps/EffectManager/EffectSheet.mjs | 0 2 files changed, 54 insertions(+) create mode 100644 module/Apps/EffectManager/EffectManager.mjs create mode 100644 module/Apps/EffectManager/EffectSheet.mjs diff --git a/module/Apps/EffectManager/EffectManager.mjs b/module/Apps/EffectManager/EffectManager.mjs new file mode 100644 index 0000000..669cabd --- /dev/null +++ b/module/Apps/EffectManager/EffectManager.mjs @@ -0,0 +1,54 @@ +import { filePath } from "../../consts.mjs"; +import { GenericAppMixin } from "../GenericApp.mjs"; + +const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api; + +export class EffectManager extends GenericAppMixin(HandlebarsApplicationMixin(ApplicationV2)) { + // #region Options + static DEFAULT_OPTIONS = { + classes: [ + `ripcrypt--EffectManager`, + ], + window: { + title: `Effect Manager`, + frame: true, + positioned: true, + resizable: false, + minimizable: true, + }, + position: { + width: `auto`, + height: `auto`, + }, + actions: { + }, + }; + + static PARTS = { + numberOfDice: { + template: filePath(`templates/Apps/DicePool/numberOfDice.hbs`), + }, + }; + // #endregion + + // #region Instance Data + _effects = new Map(); + _showSource; + + constructor({ document, showSource = true, ...opts } = {}) { + super(opts); + + this._showSource = showSource; + + for (const effect of document.allApplicableEffects()) { + this._effects.add(effect._id, effect); + }; + }; + // #endregion + + // #region Lifecycle + // #endregion + + // #region Actions + // #endregion +}; diff --git a/module/Apps/EffectManager/EffectSheet.mjs b/module/Apps/EffectManager/EffectSheet.mjs new file mode 100644 index 0000000..e69de29