From 1bc6d9673af787484773aa98a1682c519249dbc6 Mon Sep 17 00:00:00 2001 From: macniel Date: Wed, 12 Nov 2025 20:42:29 +0100 Subject: [PATCH] inverts cooldown display, removes unintuitive progress/activate button and also fixes a bug in the tooltip --- src/lang/de.json | 4 +-- src/module/dialog/combatAction.mjs | 2 +- src/module/dialog/liturgyDialog.mjs | 2 +- src/module/sheets/character/combat.mjs | 4 ++- src/module/sheets/characterSheet.mjs | 18 +++++++--- src/style/atoms/_colours.scss | 4 +-- src/style/molecules/_sidebar-elements.scss | 33 +++++++------------ .../organisms/character-tabs/_inventory.scss | 2 +- src/templates/actor/character/main-sheet.hbs | 6 ++-- src/templates/ui/partial-cooldown.hbs | 27 +++++---------- 10 files changed, 46 insertions(+), 56 deletions(-) diff --git a/src/lang/de.json b/src/lang/de.json index b1914f86..164dc25c 100644 --- a/src/lang/de.json +++ b/src/lang/de.json @@ -20,9 +20,7 @@ } }, "COOLDOWN": { - "progress": "{t} weiter durchführen", - "cancel": "{t} abbrechen", - "activate": "{t} auslösen" + "cancel": "{t} abbrechen" }, "WEAPON": { "attack": "Mit {weapon} angreifen", diff --git a/src/module/dialog/combatAction.mjs b/src/module/dialog/combatAction.mjs index c89f0165..05eaae06 100644 --- a/src/module/dialog/combatAction.mjs +++ b/src/module/dialog/combatAction.mjs @@ -126,7 +126,7 @@ export class CombatActionDialog extends HandlebarsApplicationMixin(ApplicationV2 /** @type Cooldown */ const newCooldown = { start: maneuver.cooldown({weapon, skill, target, mod: this._mod}), - current: maneuver.cooldown({weapon, skill, target, mod: this._mod}), + current: 0, data: { cssClass: "Kampf", weapon: this._weaponId, diff --git a/src/module/dialog/liturgyDialog.mjs b/src/module/dialog/liturgyDialog.mjs index 7d7764d6..23fea809 100644 --- a/src/module/dialog/liturgyDialog.mjs +++ b/src/module/dialog/liturgyDialog.mjs @@ -163,7 +163,7 @@ export class LiturgyDialog extends HandlebarsApplicationMixin(ApplicationV2) { } cooldowns.push({ start: castingTime, - current: castingTime, + current: 0, data: { cssClass: "Karmal", title: this._liturgy.name, diff --git a/src/module/sheets/character/combat.mjs b/src/module/sheets/character/combat.mjs index 10485d66..ff41d23c 100644 --- a/src/module/sheets/character/combat.mjs +++ b/src/module/sheets/character/combat.mjs @@ -26,9 +26,11 @@ export default { context.lepper = Math.min((actorData.system.lep.aktuell / actorData.system.lep.max) * 100, 100) context.keper = Math.min((actorData.system.kap.aktuell / actorData.system.kap.max) * 100, 100) context.aspper = Math.min((actorData.system.asp.aktuell / actorData.system.asp.max) * 100, 100) - context.lepcurrent = actorData.system.lep.aktuell ?? 0 + context.lepcurrent = actorData.system.lep.aktuell ?? 0 context.aupcurrent = actorData.system.aup.aktuell ?? 0 + context.aspcurrent = actorData.system.asp.aktuell ?? 0 + context.kapcurrent = actorData.system.kap.aktuell ?? 0 return context diff --git a/src/module/sheets/characterSheet.mjs b/src/module/sheets/characterSheet.mjs index aaba9861..51e5ee86 100644 --- a/src/module/sheets/characterSheet.mjs +++ b/src/module/sheets/characterSheet.mjs @@ -153,7 +153,7 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) { cooldowns.splice(cooldownId, 1) if (cooldown) { - cooldown.current = cooldown.current - 1 + cooldown.current = cooldown.current + 1 } cooldowns.push(cooldown) @@ -177,7 +177,7 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) { const cooldowns = this.document.system.cooldowns const cooldown = this.document.system.cooldowns[cooldownId] - if (cooldown && cooldown.current <= 0) { + if (cooldown && cooldown.current >= cooldown.start) { const am = new ActionManager(this.document) console.log(cooldown.data.maneuver) const action = new Function(`return ${cooldown.data.maneuver}`) @@ -412,8 +412,11 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) { context.lepper = Math.min((actorData.system.lep.aktuell / actorData.system.lep.max) * 100, 100) context.keper = Math.min((actorData.system.kap.aktuell / actorData.system.kap.max) * 100, 100) context.aspper = Math.min((actorData.system.asp.aktuell / actorData.system.asp.max) * 100, 100) + context.lepcurrent = actorData.system.lep.aktuell ?? 0 context.aupcurrent = actorData.system.aup.aktuell ?? 0 + context.aspcurrent = actorData.system.asp.aktuell ?? 0 + context.kapcurrent = actorData.system.kap.aktuell ?? 0 const fernkampf = actorData.findEquipmentOnSlot("fernkampf", actorData.system.setEquipped, actorData) const links = actorData.findEquipmentOnSlot("links", actorData.system.setEquipped, actorData) @@ -489,15 +492,20 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) { let tooltip = cooldown.data.title if (cooldown.data.weapon) { weapon = this.document.itemTypes["Equipment"].find(p => p._id === cooldown.data.weapon) - tooltip += `
Waffe:${weapon.name}` + tooltip += `
Waffe: ${weapon.name}` } if (cooldown.data.target) { target = game.actors.get(game.scenes.current.tokens.find(p => p._id === cooldown.data.target).actorId) - tooltip += `
Waffe:${target.name}` + tooltip += `
Ziel: ${target.name}` } cooldown.title = cooldown.data.title cooldown.progress = ((cooldown.current / cooldown.start) * 100) + "%" - cooldown.tooltip = tooltip + `
Aktionen verbleibend: ${cooldown.current}` + if (cooldown.start - cooldown.current > 0) { + cooldown.tooltip = tooltip + `
Aktionen verbleibend: ${cooldown.start - cooldown.current}
: 1 Aktion aufwenden` + } else { + cooldown.tooltip = tooltip + `
Aktionen verbleibend: ${cooldown.start - cooldown.current}
: Aktion durchführen` + } + }) context.hasSpells = actorData.itemTypes["Spell"].length > 0 diff --git a/src/style/atoms/_colours.scss b/src/style/atoms/_colours.scss index 950f42d7..64689d04 100644 --- a/src/style/atoms/_colours.scss +++ b/src/style/atoms/_colours.scss @@ -1,12 +1,12 @@ $nachteil-color: #555753; $nachteil-text-color: #FFF; -$liturgie-color: #edd400; +$liturgie-color: #59aebf; $liturgie-text-color: #000; $zauber-color: #3465a4; $zauber-text-color: #000; $talent-color: #f57900; $talent-text-color: #000; -$kampftalent-color: #cc0000; +$kampftalent-color: #c36e14; $kampftalent-text-color: #FFF; $talent-body-color: #45d18c; diff --git a/src/style/molecules/_sidebar-elements.scss b/src/style/molecules/_sidebar-elements.scss index 7a696c23..62354506 100644 --- a/src/style/molecules/_sidebar-elements.scss +++ b/src/style/molecules/_sidebar-elements.scss @@ -11,7 +11,7 @@ width: 100%; position: relative; border: 1px inset #ccc; - background-color: rgba(0, 0, 0, 0.2); + background-color: rgba(0, 0, 0, 0.5); margin: 8px 0; label { @@ -19,8 +19,6 @@ left: 0; top: 0; bottom: 0; - width: 48px; - background-color: rgba(0, 0, 0, 0.1); z-index: 3; line-height: 24px; vertical-align: middle; @@ -226,22 +224,13 @@ position: absolute; background: url('/systems/DSA_4-1/assets/gradient.png'); background-size: 12px 100%; + background-blend-mode: overlay; + background-color: rgba(128, 0, 192, 1); left: 0; bottom: 0; top: 0; border-radius: 12px; z-index: 2; - - &::after { // progress fill - content: ''; - position: absolute; - left: 0; - top: 0; - right: 0; - bottom: 0; - border-radius: 12px; - background-color: rgba(128, 0, 192, 0.5); - } } &::after { @@ -256,20 +245,20 @@ } - &.Kampf .progress::after { - background-color: rgba(colors.$kampftalent-color, 0.5); + &.Kampf .progress { + background-color: rgba(colors.$kampftalent-color, 1); } - &.Karmal .progress::after { - background-color: rgba(colors.$liturgie-color, 0.5); + &.Karmal .progress { + background-color: rgba(colors.$liturgie-color, 1); } - &.Magisch .progress::after { - background-color: rgba(colors.$zauber-color, 0.5); + &.Magisch .progress { + background-color: rgba(colors.$zauber-color, 1); } - &.Talent .progress::after { - background-color: rgba(colors.$talent-color, 0.5); + &.Talent .progress { + background-color: rgba(colors.$talent-color, 1); } } diff --git a/src/style/organisms/character-tabs/_inventory.scss b/src/style/organisms/character-tabs/_inventory.scss index 4a490e73..ecb35fb7 100644 --- a/src/style/organisms/character-tabs/_inventory.scss +++ b/src/style/organisms/character-tabs/_inventory.scss @@ -28,7 +28,7 @@ position: relative; border: 1px inset #ccc; background-color: rgba(0, 0, 0, 0.2); - height: 8px; + height: 16px; span.fill { position: absolute; diff --git a/src/templates/actor/character/main-sheet.hbs b/src/templates/actor/character/main-sheet.hbs index f4198f96..0af055ff 100644 --- a/src/templates/actor/character/main-sheet.hbs +++ b/src/templates/actor/character/main-sheet.hbs @@ -32,12 +32,14 @@ {{#if ausdauer}} {{/if}} diff --git a/src/templates/ui/partial-cooldown.hbs b/src/templates/ui/partial-cooldown.hbs index 199e05b7..d6cb26ee 100644 --- a/src/templates/ui/partial-cooldown.hbs +++ b/src/templates/ui/partial-cooldown.hbs @@ -1,23 +1,14 @@
- {{#if (gt this.current 0)}} - - {{this.title}} + {{this.title}} - {{else}} - - {{this.title}} - - {{/if}}
\ No newline at end of file + \ No newline at end of file