mirror of
https://github.com/holub/mame
synced 2025-06-23 21:06:38 +03:00
Factored out quit/confirmquit logic into ui_manager::request_quit()
This commit is contained in:
parent
09ee48d11a
commit
a2ff7cf249
@ -1525,10 +1525,8 @@ UINT32 ui_manager::handler_ingame(running_machine &machine, render_container *co
|
||||
|
||||
if (ui_input_pressed(machine, IPT_UI_CANCEL))
|
||||
{
|
||||
if (!machine.options().confirm_quit())
|
||||
machine.schedule_exit();
|
||||
else
|
||||
return machine.ui().set_handler(handler_confirm_quit, 0);
|
||||
machine.ui().request_quit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// turn on menus if requested
|
||||
@ -1694,6 +1692,19 @@ UINT32 ui_manager::handler_load_save(running_machine &machine, render_container
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// request_quit
|
||||
//-------------------------------------------------
|
||||
|
||||
void ui_manager::request_quit()
|
||||
{
|
||||
if (!machine().options().confirm_quit())
|
||||
machine().schedule_exit();
|
||||
else
|
||||
set_handler(handler_confirm_quit, 0);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// handler_confirm_quit - leads the user through
|
||||
// confirming quit emulation
|
||||
|
@ -157,6 +157,7 @@ public:
|
||||
void image_handler_ingame();
|
||||
void increase_frameskip();
|
||||
void decrease_frameskip();
|
||||
void request_quit();
|
||||
|
||||
// print the game info string into a buffer
|
||||
astring &game_info_astring(astring &string);
|
||||
|
Loading…
Reference in New Issue
Block a user