mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-04-24 16:52:50 +02:00
Allow only a single instance of the exit prompt
This is required because there is a very low-level shortcut that can create one even if one is already being shown.
This commit is contained in:
parent
03e1b12173
commit
ca930c2494
@ -66,9 +66,15 @@ void Engine::Exit()
|
||||
|
||||
void Engine::ConfirmExit()
|
||||
{
|
||||
new ConfirmPrompt("You are about to quit", "Are you sure you want to exit the game?", { [] {
|
||||
ui::Engine::Ref().Exit();
|
||||
} });
|
||||
if (!confirmingExit)
|
||||
{
|
||||
confirmingExit = true;
|
||||
new ConfirmPrompt("You are about to quit", "Are you sure you want to exit the game?", { [] {
|
||||
ui::Engine::Ref().Exit();
|
||||
}, [this] {
|
||||
confirmingExit = false;
|
||||
} });
|
||||
}
|
||||
}
|
||||
|
||||
void Engine::ShowWindow(Window * window)
|
||||
|
@ -79,6 +79,8 @@ namespace ui
|
||||
Graphics * g;
|
||||
bool GraveExitsConsole;
|
||||
|
||||
bool confirmingExit = false;
|
||||
|
||||
unsigned int FrameIndex;
|
||||
private:
|
||||
FpsLimit fpsLimit;
|
||||
|
Loading…
x
Reference in New Issue
Block a user