From a585ec4c5341d37798a25d76b87041f58dd65260 Mon Sep 17 00:00:00 2001 From: Ingo Ruhnke Date: Wed, 22 Oct 2014 10:27:17 +0200 Subject: [PATCH] Disabled confirmation dialog on Quit --- src/supertux/menu/main_menu.cpp | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/supertux/menu/main_menu.cpp b/src/supertux/menu/main_menu.cpp index c6a1001b3..1c8edc93c 100644 --- a/src/supertux/menu/main_menu.cpp +++ b/src/supertux/menu/main_menu.cpp @@ -77,19 +77,30 @@ MainMenu::menu_action(MenuItem* item) case MNID_CREDITS: MenuManager::instance().clear_menu_stack(); ScreenManager::current()->push_screen(std::unique_ptr(new TextScroller("credits.txt")), - std::unique_ptr(new FadeOut(0.5))); + std::unique_ptr(new FadeOut(0.5))); break; case MNID_QUITMAINMENU: - std::unique_ptr dialog(new Dialog); - dialog->set_text(_("Do you really want to quit SuperTux?")); - dialog->add_cancel_button(_("Cancel")); - dialog->add_default_button(_("Quit SuperTux"), [] { - MenuManager::instance().clear_menu_stack(); - ScreenManager::current()->quit(std::unique_ptr(new FadeOut(0.25))); - SoundManager::current()->stop_music(0.25); - }); - MenuManager::instance().set_dialog(std::move(dialog)); + if (true) + { + // instantly exit the game + MenuManager::instance().clear_menu_stack(); + ScreenManager::current()->quit(std::unique_ptr(new FadeOut(0.25))); + SoundManager::current()->stop_music(0.25); + } + else + { + // confirmation dialog + std::unique_ptr dialog(new Dialog); + dialog->set_text(_("Do you really want to quit SuperTux?")); + dialog->add_cancel_button(_("Cancel")); + dialog->add_default_button(_("Quit SuperTux"), [] { + MenuManager::instance().clear_menu_stack(); + ScreenManager::current()->quit(std::unique_ptr(new FadeOut(0.25))); + SoundManager::current()->stop_music(0.25); + }); + MenuManager::instance().set_dialog(std::move(dialog)); + } break; } } -- 2.11.0