diff --git a/module/Apps/ActorSheets/HeroSkillsCardV1.mjs b/module/Apps/ActorSheets/HeroSkillsCardV1.mjs index b0e83fb..b9992b5 100644 --- a/module/Apps/ActorSheets/HeroSkillsCardV1.mjs +++ b/module/Apps/ActorSheets/HeroSkillsCardV1.mjs @@ -43,6 +43,12 @@ export class HeroSkillsCardV1 extends GenericAppMixin(HandlebarsApplicationMixin async _onRender(context, options) { await super._onRender(context, options); HeroSkillsCardV1._onRender.bind(this)(context, options); + + const ammo = this.element.querySelector(`.ammo`); + + ammo.addEventListener(`mouseenter`, () => {console.log(`mouseenter-ing`)}); + + ammo.addEventListener(`contextmenu`, () => {console.log(`right-clicking`)}); }; static async _onRender(_context, options) { diff --git a/module/Apps/popovers/AmmoTracker.mjs b/module/Apps/popovers/AmmoTracker.mjs new file mode 100644 index 0000000..b216185 --- /dev/null +++ b/module/Apps/popovers/AmmoTracker.mjs @@ -0,0 +1,45 @@ +import { filePath } from "../../consts.mjs"; +import { GenericAppMixin } from "../GenericApp.mjs"; + +const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api; + +export class AmmoTracker extends GenericAppMixin(HandlebarsApplicationMixin(ApplicationV2)) { + // #region Options + static DEFAULT_OPTIONS = { + classes: [ + `ripcrypt--AmmoTracker`, + ], + window: { + frame: false, + positioned: true, + resizable: false, + minimizable: false, + }, + position: { + width: 100, + height: 30, + }, + actions: {}, + }; + + static PARTS = { + main: { + template: filePath(`templates/Apps/popovers/AmmoTracker/content.hbs`), + }, + }; + // #endregion + + // #region Instance Data + // #endregion + + // #region Lifecycle + async _onFirstRender(context, options) { + await super._onFirstRender(context, options); + const ammoContainer = this.element.querySelector(`.ammo`); + console.dir(ammoContainer); + }; + // #endregion + + // #region Actions + // #endregion +}; diff --git a/templates/Apps/popovers/AmmoTracker/content.hbs b/templates/Apps/popovers/AmmoTracker/content.hbs new file mode 100644 index 0000000..80f0024 --- /dev/null +++ b/templates/Apps/popovers/AmmoTracker/content.hbs @@ -0,0 +1,3 @@ +
+ Hello +
\ No newline at end of file