mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-21 18:09:54 +02:00
[Feature] System Styled GamePause (#1986)
Some checks are pending
Project CI / build (24.x) (push) Waiting to run
Some checks are pending
Project CI / build (24.x) (push) Waiting to run
* Experimented with hope/fear pulsed text and the DhCompatible logo * Improved handling so that modules changing the game pause work normally * Moved pause-pulse keyframes to game-pause.less
This commit is contained in:
parent
a96eb6ab62
commit
58eb41e4a9
6 changed files with 50 additions and 0 deletions
|
|
@ -88,6 +88,7 @@ CONFIG.ui.actors = applications.sidebar.DhActorDirectory;
|
|||
CONFIG.ui.daggerheartMenu = applications.sidebar.DaggerheartMenu;
|
||||
CONFIG.ui.resources = applications.ui.DhFearTracker;
|
||||
CONFIG.ui.countdowns = applications.ui.DhCountdowns;
|
||||
CONFIG.ui.pause = applications.ui.DhGamePause;
|
||||
CONFIG.ux.ContextMenu = applications.ux.DHContextMenu;
|
||||
CONFIG.ux.TooltipManager = documents.DhTooltipManager;
|
||||
CONFIG.ux.TokenManager = new TokenManager();
|
||||
|
|
|
|||
|
|
@ -8,3 +8,4 @@ export { default as DhHotbar } from './hotbar.mjs';
|
|||
export { default as DhSceneNavigation } from './sceneNavigation.mjs';
|
||||
export { ItemBrowser } from './itemBrowser.mjs';
|
||||
export { default as DhProgress } from './progress.mjs';
|
||||
export { default as DhGamePause } from './gamePause.mjs';
|
||||
|
|
|
|||
23
module/applications/ui/gamePause.mjs
Normal file
23
module/applications/ui/gamePause.mjs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
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);
|
||||
|
||||
/* 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;
|
||||
}
|
||||
}
|
||||
23
styles/less/ui/game-pause/game-pause.less
Normal file
23
styles/less/ui/game-pause/game-pause.less
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
@import '../../utils/mixin.less';
|
||||
|
||||
#pause.dh-style {
|
||||
figcaption {
|
||||
position: absolute;
|
||||
margin-top: 24px;
|
||||
animation: pause-pulse 3s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes pause-pulse {
|
||||
0% {
|
||||
filter: drop-shadow(0 0 5px @secondary-blue);
|
||||
}
|
||||
|
||||
50% {
|
||||
filter: drop-shadow(0 0 5px @golden);
|
||||
}
|
||||
|
||||
100% {
|
||||
filter: drop-shadow(0 0 5px @secondary-blue);
|
||||
}
|
||||
}
|
||||
}
|
||||
1
styles/less/ui/game-pause/index.less
Normal file
1
styles/less/ui/game-pause/index.less
Normal file
|
|
@ -0,0 +1 @@
|
|||
@import './game-pause.less';
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
@import './combat-sidebar/index.less';
|
||||
@import './countdown/index.less';
|
||||
@import './effects-display/index.less';
|
||||
@import './game-pause/index.less';
|
||||
@import './item-browser/index.less';
|
||||
@import './ownership-selection/index.less';
|
||||
@import './resources/index.less';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue