Busfahrt: nur EIN Onboarding (Welcome-Overlay abgeloest)
Ursache 2x: Busfahrt zeigte sein eigenes #welcome-overlay UND das GgsQuickIntro-Onboarding. Jetzt ist GgsQuickIntro das einzige Start-Gate: - ggs-quick-intro: onStart-Callback (feuert einmal beim Schliessen bzw. sofort wenn schon gesehen), isSeen exportiert. - Busfahrt: welcome-overlay wird nicht mehr gezeigt; onStart -> startGame; startGame wartet per Retry auf boot() (kein Timing-Problem). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -842,6 +842,7 @@
|
||||
window.addEventListener('DOMContentLoaded', function () {
|
||||
if (window.GgsQuickIntro) GgsQuickIntro.init({
|
||||
simId: 'busfahrt',
|
||||
onStart: function () { startGame(); }, // Onboarding schliessen startet die Tour
|
||||
title: '🚌 Busfahrt',
|
||||
lead: 'Du fährst mit dem Reisebus Aufträge quer durch Europa. Wäge gut ab: Zeit, Distanz und Bezahlung entscheiden über deinen Gewinn.',
|
||||
steps: [
|
||||
@@ -1315,8 +1316,8 @@ async function boot() {
|
||||
? (ECON.targetBudget[lvl] || 7500)
|
||||
: ECON.targetBudget;
|
||||
document.getElementById('welcome-target').textContent = formatEur(target);
|
||||
|
||||
document.getElementById('welcome-overlay').classList.add('show');
|
||||
// Kein separates Welcome-Overlay mehr: das GgsQuickIntro-Onboarding ist das
|
||||
// einzige Start-Gate — dessen Schliessen ruft startGame() (siehe onStart).
|
||||
}
|
||||
|
||||
function updateTopbar() {
|
||||
@@ -1334,9 +1335,11 @@ function updateTopbar() {
|
||||
}
|
||||
|
||||
function startGame() {
|
||||
document.getElementById('welcome-overlay').classList.remove('show');
|
||||
if (!game) { setTimeout(startGame, 60); return; } // auf boot() warten
|
||||
const wo = document.getElementById('welcome-overlay');
|
||||
if (wo) wo.classList.remove('show');
|
||||
initAudioOnFirstInteraction();
|
||||
if (game && !game._startedAt) game._startedAt = Date.now();
|
||||
if (!game._startedAt) game._startedAt = Date.now();
|
||||
loadNextOrder();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user