leistung_pct-Fundament (Teacher+Backend bevorzugen) + Tempo-Button-Zustaende

- teacher.html _leistungPct: von der Sim geliefertes s.leistung_pct hat
  Vorrang, sonst zentrale Ableitung (Fallback).
- live.php extractScore: leistung_pct (0-100) hat Vorrang vor score/Sterne.
- admin-styleguide.html: Tempo-Button zeigt IMMER den Stand (1x/2x/8x Auto/
  Pause); Toggle-Verhalten (Panel bleibt offen bis erneutem Klick) beschrieben.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-08-25 12:31:23 +02:00
parent 7e1a7c5228
commit 539f6b012e
3 changed files with 22 additions and 1 deletions
+3
View File
@@ -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 0100-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);