diff options
Diffstat (limited to 'src/emu/ui/optsmenu.cpp')
-rw-r--r-- | src/emu/ui/optsmenu.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/emu/ui/optsmenu.cpp b/src/emu/ui/optsmenu.cpp index 54e269bf4ed..66750483c43 100644 --- a/src/emu/ui/optsmenu.cpp +++ b/src/emu/ui/optsmenu.cpp @@ -30,6 +30,7 @@ ui_menu_game_options::ui_menu_game_options(running_machine &machine, render_container *container) : ui_menu(machine, container) { + m_main = main_filters::actual; } //------------------------------------------------- @@ -38,6 +39,7 @@ ui_menu_game_options::ui_menu_game_options(running_machine &machine, render_cont ui_menu_game_options::~ui_menu_game_options() { + main_filters::actual = m_main; ui_menu::menu_stack->reset(UI_MENU_RESET_SELECT_FIRST); save_ui_options(machine()); ui_globals::switch_image = true; @@ -52,9 +54,9 @@ void ui_menu_game_options::handle() bool changed = false; // process the menu -// ui_menu::menu_stack->parent->process(UI_MENU_PROCESS_NOINPUT); -// const ui_menu_event *m_event = process(UI_MENU_PROCESS_LR_REPEAT | UI_MENU_PROCESS_NOIMAGE); - const ui_menu_event *m_event = process(UI_MENU_PROCESS_LR_REPEAT); + ui_menu::menu_stack->parent->process(UI_MENU_PROCESS_NOINPUT); + const ui_menu_event *m_event = process(UI_MENU_PROCESS_LR_REPEAT | UI_MENU_PROCESS_NOIMAGE); +// const ui_menu_event *m_event = process(UI_MENU_PROCESS_LR_REPEAT); if (m_event != nullptr && m_event->itemref != nullptr) switch ((FPTR)m_event->itemref) @@ -63,7 +65,7 @@ void ui_menu_game_options::handle() { if (m_event->iptkey == IPT_UI_LEFT || m_event->iptkey == IPT_UI_RIGHT) { - (m_event->iptkey == IPT_UI_RIGHT) ? ++main_filters::actual : --main_filters::actual; + (m_event->iptkey == IPT_UI_RIGHT) ? ++m_main : --m_main; changed = true; } else if (m_event->iptkey == IPT_UI_SELECT) @@ -73,7 +75,7 @@ void ui_menu_game_options::handle() for (int index = 0; index < total; ++index) s_sel[index] = main_filters::text[index]; - ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, s_sel, main_filters::actual)); + ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, s_sel, m_main)); } break; } @@ -191,14 +193,14 @@ void ui_menu_game_options::handle() void ui_menu_game_options::populate() { - if (strcmp(machine().options().ui(),"simple")!=0) - { + if (strcmp(machine().options().ui(),"simple")!=0) + { // set filter arrow std::string fbuff; // add filter item - UINT32 arrow_flags = get_arrow_flags((int)FILTER_FIRST, (int)FILTER_LAST, main_filters::actual); - item_append(_("Filter"), main_filters::text[main_filters::actual], arrow_flags, (void *)(FPTR)FILTER_MENU); + UINT32 arrow_flags = get_arrow_flags((int)FILTER_FIRST, (int)FILTER_LAST, m_main); + item_append(_("Filter"), main_filters::text[m_main], arrow_flags, (void *)(FPTR)FILTER_MENU); // add category subitem if (main_filters::actual == FILTER_CATEGORY && !machine().inifile().ini_index.empty()) @@ -265,7 +267,7 @@ void ui_menu_game_options::custom_render(void *selectedref, float top, float bot float width; ui_manager &mui = machine().ui(); mui.draw_text_full(container, _("Settings"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, - DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); + DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); width += 2 * UI_BOX_LR_BORDER; float maxwidth = MAX(origx2 - origx1, width); @@ -285,7 +287,7 @@ void ui_menu_game_options::custom_render(void *selectedref, float top, float bot // draw the text within it mui.draw_text_full(container, _("Settings"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE, - DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); + DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); } //------------------------------------------------- |