Merged with main

This commit is contained in:
WBHarry 2025-06-06 03:01:09 +02:00
commit 629782eccc
4 changed files with 23 additions and 6 deletions

View file

@ -22,7 +22,8 @@ export default class Resources extends HandlebarsApplicationMixin(ApplicationV2)
frame: true, frame: true,
title: 'Fear', title: 'Fear',
positioned: true, positioned: true,
resizable: true resizable: true,
minimizable: false
}, },
actions: { actions: {
setFear: Resources.setFear, setFear: Resources.setFear,
@ -105,6 +106,5 @@ export default class Resources extends HandlebarsApplicationMixin(ApplicationV2)
if (!game.user.isGM) return; if (!game.user.isGM) return;
value = Math.max(0, Math.min(this.maxFear, value)); value = Math.max(0, Math.min(this.maxFear, value));
await game.settings.set(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Resources.Fear, value); await game.settings.set(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Resources.Fear, value);
await this.render(true);
} }
} }

View file

@ -181,7 +181,10 @@ export const registerDHSettings = () => {
scope: 'world', scope: 'world',
config: false, config: false,
type: Number, type: Number,
default: 0 default: 0,
onChange: () => {
if (ui.resources) ui.resources.render({ force: true });
}
}); });
game.settings.register(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Resources.MaxFear, { game.settings.register(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Resources.MaxFear, {

View file

@ -2934,11 +2934,18 @@ div.daggerheart.views.multiclass {
--primary-color-fear: rgba(9, 71, 179, 0.75); --primary-color-fear: rgba(9, 71, 179, 0.75);
--secondary-color-fear: rgba(9, 71, 179, 0.75); --secondary-color-fear: rgba(9, 71, 179, 0.75);
--shadow-text-stroke: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; --shadow-text-stroke: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
--fear-animation: background 0.3s ease, box-shadow .3s ease, border-color .3s ease, opacity .3s ease;
} }
#resources { #resources {
min-height: calc(var(--header-height) + 4rem); min-height: calc(var(--header-height) + 4rem);
min-width: 4rem; min-width: 4rem;
color: #d3d3d3; color: #d3d3d3;
transition: var(--fear-animation);
}
#resources header,
#resources .controls,
#resources .window-resize-handle {
transition: var(--fear-animation);
} }
#resources .window-content { #resources .window-content {
padding: 0.5rem; padding: 0.5rem;
@ -3023,7 +3030,7 @@ div.daggerheart.views.multiclass {
#resources .window-content #resource-fear.isGM i:hover { #resources .window-content #resource-fear.isGM i:hover {
font-size: var(--font-size-20); font-size: var(--font-size-20);
} }
#resources button[data-action='close'] { #resources button[data-action="close"] {
display: none; display: none;
} }
#resources:not(:hover):not(.minimized) { #resources:not(:hover):not(.minimized) {
@ -3034,7 +3041,7 @@ div.daggerheart.views.multiclass {
#resources:not(:hover):not(.minimized) header, #resources:not(:hover):not(.minimized) header,
#resources:not(:hover):not(.minimized) .controls, #resources:not(:hover):not(.minimized) .controls,
#resources:not(:hover):not(.minimized) .window-resize-handle { #resources:not(:hover):not(.minimized) .window-resize-handle {
visibility: hidden; opacity: 0;
} }
#resources:has(.fear-bar) { #resources:has(.fear-bar) {
min-width: 200px; min-width: 200px;

View file

@ -2,12 +2,19 @@
--primary-color-fear: rgba(9, 71, 179, 0.75); --primary-color-fear: rgba(9, 71, 179, 0.75);
--secondary-color-fear: rgba(9, 71, 179, 0.75); --secondary-color-fear: rgba(9, 71, 179, 0.75);
--shadow-text-stroke: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; --shadow-text-stroke: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
--fear-animation: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
} }
#resources { #resources {
min-height: calc(var(--header-height) + 4rem); min-height: calc(var(--header-height) + 4rem);
min-width: 4rem; min-width: 4rem;
color: #d3d3d3; color: #d3d3d3;
transition: var(--fear-animation);
header,
.controls,
.window-resize-handle {
transition: var(--fear-animation);
}
.window-content { .window-content {
padding: 0.5rem; padding: 0.5rem;
#resource-fear { #resource-fear {
@ -106,7 +113,7 @@
header, header,
.controls, .controls,
.window-resize-handle { .window-resize-handle {
visibility: hidden; opacity: 0;
} }
} }
&:has(.fear-bar) { &:has(.fear-bar) {