@@ -302,7 +302,7 @@ void mame_ui_manager::init()
302302 set_handler (
303303 ui_callback_type::NOINPUT ,
304304 handler_callback_func (
305- [this ] (render_container &container) -> uint32_t
305+ [this , &container = machine (). render (). ui_container ()] ( ) -> uint32_t
306306 {
307307 draw_text_box (container, messagebox_text, ui::text_layout::text_justify::LEFT , 0 .5f , 0 .5f , colors ().background_color ());
308308 return 0 ;
@@ -652,7 +652,7 @@ void mame_ui_manager::display_startup_screens(bool first_time)
652652 rgb_t warning_color;
653653 bool config_menu = false ;
654654 auto handler_messagebox_anykey =
655- [this , &poller, &warning_text, &warning_color, &config_menu] (render_container &container) -> uint32_t
655+ [this , &poller, &warning_text, &warning_color, &config_menu, &container = machine (). render (). ui_container ()] ( ) -> uint32_t
656656 {
657657 // draw a standard message window
658658 draw_text_box (container, warning_text, ui::text_layout::text_justify::LEFT , 0 .5f , 0 .5f , warning_color);
@@ -862,6 +862,7 @@ void mame_ui_manager::display_startup_screens(bool first_time)
862862 }
863863 else if (config_menu)
864864 {
865+ ui::menu::stack_push<ui::menu_main>(*this , machine ().render ().ui_container ());
865866 show_menu ();
866867
867868 // loop while we have a handler
@@ -929,7 +930,7 @@ bool mame_ui_manager::update_and_render(render_container &container)
929930
930931 // call the current UI handler
931932 machine ().ui_input ().check_ui_inputs ();
932- uint32_t const handler_result = m_handler_callback (container );
933+ uint32_t const handler_result = m_handler_callback ();
933934
934935 // display any popup messages
935936 if (osd_ticks () < m_popup_text_end)
@@ -1538,7 +1539,7 @@ void mame_ui_manager::image_handler_ingame()
15381539// of the standard keypresses
15391540// -------------------------------------------------
15401541
1541- uint32_t mame_ui_manager::handler_ingame (render_container &container )
1542+ uint32_t mame_ui_manager::handler_ingame ()
15421543{
15431544 // let the OSD do its thing first
15441545 machine ().osd ().check_osd_inputs ();
@@ -1547,7 +1548,7 @@ uint32_t mame_ui_manager::handler_ingame(render_container &container)
15471548
15481549 // draw the profiler if visible
15491550 if (show_profiler ())
1550- draw_profiler (container );
1551+ draw_profiler (machine (). render (). ui_container () );
15511552
15521553 // if we're single-stepping, pause now
15531554 if (single_step ())
@@ -1625,6 +1626,8 @@ uint32_t mame_ui_manager::handler_ingame(render_container &container)
16251626 // turn on menus if requested
16261627 if (machine ().ui_input ().pressed (IPT_UI_MENU ))
16271628 {
1629+ if (ui::menu::stack_empty (*this ))
1630+ ui::menu::stack_push<ui::menu_main>(*this , machine ().render ().ui_container ());
16281631 show_menu ();
16291632 return 0 ;
16301633 }
@@ -1658,7 +1661,7 @@ uint32_t mame_ui_manager::handler_ingame(render_container &container)
16581661 set_handler (
16591662 ui_callback_type::MENU ,
16601663 handler_callback_func (
1661- [this , is_paused] (render_container &container) -> uint32_t
1664+ [this , is_paused, &container = machine (). render (). ui_container ()] ( ) -> uint32_t
16621665 {
16631666 return ui_gfx_ui_handler (container, *this , is_paused);
16641667 }));
@@ -2704,7 +2707,7 @@ bool mame_ui_manager::set_ui_event_handler(std::function<bool ()> &&handler)
27042707 set_handler (
27052708 ui_callback_type::CUSTOM ,
27062709 handler_callback_func (
2707- [cb = std::move (handler)] (render_container &container ) -> uint32_t
2710+ [cb = std::move (handler)] () -> uint32_t
27082711 {
27092712 return !cb () ? HANDLER_CANCEL : 0 ;
27102713 }));
0 commit comments