From 4cbdb6bbb1b083e7bdb5df5d0e7c148333937723 Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 25 Aug 2026 15:31:33 +0200 Subject: [PATCH] Farmer: Klick-Blocker gefixt (updateMoneyDisplay-Crash) + Konsolidierung ROOT CAUSE: #money-display aus Header entfernt, aber updateMoneyDisplay() las es beim Boot ungeschuetzt -> null.textContent wirft -> Boot bricht ab -> map.on('click') wird nie gebunden -> Sim unbedienbar. Jetzt null-safe. Konsolidierung (Thomas-Wunsch): Jahr/Markt/Erntejahr-starten in die Anbau-Versuch-Box (farmer-side-status) statt separater Jahr-Leiste; Jahr-Badge aus der Pille raus. Anbau-Box wieder hoeher (top 64). Co-Authored-By: Claude Opus 4.8 --- App/sims/farmer/game.html | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/App/sims/farmer/game.html b/App/sims/farmer/game.html index eac10e4..65787fd 100644 --- a/App/sims/farmer/game.html +++ b/App/sims/farmer/game.html @@ -127,11 +127,20 @@ /* ===== Side-Panel (rechts unter Year-Bar) — toggelt zwischen Picker und Report ===== */ .farmer-side { - position: absolute; right: 8px; top: 112px; z-index: 1000; - max-height: calc(100dvh - 92px - env(safe-area-inset-bottom)); + position: absolute; right: 8px; top: 64px; z-index: 1000; + max-height: calc(100dvh - 80px - env(safe-area-inset-bottom)); overflow-y: auto; width: 240px; } + .farmer-side-status { + background: rgba(255, 255, 255, 0.95); + border-radius: 8px; padding: 8px; + box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15); + display: flex; gap: 6px; align-items: center; flex-wrap: wrap; + margin-bottom: 6px; + } + .fs-year { color: #8b5a2b; font-weight: 800; font-size: 14px; white-space: nowrap; } + .farmer-side-status .farmer-harvest-btn { flex: 1 0 100%; } /* Picker */ .farmer-picker { @@ -491,7 +500,6 @@

Landwirtschaft

- Jahr 1
🏠 @@ -501,14 +509,6 @@
-
- - Markt - - - -
-
📊 Bilanz im Verlauf
@@ -533,6 +533,14 @@
+
+ Jahr 1 + + Markt + + + +
Anbau-Versuch
@@ -1742,10 +1750,12 @@ function updateMarketDisplay() { } function updateMoneyDisplay() { - const el = document.getElementById('money-display'); - el.textContent = game.money.toLocaleString('de-DE') + ' €'; const isNeg = game.money < 0; - el.classList.toggle('negative', isNeg); + const el = document.getElementById('money-display'); // optional (steht jetzt in der KPI-Sidebar) + if (el) { + el.textContent = game.money.toLocaleString('de-DE') + ' €'; + el.classList.toggle('negative', isNeg); + } if (isNeg && !_prevMoneyNeg) playSound('negative_balance'); _prevMoneyNeg = isNeg; updateKpi(); // KPIs sind an Money-Update gekoppelt — bei jeder Bilanz-Änderung neu rendern