mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Display exit confirmation dialog on Alt-F4
This commit is contained in:
parent
59806bf112
commit
833051cced
@ -24,6 +24,7 @@
|
||||
#include "CServerHandler.h"
|
||||
#include "ClientCommandManager.h"
|
||||
#include "windows/CMessage.h"
|
||||
#include "windows/InfoWindows.h"
|
||||
#include "render/IScreenHandler.h"
|
||||
#include "render/Graphics.h"
|
||||
|
||||
@ -502,10 +503,14 @@ static void quitApplication()
|
||||
|
||||
void handleQuit(bool ask)
|
||||
{
|
||||
if(CSH->client && LOCPLINT && ask)
|
||||
if(ask)
|
||||
{
|
||||
CCS->curh->set(Cursor::Map::POINTER);
|
||||
LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[69], quitApplication, nullptr);
|
||||
|
||||
if (LOCPLINT)
|
||||
LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[69], quitApplication, nullptr);
|
||||
else
|
||||
CInfoWindow::showYesNoDialog(CGI->generaltexth->allTexts[69], {}, quitApplication, {}, PlayerColor(1));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -116,7 +116,11 @@ void InputHandler::preprocessEvent(const SDL_Event & ev)
|
||||
if(ev.type == SDL_QUIT)
|
||||
{
|
||||
boost::mutex::scoped_lock interfaceLock(GH.interfaceMutex);
|
||||
#ifdef VCMI_ANDROID
|
||||
handleQuit(false);
|
||||
#else
|
||||
handleQuit(true);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
else if(ev.type == SDL_KEYDOWN)
|
||||
|
Loading…
Reference in New Issue
Block a user