diff --git a/module/applications/sheets/actors/party.mjs b/module/applications/sheets/actors/party.mjs index 773e3867..d366669a 100644 --- a/module/applications/sheets/actors/party.mjs +++ b/module/applications/sheets/actors/party.mjs @@ -6,13 +6,17 @@ export default class Party extends DHBaseActorSheet { static DEFAULT_OPTIONS = { classes: ['party'], position: { - width: 500 + width: 550 }, window: { resizable: true }, actions: { - deletePartyMember: this.#deletePartyMember + deletePartyMember: Party.#deletePartyMember, + toggleHope: Party.#toggleHope, + toggleHitPoints: Party.#toggleHitPoints, + toggleStress: Party.#toggleStress, + toggleArmorSlot: Party.#toggleArmorSlot }, dragDrop: [{ dragSelector: '.actors-section .inventory-item', dropSelector: null }] }; @@ -22,7 +26,10 @@ export default class Party extends DHBaseActorSheet { header: { template: 'systems/daggerheart/templates/sheets/actors/party/header.hbs' }, tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' }, partyMembers: { template: 'systems/daggerheart/templates/sheets/actors/party/party-members.hbs' }, - resources: { template: 'systems/daggerheart/templates/sheets/actors/party/resources.hbs' }, + resources: { + template: 'systems/daggerheart/templates/sheets/actors/party/resources.hbs', + scrollable: ['.resources'] + }, notes: { template: 'systems/daggerheart/templates/sheets/actors/party/notes.hbs' } }; @@ -93,6 +100,54 @@ export default class Party extends DHBaseActorSheet { } } + /** + * Toggles a hope resource value. + * @type {ApplicationClickAction} + */ + static async #toggleHope(_, target) { + const hopeValue = Number.parseInt(target.dataset.value); + const actor = await foundry.utils.fromUuid(target.dataset.actorId); + const newValue = actor.system.resources.hope.value >= hopeValue ? hopeValue - 1 : hopeValue; + await actor.update({ 'system.resources.hope.value': newValue }); + this.render(); + } + + /** + * Toggles a hp resource value. + * @type {ApplicationClickAction} + */ + static async #toggleHitPoints(_, target) { + const hitPointsValue = Number.parseInt(target.dataset.value); + const actor = await foundry.utils.fromUuid(target.dataset.actorId); + const newValue = actor.system.resources.hitPoints.value >= hitPointsValue ? hitPointsValue - 1 : hitPointsValue; + await actor.update({ 'system.resources.hitPoints.value': newValue }); + this.render(); + } + + /** + * Toggles a stress resource value. + * @type {ApplicationClickAction} + */ + static async #toggleStress(_, target) { + const stressValue = Number.parseInt(target.dataset.value); + const actor = await foundry.utils.fromUuid(target.dataset.actorId); + const newValue = actor.system.resources.stress.value >= stressValue ? stressValue - 1 : stressValue; + await actor.update({ 'system.resources.stress.value': newValue }); + this.render(); + } + + /** + * Toggles a armor slot resource value. + * @type {ApplicationClickAction} + */ + static async #toggleArmorSlot(_, target, element) { + const armorItem = await foundry.utils.fromUuid(target.dataset.itemUuid); + const armorValue = Number.parseInt(target.dataset.value); + const newValue = armorItem.system.marks.value >= armorValue ? armorValue - 1 : armorValue; + await armorItem.update({ 'system.marks.value': newValue }); + this.render(); + } + /* -------------------------------------------- */ async _onDragStart(event) { diff --git a/module/applications/sheets/api/application-mixin.mjs b/module/applications/sheets/api/application-mixin.mjs index d156f166..21f1feae 100644 --- a/module/applications/sheets/api/application-mixin.mjs +++ b/module/applications/sheets/api/application-mixin.mjs @@ -473,7 +473,6 @@ export default function DHApplicationMixin(Base) { context.fields = this.document.schema.fields; context.systemFields = this.document.system.schema.fields; context.settings = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance); - console.log(context); return context; } diff --git a/styles/less/global/sheet.less b/styles/less/global/sheet.less index 08e2668f..1e7bad0a 100755 --- a/styles/less/global/sheet.less +++ b/styles/less/global/sheet.less @@ -14,8 +14,12 @@ body.game:is(.performance-low, .noblur) { .themed.theme-dark .application.daggerheart.sheet.dh-style, .themed.theme-dark.application.daggerheart.sheet.dh-style, &.theme-dark .application.daggerheart { - background: @dark-blue; - }; + &.adversary, + &.character, + &.item { + background: @dark-blue; + } + } } .application.sheet.dh-style { diff --git a/styles/less/sheets/actors/party/resources.less b/styles/less/sheets/actors/party/resources.less new file mode 100644 index 00000000..f912f56b --- /dev/null +++ b/styles/less/sheets/actors/party/resources.less @@ -0,0 +1,195 @@ +@import '../../../utils/colors.less'; +@import '../../../utils/fonts.less'; +@import '../../../utils/mixin.less'; + +body.game:is(.performance-low, .noblur) { + .application.sheet.daggerheart.actor.dh-style.party .tab.resources .actors-list .actor-resources { + background: light-dark(@dark-blue, @dark-golden); + + .actor-name { + background: light-dark(@dark-blue, @dark-golden); + } + } +} + +.application.sheet.daggerheart.actor.dh-style.party { + .tab.resources { + max-height: 400px; + overflow: auto; + + .actors-list { + display: flex; + flex-direction: row; + flex-wrap: wrap; + gap: 10px; + align-items: center; + width: 100%; + justify-content: center; + + .actor-resources { + display: flex; + flex-direction: column; + position: relative; + background: light-dark(@dark-blue-40, @dark-golden-40); + border-radius: 6px; + max-width: 230px; + height: -webkit-fill-available; + + .actor-name { + position: absolute; + top: 0px; + background: light-dark(@dark-blue-90, @dark-golden-80); + backdrop-filter: blur(6.5px); + border-radius: 6px 6px 0px 0px; + text-align: center; + width: 100%; + z-index: 1; + font-size: var(--font-size-20); + color: light-dark(@beige, @golden); + font-weight: bold; + padding: 5px 0; + } + + .actor-img { + height: 150px; + object-fit: cover; + border-radius: 6px 6px 0px 0px; + mask-image: linear-gradient(180deg, black 88%, transparent 100%); + } + + .resources { + display: flex; + flex-direction: column; + gap: 10px; + align-items: center; + margin: 10px; + + .slot-section { + display: flex; + flex-direction: column; + align-items: center; + + .slot-bar { + display: flex; + flex-wrap: wrap; + gap: 5px; + width: 239px; + + background-color: light-dark(@dark-blue-10, @dark-blue); + color: light-dark(@dark-blue, @golden); + padding: 5px; + border: 1px solid light-dark(@dark-blue, @golden); + border-radius: 6px; + width: fit-content; + + .armor-slot { + cursor: pointer; + transition: all 0.3s ease; + font-size: var(--font-size-12); + + .fa-shield-halved { + color: light-dark(@dark-blue-40, @golden-40); + } + } + + .slot { + width: 20px; + height: 10px; + border: 1px solid light-dark(@dark-blue, @golden); + background: light-dark(@dark-blue-10, @golden-10); + border-radius: 3px; + transition: all 0.3s ease; + cursor: pointer; + + &.filled { + background: light-dark(@dark-blue, @golden); + } + } + } + .slot-label { + display: flex; + align-items: center; + color: light-dark(@beige, @dark-blue); + background: light-dark(@dark-blue, @golden); + padding: 0 5px; + width: fit-content; + font-weight: bold; + border-radius: 0px 0px 5px 5px; + font-size: var(--font-size-12); + + .label { + padding-right: 5px; + } + + .value { + padding-left: 6px; + border-left: 1px solid @dark-golden; + } + } + } + + .hope-section { + position: relative; + display: flex; + gap: 10px; + background-color: light-dark(transparent, @dark-blue); + color: light-dark(@dark-blue, @golden); + padding: 5px 10px; + border: 1px solid light-dark(@dark-blue, @golden); + border-radius: 3px; + align-items: center; + width: fit-content; + + h4 { + font-size: var(--font-size-12); + font-weight: bold; + text-transform: uppercase; + color: light-dark(@dark-blue, @golden); + } + + .hope-value { + display: flex; + cursor: pointer; + font-size: var(--font-size-12); + } + } + + .threshold-section { + display: flex; + align-self: center; + gap: 10px; + background-color: light-dark(transparent, @dark-blue); + color: light-dark(@dark-blue, @golden); + padding: 5px 10px; + border: 1px solid light-dark(@dark-blue, @golden); + border-radius: 3px; + align-items: center; + width: fit-content; + + h4 { + font-size: var(--font-size-12); + font-weight: bold; + text-transform: uppercase; + color: light-dark(@dark-blue, @golden); + + &.threshold-value { + color: light-dark(@dark, @beige); + } + } + } + } + } + } + .actors-dragger { + display: flex; + align-items: center; + justify-content: center; + box-sizing: border-box; + width: 100%; + height: 40px; + border: 1px dashed light-dark(@dark-blue-50, @beige-50); + border-radius: 3px; + color: light-dark(@dark-blue-50, @beige-50); + } + } +} diff --git a/styles/less/sheets/actors/party/sheet.less b/styles/less/sheets/actors/party/sheet.less index 1abe9497..9f5b6b1c 100644 --- a/styles/less/sheets/actors/party/sheet.less +++ b/styles/less/sheets/actors/party/sheet.less @@ -20,7 +20,7 @@ scrollbar-color: light-dark(@dark-blue, @golden) transparent; &.active { - overflow: hidden; + overflow: auto; display: flex; flex-direction: column; } diff --git a/styles/less/sheets/index.less b/styles/less/sheets/index.less index 95359511..82510c7a 100644 --- a/styles/less/sheets/index.less +++ b/styles/less/sheets/index.less @@ -25,6 +25,7 @@ @import './actors/party/header.less'; @import './actors/party/party-members.less'; @import './actors/party/sheet.less'; +@import './actors/party/resources.less'; @import './items/beastform.less'; @import './items/class.less'; diff --git a/styles/less/utils/colors.less b/styles/less/utils/colors.less index dcc7cc5b..0e5eff9e 100755 --- a/styles/less/utils/colors.less +++ b/styles/less/utils/colors.less @@ -24,6 +24,7 @@ @medium-red-40: #d0474740; @dark-golden: #2b1d03; +@dark-golden-40: #2b1d0340; @dark-golden-80: #2b1d0380; @red: #e54e4e; diff --git a/templates/sheets/actors/party/resources.hbs b/templates/sheets/actors/party/resources.hbs index 37031903..e0b073a6 100644 --- a/templates/sheets/actors/party/resources.hbs +++ b/templates/sheets/actors/party/resources.hbs @@ -22,17 +22,82 @@ {{localize tabs.resources.label}} - {{#unless document.system.partyMembers.length}} -
- {{localize "DAGGERHEART.GENERAL.dropActorsHere"}} -
- {{/unless}} \ No newline at end of file