Added a render hook for the daggerheartMenu render

This commit is contained in:
WBHarry 2025-11-29 17:24:08 +01:00
parent 630ba5ab7d
commit 3f228db420
4 changed files with 28 additions and 1 deletions

View file

@ -43,6 +43,18 @@ export default class DaggerheartMenu extends HandlebarsApplicationMixin(Abstract
/* -------------------------------------------- */
/** @inheritDoc */
async _onRender(context, options) {
super._onRender(context, options);
Hooks.callAll(
CONFIG.DH.HOOKS.sidebarMenuRender,
this,
this.element.querySelector('[data-application-part="main"]'),
context
);
}
/** @inheritDoc */
async _prepareContext(options) {
const context = await super._prepareContext(options);

View file

@ -4,6 +4,7 @@ export * as domainConfig from './domainConfig.mjs';
export * as effectConfig from './effectConfig.mjs';
export * as flagsConfig from './flagsConfig.mjs';
export * as generalConfig from './generalConfig.mjs';
export { default as hooksConfig } from './hooksConfig.mjs';
export * as itemConfig from './itemConfig.mjs';
export * as settingsConfig from './settingsConfig.mjs';
export * as systemConfig from './system.mjs';

View file

@ -0,0 +1,12 @@
const systemHooks = {
/**
* Runs on render of the Daggerheart Sidebar menu.
* @param {App} app
* @param {Node} contentElement
* @param {ApplicationContext} context
* @returns {void}
*/
sidebarMenuRender: 'sidebar-menu-render'
};
export default systemHooks;

View file

@ -6,7 +6,8 @@ import * as SETTINGS from './settingsConfig.mjs';
import * as EFFECTS from './effectConfig.mjs';
import * as ACTIONS from './actionConfig.mjs';
import * as FLAGS from './flagsConfig.mjs';
import * as ITEMBROWSER from './itemBrowserConfig.mjs'
import { default as HOOKS } from './hooksConfig.mjs';
import * as ITEMBROWSER from './itemBrowserConfig.mjs';
export const SYSTEM_ID = 'daggerheart';
@ -20,5 +21,6 @@ export const SYSTEM = {
EFFECTS,
ACTIONS,
FLAGS,
HOOKS,
ITEMBROWSER
};