diff options
Diffstat (limited to 'src/frontend/mame/ui/quitmenu.cpp')
-rw-r--r-- | src/frontend/mame/ui/quitmenu.cpp | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/src/frontend/mame/ui/quitmenu.cpp b/src/frontend/mame/ui/quitmenu.cpp index cd1fb4ac59b..2177313a0cd 100644 --- a/src/frontend/mame/ui/quitmenu.cpp +++ b/src/frontend/mame/ui/quitmenu.cpp @@ -20,7 +20,8 @@ menu_confirm_quit::menu_confirm_quit(mame_ui_manager &mui, render_container &con : autopause_menu<>(mui, container) { set_one_shot(true); - set_process_flags(PROCESS_CUSTOM_ONLY | PROCESS_NOINPUT); + set_needs_prev_menu_item(false); + set_heading(_("menu-quit", "Are you sure you want to quit?")); } @@ -29,33 +30,24 @@ menu_confirm_quit::~menu_confirm_quit() } -void menu_confirm_quit::custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) -{ - ui().draw_text_box( - container(), - util::string_format( - _("Are you sure you want to quit?\n\n" - "Press %1$s to quit\n" - "Press %2$s to return to emulation"), - ui().get_general_input_setting(IPT_UI_SELECT), - ui().get_general_input_setting(IPT_UI_BACK)), - text_layout::text_justify::CENTER, - 0.5f, 0.5f, - UI_RED_COLOR); -} - - void menu_confirm_quit::populate() { + item_append(_("menu-quit", "Quit"), 0, nullptr); + item_append(_("menu-quit", "Return to emulation"), 0, nullptr); } -void menu_confirm_quit::handle(event const *ev) +bool menu_confirm_quit::handle(event const *ev) { - if (machine().ui_input().pressed(IPT_UI_SELECT)) - machine().schedule_exit(); - else if (machine().ui_input().pressed(IPT_UI_BACK)) - stack_pop(); + if (ev && (IPT_UI_SELECT == ev->iptkey)) + { + if (0 == selected_index()) + machine().schedule_exit(); + else + stack_pop(); + } + + return false; } } // namespace ui |