diff options
Diffstat (limited to 'src/emu/ui/optsmenu.cpp')
-rw-r--r-- | src/emu/ui/optsmenu.cpp | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/src/emu/ui/optsmenu.cpp b/src/emu/ui/optsmenu.cpp index c80ad0ad00e..a87de984694 100644 --- a/src/emu/ui/optsmenu.cpp +++ b/src/emu/ui/optsmenu.cpp @@ -91,26 +91,24 @@ void ui_menu_game_options::handle() { if (m_event->iptkey == IPT_UI_LEFT) { - machine().inifile().current_file--; - machine().inifile().current_category = 0; + machine().inifile().move_file(-1); changed = true; } else if (m_event->iptkey == IPT_UI_RIGHT) { - machine().inifile().current_file++; - machine().inifile().current_category = 0; + machine().inifile().move_file(1); changed = true; } else if (m_event->iptkey == IPT_UI_SELECT) { inifile_manager &ifile = machine().inifile(); - int total = ifile.ini_index.size(); + int total = ifile.total(); std::vector<std::string> s_sel(total); - machine().inifile().current_category = 0; + machine().inifile().set_cat(0); for (size_t index = 0; index < total; ++index) - s_sel[index] = ifile.ini_index[index].name; + s_sel[index] = ifile.get_file(index); - ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, s_sel, ifile.current_file, SELECTOR_INIFILE)); + ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, s_sel, ifile.cur_file(), SELECTOR_INIFILE)); } break; } @@ -118,24 +116,23 @@ void ui_menu_game_options::handle() { if (m_event->iptkey == IPT_UI_LEFT) { - machine().inifile().current_category--; + machine().inifile().move_cat(-1); changed = true; } else if (m_event->iptkey == IPT_UI_RIGHT) { - machine().inifile().current_category++; + machine().inifile().move_cat(1); changed = true; } else if (m_event->iptkey == IPT_UI_SELECT) { inifile_manager &ifile = machine().inifile(); - int cfile = ifile.current_file; - int total = ifile.ini_index[cfile].category.size(); + int total = ifile.cat_total(); std::vector<std::string> s_sel(total); for (int index = 0; index < total; ++index) - s_sel[index] = ifile.ini_index[cfile].category[index].name; + s_sel[index] = ifile.get_category(index); - ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, s_sel, ifile.current_category, SELECTOR_CATEGORY)); + ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, s_sel, ifile.cur_cat(), SELECTOR_CATEGORY)); } break; } @@ -217,20 +214,19 @@ void ui_menu_game_options::populate() item_append(_("Filter"), main_filters::text[m_main], arrow_flags, (void *)(FPTR)FILTER_MENU); // add category subitem - if (m_main == FILTER_CATEGORY && !machine().inifile().ini_index.empty()) + if (m_main == FILTER_CATEGORY && machine().inifile().total() > 0) { inifile_manager &inif = machine().inifile(); - int afile = inif.current_file; - arrow_flags = get_arrow_flags(0, inif.ini_index.size() - 1, afile); + arrow_flags = get_arrow_flags(0, inif.total() - 1, inif.cur_file()); fbuff = _(" ^!File"); convert_command_glyph(fbuff); - item_append(fbuff.c_str(), inif.actual_file().c_str(), arrow_flags, (void *)(FPTR)FILE_CATEGORY_FILTER); + item_append(fbuff.c_str(), inif.get_file().c_str(), arrow_flags, (void *)(FPTR)FILE_CATEGORY_FILTER); - arrow_flags = get_arrow_flags(0, inif.ini_index[afile].category.size() - 1, inif.current_category); + arrow_flags = get_arrow_flags(0, inif.cat_total() - 1, inif.cur_cat()); fbuff = _(" ^!Category"); convert_command_glyph(fbuff); - item_append(fbuff.c_str(), inif.actual_category().c_str(), arrow_flags, (void *)(FPTR)CATEGORY_FILTER); + item_append(fbuff.c_str(), inif.get_category().c_str(), arrow_flags, (void *)(FPTR)CATEGORY_FILTER); } // add manufacturer subitem else if (m_main == FILTER_MANUFACTURER && c_mnfct::ui.size() > 0) |