mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-13 16:18:11 +02:00
Improved handling so that modules changing the game pause work normally
This commit is contained in:
parent
47a852754c
commit
9f3ffdbdbb
2 changed files with 16 additions and 3 deletions
|
|
@ -1,9 +1,22 @@
|
||||||
export default class DhGamePause extends foundry.applications.ui.GamePause {
|
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 */
|
/** @override */
|
||||||
async _prepareContext(options) {
|
async _prepareContext(options) {
|
||||||
const context = await super._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;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
@import '../../utils/mixin.less';
|
@import '../../utils/mixin.less';
|
||||||
|
|
||||||
#pause.paused {
|
#pause.dh-style {
|
||||||
figcaption {
|
figcaption {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
margin-top: 24px;
|
margin-top: 24px;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue