feat(fight): give up a live fight from the pause card
This commit is contained in:
@@ -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>`);
|
||||
|
||||
Reference in New Issue
Block a user