diff --git a/App/admin-styleguide.html b/App/admin-styleguide.html index 575b8a9..460c4e0 100644 --- a/App/admin-styleguide.html +++ b/App/admin-styleguide.html @@ -267,6 +267,13 @@ .khz-select{height:30px;border:1px solid rgba(0,0,0,.12);border-radius:8px;padding:0 .55rem;font-size:.78rem;color:#1f4e5a;font-weight:700;background:#f7f6f3;display:inline-flex;align-items:center;gap:.35rem;white-space:nowrap} .khz-range{width:96px;height:6px;border-radius:99px;background:linear-gradient(90deg,#4a7c8a 0 62%,#dfe6e9 62% 100%);position:relative} .khz-range::after{content:'';position:absolute;left:62%;top:50%;transform:translate(-50%,-50%);width:14px;height:14px;border-radius:50%;background:#4a7c8a;box-shadow:0 1px 3px rgba(0,0,0,.3)} + /* Tempo-Button zeigt IMMER den aktuellen Stand */ + .khz-spd{width:38px;height:38px;border-radius:12px;border:none;background:#fff;box-shadow:0 2px 9px rgba(0,0,0,.2);display:inline-flex;flex-direction:column;align-items:center;justify-content:center;color:#1f4e5a;font-weight:800;line-height:1;cursor:pointer;vertical-align:middle} + .khz-spd b{font-size:.82rem} + .khz-spd small{font-size:.5rem;font-weight:700;margin-top:1px;color:#4a7c8a;letter-spacing:.02em} + .khz-spd.act{background:#4a7c8a;color:#fff} + .khz-spd.act small{color:#dbe9ee} + .khz-spd .ic{width:18px;height:18px;color:inherit}
Tempo-Button im Header — zeigt IMMER den aktuellen Stand
+
+ + + + +
+

Klick öffnet das Tempo-Panel und lässt es offen bis zum erneuten Klick (Toggle) — genauso beim Musik-Player. Der Button selbst zeigt jederzeit den Speed: , , 8× Auto (z. B. Logistik) oder ⏸ Pause. So bleibt der Zustand sichtbar, ohne dass das Panel offen bleiben muss.

+
Aufgeklappt · Musikplayer (Klick auf das Musik-Icon)
diff --git a/App/php/api/live.php b/App/php/api/live.php index a46eb6e..dd48716 100644 --- a/App/php/api/live.php +++ b/App/php/api/live.php @@ -148,7 +148,9 @@ if ($method === 'GET') { // sonst der Sim-Score (Farmer/Weltküche liefern `score`). $extractScore = function($row) { $r = $row['results'] ? json_decode($row['results'], true) : []; - foreach ([$r['score'] ?? null, $r['results']['score'] ?? null] as $c) if (is_numeric($c)) return max(0, min(100, (int)round($c))); + // Von der Sim geliefertes Leistungs-% (0–100) hat Vorrang, dann score, dann Sterne→%. + foreach ([$r['leistung_pct'] ?? null, $r['results']['leistung_pct'] ?? null, $r['data']['leistung_pct'] ?? null, + $r['score'] ?? null, $r['results']['score'] ?? null] as $c) if (is_numeric($c)) return max(0, min(100, (int)round($c))); if (isset($r['stars']) && is_numeric($r['stars'])) return (int)round($r['stars'] / 5 * 100); return null; }; diff --git a/App/teacher.html b/App/teacher.html index c4bb4fe..6e449f1 100644 --- a/App/teacher.html +++ b/App/teacher.html @@ -682,6 +682,9 @@ function _pctBadge(pct) { function _leistungPct(simId, s) { if (!s || typeof s !== 'object') return null; var cl = function(v,a,b){ return Math.max(a, Math.min(b, v)); }; + // Von der Sim selbst geliefertes Leistungs-% hat Vorrang (Fundament-Umbau) — + // sonst zentrale Ableitung als Fallback. + if (typeof s.leistung_pct === 'number' && !isNaN(s.leistung_pct)) return cl(Math.round(s.leistung_pct), 0, 100); // Sims mit echtem 0–100-Live-Score (klima, fluss, kofferdetektiv, heli) direkt: if (typeof s.score === 'number' && simId !== 'weltkueche' && simId !== 'busfahrt' && simId !== 'fluggesellschaft') return cl(Math.round(s.score), 0, 100);