trunk/src/emu/ui/menu.cpp
| r253178 | r253179 | |
| 1950 | 1950 | selected = visible_items + 2; |
| 1951 | 1951 | stop = true; |
| 1952 | 1952 | } |
| 1953 | | else if (hover >= HOVER_MAME_ALL && hover <= HOVER_MAME_SYSTEMS) |
| 1954 | | { |
| 1955 | | ume_filters::actual = (HOVER_MAME_ALL - hover) * (-1); |
| 1956 | | menu_event.iptkey = IPT_OTHER; |
| 1957 | | stop = true; |
| 1958 | | } |
| 1959 | 1953 | else if (hover >= HOVER_RP_FIRST && hover <= HOVER_RP_LAST) |
| 1960 | 1954 | { |
| 1961 | 1955 | ui_globals::rpanel = (HOVER_RP_FIRST - hover) * (-1); |
| r253178 | r253179 | |
| 2030 | 2024 | } |
| 2031 | 2025 | |
| 2032 | 2026 | //------------------------------------------------- |
| 2033 | | // draw UME box |
| 2034 | | //------------------------------------------------- |
| 2035 | | |
| 2036 | | void ui_menu::draw_ume_box(float x1, float y1, float x2, float y2) |
| 2037 | | { |
| 2038 | | float text_size = 0.65f; |
| 2039 | | ui_manager &mui = machine().ui(); |
| 2040 | | float line_height = mui.get_line_height() * text_size; |
| 2041 | | float maxwidth = 0.0f; |
| 2042 | | |
| 2043 | | for (int x = 0; x < ume_filters::length; x++) |
| 2044 | | { |
| 2045 | | float width; |
| 2046 | | // compute width of left hand side |
| 2047 | | mui.draw_text_full(container, ume_filters::text[x], 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER, |
| 2048 | | DRAW_NONE, UI_TEXT_COLOR, ARGB_BLACK, &width, nullptr, text_size); |
| 2049 | | width += 2 * UI_BOX_LR_BORDER; |
| 2050 | | maxwidth = MAX(maxwidth, width); |
| 2051 | | } |
| 2052 | | |
| 2053 | | x2 = x1 + maxwidth; |
| 2054 | | |
| 2055 | | mui.draw_outlined_box(container, x1, y1, x2, y2, UI_BACKGROUND_COLOR); |
| 2056 | | |
| 2057 | | // take off the borders |
| 2058 | | x1 += UI_BOX_LR_BORDER; |
| 2059 | | x2 -= UI_BOX_LR_BORDER; |
| 2060 | | y1 += UI_BOX_TB_BORDER; |
| 2061 | | y2 -= UI_BOX_TB_BORDER; |
| 2062 | | |
| 2063 | | for (int filter = 0; filter < ume_filters::length; filter++) |
| 2064 | | { |
| 2065 | | rgb_t bgcolor = UI_TEXT_BG_COLOR; |
| 2066 | | rgb_t fgcolor = UI_TEXT_COLOR; |
| 2067 | | |
| 2068 | | if (mouse_hit && x1 <= mouse_x && x2 > mouse_x && y1 <= mouse_y && y1 + line_height > mouse_y) |
| 2069 | | { |
| 2070 | | bgcolor = UI_MOUSEOVER_BG_COLOR; |
| 2071 | | fgcolor = UI_MOUSEOVER_COLOR; |
| 2072 | | hover = HOVER_MAME_ALL + filter; |
| 2073 | | } |
| 2074 | | |
| 2075 | | if (ume_filters::actual == filter) |
| 2076 | | { |
| 2077 | | bgcolor = UI_SELECTED_BG_COLOR; |
| 2078 | | fgcolor = UI_SELECTED_COLOR; |
| 2079 | | } |
| 2080 | | |
| 2081 | | if (bgcolor != UI_TEXT_BG_COLOR) |
| 2082 | | container->add_rect(x1, y1, x2, y1 + line_height, bgcolor, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE)); |
| 2083 | | |
| 2084 | | mui.draw_text_full(container, ume_filters::text[filter], x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, |
| 2085 | | DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr, text_size); |
| 2086 | | |
| 2087 | | y1 += line_height; |
| 2088 | | } |
| 2089 | | } |
| 2090 | | |
| 2091 | | //------------------------------------------------- |
| 2092 | 2027 | // draw right box title |
| 2093 | 2028 | //------------------------------------------------- |
| 2094 | 2029 | |
trunk/src/emu/ui/moptions.cpp
| r253178 | r253179 | |
| 49 | 49 | { OPTION_USE_BACKGROUND, "1", OPTION_BOOLEAN, "enable background image in main view" }, |
| 50 | 50 | { OPTION_SKIP_BIOS_MENU, "0", OPTION_BOOLEAN, "skip bios submenu, start with configured or default" }, |
| 51 | 51 | { OPTION_SKIP_PARTS_MENU, "0", OPTION_BOOLEAN, "skip parts submenu, start with first part" }, |
| 52 | | { OPTION_START_FILTER, "0", OPTION_INTEGER, "startup filter (0 = ALL, 1 = ARCADES, 2 = SYSTEMS)" }, |
| 53 | 52 | { OPTION_LAST_USED_FILTER, "", OPTION_STRING, "latest used filter" }, |
| 54 | 53 | { OPTION_LAST_USED_MACHINE, "", OPTION_STRING, "latest used machine" }, |
| 55 | 54 | { OPTION_INFO_AUTO_AUDIT, "0", OPTION_BOOLEAN, "enable auto audit in the general info panel" }, |
trunk/src/emu/ui/moptions.h
| r253178 | r253179 | |
| 44 | 44 | #define OPTION_USE_BACKGROUND "use_background" |
| 45 | 45 | #define OPTION_SKIP_BIOS_MENU "skip_biosmenu" |
| 46 | 46 | #define OPTION_SKIP_PARTS_MENU "skip_partsmenu" |
| 47 | | #define OPTION_START_FILTER "start_filter" |
| 48 | 47 | #define OPTION_LAST_USED_FILTER "last_used_filter" |
| 49 | 48 | #define OPTION_LAST_USED_MACHINE "last_used_machine" |
| 50 | 49 | #define OPTION_INFO_AUTO_AUDIT "info_audit_enabled" |
| r253178 | r253179 | |
| 106 | 105 | bool use_background_image() const { return bool_value(OPTION_USE_BACKGROUND); } |
| 107 | 106 | bool skip_bios_menu() const { return bool_value(OPTION_SKIP_BIOS_MENU); } |
| 108 | 107 | bool skip_parts_menu() const { return bool_value(OPTION_SKIP_PARTS_MENU); } |
| 109 | | int start_filter() const { return int_value(OPTION_START_FILTER); } |
| 110 | 108 | const char *last_used_machine() const { return value(OPTION_LAST_USED_MACHINE); } |
| 111 | 109 | const char *last_used_filter() const { return value(OPTION_LAST_USED_FILTER); } |
| 112 | 110 | bool info_audit() const { return bool_value(OPTION_INFO_AUTO_AUDIT); } |
trunk/src/emu/ui/optsmenu.cpp
| r253178 | r253179 | |
| 205 | 205 | if (m_event->iptkey == IPT_UI_SELECT) |
| 206 | 206 | ui_menu::stack_push(global_alloc_clear<ui_menu_custom_filter>(machine(), container)); |
| 207 | 207 | break; |
| 208 | | |
| 209 | | case UME_SYSTEM: |
| 210 | | if (m_event->iptkey == IPT_UI_LEFT || m_event->iptkey == IPT_UI_RIGHT) |
| 211 | | { |
| 212 | | (m_event->iptkey == IPT_UI_RIGHT) ? ume_filters::actual++ : ume_filters::actual--; |
| 213 | | changed = true; |
| 214 | | } |
| 215 | | else if (m_event->iptkey == IPT_UI_SELECT) |
| 216 | | { |
| 217 | | int total = ume_filters::length; |
| 218 | | std::vector<std::string> s_sel(total); |
| 219 | | for (int index = 0; index < total; ++index) |
| 220 | | s_sel[index] = ume_filters::text[index]; |
| 221 | | |
| 222 | | ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, s_sel, ume_filters::actual)); |
| 223 | | } |
| 224 | | |
| 225 | | break; |
| 226 | 208 | } |
| 227 | 209 | |
| 228 | 210 | if (changed) |
| r253178 | r253179 | |
| 239 | 221 | std::string fbuff; |
| 240 | 222 | |
| 241 | 223 | // add filter item |
| 242 | | UINT32 arrow_flags = get_arrow_flags(0, ume_filters::length - 1, ume_filters::actual); |
| 243 | | item_append("Machine", ume_filters::text[ume_filters::actual], arrow_flags, (void *)(FPTR)UME_SYSTEM); |
| 244 | | |
| 245 | | // add filter item |
| 246 | | arrow_flags = get_arrow_flags((int)FILTER_FIRST, (int)FILTER_LAST, main_filters::actual); |
| 224 | UINT32 arrow_flags = get_arrow_flags((int)FILTER_FIRST, (int)FILTER_LAST, main_filters::actual); |
| 247 | 225 | item_append("Filter", main_filters::text[main_filters::actual], arrow_flags, (void *)(FPTR)FILTER_MENU); |
| 248 | 226 | |
| 249 | 227 | // add category subitem |
trunk/src/emu/ui/selgame.cpp
| r253178 | r253179 | |
| 173 | 173 | ui_globals::curdats_view = MEWUI_FIRST_LOAD; |
| 174 | 174 | ui_globals::switch_image = false; |
| 175 | 175 | ui_globals::default_image = true; |
| 176 | | ume_filters::actual = moptions.start_filter(); |
| 177 | 176 | ui_globals::panels_status = moptions.hide_panels(); |
| 178 | 177 | } |
| 179 | 178 | |
| r253178 | r253179 | |
| 206 | 205 | else if (main_filters::actual == FILTER_SCREEN) |
| 207 | 206 | filter.append(",").append(screen_filters::text[screen_filters::actual]); |
| 208 | 207 | |
| 209 | | mopt.set_value(OPTION_START_FILTER, ume_filters::actual, OPTION_PRIORITY_CMDLINE, error_string); |
| 210 | 208 | mopt.set_value(OPTION_LAST_USED_FILTER, filter.c_str(), OPTION_PRIORITY_CMDLINE, error_string); |
| 211 | 209 | mopt.set_value(OPTION_LAST_USED_MACHINE, last_driver.c_str(), OPTION_PRIORITY_CMDLINE, error_string); |
| 212 | 210 | mopt.set_value(OPTION_HIDE_PANELS, ui_globals::panels_status, OPTION_PRIORITY_CMDLINE, error_string); |
| r253178 | r253179 | |
| 755 | 753 | ui_manager &mui = machine().ui(); |
| 756 | 754 | float tbarspace = mui.get_line_height(); |
| 757 | 755 | |
| 758 | | if (ume_filters::actual == MEWUI_MAME) |
| 759 | | strprintf(tempbuf[0], "MAME %s ( %d / %d machines (%d BIOS) )", bare_build_version, visible_items, (driver_list::total() - 1), m_isabios + m_issbios); |
| 760 | | else if (ume_filters::actual == MEWUI_ARCADES) |
| 761 | | strprintf(tempbuf[0], "MAME %s ( %d / %d arcades (%d BIOS) )", bare_build_version, visible_items, m_isarcades, m_isabios); |
| 762 | | else if (ume_filters::actual == MEWUI_SYSTEMS) |
| 763 | | strprintf(tempbuf[0], "MAME %s ( %d / %d systems (%d BIOS) )", bare_build_version, visible_items, m_issystems, m_issbios); |
| 764 | | |
| 756 | strprintf(tempbuf[0], "MAME %s ( %d / %d machines (%d BIOS) )", bare_build_version, visible_items, (driver_list::total() - 1), m_isabios + m_issbios); |
| 765 | 757 | std::string filtered; |
| 766 | 758 | |
| 767 | 759 | if (main_filters::actual == FILTER_CATEGORY && !machine().inifile().ini_index.empty()) |
| r253178 | r253179 | |
| 817 | 809 | y1 += mui.get_line_height(); |
| 818 | 810 | } |
| 819 | 811 | |
| 820 | | // draw ume box |
| 821 | | x1 -= UI_BOX_LR_BORDER; |
| 822 | | y1 = origy1 - top; |
| 823 | | draw_ume_box(x1, y1, x2, y2); |
| 824 | | |
| 825 | 812 | // determine the text to render below |
| 826 | 813 | if (main_filters::actual != FILTER_FAVORITE_GAME) |
| 827 | 814 | driver = ((FPTR)selectedref > 2) ? (const game_driver *)selectedref : nullptr; |
| r253178 | r253179 | |
| 1235 | 1222 | if (!bioscheck && filter != FILTER_BIOS && (s_driver->flags & MACHINE_IS_BIOS_ROOT) != 0) |
| 1236 | 1223 | continue; |
| 1237 | 1224 | |
| 1238 | | if ((s_driver->flags & MACHINE_TYPE_ARCADE) && ume_filters::actual == MEWUI_SYSTEMS) |
| 1239 | | continue; |
| 1240 | | |
| 1241 | | if (!(s_driver->flags & MACHINE_TYPE_ARCADE) && ume_filters::actual == MEWUI_ARCADES) |
| 1242 | | continue; |
| 1243 | | |
| 1244 | 1225 | switch (filter) |
| 1245 | 1226 | { |
| 1246 | 1227 | case FILTER_ALL: |
| r253178 | r253179 | |
| 1344 | 1325 | |
| 1345 | 1326 | for (auto & elem : s_drivers) |
| 1346 | 1327 | { |
| 1347 | | if ((elem->flags & MACHINE_TYPE_ARCADE) && ume_filters::actual == MEWUI_SYSTEMS) |
| 1348 | | continue; |
| 1349 | | |
| 1350 | | if (!(elem->flags & MACHINE_TYPE_ARCADE) && ume_filters::actual == MEWUI_ARCADES) |
| 1351 | | continue; |
| 1352 | | |
| 1353 | 1328 | m_displaylist.push_back(elem); |
| 1354 | 1329 | } |
| 1355 | 1330 | |
| r253178 | r253179 | |
| 1423 | 1398 | { |
| 1424 | 1399 | if (!bioscheck && filter != FILTER_BIOS && (s_driver->flags & MACHINE_IS_BIOS_ROOT) != 0) |
| 1425 | 1400 | continue; |
| 1426 | | |
| 1427 | | if ((s_driver->flags & MACHINE_TYPE_ARCADE) && ume_filters::actual == MEWUI_SYSTEMS) |
| 1428 | | continue; |
| 1429 | | |
| 1430 | | if (!(s_driver->flags & MACHINE_TYPE_ARCADE) && ume_filters::actual == MEWUI_ARCADES) |
| 1431 | | continue; |
| 1432 | | |
| 1433 | 1401 | int idx = driver_list::find(s_driver->name); |
| 1434 | 1402 | |
| 1435 | 1403 | switch (filter) |