t1193: in-game menu (pause, resume, back to main menu with reward first)
@@ -71,12 +71,12 @@
71
71
72
72
<div id="online-login" hidden>
73
73
<p data-i18n="online.loginPrompt">To play online, log in with your account on auth.timfalken.com.</p>
74
<a id="btn-login" class="button" href="auth.php" data-i18n="menu.login">Log in</a>
74
<a id="btn-login" class="button" href="auth.php?return=online" data-i18n="menu.login">Log in</a>
75
75
<button type="button" class="btn-secondary" data-back-menu data-i18n="planet.back">Back</button>
76
76
<p id="local-login" class="hint" hidden>
77
77
<span data-i18n="online.localTest">Local test:</span>
78
<a href="auth.php?test=1">test_user_1</a> ·
79
<a href="auth.php?test=2">test_user_2</a>
78
<a href="auth.php?test=1&next=index.html%3Fonline%3D1">test_user_1</a> ·
79
<a href="auth.php?test=2&next=index.html%3Fonline%3D1">test_user_2</a>
80
80
</p>
81
81
</div>
82
82
@@ -172,9 +172,12 @@
172
172
<div class="hud-label" data-i18n="hud.points">Points</div>
173
173
<div id="score">0</div>
174
174
</div>
175
<div class="hud-right">
176
<div id="planet-name">Terra</div>
177
<div id="planet-stats"></div>
175
<div class="hud-right-wrap">
176
<div class="hud-right">
177
<div id="planet-name">Terra</div>
178
<div id="planet-stats"></div>
179
</div>
180
<button type="button" id="btn-game-menu" class="btn-game-menu" hidden aria-haspopup="dialog" aria-controls="game-menu" data-i18n-aria="game.menu" aria-label="Menu" title="Menu"><span aria-hidden="true">☰</span></button>
178
181
</div>
179
182
<div id="offline-hud" class="hud-offline" hidden>
180
183
<span id="offline-round">Round 1</span>
@@ -186,6 +189,14 @@
186
189
<div id="chain-indicator" hidden></div>
187
190
</div>
188
191
192
<div id="game-menu" class="screen overlay" role="dialog" aria-modal="true" aria-labelledby="game-menu-title" hidden>
193
<h2 id="game-menu-title" data-i18n="game.paused">Paused</h2>
194
<div class="game-menu-buttons">
195
<button type="button" id="btn-game-resume" class="btn-secondary btn-primary-ish" data-i18n="game.resume">Resume</button>
196
<button type="button" id="btn-game-quit" class="btn-secondary" data-i18n="game.backToMenu">Back to main menu</button>
197
</div>
198
</div>
199
189
200
<div id="offline-result" class="screen overlay" hidden>
190
201
<h2 data-i18n="offline.resultTitle">Offline Battle</h2>
191
202
<p id="offline-reached-line">You reached round <strong id="offline-reached">1</strong>.</p>
@@ -71,12 +71,12 @@71
71
72
<div id="online-login" hidden>72
<div id="online-login" hidden>73
<p data-i18n="online.loginPrompt">To play online, log in with your account on auth.timfalken.com.</p>73
<p data-i18n="online.loginPrompt">To play online, log in with your account on auth.timfalken.com.</p>74
<a id="btn-login" class="button" href="auth.php" data-i18n="menu.login">Log in</a>74
<a id="btn-login" class="button" href="auth.php?return=online" data-i18n="menu.login">Log in</a>75
<button type="button" class="btn-secondary" data-back-menu data-i18n="planet.back">Back</button>75
<button type="button" class="btn-secondary" data-back-menu data-i18n="planet.back">Back</button>76
<p id="local-login" class="hint" hidden>76
<p id="local-login" class="hint" hidden>77
<span data-i18n="online.localTest">Local test:</span>77
<span data-i18n="online.localTest">Local test:</span>78
<a href="auth.php?test=1">test_user_1</a> ·78
<a href="auth.php?test=1&next=index.html%3Fonline%3D1">test_user_1</a> ·79
<a href="auth.php?test=2">test_user_2</a>79
<a href="auth.php?test=2&next=index.html%3Fonline%3D1">test_user_2</a>80
</p>80
</p>81
</div>81
</div>82
82
@@ -172,9 +172,12 @@172
<div class="hud-label" data-i18n="hud.points">Points</div>172
<div class="hud-label" data-i18n="hud.points">Points</div>173
<div id="score">0</div>173
<div id="score">0</div>174
</div>174
</div>175
<div class="hud-right">175
<div class="hud-right-wrap">176
<div id="planet-name">Terra</div>176
<div class="hud-right">177
<div id="planet-stats"></div>177
<div id="planet-name">Terra</div>178
<div id="planet-stats"></div>179
</div>180
<button type="button" id="btn-game-menu" class="btn-game-menu" hidden aria-haspopup="dialog" aria-controls="game-menu" data-i18n-aria="game.menu" aria-label="Menu" title="Menu"><span aria-hidden="true">☰</span></button>178
</div>181
</div>179
<div id="offline-hud" class="hud-offline" hidden>182
<div id="offline-hud" class="hud-offline" hidden>180
<span id="offline-round">Round 1</span>183
<span id="offline-round">Round 1</span>@@ -186,6 +189,14 @@186
<div id="chain-indicator" hidden></div>189
<div id="chain-indicator" hidden></div>187
</div>190
</div>188
191
192
<div id="game-menu" class="screen overlay" role="dialog" aria-modal="true" aria-labelledby="game-menu-title" hidden>193
<h2 id="game-menu-title" data-i18n="game.paused">Paused</h2>194
<div class="game-menu-buttons">195
<button type="button" id="btn-game-resume" class="btn-secondary btn-primary-ish" data-i18n="game.resume">Resume</button>196
<button type="button" id="btn-game-quit" class="btn-secondary" data-i18n="game.backToMenu">Back to main menu</button>197
</div>198
</div>199
189
<div id="offline-result" class="screen overlay" hidden>200
<div id="offline-result" class="screen overlay" hidden>190
<h2 data-i18n="offline.resultTitle">Offline Battle</h2>201
<h2 data-i18n="offline.resultTitle">Offline Battle</h2>191
<p id="offline-reached-line">You reached round <strong id="offline-reached">1</strong>.</p>202
<p id="offline-reached-line">You reached round <strong id="offline-reached">1</strong>.</p>@@ -46,7 +46,7 @@ html, body {
46
46
text-align: center;
47
47
}
48
48
49
.screen[hidden], #hud[hidden], #game-over[hidden], #online-panel[hidden], #minis[hidden], #spectator[hidden], #podium[hidden], #flights[hidden], #flights-back[hidden], #planet-select[hidden], #offline-result[hidden], #offline-hud[hidden], #chain-indicator[hidden], #designer[hidden], #designer-edit[hidden], #reward[hidden] { display: none !important; }
49
.screen[hidden], #hud[hidden], #game-over[hidden], #online-panel[hidden], #minis[hidden], #spectator[hidden], #podium[hidden], #flights[hidden], #flights-back[hidden], #planet-select[hidden], #offline-result[hidden], #game-menu[hidden], #btn-game-menu[hidden], #offline-hud[hidden], #chain-indicator[hidden], #designer[hidden], #designer-edit[hidden], #reward[hidden] { display: none !important; }
50
50
51
51
h1 {
52
52
font-size: clamp(48px, 14vw, 96px);
@@ -1063,3 +1063,55 @@ html[lang="ja"], html[lang="zh-Hans"], html[lang="ko"] {
1063
1063
color: #8f96b2;
1064
1064
z-index: 3;
1065
1065
}
1066
1067
/* —— t1193 in-game menu (Spelen / Offline Strijd) —— */
1068
.hud-right-wrap {
1069
display: flex;
1070
align-items: flex-start;
1071
gap: 10px;
1072
min-width: 0;
1073
}
1074
.btn-game-menu {
1075
pointer-events: auto;
1076
flex: 0 0 auto;
1077
width: 40px;
1078
height: 40px;
1079
padding: 0;
1080
border: 1px solid #6a7394;
1081
border-radius: 10px;
1082
background: rgba(27, 32, 56, 0.85);
1083
color: #e8eaf2;
1084
font-size: 20px;
1085
line-height: 38px;
1086
cursor: pointer;
1087
touch-action: manipulation;
1088
-webkit-tap-highlight-color: transparent;
1089
}
1090
.btn-game-menu:is(:hover, :focus-visible) {
1091
border-color: #ffe27a;
1092
color: #fff6c8;
1093
}
1094
#game-menu {
1095
z-index: 60;
1096
}
1097
#game-menu h2 {
1098
color: #ffe27a;
1099
}
1100
.game-menu-buttons {
1101
display: flex;
1102
flex-direction: column;
1103
align-items: center;
1104
gap: 4px;
1105
margin-top: 8px;
1106
}
1107
.game-menu-buttons .btn-secondary {
1108
min-width: min(80vw, 300px);
1109
}
1110
.btn-primary-ish {
1111
border-color: #ffe27a !important;
1112
color: #fff6c8 !important;
1113
}
1114
@media (max-width: 520px) {
1115
.hud-right-wrap { gap: 6px; }
1116
.btn-game-menu { width: 36px; height: 36px; line-height: 34px; font-size: 18px; }
1117
}
@@ -46,7 +46,7 @@ html, body {46
text-align: center;46
text-align: center;47
}47
}48
48
49
.screen[hidden], #hud[hidden], #game-over[hidden], #online-panel[hidden], #minis[hidden], #spectator[hidden], #podium[hidden], #flights[hidden], #flights-back[hidden], #planet-select[hidden], #offline-result[hidden], #offline-hud[hidden], #chain-indicator[hidden], #designer[hidden], #designer-edit[hidden], #reward[hidden] { display: none !important; }49
.screen[hidden], #hud[hidden], #game-over[hidden], #online-panel[hidden], #minis[hidden], #spectator[hidden], #podium[hidden], #flights[hidden], #flights-back[hidden], #planet-select[hidden], #offline-result[hidden], #game-menu[hidden], #btn-game-menu[hidden], #offline-hud[hidden], #chain-indicator[hidden], #designer[hidden], #designer-edit[hidden], #reward[hidden] { display: none !important; }50
50
51
h1 {51
h1 {52
font-size: clamp(48px, 14vw, 96px);52
font-size: clamp(48px, 14vw, 96px);@@ -1063,3 +1063,55 @@ html[lang="ja"], html[lang="zh-Hans"], html[lang="ko"] {1063
color: #8f96b2;1063
color: #8f96b2;1064
z-index: 3;1064
z-index: 3;1065
}1065
}1066
1067
/* —— t1193 in-game menu (Spelen / Offline Strijd) —— */1068
.hud-right-wrap {1069
display: flex;1070
align-items: flex-start;1071
gap: 10px;1072
min-width: 0;1073
}1074
.btn-game-menu {1075
pointer-events: auto;1076
flex: 0 0 auto;1077
width: 40px;1078
height: 40px;1079
padding: 0;1080
border: 1px solid #6a7394;1081
border-radius: 10px;1082
background: rgba(27, 32, 56, 0.85);1083
color: #e8eaf2;1084
font-size: 20px;1085
line-height: 38px;1086
cursor: pointer;1087
touch-action: manipulation;1088
-webkit-tap-highlight-color: transparent;1089
}1090
.btn-game-menu:is(:hover, :focus-visible) {1091
border-color: #ffe27a;1092
color: #fff6c8;1093
}1094
#game-menu {1095
z-index: 60;1096
}1097
#game-menu h2 {1098
color: #ffe27a;1099
}1100
.game-menu-buttons {1101
display: flex;1102
flex-direction: column;1103
align-items: center;1104
gap: 4px;1105
margin-top: 8px;1106
}1107
.game-menu-buttons .btn-secondary {1108
min-width: min(80vw, 300px);1109
}1110
.btn-primary-ish {1111
border-color: #ffe27a !important;1112
color: #fff6c8 !important;1113
}1114
@media (max-width: 520px) {1115
.hud-right-wrap { gap: 6px; }1116
.btn-game-menu { width: 36px; height: 36px; line-height: 34px; font-size: 18px; }1117
}@@ -283,7 +283,12 @@
283
283
"reward.won": "You won!",
284
284
"reward.lost": "You lost...",
285
285
"reward.total": "Total points",
286
"reward.continue": "Tap to continue"
286
"reward.continue": "Tap to continue",
287
"game.menu": "Menu",
288
"game.paused": "Paused",
289
"game.resume": "Resume",
290
"game.backToMenu": "Back to main menu",
291
"reward.ended": "Game ended"
287
292
},
288
293
"nl": {
289
294
"menu.tagline": "Drie op een rij, en je blokjes krijgen raketmotoren.",
@@ -568,7 +573,12 @@
568
573
"reward.won": "Gewonnen!",
569
574
"reward.lost": "Verloren...",
570
575
"reward.total": "Totaal punten",
571
"reward.continue": "Tik om verder te gaan"
576
"reward.continue": "Tik om verder te gaan",
577
"game.menu": "Menu",
578
"game.paused": "Gepauzeerd",
579
"game.resume": "Verder spelen",
580
"game.backToMenu": "Terug naar hoofdmenu",
581
"reward.ended": "Spel gestopt"
572
582
},
573
583
"de": {
574
584
"menu.tagline": "Drei in einer Reihe — und deine Blöcke bekommen Raketenantrieb.",
@@ -853,7 +863,12 @@
853
863
"reward.won": "Gewonnen!",
854
864
"reward.lost": "Verloren...",
855
865
"reward.total": "Punkte gesamt",
856
"reward.continue": "Tippen zum Fortfahren"
866
"reward.continue": "Tippen zum Fortfahren",
867
"game.menu": "Menü",
868
"game.paused": "Pausiert",
869
"game.resume": "Weiterspielen",
870
"game.backToMenu": "Zurück zum Hauptmenü",
871
"reward.ended": "Spiel beendet"
857
872
},
858
873
"fr": {
859
874
"menu.tagline": "Trois d’affilée, et tes blocs s’équipent de propulseurs.",
@@ -1138,7 +1153,12 @@
1138
1153
"reward.won": "Victoire !",
1139
1154
"reward.lost": "Perdu...",
1140
1155
"reward.total": "Total des points",
1141
"reward.continue": "Touchez pour continuer"
1156
"reward.continue": "Touchez pour continuer",
1157
"game.menu": "Menu",
1158
"game.paused": "En pause",
1159
"game.resume": "Reprendre",
1160
"game.backToMenu": "Retour au menu principal",
1161
"reward.ended": "Partie terminée"
1142
1162
},
1143
1163
"ja": {
1144
1164
"menu.tagline": "三つ揃えると、ブロックにロケットが点火します。",
@@ -1423,7 +1443,12 @@
1423
1443
"reward.won": "勝利!",
1424
1444
"reward.lost": "敗北...",
1425
1445
"reward.total": "合計ポイント",
1426
"reward.continue": "タップして続ける"
1446
"reward.continue": "タップして続ける",
1447
"game.menu": "メニュー",
1448
"game.paused": "一時停止中",
1449
"game.resume": "再開",
1450
"game.backToMenu": "メインメニューに戻る",
1451
"reward.ended": "ゲーム終了"
1427
1452
},
1428
1453
"zh": {
1429
1454
"menu.tagline": "三个一排,你的方块就会装上火箭。",
@@ -1708,7 +1733,12 @@
1708
1733
"reward.won": "你赢了!",
1709
1734
"reward.lost": "你输了...",
1710
1735
"reward.total": "总积分",
1711
"reward.continue": "点击继续"
1736
"reward.continue": "点击继续",
1737
"game.menu": "菜单",
1738
"game.paused": "已暂停",
1739
"game.resume": "继续游戏",
1740
"game.backToMenu": "返回主菜单",
1741
"reward.ended": "游戏结束"
1712
1742
},
1713
1743
"ko": {
1714
1744
"menu.tagline": "세 개를 나란히 맞추면 블록에 로켓이 점화됩니다.",
@@ -1993,7 +2023,12 @@
1993
2023
"reward.won": "승리!",
1994
2024
"reward.lost": "패배...",
1995
2025
"reward.total": "총 포인트",
1996
"reward.continue": "탭하여 계속"
2026
"reward.continue": "탭하여 계속",
2027
"game.menu": "메뉴",
2028
"game.paused": "일시정지",
2029
"game.resume": "계속하기",
2030
"game.backToMenu": "메인 메뉴로 돌아가기",
2031
"reward.ended": "게임 종료"
1997
2032
},
1998
2033
"pl": {
1999
2034
"menu.tagline": "Trzy w rzędzie, a twoje klocki dostają napęd rakietowy.",
@@ -2278,7 +2313,12 @@
2278
2313
"reward.won": "Wygrana!",
2279
2314
"reward.lost": "Przegrana...",
2280
2315
"reward.total": "Suma punktów",
2281
"reward.continue": "Dotknij, aby kontynuować"
2316
"reward.continue": "Dotknij, aby kontynuować",
2317
"game.menu": "Menu",
2318
"game.paused": "Pauza",
2319
"game.resume": "Wznów",
2320
"game.backToMenu": "Powrót do menu głównego",
2321
"reward.ended": "Gra zakończona"
2282
2322
},
2283
2323
"ru": {
2284
2324
"menu.tagline": "Три в ряд — и твои блоки получают ракетные двигатели.",
@@ -2563,7 +2603,12 @@
2563
2603
"reward.won": "Победа!",
2564
2604
"reward.lost": "Поражение...",
2565
2605
"reward.total": "Всего очков",
2566
"reward.continue": "Нажмите, чтобы продолжить"
2606
"reward.continue": "Нажмите, чтобы продолжить",
2607
"game.menu": "Меню",
2608
"game.paused": "Пауза",
2609
"game.resume": "Продолжить",
2610
"game.backToMenu": "В главное меню",
2611
"reward.ended": "Игра окончена"
2567
2612
},
2568
2613
"es": {
2569
2614
"menu.tagline": "Tres en raya, y tus bloques ganan motores cohete.",
@@ -2848,7 +2893,12 @@
2848
2893
"reward.won": "¡Has ganado!",
2849
2894
"reward.lost": "Has perdido...",
2850
2895
"reward.total": "Puntos totales",
2851
"reward.continue": "Toca para continuar"
2896
"reward.continue": "Toca para continuar",
2897
"game.menu": "Menú",
2898
"game.paused": "En pausa",
2899
"game.resume": "Continuar",
2900
"game.backToMenu": "Volver al menú principal",
2901
"reward.ended": "Partida terminada"
2852
2902
}
2853
2903
},
2854
2904
"errors": {
@@ -283,7 +283,12 @@283
"reward.won": "You won!",283
"reward.won": "You won!",284
"reward.lost": "You lost...",284
"reward.lost": "You lost...",285
"reward.total": "Total points",285
"reward.total": "Total points",286
"reward.continue": "Tap to continue"286
"reward.continue": "Tap to continue",287
"game.menu": "Menu",288
"game.paused": "Paused",289
"game.resume": "Resume",290
"game.backToMenu": "Back to main menu",291
"reward.ended": "Game ended"287
},292
},288
"nl": {293
"nl": {289
"menu.tagline": "Drie op een rij, en je blokjes krijgen raketmotoren.",294
"menu.tagline": "Drie op een rij, en je blokjes krijgen raketmotoren.",@@ -568,7 +573,12 @@568
"reward.won": "Gewonnen!",573
"reward.won": "Gewonnen!",569
"reward.lost": "Verloren...",574
"reward.lost": "Verloren...",570
"reward.total": "Totaal punten",575
"reward.total": "Totaal punten",571
"reward.continue": "Tik om verder te gaan"576
"reward.continue": "Tik om verder te gaan",577
"game.menu": "Menu",578
"game.paused": "Gepauzeerd",579
"game.resume": "Verder spelen",580
"game.backToMenu": "Terug naar hoofdmenu",581
"reward.ended": "Spel gestopt"572
},582
},573
"de": {583
"de": {574
"menu.tagline": "Drei in einer Reihe — und deine Blöcke bekommen Raketenantrieb.",584
"menu.tagline": "Drei in einer Reihe — und deine Blöcke bekommen Raketenantrieb.",@@ -853,7 +863,12 @@853
"reward.won": "Gewonnen!",863
"reward.won": "Gewonnen!",854
"reward.lost": "Verloren...",864
"reward.lost": "Verloren...",855
"reward.total": "Punkte gesamt",865
"reward.total": "Punkte gesamt",856
"reward.continue": "Tippen zum Fortfahren"866
"reward.continue": "Tippen zum Fortfahren",867
"game.menu": "Menü",868
"game.paused": "Pausiert",869
"game.resume": "Weiterspielen",870
"game.backToMenu": "Zurück zum Hauptmenü",871
"reward.ended": "Spiel beendet"857
},872
},858
"fr": {873
"fr": {859
"menu.tagline": "Trois d’affilée, et tes blocs s’équipent de propulseurs.",874
"menu.tagline": "Trois d’affilée, et tes blocs s’équipent de propulseurs.",@@ -1138,7 +1153,12 @@1138
"reward.won": "Victoire !",1153
"reward.won": "Victoire !",1139
"reward.lost": "Perdu...",1154
"reward.lost": "Perdu...",1140
"reward.total": "Total des points",1155
"reward.total": "Total des points",1141
"reward.continue": "Touchez pour continuer"1156
"reward.continue": "Touchez pour continuer",1157
"game.menu": "Menu",1158
"game.paused": "En pause",1159
"game.resume": "Reprendre",1160
"game.backToMenu": "Retour au menu principal",1161
"reward.ended": "Partie terminée"1142
},1162
},1143
"ja": {1163
"ja": {1144
"menu.tagline": "三つ揃えると、ブロックにロケットが点火します。",1164
"menu.tagline": "三つ揃えると、ブロックにロケットが点火します。",@@ -1423,7 +1443,12 @@1423
"reward.won": "勝利!",1443
"reward.won": "勝利!",1424
"reward.lost": "敗北...",1444
"reward.lost": "敗北...",1425
"reward.total": "合計ポイント",1445
"reward.total": "合計ポイント",1426
"reward.continue": "タップして続ける"1446
"reward.continue": "タップして続ける",1447
"game.menu": "メニュー",1448
"game.paused": "一時停止中",1449
"game.resume": "再開",1450
"game.backToMenu": "メインメニューに戻る",1451
"reward.ended": "ゲーム終了"1427
},1452
},1428
"zh": {1453
"zh": {1429
"menu.tagline": "三个一排,你的方块就会装上火箭。",1454
"menu.tagline": "三个一排,你的方块就会装上火箭。",@@ -1708,7 +1733,12 @@1708
"reward.won": "你赢了!",1733
"reward.won": "你赢了!",1709
"reward.lost": "你输了...",1734
"reward.lost": "你输了...",1710
"reward.total": "总积分",1735
"reward.total": "总积分",1711
"reward.continue": "点击继续"1736
"reward.continue": "点击继续",1737
"game.menu": "菜单",1738
"game.paused": "已暂停",1739
"game.resume": "继续游戏",1740
"game.backToMenu": "返回主菜单",1741
"reward.ended": "游戏结束"1712
},1742
},1713
"ko": {1743
"ko": {1714
"menu.tagline": "세 개를 나란히 맞추면 블록에 로켓이 점화됩니다.",1744
"menu.tagline": "세 개를 나란히 맞추면 블록에 로켓이 점화됩니다.",@@ -1993,7 +2023,12 @@1993
"reward.won": "승리!",2023
"reward.won": "승리!",1994
"reward.lost": "패배...",2024
"reward.lost": "패배...",1995
"reward.total": "총 포인트",2025
"reward.total": "총 포인트",1996
"reward.continue": "탭하여 계속"2026
"reward.continue": "탭하여 계속",2027
"game.menu": "메뉴",2028
"game.paused": "일시정지",2029
"game.resume": "계속하기",2030
"game.backToMenu": "메인 메뉴로 돌아가기",2031
"reward.ended": "게임 종료"1997
},2032
},1998
"pl": {2033
"pl": {1999
"menu.tagline": "Trzy w rzędzie, a twoje klocki dostają napęd rakietowy.",2034
"menu.tagline": "Trzy w rzędzie, a twoje klocki dostają napęd rakietowy.",@@ -2278,7 +2313,12 @@2278
"reward.won": "Wygrana!",2313
"reward.won": "Wygrana!",2279
"reward.lost": "Przegrana...",2314
"reward.lost": "Przegrana...",2280
"reward.total": "Suma punktów",2315
"reward.total": "Suma punktów",2281
"reward.continue": "Dotknij, aby kontynuować"2316
"reward.continue": "Dotknij, aby kontynuować",2317
"game.menu": "Menu",2318
"game.paused": "Pauza",2319
"game.resume": "Wznów",2320
"game.backToMenu": "Powrót do menu głównego",2321
"reward.ended": "Gra zakończona"2282
},2322
},2283
"ru": {2323
"ru": {2284
"menu.tagline": "Три в ряд — и твои блоки получают ракетные двигатели.",2324
"menu.tagline": "Три в ряд — и твои блоки получают ракетные двигатели.",@@ -2563,7 +2603,12 @@2563
"reward.won": "Победа!",2603
"reward.won": "Победа!",2564
"reward.lost": "Поражение...",2604
"reward.lost": "Поражение...",2565
"reward.total": "Всего очков",2605
"reward.total": "Всего очков",2566
"reward.continue": "Нажмите, чтобы продолжить"2606
"reward.continue": "Нажмите, чтобы продолжить",2607
"game.menu": "Меню",2608
"game.paused": "Пауза",2609
"game.resume": "Продолжить",2610
"game.backToMenu": "В главное меню",2611
"reward.ended": "Игра окончена"2567
},2612
},2568
"es": {2613
"es": {2569
"menu.tagline": "Tres en raya, y tus bloques ganan motores cohete.",2614
"menu.tagline": "Tres en raya, y tus bloques ganan motores cohete.",@@ -2848,7 +2893,12 @@2848
"reward.won": "¡Has ganado!",2893
"reward.won": "¡Has ganado!",2849
"reward.lost": "Has perdido...",2894
"reward.lost": "Has perdido...",2850
"reward.total": "Puntos totales",2895
"reward.total": "Puntos totales",2851
"reward.continue": "Toca para continuar"2896
"reward.continue": "Toca para continuar",2897
"game.menu": "Menú",2898
"game.paused": "En pausa",2899
"game.resume": "Continuar",2900
"game.backToMenu": "Volver al menú principal",2901
"reward.ended": "Partida terminada"2852
}2902
}2853
},2903
},2854
"errors": {2904
"errors": {@@ -98,6 +98,7 @@ window.onload = function ()
98
98
app.debugPhysics = isPhysicsDebugEnabled();
99
99
var play = document.getElementById('btn-play');
100
100
play.addEventListener('click', onPlay);
101
bindGameMenu();
101
102
play.addEventListener('pointerup', function (e)
102
103
{
103
104
// A touch-friendly path: some mobile browsers swallow the click
@@ -228,6 +229,7 @@ function startPlay (opts)
228
229
{ bindPointer(app.scene.canvas); }
229
230
refreshHud();
230
231
showEl('hud');
232
setGameMenuButton(!app.online && !app.spectating);
231
233
}
232
234
catch (err)
233
235
{
@@ -327,6 +329,10 @@ function teardownPlay ()
327
329
app.columnWarn = [];
328
330
app.pointerId = null;
329
331
app.gameOverShown = false;
332
app.paused = false;
333
app.quitting = false;
334
hideEl('game-menu');
335
setGameMenuButton(false);
330
336
hideEl('hud');
331
337
hideEl('game-over');
332
338
hideEl('spectator');
@@ -894,6 +900,14 @@ function tickView (dt)
894
900
placeTile(app.cells[i], col, row);
895
901
}
896
902
903
// t1193: in-game menu open (Spelen / Offline Strijd) or quitting:
904
// the field, bots and timers stand still; only the view is kept.
905
if (app.paused)
906
{
907
syncSprites(0);
908
return;
909
}
910
897
911
app.core.tick(dt);
898
912
if (app.offline && app.battle)
899
913
{ tickOffline(dt); }
@@ -1095,7 +1109,16 @@ function fieldFromEvent (e)
1095
1109
1096
1110
function playingForDrag ()
1097
1111
{
1098
return app.core && app.core.state === 'playing';
1112
return app.core && app.core.state === 'playing' && !app.paused;
1113
}
1114
1115
/** Touches on HUD buttons / menus are UI taps, not field drags (t1193). */
1116
function isUiTouchTarget (e)
1117
{
1118
var el = e && e.target;
1119
if (!el || !el.closest)
1120
{ return false; }
1121
return !!el.closest('button, a, input, select, #game-menu, #reward');
1099
1122
}
1100
1123
1101
1124
function startDragFromEvent (e)
@@ -1245,6 +1268,8 @@ function onTouchStart (e)
1245
1268
{
1246
1269
if (!playingForDrag())
1247
1270
{ return; }
1271
if (app.activeTouchId == null && isUiTouchTarget(e))
1272
{ return; }
1248
1273
if (app.activeTouchId != null)
1249
1274
{
1250
1275
if (e.preventDefault)
@@ -2143,7 +2168,17 @@ function bindOnlineUi ()
2143
2168
2144
2169
var params = new URLSearchParams(window.location.search);
2145
2170
if (params.get('online') === '1' || params.get('auth') === 'unconfigured')
2146
{ openOnlinePanel(); }
2171
{
2172
openOnlinePanel();
2173
// t1193: one-shot; a reload must not jump to online play again.
2174
try
2175
{
2176
params.delete('online');
2177
var rest = params.toString();
2178
window.history.replaceState(null, '', window.location.pathname + (rest ? '?' + rest : '') + window.location.hash);
2179
}
2180
catch (e) { /* ignore */ }
2181
}
2147
2182
}
2148
2183
2149
2184
function openOnlinePanel ()
@@ -2495,6 +2530,102 @@ function refreshMenuAccount ()
2495
2530
{ localLogin.hidden = !(typeof Online !== 'undefined' && Online.local); }
2496
2531
}
2497
2532
2533
/* ---------- t1193 in-game menu (Spelen / Offline Strijd) ----------- */
2534
2535
function setGameMenuButton (show)
2536
{
2537
var btn = document.getElementById('btn-game-menu');
2538
if (btn)
2539
{ btn.hidden = !show; }
2540
}
2541
2542
/** The menu can open during a running solo / offline field only. */
2543
function canOpenGameMenu ()
2544
{
2545
return app.mode === 'playing' && !!app.core && !app.online && !app.spectating
2546
&& app.core.state === 'playing' && !app.rewardActive && !app.quitting
2547
&& !(app.offline && app.battle && app.battle.state !== 'playing');
2548
}
2549
2550
function openGameMenu ()
2551
{
2552
if (!canOpenGameMenu())
2553
{ return false; }
2554
if (app.core.drag)
2555
{ finishDrag({ noLaunch: true }); }
2556
app.paused = true;
2557
showEl('game-menu');
2558
var resume = document.getElementById('btn-game-resume');
2559
if (resume && resume.focus)
2560
{ resume.focus(); }
2561
return true;
2562
}
2563
2564
function resumeFromGameMenu ()
2565
{
2566
hideEl('game-menu');
2567
if (!app.quitting)
2568
{ app.paused = false; }
2569
}
2570
2571
/**
2572
* "Back to main menu": ends the match now. Logged in, the points so far
2573
* go through the normal play_finish + reward screen first (the server
2574
* still applies its caps); logged out, straight to the menu. Offline
2575
* Strijd ends the whole battle (no next round).
2576
*/
2577
function quitToMainMenu ()
2578
{
2579
if (!app.core || app.quitting)
2580
{ return; }
2581
hideEl('game-menu');
2582
app.paused = true;
2583
app.quitting = true;
2584
app.gameOverShown = true;
2585
app.lastScore = app.core.score || 0;
2586
setGameMenuButton(false);
2587
var score = app.lastScore;
2588
var done = function ()
2589
{
2590
app.quitting = false;
2591
app.paused = false;
2592
returnToMenu();
2593
};
2594
if (rewardEnabled())
2595
{
2596
var title = (typeof I18n !== 'undefined') ? I18n.t('reward.ended') : 'Game ended';
2597
showReward(false, finishPlaySession(score), done, title);
2598
}
2599
else
2600
{
2601
finishPlaySession(score);
2602
done();
2603
}
2604
}
2605
2606
function bindGameMenu ()
2607
{
2608
var btn = document.getElementById('btn-game-menu');
2609
if (btn)
2610
{ btn.addEventListener('click', function () { openGameMenu(); }); }
2611
var resume = document.getElementById('btn-game-resume');
2612
if (resume)
2613
{ resume.addEventListener('click', resumeFromGameMenu); }
2614
var quit = document.getElementById('btn-game-quit');
2615
if (quit)
2616
{ quit.addEventListener('click', quitToMainMenu); }
2617
document.addEventListener('keydown', function (e)
2618
{
2619
if (e.key !== 'Escape')
2620
{ return; }
2621
var menu = document.getElementById('game-menu');
2622
if (menu && !menu.hidden)
2623
{ resumeFromGameMenu(); }
2624
else
2625
{ openGameMenu(); }
2626
});
2627
}
2628
2498
2629
function beginPlaySession (mode)
2499
2630
{
2500
2631
if (app.playToken)
@@ -2550,7 +2681,7 @@ function rewardEnabled ()
2550
2681
* next() — the same destination the mode used before (menu, next
2551
2682
* offline round, offline result, or the online lobby/podium).
2552
2683
*/
2553
function showReward (won, resultPromise, next)
2684
function showReward (won, resultPromise, next, title)
2554
2685
{
2555
2686
app.rewardActive = true;
2556
2687
hideEl('game-over');
@@ -2558,6 +2689,7 @@ function showReward (won, resultPromise, next)
2558
2689
hideEl('podium');
2559
2690
var handle = Reward.play({
2560
2691
won: won,
2692
title: title || null,
2561
2693
planet: app.planet,
2562
2694
result: resultPromise,
2563
2695
onDone: function ()
@@ -2568,7 +2700,12 @@ function showReward (won, resultPromise, next)
2568
2700
}
2569
2701
});
2570
2702
if (!handle)
2571
{ app.rewardActive = false; }
2703
{
2704
app.rewardActive = false;
2705
// No reward overlay (e.g. missing DOM): still continue (t1193).
2706
if (title && next)
2707
{ next(); }
2708
}
2572
2709
}
2573
2710
2574
2711
function myOnlinePlace (lobby)
@@ -98,6 +98,7 @@ window.onload = function ()98
app.debugPhysics = isPhysicsDebugEnabled();98
app.debugPhysics = isPhysicsDebugEnabled();99
var play = document.getElementById('btn-play');99
var play = document.getElementById('btn-play');100
play.addEventListener('click', onPlay);100
play.addEventListener('click', onPlay);101
bindGameMenu();101
play.addEventListener('pointerup', function (e)102
play.addEventListener('pointerup', function (e)102
{103
{103
// A touch-friendly path: some mobile browsers swallow the click104
// A touch-friendly path: some mobile browsers swallow the click@@ -228,6 +229,7 @@ function startPlay (opts)228
{ bindPointer(app.scene.canvas); }229
{ bindPointer(app.scene.canvas); }229
refreshHud();230
refreshHud();230
showEl('hud');231
showEl('hud');232
setGameMenuButton(!app.online && !app.spectating);231
}233
}232
catch (err)234
catch (err)233
{235
{@@ -327,6 +329,10 @@ function teardownPlay ()327
app.columnWarn = [];329
app.columnWarn = [];328
app.pointerId = null;330
app.pointerId = null;329
app.gameOverShown = false;331
app.gameOverShown = false;332
app.paused = false;333
app.quitting = false;334
hideEl('game-menu');335
setGameMenuButton(false);330
hideEl('hud');336
hideEl('hud');331
hideEl('game-over');337
hideEl('game-over');332
hideEl('spectator');338
hideEl('spectator');@@ -894,6 +900,14 @@ function tickView (dt)894
placeTile(app.cells[i], col, row);900
placeTile(app.cells[i], col, row);895
}901
}896
902
903
// t1193: in-game menu open (Spelen / Offline Strijd) or quitting:904
// the field, bots and timers stand still; only the view is kept.905
if (app.paused)906
{907
syncSprites(0);908
return;909
}910
897
app.core.tick(dt);911
app.core.tick(dt);898
if (app.offline && app.battle)912
if (app.offline && app.battle)899
{ tickOffline(dt); }913
{ tickOffline(dt); }@@ -1095,7 +1109,16 @@ function fieldFromEvent (e)1095
1109
1096
function playingForDrag ()1110
function playingForDrag ()1097
{1111
{1098
return app.core && app.core.state === 'playing';1112
return app.core && app.core.state === 'playing' && !app.paused;1113
}1114
1115
/** Touches on HUD buttons / menus are UI taps, not field drags (t1193). */1116
function isUiTouchTarget (e)1117
{1118
var el = e && e.target;1119
if (!el || !el.closest)1120
{ return false; }1121
return !!el.closest('button, a, input, select, #game-menu, #reward');1099
}1122
}1100
1123
1101
function startDragFromEvent (e)1124
function startDragFromEvent (e)@@ -1245,6 +1268,8 @@ function onTouchStart (e)1245
{1268
{1246
if (!playingForDrag())1269
if (!playingForDrag())1247
{ return; }1270
{ return; }1271
if (app.activeTouchId == null && isUiTouchTarget(e))1272
{ return; }1248
if (app.activeTouchId != null)1273
if (app.activeTouchId != null)1249
{1274
{1250
if (e.preventDefault)1275
if (e.preventDefault)@@ -2143,7 +2168,17 @@ function bindOnlineUi ()2143
2168
2144
var params = new URLSearchParams(window.location.search);2169
var params = new URLSearchParams(window.location.search);2145
if (params.get('online') === '1' || params.get('auth') === 'unconfigured')2170
if (params.get('online') === '1' || params.get('auth') === 'unconfigured')2146
{ openOnlinePanel(); }2171
{2172
openOnlinePanel();2173
// t1193: one-shot; a reload must not jump to online play again.2174
try2175
{2176
params.delete('online');2177
var rest = params.toString();2178
window.history.replaceState(null, '', window.location.pathname + (rest ? '?' + rest : '') + window.location.hash);2179
}2180
catch (e) { /* ignore */ }2181
}2147
}2182
}2148
2183
2149
function openOnlinePanel ()2184
function openOnlinePanel ()@@ -2495,6 +2530,102 @@ function refreshMenuAccount ()2495
{ localLogin.hidden = !(typeof Online !== 'undefined' && Online.local); }2530
{ localLogin.hidden = !(typeof Online !== 'undefined' && Online.local); }2496
}2531
}2497
2532
2533
/* ---------- t1193 in-game menu (Spelen / Offline Strijd) ----------- */2534
2535
function setGameMenuButton (show)2536
{2537
var btn = document.getElementById('btn-game-menu');2538
if (btn)2539
{ btn.hidden = !show; }2540
}2541
2542
/** The menu can open during a running solo / offline field only. */2543
function canOpenGameMenu ()2544
{2545
return app.mode === 'playing' && !!app.core && !app.online && !app.spectating2546
&& app.core.state === 'playing' && !app.rewardActive && !app.quitting2547
&& !(app.offline && app.battle && app.battle.state !== 'playing');2548
}2549
2550
function openGameMenu ()2551
{2552
if (!canOpenGameMenu())2553
{ return false; }2554
if (app.core.drag)2555
{ finishDrag({ noLaunch: true }); }2556
app.paused = true;2557
showEl('game-menu');2558
var resume = document.getElementById('btn-game-resume');2559
if (resume && resume.focus)2560
{ resume.focus(); }2561
return true;2562
}2563
2564
function resumeFromGameMenu ()2565
{2566
hideEl('game-menu');2567
if (!app.quitting)2568
{ app.paused = false; }2569
}2570
2571
/**2572
* "Back to main menu": ends the match now. Logged in, the points so far2573
* go through the normal play_finish + reward screen first (the server2574
* still applies its caps); logged out, straight to the menu. Offline2575
* Strijd ends the whole battle (no next round).2576
*/2577
function quitToMainMenu ()2578
{2579
if (!app.core || app.quitting)2580
{ return; }2581
hideEl('game-menu');2582
app.paused = true;2583
app.quitting = true;2584
app.gameOverShown = true;2585
app.lastScore = app.core.score || 0;2586
setGameMenuButton(false);2587
var score = app.lastScore;2588
var done = function ()2589
{2590
app.quitting = false;2591
app.paused = false;2592
returnToMenu();2593
};2594
if (rewardEnabled())2595
{2596
var title = (typeof I18n !== 'undefined') ? I18n.t('reward.ended') : 'Game ended';2597
showReward(false, finishPlaySession(score), done, title);2598
}2599
else2600
{2601
finishPlaySession(score);2602
done();2603
}2604
}2605
2606
function bindGameMenu ()2607
{2608
var btn = document.getElementById('btn-game-menu');2609
if (btn)2610
{ btn.addEventListener('click', function () { openGameMenu(); }); }2611
var resume = document.getElementById('btn-game-resume');2612
if (resume)2613
{ resume.addEventListener('click', resumeFromGameMenu); }2614
var quit = document.getElementById('btn-game-quit');2615
if (quit)2616
{ quit.addEventListener('click', quitToMainMenu); }2617
document.addEventListener('keydown', function (e)2618
{2619
if (e.key !== 'Escape')2620
{ return; }2621
var menu = document.getElementById('game-menu');2622
if (menu && !menu.hidden)2623
{ resumeFromGameMenu(); }2624
else2625
{ openGameMenu(); }2626
});2627
}2628
2498
function beginPlaySession (mode)2629
function beginPlaySession (mode)2499
{2630
{2500
if (app.playToken)2631
if (app.playToken)@@ -2550,7 +2681,7 @@ function rewardEnabled ()2550
* next() — the same destination the mode used before (menu, next2681
* next() — the same destination the mode used before (menu, next2551
* offline round, offline result, or the online lobby/podium).2682
* offline round, offline result, or the online lobby/podium).2552
*/2683
*/2553
function showReward (won, resultPromise, next)2684
function showReward (won, resultPromise, next, title)2554
{2685
{2555
app.rewardActive = true;2686
app.rewardActive = true;2556
hideEl('game-over');2687
hideEl('game-over');@@ -2558,6 +2689,7 @@ function showReward (won, resultPromise, next)2558
hideEl('podium');2689
hideEl('podium');2559
var handle = Reward.play({2690
var handle = Reward.play({2560
won: won,2691
won: won,2692
title: title || null,2561
planet: app.planet,2693
planet: app.planet,2562
result: resultPromise,2694
result: resultPromise,2563
onDone: function ()2695
onDone: function ()@@ -2568,7 +2700,12 @@ function showReward (won, resultPromise, next)2568
}2700
}2569
});2701
});2570
if (!handle)2702
if (!handle)2571
{ app.rewardActive = false; }2703
{2704
app.rewardActive = false;2705
// No reward overlay (e.g. missing DOM): still continue (t1193).2706
if (title && next)2707
{ next(); }2708
}2572
}2709
}2573
2710
2574
function myOnlinePlace (lobby)2711
function myOnlinePlace (lobby)