//~menu_file_manager() { } // force file manager menu public static void force_file_manager(mame_ui_manager mui, render_container container, string warnings) { // reset the menu stack stack_reset(mui.machine()); // add the quit entry followed by the game select entry stack_push_special_main(new menu_quit_game(mui, container)); stack_push(new menu_file_manager(mui, container, warnings)); // force the menus on mui.show_menu(); // make sure MAME is paused mui.machine().pause(); }
//~menu_file_manager() { } // force file manager menu public static void force_file_manager(mame_ui_manager mui, render_container container, string warnings) { // drop any existing menus and start the file manager menu.stack_reset(mui); menu.stack_push_special_main(new menu_file_manager(mui, container, warnings)); mui.show_menu(); // make sure MAME is paused mui.machine().pause(); }
// force game select menu //------------------------------------------------- // force the game select menu to be visible // and inescapable //------------------------------------------------- public static void force_game_select(mame_ui_manager mui, render_container container) { // drop any existing menus and start the system selection menu menu.stack_reset(mui); menu.stack_push_special_main(new menu_select_game(mui, container, null)); mui.show_menu(); // make sure MAME is paused mui.machine().pause(); }
//------------------------------------------------- // ctor //------------------------------------------------- menu_select_game(mame_ui_manager mui, render_container container, string gamename) : base(mui, container, false) { m_persistent_data = system_list.instance(); m_icons = new icon_cache(MAX_ICONS_RENDER); m_icon_paths = ""; m_displaylist = new std.vector <ui_system_info>(); m_searchlist = new std.vector <std.pair <double, ui_system_info> >(); m_searched_fields = (unsigned)system_list.available.AVAIL_NONE; m_populated_favorites = false; string error_string; string last_filter; ui_options moptions = mui.options(); // load drivers cache m_persistent_data.cache_data(mui.options()); // check if there are available system icons check_for_icons(null); // build drivers list if (!load_available_machines()) { build_available_list(); } if (s_first_start) { //s_first_start = false; TODO: why wasn't it ever clearing the first start flag? reselect_last.set_driver(moptions.last_used_machine()); ui_globals.rpanel = (uint8_t)std.min(std.max(moptions.last_right_panel(), (int)RP_FIRST), (int)RP_LAST); string tmp = moptions.last_used_filter(); size_t found = tmp.find_first_of(','); string fake_ini; if (found == npos) { fake_ini = util.string_format("\uFEFF{0} = 1\n", tmp); } else { string sub_filter = tmp.substr(found + 1); tmp = tmp.Substring((int)found); // .resize(found); fake_ini = util.string_format("\uFEFF{0} = {1}\n", tmp, sub_filter); } emu_file file = new emu_file(ui().options().ui_path(), OPEN_FLAG_READ); MemoryU8 fake_ini_buffer = new MemoryU8(System.Text.Encoding.ASCII.GetBytes(fake_ini)); if (!file.open_ram(fake_ini_buffer, (u32)fake_ini.size())) //if (!file.open_ram(fake_ini.c_str(), fake_ini.size())) { m_persistent_data.filter_data().load_ini(file); file.close(); } } // do this after processing the last used filter setting so it overwrites the placeholder load_custom_filters(); m_filter_highlight = (int)m_persistent_data.filter_data().get_current_filter_type(); if (!moptions.remember_last()) { reselect_last.reset(); } mui.machine().options().set_value(OPTION_SNAPNAME, "%g/%i", OPTION_PRIORITY_CMDLINE); ui_globals.curdats_view = 0; ui_globals.panels_status = (uint16_t)moptions.hide_panels(); ui_globals.curdats_total = 1; }