From 4e3554c28bb571baf38181c65f689536c75b10d7 Mon Sep 17 00:00:00 2001 From: Tim Evans Date: Tue, 2 Jun 2026 22:05:05 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20readability=20=E2=80=94=20solid=20dark?= =?UTF-8?q?=20backgrounds=20on=20all=20chat=20cards=20(v1.4.2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root cause: all chat card containers used rgba() with 0.2-0.4 opacity, which becomes nearly transparent on Foundry v14 parchment chat bg. Light text (white, cyan, yellow, green) was invisible on the result. CSS fixes (solid dark backgrounds replacing transparent rgba): - .panic-result: rgba(139,0,0,0.2) -> #1c0808 + color: #e0e0e0 - .panic-success: rgba(0,128,0,0.2) -> #081c08 + green text toned to #55ee55 - .panic-effect: rgba(0,0,0,0.4) -> #111111 + color: #e0e0e0 - .critical-injury: rgba(220,20,60,0.2) -> #1c080d + color: #e0e0e0 - .crit-effects/.crit-healing/.crit-recovery: rgba(0,0,0,0.3) -> #111111 - .time-limit: rgba(255,170,0,0.2) -> #1a1200 New CSS classes added (were missing entirely): - .instability-result with dark bg, border, and sub-element rules - .instability-no-effect, .instability-effect-text, .instability-auto-note - .panic-auto (auto-applied row) - .drug-gm-alert, .weapon-reload-chat JS inline style fixes: - Rest card: rgba(0,60,30,0.3) -> #0a1a0e (solid) - Ammo empty card: rgba(80,20,0,0.3) -> #1a0800 (solid) - Instability effect text: color:#333 (dark on dark) -> CSS class #d8d8d8 - Instability auto-note: color:#ffcc44 inline -> CSS class --- styles/zero-engine.css | 88 ++++++++++++++++++++++++++++++++++++------ system.json | 2 +- zero-engine.mjs | 16 ++++---- 3 files changed, 86 insertions(+), 20 deletions(-) diff --git a/styles/zero-engine.css b/styles/zero-engine.css index 826a9a1..df98cd2 100644 --- a/styles/zero-engine.css +++ b/styles/zero-engine.css @@ -1519,11 +1519,12 @@ ======================================== */ .panic-result { - background: rgba(139, 0, 0, 0.2); + background: #1c0808; border: 2px solid #8b0000; border-radius: 6px; padding: 15px; margin: 10px 0; + color: #e0e0e0; } .panic-formula { @@ -1534,16 +1535,16 @@ .panic-total { font-size: 20px; - color: #ff4444; + color: #ff5555; font-weight: bold; } .panic-success { - background: rgba(0, 128, 0, 0.2); + background: #081c08; border: 2px solid #00aa00; border-radius: 4px; padding: 12px; - color: #00ff00; + color: #55ee55; font-weight: bold; text-align: center; margin-top: 10px; @@ -1551,15 +1552,16 @@ } .panic-effect { - background: rgba(0, 0, 0, 0.4); + background: #111111; border: 1px solid #ff4444; border-radius: 4px; padding: 12px; margin-top: 10px; + color: #e0e0e0; } .panic-effect strong { - color: #ff6b6b; + color: #ff7777; font-size: 16px; display: block; margin-bottom: 8px; @@ -1568,11 +1570,12 @@ } .critical-injury { - background: rgba(220, 20, 60, 0.2); + background: #1c080d; border: 2px solid #dc143c; border-radius: 6px; padding: 15px; margin: 10px 0; + color: #e0e0e0; } .crit-roll { @@ -1598,21 +1601,23 @@ } .time-limit { - background: rgba(255, 170, 0, 0.2); + background: #1a1200; border: 1px solid #ffaa00; border-radius: 4px; padding: 8px; - color: #ffaa00; + color: #ffbb33; font-weight: bold; margin: 8px 0; } .crit-effects, -.crit-healing { - background: rgba(0, 0, 0, 0.3); +.crit-healing, +.crit-recovery { + background: #111111; border-radius: 4px; padding: 8px; margin: 8px 0; + color: #d8d8d8; } .crit-effects strong, @@ -1622,6 +1627,67 @@ margin-bottom: 4px; } +/* ======================================== + CHAT CARD — MISSING BACKGROUND FIX + All system chat output needs a solid dark background so that + coloured text remains readable regardless of Foundry's chat theme. + ======================================== */ + +/* Instability roll result */ +.instability-result { + background: #0e1a14; + border: 2px solid #ff6600; + border-radius: 6px; + padding: 10px 14px; + margin: 6px 0; + color: #e0e0e0; +} +.instability-result p { margin: 4px 0; color: #e0e0e0; } +.instability-result strong { color: #fff; } +.instability-no-effect { color: #55ee88 !important; font-weight: bold; } +.instability-effect-text { color: #d8d8d8 !important; font-size: 13px; line-height: 1.5; } +.instability-auto-note { + color: #ffcc55 !important; + font-size: 11px; + font-style: italic; + border-top: 1px solid rgba(255,204,85,0.3); + margin-top: 6px; + padding-top: 4px; +} + +/* Panic result — auto-note row */ +.panic-auto { + background: rgba(255, 200, 0, 0.1); + border: 1px solid rgba(255, 200, 0, 0.3); + border-radius: 3px; + padding: 4px 8px; + font-size: 12px; + color: #ffcc44; + margin-top: 6px; +} +.panic-auto strong { color: #ffe066; } + +/* Drug GM alert (stamina strain, drug state) */ +.drug-gm-alert { + background: #0d0d1a; + border: 1px solid rgba(0, 180, 255, 0.4); + border-radius: 5px; + padding: 8px 12px; + color: #c0d8ff; + font-size: 13px; +} +.drug-gm-alert strong { color: #88ccff; } + +/* Weapon reload notification */ +.weapon-reload-chat { + background: #0d1a0d; + border: 1px solid rgba(0, 200, 100, 0.35); + border-radius: 5px; + padding: 7px 10px; + color: #b8eec8; + font-size: 13px; +} + /* ======================================== ROLLABLE INDICATOR ======================================== */ diff --git a/system.json b/system.json index de2006b..62df523 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "id": "zero-engine", "title": "Zero Engine (SLA Industries)", "description": "A basic game system for SLA Industries using the Zero Engine rules.", - "version": "1.4.1", + "version": "1.4.2", "compatibility": { "minimum": 13, "verified": "14.359" diff --git a/zero-engine.mjs b/zero-engine.mjs index 01908c5..9128c57 100644 --- a/zero-engine.mjs +++ b/zero-engine.mjs @@ -1644,9 +1644,9 @@ class ZeroEngineActorSheet extends foundry.appv1.sheets.ActorSheet { ui.notifications.info(`${actor.name} rests — weapons restored: ${names}`); await ChatMessage.create({ speaker: ChatMessage.getSpeaker({ actor }), - content: `
+ content: `
🛏 ${actor.name} — RESTING
- Weapons restored: ${names} + Weapons restored: ${names}
` }); } @@ -1712,7 +1712,7 @@ class ZeroEngineActorSheet extends foundry.appv1.sheets.ActorSheet { await ChatMessage.create({ speaker: ChatMessage.getSpeaker({ actor }), flavor: `🔀 ${actor.name} — Instability Check`, - content: `

Rolled ${dieVal} + Instability ${currentInstability} = ${total}

✓ Held together. No effect.

`, + content: `

Rolled ${dieVal} + Instability ${currentInstability} = ${total}

✓ Held together. No effect.

`, rolls: [roll] }); return; @@ -1730,7 +1730,7 @@ class ZeroEngineActorSheet extends foundry.appv1.sheets.ActorSheet { let content = `
`; content += `

Rolled ${dieVal} + Instability ${currentInstability} = ${total}

`; content += `

${entry.name}

`; - content += `

${entry.effect}

`; + content += `

${entry.effect}

`; // Auto-apply immediate mechanical effects const updates = {}; @@ -1777,7 +1777,7 @@ class ZeroEngineActorSheet extends foundry.appv1.sheets.ActorSheet { await actor.update(updates); } if (notes.length > 0) { - content += `

Auto-applied: ${notes.join(' | ')}

`; + content += `

Auto-applied: ${notes.join(' | ')}

`; } content += '
'; @@ -2588,9 +2588,9 @@ class ZeroEngineActorSheet extends foundry.appv1.sheets.ActorSheet { await weaponItem.update({ 'system.ammoEmpty': true }); await ChatMessage.create({ speaker: ChatMessage.getSpeaker({ actor }), - content: `
- 🔒 ${weaponInfo.name} — OUT OF AMMO
- A stress die came up 1 on the push — the weapon has run dry. Rest to restore ammunition. + content: `
+ 🔒 ${weaponInfo.name} — OUT OF AMMO
+ A stress die came up 1 on the push — the weapon has run dry. Rest to restore ammunition.
` }); }