Fixed MT06263

This commit is contained in:
dankan1890 2016-07-02 03:50:26 +02:00
parent ad47988e79
commit eeadf6d71c
6 changed files with 12 additions and 18 deletions

View File

@ -145,7 +145,7 @@ void menu_cheat::populate()
UINT32 flags; UINT32 flags;
curcheat->menu_text(text, subtext, flags); curcheat->menu_text(text, subtext, flags);
if (text == MENU_SEPARATOR_ITEM) if (text == MENU_SEPARATOR_ITEM)
item_append(menu_item_type::SEPARATOR); item_append(menu_item_type::SEPARATOR, flags);
else else
item_append(text, subtext, flags, curcheat.get()); item_append(text, subtext, flags, curcheat.get());
} }

View File

@ -110,7 +110,7 @@ void menu_dats_view::populate()
(m_issoft == true) ? get_data_sw() : get_data(); (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; customtop = 2.0f * ui().get_line_height() + 4.0f * UI_BOX_TB_BORDER;
custombottom = ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER; custombottom = ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;

View File

@ -318,10 +318,10 @@ void menu::item_append(menu_item item)
// end of the menu // 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) 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);
} }
//------------------------------------------------- //-------------------------------------------------

View File

@ -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(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(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 item);
void item_append(menu_item_type type); void item_append(menu_item_type type, UINT32 flags = 0);
// configure the menu for custom rendering // configure the menu for custom rendering
virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2); virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2);

View File

@ -501,6 +501,7 @@ void menu_select_game::populate()
ui_globals::redraw_icon = true; ui_globals::redraw_icon = true;
ui_globals::switch_image = true; ui_globals::switch_image = true;
int old_item_selected = -1; int old_item_selected = -1;
UINT32 flags_ui = FLAG_UI | FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW;
if (!isfavorite()) if (!isfavorite())
{ {
@ -537,8 +538,6 @@ void menu_select_game::populate()
int curitem = 0; int curitem = 0;
for (auto & elem : m_displaylist) 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) if (old_item_selected == -1 && elem->name == reselect_last::driver)
old_item_selected = curitem; 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)) if (cx != -1 && ((driver_list::driver(cx).flags & MACHINE_IS_BIOS_ROOT) != 0))
cloneof = false; 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++; curitem++;
} }
} }
@ -565,7 +562,7 @@ void menu_select_game::populate()
// iterate over entries // iterate over entries
for (auto & mfavorite : mame_machine_manager::instance()->favorite().m_list) 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 (mfavorite.startempty == 1)
{ {
if (old_item_selected == -1 && mfavorite.shortname == reselect_last::driver) 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)) if (cx != -1 && ((driver_list::driver(cx).flags & MACHINE_IS_BIOS_ROOT) != 0))
cloneof = false; 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 else
{ {
if (old_item_selected == -1 && mfavorite.shortname == reselect_last::driver) if (old_item_selected == -1 && mfavorite.shortname == reselect_last::driver)
old_item_selected = curitem; old_item_selected = curitem;
item_append(mfavorite.longname, mfavorite.devicetype, 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++; curitem++;
} }
} }
item_append(menu_item_type::SEPARATOR); item_append(menu_item_type::SEPARATOR, flags_ui);
// add special items // add special items
if (menu::stack_has_special_main_menu()) 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 Options"), "", flags_ui, (void *)(FPTR)CONF_OPTS);
item_append(_("Configure Machine"), "", flags_ui, (void *)(FPTR)CONF_MACHINE); item_append(_("Configure Machine"), "", flags_ui, (void *)(FPTR)CONF_MACHINE);
skip_main_items = 2; skip_main_items = 2;

View File

@ -492,7 +492,7 @@ void menu_select_software::populate()
(void *)m_searchlist[curitem]); (void *)m_searchlist[curitem]);
} }
item_append(menu_item_type::SEPARATOR); item_append(menu_item_type::SEPARATOR, flags_ui);
// configure the custom rendering // configure the custom rendering
customtop = 4.0f * ui().get_line_height() + 5.0f * UI_BOX_TB_BORDER; customtop = 4.0f * ui().get_line_height() + 5.0f * UI_BOX_TB_BORDER;