Heli Aktuell: letzten Einsatz in der Auftragswahl behalten
game.html: bei Mission-Ende Snapshot game.lastResult (Start/Landung/Gesamt); GGS_LIVE_STATE zeigt in mission/briefing den letzten Einsatz statt leerer Spalten. teacher.html Status: "✓/⚠ letzter Einsatz" wenn Werte aus dem letzten Lauf stammen. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+22
-5
@@ -464,10 +464,13 @@ window.GGS_LIVE_STATE = function () {
|
||||
var POST_START = ['flight','approach','landing','results'];
|
||||
var startDone = phase && POST_START.indexOf(phase) >= 0;
|
||||
var landingDone = phase === 'results';
|
||||
// In der Auftragswahl/Briefing (keine aktive Mission) das letzte Ergebnis zeigen.
|
||||
var atSelect = (!phase || phase === 'mission' || phase === 'briefing');
|
||||
var lr = (atSelect && game.lastResult) ? game.lastResult : null;
|
||||
return {
|
||||
phase: phase,
|
||||
missionId: m.id || null,
|
||||
missionTitle: m.title || null,
|
||||
missionId: m.id || (lr ? lr.missionId : null),
|
||||
missionTitle: m.title || (lr ? lr.missionTitle : null),
|
||||
heliKey: (m.heliKey || (m.base && BASE_CONFIG[m.base] && BASE_CONFIG[m.base].heliKey)) || null,
|
||||
heliName: (m.base ? displayHeliName(m.base) : null),
|
||||
stationCallsign: game.stationCallsign || null,
|
||||
@@ -475,9 +478,11 @@ window.GGS_LIVE_STATE = function () {
|
||||
planTotal: routeLen ? routeLen - 1 : 0,
|
||||
planCorrect: game.planCorrect || 0,
|
||||
planAttempts: game.planAttempts || 0,
|
||||
startScore: startDone ? (game.startScore || 0) : null,
|
||||
landingScore: landingDone ? (game.landingScore || 0) : null,
|
||||
totalStars: landingDone ? (game.totalStars || 0) : null,
|
||||
startScore: startDone ? (game.startScore || 0) : (lr ? lr.startScore : null),
|
||||
landingScore: landingDone ? (game.landingScore || 0) : (lr ? lr.landingScore : null),
|
||||
totalStars: landingDone ? (game.totalStars || 0) : (lr ? lr.totalStars : null),
|
||||
lastResult: lr ? true : false,
|
||||
lastFailed: lr ? !!lr.failed : false,
|
||||
failed: !!game.missionFailed,
|
||||
missionStartedAt: game.missionStartedAt || null,
|
||||
// Laufender 0–100-Score für die Ampelfarbe im Lehrer-Live (Tag-Balken).
|
||||
@@ -1840,6 +1845,18 @@ function initResultsPhase() {
|
||||
if (game.planTakeover) planStars = 0;
|
||||
var totalStars = Math.round((planStars + game.startScore + game.landingScore) / 3);
|
||||
game.totalStars = totalStars;
|
||||
// Snapshot des zuletzt abgeschlossenen Einsatzes — damit die Lehrer-Ansicht
|
||||
// „Aktuell" in der Auftragswahl (zwischen zwei Missionen) noch das letzte
|
||||
// Ergebnis (Start/Landung/Gesamt) zeigt statt leerer Spalten.
|
||||
game.lastResult = {
|
||||
missionId: game.mission ? game.mission.id : null,
|
||||
missionTitle: game.mission ? game.mission.title : null,
|
||||
planStars: planStars,
|
||||
startScore: game.startScore || 0,
|
||||
landingScore: game.landingScore || 0,
|
||||
totalStars: totalStars,
|
||||
failed: !!game.missionFailed,
|
||||
};
|
||||
// Assessment-Hook 3: Mission-Ende (mit Sterne + Dauer)
|
||||
assessmentComplete();
|
||||
// Submit ans Lehrer-Cockpit (player_progress + student_results)
|
||||
|
||||
+6
-1
@@ -905,7 +905,12 @@ var LIVE_PRIMARY_FIELDS = {
|
||||
var s = row.state||{};
|
||||
if (v === true) return '<span style="color:#c07a6b;font-weight:700">⚠ Chefpilot</span>';
|
||||
if (s.phase === 'results') return '<span style="color:#5a8a5e;font-weight:700">✓ Erfolg</span>';
|
||||
if (s.phase === 'mission' || !s.phase) return '<span style="color:#8a8a8a">wählt Auftrag</span>';
|
||||
if (s.phase === 'mission' || !s.phase) {
|
||||
if (s.lastResult) return s.lastFailed
|
||||
? '<span style="color:#c07a6b;font-weight:600" title="Werte = letzter Einsatz">⚠ letzter Einsatz</span>'
|
||||
: '<span style="color:#5a8a5e;font-weight:600" title="Werte = letzter Einsatz">✓ letzter Einsatz</span>';
|
||||
return '<span style="color:#8a8a8a">wählt Auftrag</span>';
|
||||
}
|
||||
return '<span style="color:#4a7c8a;font-weight:600">🟢 unterwegs</span>';
|
||||
}},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user