Forced reset in order to properly apply some options. (nw)

This commit is contained in:
dankan1890 2016-04-20 05:12:40 +02:00
parent 368192cdc5
commit 8b490a9fad
6 changed files with 24 additions and 4 deletions

View File

@ -580,7 +580,7 @@ void emu_options::set_system_name(const char *name)
if (*software_name() != 0) if (*software_name() != 0)
{ {
std::string sw_load(software_name()); std::string sw_load(software_name());
std::string sw_list, sw_name, sw_part, sw_instance, option_errors, error_string; std::string sw_list, sw_name, sw_part, sw_instance, error_string;
int left = sw_load.find_first_of(':'); int left = sw_load.find_first_of(':');
int middle = sw_load.find_first_of(':', left + 1); int middle = sw_load.find_first_of(':', left + 1);
int right = sw_load.find_last_of(':'); int right = sw_load.find_last_of(':');

View File

@ -60,6 +60,9 @@ void inifile_manager::directory_scan()
} }
} }
} }
// sort
std::stable_sort(ini_index.begin(), ini_index.end());
} }
//------------------------------------------------- //-------------------------------------------------
@ -85,6 +88,9 @@ void inifile_manager::init_category(std::string &filename)
} }
} }
// sort
std::stable_sort(index.begin(), index.end());
if (!index.empty()) if (!index.empty())
ini_index.emplace_back(filename, index); ini_index.emplace_back(filename, index);
} }

View File

@ -30,7 +30,7 @@ public:
std::string get_file(int file = -1) { return ((file == -1) ? ini_index[c_file].first : ini_index[file].first); } std::string get_file(int file = -1) { return ((file == -1) ? ini_index[c_file].first : ini_index[file].first); }
std::string get_category(int cat = -1) { return ((cat == -1) ? ini_index[c_file].second[c_cat].first : ini_index[c_file].second[cat].first); } std::string get_category(int cat = -1) { return ((cat == -1) ? ini_index[c_file].second[c_cat].first : ini_index[c_file].second[cat].first); }
size_t total() { return ini_index.size(); } size_t total() { return ini_index.size(); }
size_t cat_total() { return ini_index[c_file].second.size(); } size_t cat_total(int cat = -1) { return ((cat == -1) ? ini_index[c_file].second.size() : ini_index[cat].second.size()); }
UINT16 &cur_file() { return c_file; } UINT16 &cur_file() { return c_file; }
UINT16 &cur_cat() { return c_cat; } UINT16 &cur_cat() { return c_cat; }

View File

@ -773,12 +773,14 @@ void ui_menu_machine_configure::handle()
void ui_menu_machine_configure::populate() void ui_menu_machine_configure::populate()
{ {
// add options items // add options items
item_append(_("Bios"), nullptr, MENU_FLAG_DISABLE | MENU_FLAG_UI_HEADING, nullptr);
if (!m_bios.empty()) if (!m_bios.empty())
{ {
item_append(_("Bios"), nullptr, MENU_FLAG_DISABLE | MENU_FLAG_UI_HEADING, nullptr);
UINT32 arrows = get_arrow_flags(0, m_bios.size() - 1, m_curbios); UINT32 arrows = get_arrow_flags(0, m_bios.size() - 1, m_curbios);
item_append(_("Driver"), m_bios[m_curbios].first.c_str(), arrows, (void *)(FPTR)BIOS); item_append(_("Driver"), m_bios[m_curbios].first.c_str(), arrows, (void *)(FPTR)BIOS);
} }
else
item_append(_("This machine has no bios."), nullptr, MENU_FLAG_DISABLE, nullptr);
item_append(ui_menu_item_type::SEPARATOR); item_append(ui_menu_item_type::SEPARATOR);
item_append(_(advanced_submenu_options[0].description), nullptr, 0, (void *)(FPTR)ADVANCED); item_append(_(advanced_submenu_options[0].description), nullptr, 0, (void *)(FPTR)ADVANCED);

View File

@ -161,15 +161,24 @@ void ui_menu_game_options::handle()
break; break;
case MISC_MENU: case MISC_MENU:
if (m_event->iptkey == IPT_UI_SELECT) if (m_event->iptkey == IPT_UI_SELECT)
{
ui_menu::stack_push(global_alloc_clear<ui_submenu>(machine(), container, misc_submenu_options)); ui_menu::stack_push(global_alloc_clear<ui_submenu>(machine(), container, misc_submenu_options));
ui_globals::reset = true;
}
break; break;
case SOUND_MENU: case SOUND_MENU:
if (m_event->iptkey == IPT_UI_SELECT) if (m_event->iptkey == IPT_UI_SELECT)
{
ui_menu::stack_push(global_alloc_clear<ui_menu_sound_options>(machine(), container)); ui_menu::stack_push(global_alloc_clear<ui_menu_sound_options>(machine(), container));
ui_globals::reset = true;
}
break; break;
case DISPLAY_MENU: case DISPLAY_MENU:
if (m_event->iptkey == IPT_UI_SELECT) if (m_event->iptkey == IPT_UI_SELECT)
{
ui_menu::stack_push(global_alloc_clear<ui_submenu>(machine(), container, video_submenu_options)); ui_menu::stack_push(global_alloc_clear<ui_submenu>(machine(), container, video_submenu_options));
ui_globals::reset = true;
}
break; break;
case CUSTOM_MENU: case CUSTOM_MENU:
if (m_event->iptkey == IPT_UI_SELECT) if (m_event->iptkey == IPT_UI_SELECT)
@ -189,7 +198,10 @@ void ui_menu_game_options::handle()
break; break;
case ADVANCED_MENU: case ADVANCED_MENU:
if (m_event->iptkey == IPT_UI_SELECT) if (m_event->iptkey == IPT_UI_SELECT)
{
ui_menu::stack_push(global_alloc_clear<ui_submenu>(machine(), container, advanced_submenu_options)); ui_menu::stack_push(global_alloc_clear<ui_submenu>(machine(), container, advanced_submenu_options));
ui_globals::reset = true;
}
break; break;
case SAVE_CONFIG: case SAVE_CONFIG:
if (m_event->iptkey == IPT_UI_SELECT) if (m_event->iptkey == IPT_UI_SELECT)

View File

@ -159,7 +159,7 @@ struct ui_software_info
std::string publisher; std::string publisher;
UINT8 supported = 0; UINT8 supported = 0;
std::string part; std::string part;
const game_driver *driver; const game_driver *driver = nullptr;
std::string listname; std::string listname;
std::string interface; std::string interface;
std::string instance; std::string instance;