trunk/src/emu/ui/custui.cpp
| r253592 | r253593 | |
| 28 | 28 | file_enumerator path(machine.options().language_path()); |
| 29 | 29 | const char *lang = machine.options().language(); |
| 30 | 30 | const osd_directory_entry *dirent; |
| 31 | int cnt = 0; |
| 31 | 32 | for (int x = 0; (dirent = path.next()) != nullptr; ++x) |
| 32 | 33 | if (dirent->type == ENTTYPE_DIR && strcmp(dirent->name, ".") != 0 && strcmp(dirent->name, "..") != 0) |
| 33 | 34 | { |
| 34 | 35 | m_lang.push_back(dirent->name); |
| 35 | 36 | if (strcmp(dirent->name, lang) == 0) |
| 36 | | m_currlang = x; |
| 37 | m_currlang = cnt; |
| 38 | ++cnt; |
| 37 | 39 | } |
| 38 | 40 | } |
| 39 | 41 | |
| r253592 | r253593 | |
| 48 | 50 | if (!m_lang.empty()) |
| 49 | 51 | { |
| 50 | 52 | machine().options().set_value(OPTION_LANGUAGE, m_lang[m_currlang].c_str(), OPTION_PRIORITY_CMDLINE, error_string); |
| 53 | machine().options().mark_changed(OPTION_LANGUAGE); |
| 51 | 54 | load_translation(machine().options()); |
| 52 | 55 | } |
| 53 | 56 | ui_globals::reset = true; |