Convert the Quit confirmation dialog to GUI2
This commit is contained in:
parent
3de7d1c87c
commit
c614f67f08
1 changed files with 6 additions and 4 deletions
|
@ -24,6 +24,8 @@
|
||||||
#include "game_end_exceptions.hpp"
|
#include "game_end_exceptions.hpp"
|
||||||
#include "game_preferences.hpp"
|
#include "game_preferences.hpp"
|
||||||
#include "gettext.hpp"
|
#include "gettext.hpp"
|
||||||
|
#include "gui/dialogs/message.hpp"
|
||||||
|
#include "gui/widgets/window.hpp"
|
||||||
#include "filesystem.hpp"
|
#include "filesystem.hpp"
|
||||||
#include "log.hpp"
|
#include "log.hpp"
|
||||||
#include "preferences_display.hpp"
|
#include "preferences_display.hpp"
|
||||||
|
@ -715,8 +717,8 @@ void key_event(display& disp, const SDL_KeyboardEvent& event, command_executor*
|
||||||
{
|
{
|
||||||
if(event.keysym.sym == SDLK_ESCAPE && disp.in_game()) {
|
if(event.keysym.sym == SDLK_ESCAPE && disp.in_game()) {
|
||||||
LOG_G << "escape pressed..showing quit\n";
|
LOG_G << "escape pressed..showing quit\n";
|
||||||
const int res = gui::dialog(disp,_("Quit"),_("Do you really want to quit?"),gui::YES_NO).show();
|
const int res = gui2::show_message(disp.video(), _("Quit"), _("Do you really want to quit?"), gui2::tmessage::yes_no_buttons);
|
||||||
if(res == 0) {
|
if(res != gui2::twindow::CANCEL) {
|
||||||
throw end_level_exception(QUIT);
|
throw end_level_exception(QUIT);
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
|
@ -1014,8 +1016,8 @@ void execute_command(display& disp, HOTKEY_COMMAND command, command_executor* ex
|
||||||
case HOTKEY_QUIT_GAME: {
|
case HOTKEY_QUIT_GAME: {
|
||||||
if(disp.in_game()) {
|
if(disp.in_game()) {
|
||||||
DBG_G << "is in game -- showing quit message\n";
|
DBG_G << "is in game -- showing quit message\n";
|
||||||
const int res = gui::dialog(disp,_("Quit"),_("Do you really want to quit?"),gui::YES_NO).show();
|
const int res = gui2::show_message(disp.video(), _("Quit"), _("Do you really want to quit?"), gui2::tmessage::yes_no_buttons);
|
||||||
if(res == 0) {
|
if(res != gui2::twindow::CANCEL) {
|
||||||
throw end_level_exception(QUIT);
|
throw end_level_exception(QUIT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue