From eeadf6d71c394095415d62e22fe7afaec2de470d Mon Sep 17 00:00:00 2001 From: dankan1890 Date: Sat, 2 Jul 2016 03:50:26 +0200 Subject: [PATCH] Fixed MT06263 --- src/frontend/mame/ui/cheatopt.cpp | 2 +- src/frontend/mame/ui/datmenu.cpp | 2 +- src/frontend/mame/ui/menu.cpp | 4 ++-- src/frontend/mame/ui/menu.h | 2 +- src/frontend/mame/ui/selgame.cpp | 18 ++++++------------ src/frontend/mame/ui/selsoft.cpp | 2 +- 6 files changed, 12 insertions(+), 18 deletions(-) diff --git a/src/frontend/mame/ui/cheatopt.cpp b/src/frontend/mame/ui/cheatopt.cpp index f1ec5c24278..b7d6852c3b9 100644 --- a/src/frontend/mame/ui/cheatopt.cpp +++ b/src/frontend/mame/ui/cheatopt.cpp @@ -145,7 +145,7 @@ void menu_cheat::populate() UINT32 flags; curcheat->menu_text(text, subtext, flags); if (text == MENU_SEPARATOR_ITEM) - item_append(menu_item_type::SEPARATOR); + item_append(menu_item_type::SEPARATOR, flags); else item_append(text, subtext, flags, curcheat.get()); } diff --git a/src/frontend/mame/ui/datmenu.cpp b/src/frontend/mame/ui/datmenu.cpp index 3350bcb2795..9445f30c10f 100644 --- a/src/frontend/mame/ui/datmenu.cpp +++ b/src/frontend/mame/ui/datmenu.cpp @@ -110,7 +110,7 @@ void menu_dats_view::populate() (m_issoft == true) ? get_data_sw() : get_data(); - item_append(menu_item_type::SEPARATOR); + item_append(menu_item_type::SEPARATOR, (FLAG_UI_DATS | FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW)); customtop = 2.0f * ui().get_line_height() + 4.0f * UI_BOX_TB_BORDER; custombottom = ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER; diff --git a/src/frontend/mame/ui/menu.cpp b/src/frontend/mame/ui/menu.cpp index f0ebcd38795..80895713ba2 100644 --- a/src/frontend/mame/ui/menu.cpp +++ b/src/frontend/mame/ui/menu.cpp @@ -318,10 +318,10 @@ void menu::item_append(menu_item item) // end of the menu //------------------------------------------------- -void menu::item_append(menu_item_type type) +void menu::item_append(menu_item_type type, UINT32 flags) { if (type == menu_item_type::SEPARATOR) - item_append(MENU_SEPARATOR_ITEM, "", 0, nullptr, menu_item_type::SEPARATOR); + item_append(MENU_SEPARATOR_ITEM, "", flags, nullptr, menu_item_type::SEPARATOR); } //------------------------------------------------- diff --git a/src/frontend/mame/ui/menu.h b/src/frontend/mame/ui/menu.h index 032a5f699ee..38e2367102e 100644 --- a/src/frontend/mame/ui/menu.h +++ b/src/frontend/mame/ui/menu.h @@ -66,7 +66,7 @@ public: void item_append(const std::string &text, const std::string &subtext, UINT32 flags, void *ref, menu_item_type type = menu_item_type::UNKNOWN); void item_append(std::string &&text, std::string &&subtext, UINT32 flags, void *ref, menu_item_type type = menu_item_type::UNKNOWN); void item_append(menu_item item); - void item_append(menu_item_type type); + void item_append(menu_item_type type, UINT32 flags = 0); // configure the menu for custom rendering virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2); diff --git a/src/frontend/mame/ui/selgame.cpp b/src/frontend/mame/ui/selgame.cpp index 0368d9cbbaf..556867ffa5e 100644 --- a/src/frontend/mame/ui/selgame.cpp +++ b/src/frontend/mame/ui/selgame.cpp @@ -501,6 +501,7 @@ void menu_select_game::populate() ui_globals::redraw_icon = true; ui_globals::switch_image = true; int old_item_selected = -1; + UINT32 flags_ui = FLAG_UI | FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW; if (!isfavorite()) { @@ -537,8 +538,6 @@ void menu_select_game::populate() int curitem = 0; for (auto & elem : m_displaylist) { - UINT32 flags_ui = FLAG_UI | FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW; - if (old_item_selected == -1 && elem->name == reselect_last::driver) old_item_selected = curitem; @@ -549,10 +548,8 @@ void menu_select_game::populate() if (cx != -1 && ((driver_list::driver(cx).flags & MACHINE_IS_BIOS_ROOT) != 0)) cloneof = false; } - if (cloneof) - flags_ui |= FLAG_INVERT; - item_append(elem->description, "", flags_ui, (void *)elem); + item_append(elem->description, "", (cloneof) ? (flags_ui | FLAG_INVERT) : flags_ui, (void *)elem); curitem++; } } @@ -565,7 +562,7 @@ void menu_select_game::populate() // iterate over entries for (auto & mfavorite : mame_machine_manager::instance()->favorite().m_list) { - UINT32 flags_ui = FLAG_UI | FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW | FLAG_UI_FAVORITE; + auto flags = flags_ui | FLAG_UI_FAVORITE; if (mfavorite.startempty == 1) { if (old_item_selected == -1 && mfavorite.shortname == reselect_last::driver) @@ -578,28 +575,25 @@ void menu_select_game::populate() if (cx != -1 && ((driver_list::driver(cx).flags & MACHINE_IS_BIOS_ROOT) != 0)) cloneof = false; } - if (cloneof) - flags_ui |= FLAG_INVERT; - item_append(mfavorite.longname, "", flags_ui, (void *)&mfavorite); + item_append(mfavorite.longname, "", (cloneof) ? (flags | FLAG_INVERT) : flags, (void *)&mfavorite); } else { if (old_item_selected == -1 && mfavorite.shortname == reselect_last::driver) old_item_selected = curitem; item_append(mfavorite.longname, mfavorite.devicetype, - mfavorite.parentname.empty() ? flags_ui : (FLAG_INVERT | flags_ui), (void *)&mfavorite); + mfavorite.parentname.empty() ? flags : (FLAG_INVERT | flags), (void *)&mfavorite); } curitem++; } } - item_append(menu_item_type::SEPARATOR); + item_append(menu_item_type::SEPARATOR, flags_ui); // add special items if (menu::stack_has_special_main_menu()) { - UINT32 flags_ui = FLAG_UI | FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW; item_append(_("Configure Options"), "", flags_ui, (void *)(FPTR)CONF_OPTS); item_append(_("Configure Machine"), "", flags_ui, (void *)(FPTR)CONF_MACHINE); skip_main_items = 2; diff --git a/src/frontend/mame/ui/selsoft.cpp b/src/frontend/mame/ui/selsoft.cpp index c1be3b66e9d..d29d768ce76 100644 --- a/src/frontend/mame/ui/selsoft.cpp +++ b/src/frontend/mame/ui/selsoft.cpp @@ -492,7 +492,7 @@ void menu_select_software::populate() (void *)m_searchlist[curitem]); } - item_append(menu_item_type::SEPARATOR); + item_append(menu_item_type::SEPARATOR, flags_ui); // configure the custom rendering customtop = 4.0f * ui().get_line_height() + 5.0f * UI_BOX_TB_BORDER;