diff options
author | 2016-06-18 17:15:17 +0200 | |
---|---|---|
committer | 2016-06-18 17:15:17 +0200 | |
commit | b4beaa37b744c8b2804ff398e373e035a7e8941c (patch) | |
tree | 93b7a1edcfb25197fce1028959f1f494fa3d461b /src/frontend/mame/ui/selsoft.cpp | |
parent | 0213201d1d902f7f166afd8f0ded227b009dfc07 (diff) | |
parent | 1ad39fd8250863ff4c7f90e84d971db006085a17 (diff) |
Merge remote-tracking branch 'mainline/master'
Diffstat (limited to 'src/frontend/mame/ui/selsoft.cpp')
-rw-r--r-- | src/frontend/mame/ui/selsoft.cpp | 116 |
1 files changed, 59 insertions, 57 deletions
diff --git a/src/frontend/mame/ui/selsoft.cpp b/src/frontend/mame/ui/selsoft.cpp index e650ce3ae1a..fa68affb36a 100644 --- a/src/frontend/mame/ui/selsoft.cpp +++ b/src/frontend/mame/ui/selsoft.cpp @@ -184,11 +184,11 @@ void menu_select_software::handle() else if (menu_event->iptkey == IPT_UI_SELECT) { // handle selections - if (is_focus(focused_menu::main)) + if (get_focus() == focused_menu::main) { inkey_select(menu_event); } - else if (is_focus(focused_menu::left)) + else if (get_focus() == focused_menu::left) { l_sw_hover = highlight; check_filter = true; @@ -300,14 +300,14 @@ void menu_select_software::handle() } else if (menu_event->iptkey == IPT_UI_CONFIGURE) - inkey_configure(menu_event); + inkey_navigation(); } if (menu_event && !menu_event->itemref) { if (menu_event->iptkey == IPT_UI_CONFIGURE) { - inkey_configure(menu_event); + inkey_navigation(); } else if (menu_event->iptkey == IPT_UI_LEFT) { @@ -363,7 +363,7 @@ void menu_select_software::handle() // handle UI_DOWN_FILTER highlight++; } - else if (menu_event->iptkey == IPT_OTHER && is_focus(focused_menu::left)) + else if (menu_event->iptkey == IPT_OTHER && get_focus() == focused_menu::left) { l_sw_hover = highlight; check_filter = true; @@ -493,7 +493,7 @@ void menu_select_software::populate() (void *)m_searchlist[curitem]); } - item_append(MENU_SEPARATOR_ITEM, nullptr, flags_ui, nullptr); + item_append(menu_item_type::SEPARATOR); // configure the custom rendering customtop = 4.0f * ui().get_line_height() + 5.0f * UI_BOX_TB_BORDER; @@ -987,40 +987,59 @@ void menu_select_software::inkey_special(const event *menu_event) } -void menu_select_software::inkey_configure(const event *menu_event) +void menu_select_software::inkey_navigation() { - if (is_focus(focused_menu::main)) + switch (get_focus()) { - if (selected <= visible_items) - { - m_prev_selected = item[selected].ref; - selected = visible_items + 1; - } - else - { - if (ui_globals::panels_status != HIDE_LEFT_PANEL) - set_focus(focused_menu::left); - - else if (ui_globals::panels_status == HIDE_BOTH) + case focused_menu::main: + if (selected <= visible_items) { - for (int x = 0; x < item.size(); ++x) - if (item[x].ref == m_prev_selected) - selected = x; + m_prev_selected = item[selected].ref; + selected = visible_items + 1; } else { + if (ui_globals::panels_status != HIDE_LEFT_PANEL) + set_focus(focused_menu::left); + + else if (ui_globals::panels_status == HIDE_BOTH) + { + for (int x = 0; x < item.size(); ++x) + if (item[x].ref == m_prev_selected) + selected = x; + } + else + { + set_focus(focused_menu::righttop); + } + } + break; + + case focused_menu::left: + if (ui_globals::panels_status != HIDE_RIGHT_PANEL) + { set_focus(focused_menu::righttop); } - } - } - else if (is_focus(focused_menu::left)) - { - if (ui_globals::panels_status != HIDE_RIGHT_PANEL) - { - set_focus(focused_menu::righttop); - } - else - { + else + { + set_focus(focused_menu::main); + if (m_prev_selected == nullptr) + { + selected = 0; + return; + } + + for (int x = 0; x < item.size(); ++x) + if (item[x].ref == m_prev_selected) + selected = x; + } + break; + + case focused_menu::righttop: + set_focus(focused_menu::rightbottom); + break; + + case focused_menu::rightbottom: set_focus(focused_menu::main); if (m_prev_selected == nullptr) { @@ -1031,24 +1050,7 @@ void menu_select_software::inkey_configure(const event *menu_event) for (int x = 0; x < item.size(); ++x) if (item[x].ref == m_prev_selected) selected = x; - } - } - else if (is_focus(focused_menu::righttop)) - { - set_focus(focused_menu::rightbottom); - } - else if (is_focus(focused_menu::rightbottom)) - { - set_focus(focused_menu::main); - if (m_prev_selected == nullptr) - { - selected = 0; - return; - } - - for (int x = 0; x < item.size(); ++x) - if (item[x].ref == m_prev_selected) - selected = x; + break; } } @@ -1243,12 +1245,12 @@ void menu_select_software::build_list(std::vector<ui_software_info *> &s_drivers case UI_SW_AVAILABLE: if (s_driver->available) m_displaylist.push_back(s_driver); - break; + break; case UI_SW_UNAVAILABLE: if (!s_driver->available) m_displaylist.push_back(s_driver); - break; + break; case UI_SW_SUPPORTED: if (s_driver->supported == SOFTWARE_SUPPORTED_YES) @@ -1446,7 +1448,7 @@ float menu_select_software::draw_left_panel(float x1, float y1, float x2, float hover = phover + filter; } - if (highlight == filter && is_focus(focused_menu::left)) + if (highlight == filter && get_focus() == focused_menu::left) { fgcolor = rgb_t(0xff, 0xff, 0xff, 0x00); bgcolor = rgb_t(0xff, 0xff, 0xff, 0xff); @@ -1571,7 +1573,7 @@ void menu_select_software::infos_render(void *selectedref, float origx1, float o rgb_t fgcolor = UI_TEXT_COLOR; rgb_t bgcolor = UI_TEXT_BG_COLOR; - if (is_focus(focused_menu::rightbottom)) + if (get_focus() == focused_menu::rightbottom) { fgcolor = rgb_t(0xff, 0xff, 0xff, 0x00); bgcolor = rgb_t(0xff, 0xff, 0xff, 0xff); @@ -1605,7 +1607,7 @@ void menu_select_software::infos_render(void *selectedref, float origx1, float o rgb_t fgcolor = UI_TEXT_COLOR; rgb_t bgcolor = UI_TEXT_BG_COLOR; - if (is_focus(focused_menu::rightbottom)) + if (get_focus() == focused_menu::rightbottom) { fgcolor = rgb_t(0xff, 0xff, 0xff, 0x00); bgcolor = rgb_t(0xff, 0xff, 0xff, 0xff); @@ -1767,7 +1769,7 @@ void menu_select_software::arts_render(void *selectedref, float origx1, float or olddriver = driver; ui_globals::switch_image = false; - arts_render_images(tmp_bitmap, origx1, origy1, origx2, origy2, false); + arts_render_images(tmp_bitmap, origx1, origy1, origx2, origy2); auto_free(machine(), tmp_bitmap); } @@ -1856,7 +1858,7 @@ void menu_select_software::arts_render(void *selectedref, float origx1, float or oldsoft = soft; ui_globals::switch_image = false; - arts_render_images(tmp_bitmap, origx1, origy1, origx2, origy2, true); + arts_render_images(tmp_bitmap, origx1, origy1, origx2, origy2); auto_free(machine(), tmp_bitmap); } |