feat(fight): give up a live fight from the pause card

This commit is contained in:
Benjamin Oezcan
2026-11-19 09:47:22 +01:00
parent 0ee589c91e
commit dd120f47f8
2 changed files with 10 additions and 3 deletions

View File

@@ -1879,7 +1879,14 @@
function togglePause() {
overlayEnter();
if (F && F.online && mode === 'fight') { banner(t('no_pause_online'), '#ffffff', 1.4); return; }
// live fight: no pause (the server keeps running) - but you can give up; the fight goes on behind the card
if (F && F.online && mode === 'fight') {
if ($('bGiveUp')) { hideOverlay(); return; } // second press closes the card again
card(`<h2>${t('pause')}</h2><p>${t('no_pause_online')}</p><div class="row"><button id="bGiveUp">${t('give_up')}</button><button class="primary" id="bGo">${t('continue')}</button></div>`);
$('bGo').onclick = () => { SFX.click(); hideOverlay(); };
$('bGiveUp').onclick = () => { SFX.click(); hideOverlay(); if (lobby) lobby.leaveMatch(); };
return;
}
if (mode === 'fight') {
mode = 'pause'; loop.pause();
card(`<h2>${t('pause')}</h2><div class="row"><button id="bSet2">⚙ ${t('settings')}</button><button id="bQuit">${t('give_up')}</button><button class="primary" id="bGo">${t('continue')}</button></div>`);