From 9f3ffdbdbb33bee01e5a5b038413c739f7d3a547 Mon Sep 17 00:00:00 2001 From: WBHarry Date: Mon, 8 Jun 2026 16:16:11 +0200 Subject: [PATCH] Improved handling so that modules changing the game pause work normally --- module/applications/ui/gamePause.mjs | 17 +++++++++++++++-- styles/less/ui/game-pause/game-pause.less | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/module/applications/ui/gamePause.mjs b/module/applications/ui/gamePause.mjs index d0f3f6ed..8047f1dc 100644 --- a/module/applications/ui/gamePause.mjs +++ b/module/applications/ui/gamePause.mjs @@ -1,9 +1,22 @@ export default class DhGamePause extends foundry.applications.ui.GamePause { + async _onRender(context, options) { + await super._onRender(context, options); + + /* Avoid altering the styling if a module has subscribed to the renderGamePause hook */ + if (!Hooks.events.renderGamePause?.length) { + this.element.classList.add('dh-style'); + } + } + /** @override */ async _prepareContext(options) { const context = await super._prepareContext(options); - context.spin = false; - context.icon = 'systems/daggerheart/assets/logos/compatible_with_DH_logos-10.png'; + + /* Avoid altering the gamepause context if a module has subscribed to the renderGamePause hook */ + if (!Hooks.events.renderGamePause?.length) { + context.spin = options.spin ?? false; + context.icon = options.icon ?? 'systems/daggerheart/assets/logos/compatible_with_DH_logos-10.png'; + } return context; } diff --git a/styles/less/ui/game-pause/game-pause.less b/styles/less/ui/game-pause/game-pause.less index 097f2c55..efd369a9 100644 --- a/styles/less/ui/game-pause/game-pause.less +++ b/styles/less/ui/game-pause/game-pause.less @@ -1,6 +1,6 @@ @import '../../utils/mixin.less'; -#pause.paused { +#pause.dh-style { figcaption { position: absolute; margin-top: 24px;