mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-11 19:04:05 +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:
@@ -66,9 +66,15 @@ void Engine::Exit()
|
|||||||
|
|
||||||
void Engine::ConfirmExit()
|
void Engine::ConfirmExit()
|
||||||
{
|
{
|
||||||
new ConfirmPrompt("You are about to quit", "Are you sure you want to exit the game?", { [] {
|
if (!confirmingExit)
|
||||||
ui::Engine::Ref().Exit();
|
{
|
||||||
} });
|
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)
|
void Engine::ShowWindow(Window * window)
|
||||||
|
@@ -79,6 +79,8 @@ namespace ui
|
|||||||
Graphics * g;
|
Graphics * g;
|
||||||
bool GraveExitsConsole;
|
bool GraveExitsConsole;
|
||||||
|
|
||||||
|
bool confirmingExit = false;
|
||||||
|
|
||||||
unsigned int FrameIndex;
|
unsigned int FrameIndex;
|
||||||
private:
|
private:
|
||||||
FpsLimit fpsLimit;
|
FpsLimit fpsLimit;
|
||||||
|
Reference in New Issue
Block a user