diff options
author | 2016-02-05 15:17:51 +0100 | |
---|---|---|
committer | 2016-02-05 15:17:51 +0100 | |
commit | 6fb757d6a6ee1628c49834c884d682bb43211ffd (patch) | |
tree | c9fea3e49c11df6282ef022c91396985a7bbbe4e | |
parent | d0162765cdd23c2cb015118b75c87689a839de40 (diff) |
move some options to ui.ini (nw)
-rw-r--r-- | src/emu/emuopts.cpp | 4 | ||||
-rw-r--r-- | src/emu/emuopts.h | 12 | ||||
-rw-r--r-- | src/emu/ui/custui.cpp | 8 | ||||
-rw-r--r-- | src/emu/ui/menu.cpp | 4 | ||||
-rw-r--r-- | src/emu/ui/miscmenu.cpp | 8 | ||||
-rw-r--r-- | src/emu/ui/moptions.cpp | 6 | ||||
-rw-r--r-- | src/emu/ui/moptions.h | 10 | ||||
-rw-r--r-- | src/emu/ui/ui.cpp | 8 |
8 files changed, 30 insertions, 30 deletions
diff --git a/src/emu/emuopts.cpp b/src/emu/emuopts.cpp index 9081f996e6d..716432b9088 100644 --- a/src/emu/emuopts.cpp +++ b/src/emu/emuopts.cpp @@ -178,12 +178,8 @@ const options_entry emu_options::s_option_entries[] = { OPTION_DRC_LOG_NATIVE, "0", OPTION_BOOLEAN, "write DRC native disassembly log" }, { OPTION_BIOS, nullptr, OPTION_STRING, "select the system BIOS to use" }, { OPTION_CHEAT ";c", "0", OPTION_BOOLEAN, "enable cheat subsystem" }, - { OPTION_SKIP_GAMEINFO, "0", OPTION_BOOLEAN, "skip displaying the information screen at startup" }, - { OPTION_UI_FONT, "default", OPTION_STRING, "specify a font to use" }, { OPTION_UI, "cabinet", OPTION_STRING, "type of UI (simple|cabinet)" }, { OPTION_RAMSIZE ";ram", nullptr, OPTION_STRING, "size of RAM (if supported by driver)" }, - { OPTION_CONFIRM_QUIT, "0", OPTION_BOOLEAN, "display confirm quit screen on exit" }, - { OPTION_UI_MOUSE, "1", OPTION_BOOLEAN, "display ui mouse cursor" }, { OPTION_AUTOBOOT_COMMAND ";ab", nullptr, OPTION_STRING, "command to execute after machine boot" }, { OPTION_AUTOBOOT_DELAY, "2", OPTION_INTEGER, "timer delay in sec to trigger command execution on autoboot" }, { OPTION_AUTOBOOT_SCRIPT ";script", nullptr, OPTION_STRING, "lua script to execute after machine boot" }, diff --git a/src/emu/emuopts.h b/src/emu/emuopts.h index dc5acbb7849..d8d6e162e94 100644 --- a/src/emu/emuopts.h +++ b/src/emu/emuopts.h @@ -172,8 +172,6 @@ enum #define OPTION_DRC_LOG_NATIVE "drc_log_native" #define OPTION_BIOS "bios" #define OPTION_CHEAT "cheat" -#define OPTION_SKIP_GAMEINFO "skip_gameinfo" -#define OPTION_UI_FONT "uifont" #define OPTION_UI "ui" #define OPTION_RAMSIZE "ramsize" @@ -183,9 +181,6 @@ enum #define OPTION_COMM_REMOTE_HOST "comm_remotehost" #define OPTION_COMM_REMOTE_PORT "comm_remoteport" -#define OPTION_CONFIRM_QUIT "confirm_quit" -#define OPTION_UI_MOUSE "ui_mouse" - #define OPTION_AUTOBOOT_COMMAND "autoboot_command" #define OPTION_AUTOBOOT_DELAY "autoboot_delay" #define OPTION_AUTOBOOT_SCRIPT "autoboot_script" @@ -348,8 +343,6 @@ public: bool drc_log_native() const { return bool_value(OPTION_DRC_LOG_NATIVE); } const char *bios() const { return value(OPTION_BIOS); } bool cheat() const { return bool_value(OPTION_CHEAT); } - bool skip_gameinfo() const { return bool_value(OPTION_SKIP_GAMEINFO); } - const char *ui_font() const { return value(OPTION_UI_FONT); } const char *ui() const { return value(OPTION_UI); } const char *ram_size() const { return value(OPTION_RAMSIZE); } @@ -358,10 +351,7 @@ public: const char *comm_localport() const { return value(OPTION_COMM_LOCAL_PORT); } const char *comm_remotehost() const { return value(OPTION_COMM_REMOTE_HOST); } const char *comm_remoteport() const { return value(OPTION_COMM_REMOTE_PORT); } - - bool confirm_quit() const { return bool_value(OPTION_CONFIRM_QUIT); } - bool ui_mouse() const { return bool_value(OPTION_UI_MOUSE); } - + const char *autoboot_command() const { return value(OPTION_AUTOBOOT_COMMAND); } int autoboot_delay() const { return int_value(OPTION_AUTOBOOT_DELAY); } const char *autoboot_script() const { return value(OPTION_AUTOBOOT_SCRIPT); } diff --git a/src/emu/ui/custui.cpp b/src/emu/ui/custui.cpp index b03f51f9122..fb1459837ab 100644 --- a/src/emu/ui/custui.cpp +++ b/src/emu/ui/custui.cpp @@ -33,11 +33,11 @@ ui_menu_custom_ui::ui_menu_custom_ui(running_machine &machine, render_container ui_menu_custom_ui::~ui_menu_custom_ui() { std::string error_string; - machine().options().set_value(OPTION_HIDE_PANELS, ui_globals::panels_status, OPTION_PRIORITY_CMDLINE, error_string); + machine().ui().options().set_value(OPTION_HIDE_PANELS, ui_globals::panels_status, OPTION_PRIORITY_CMDLINE, error_string); ui_globals::reset = true; } -//------------------------------------------------- +//------------------------------------------------- // handle //------------------------------------------------- @@ -143,7 +143,7 @@ ui_menu_font_ui::ui_menu_font_ui(running_machine &machine, render_container *con ui_options &moptions = machine.ui().options(); #ifdef UI_WINDOWS - std::string name(machine.options().ui_font()); + std::string name(machine.ui().options().ui_font()); list(); m_bold = (strreplace(name, "[B]", "") + strreplace(name, "[b]", "") > 0); @@ -442,7 +442,7 @@ ui_menu_colors_ui::~ui_menu_colors_ui() for (int index = 1; index < MUI_RESTORE; index++) { strprintf(dec_color, "%x", (UINT32)m_color_table[index].color); - machine().options().set_value(m_color_table[index].option, dec_color.c_str(), OPTION_PRIORITY_CMDLINE, error_string); + machine().ui().options().set_value(m_color_table[index].option, dec_color.c_str(), OPTION_PRIORITY_CMDLINE, error_string); } } diff --git a/src/emu/ui/menu.cpp b/src/emu/ui/menu.cpp index a8ba0d75b04..b401da66144 100644 --- a/src/emu/ui/menu.cpp +++ b/src/emu/ui/menu.cpp @@ -1613,9 +1613,9 @@ void ui_menu::get_title_search(std::string &snaptext, std::string &searchstr) snaptext.assign(arts_info[ui_globals::curimage_view].title); // get search path - path_iterator path(machine().options().value(arts_info[ui_globals::curimage_view].path)); + path_iterator path(machine().ui().options().value(arts_info[ui_globals::curimage_view].path)); std::string curpath; - searchstr.assign(machine().options().value(arts_info[ui_globals::curimage_view].path)); + searchstr.assign(machine().ui().options().value(arts_info[ui_globals::curimage_view].path)); // iterate over path and add path for zipped formats while (path.next(curpath)) diff --git a/src/emu/ui/miscmenu.cpp b/src/emu/ui/miscmenu.cpp index 2226d0435a8..3f5b987975f 100644 --- a/src/emu/ui/miscmenu.cpp +++ b/src/emu/ui/miscmenu.cpp @@ -564,8 +564,8 @@ ui_menu_misc_options::misc_option ui_menu_misc_options::m_options[] = { { 0, "DATs info", OPTION_DATS_ENABLED }, { 0, "Cheats", OPTION_CHEAT }, { 0, "Show mouse pointer", OPTION_UI_MOUSE }, - { 0, "Confirm quit from machines", OPTION_CONFIRM_QUIT }, - { 0, "Skip displaying information's screen at startup", OPTION_SKIP_GAMEINFO }, + { 0, "Confirm quit from machines", OPTION_UI_CONFIRM_QUIT }, + { 0, "Skip displaying information's screen at startup", OPTION_UI_SKIP_GAMEINFO }, { 0, "Force 4:3 appearance for software snapshot", OPTION_FORCED4X3 }, { 0, "Use image as background", OPTION_USE_BACKGROUND }, { 0, "Skip bios selection menu", OPTION_SKIP_BIOS_MENU }, @@ -579,14 +579,14 @@ ui_menu_misc_options::misc_option ui_menu_misc_options::m_options[] = { ui_menu_misc_options::ui_menu_misc_options(running_machine &machine, render_container *container) : ui_menu(machine, container) { for (int d = 1; d < ARRAY_LENGTH(m_options); ++d) - m_options[d].status = machine.options().bool_value(m_options[d].option); + m_options[d].status = machine.ui().options().bool_value(m_options[d].option); } ui_menu_misc_options::~ui_menu_misc_options() { std::string error_string; for (int d = 1; d < ARRAY_LENGTH(m_options); ++d) - machine().options().set_value(m_options[d].option, m_options[d].status, OPTION_PRIORITY_CMDLINE, error_string); + machine().ui().options().set_value(m_options[d].option, m_options[d].status, OPTION_PRIORITY_CMDLINE, error_string); ui_globals::reset = true; } diff --git a/src/emu/ui/moptions.cpp b/src/emu/ui/moptions.cpp index 5dfdfde43c3..dd4897749fc 100644 --- a/src/emu/ui/moptions.cpp +++ b/src/emu/ui/moptions.cpp @@ -52,9 +52,13 @@ const options_entry ui_options::s_option_entries[] = { OPTION_LAST_USED_FILTER, "", OPTION_STRING, "latest used filter" }, { OPTION_LAST_USED_MACHINE, "", OPTION_STRING, "latest used machine" }, { OPTION_INFO_AUTO_AUDIT, "0", OPTION_BOOLEAN, "enable auto audit in the general info panel" }, + { OPTION_UI_SKIP_GAMEINFO, "0", OPTION_BOOLEAN, "skip displaying the information screen at startup" }, + { OPTION_UI_FONT, "default", OPTION_STRING, "specify a font to use" }, + { OPTION_UI_CONFIRM_QUIT, "0", OPTION_BOOLEAN, "display confirm quit screen on exit" }, + { OPTION_UI_MOUSE, "1", OPTION_BOOLEAN, "display ui mouse cursor" }, // UI options - { nullptr, nullptr, OPTION_HEADER, "UI UI OPTIONS" }, + { nullptr, nullptr, OPTION_HEADER, "UI OPTIONS" }, { OPTION_INFOS_SIZE "(0.05-1.00)", "0.75", OPTION_FLOAT, "UI right panel infos text size (0.05 - 1.00)" }, { OPTION_FONT_ROWS "(25-40)", "30", OPTION_INTEGER, "UI font text size (25 - 40)" }, { OPTION_HIDE_PANELS "(0-3)", "0", OPTION_INTEGER, "UI hide left/right panel in main view (0 = Show all, 1 = hide left, 2 = hide right, 3 = hide both" }, diff --git a/src/emu/ui/moptions.h b/src/emu/ui/moptions.h index e3c649111d9..3b1ab8948c0 100644 --- a/src/emu/ui/moptions.h +++ b/src/emu/ui/moptions.h @@ -70,6 +70,12 @@ #define OPTION_UI_DIPSW_COLOR "ui_dipsw_color" #define OPTION_UI_SLIDER_COLOR "ui_slider_color" +#define OPTION_UI_FONT "uifont" +#define OPTION_UI_CONFIRM_QUIT "confirm_quit" +#define OPTION_UI_MOUSE "ui_mouse" +#define OPTION_UI_SKIP_GAMEINFO "skip_gameinfo" + + class ui_options : public core_options { public: @@ -131,6 +137,10 @@ public: const char *ui_dipsw_color() const { return value(OPTION_UI_DIPSW_COLOR); } const char *ui_slider_color() const { return value(OPTION_UI_SLIDER_COLOR); } + bool skip_gameinfo() const { return bool_value(OPTION_UI_SKIP_GAMEINFO); } + const char *ui_font() const { return value(OPTION_UI_FONT); } + bool confirm_quit() const { return bool_value(OPTION_UI_CONFIRM_QUIT); } + bool ui_mouse() const { return bool_value(OPTION_UI_MOUSE); } private: static const options_entry s_option_entries[]; }; diff --git a/src/emu/ui/ui.cpp b/src/emu/ui/ui.cpp index b549a51e80f..6d996ac50a0 100644 --- a/src/emu/ui/ui.cpp +++ b/src/emu/ui/ui.cpp @@ -361,7 +361,7 @@ void ui_manager::display_startup_screens(bool first_time, bool show_disclaimer) { const int maxstate = 4; int str = machine().options().seconds_to_run(); - bool show_gameinfo = !machine().options().skip_gameinfo(); + bool show_gameinfo = !machine().ui().options().skip_gameinfo(); bool show_warnings = true, show_mandatory_fileman = true; int state; @@ -497,7 +497,7 @@ void ui_manager::update_and_render(render_container *container) m_popup_text_end = 0; // display the internal mouse cursor - if (m_mouse_show || (is_menu_active() && machine().options().ui_mouse())) + if (m_mouse_show || (is_menu_active() && machine().ui().options().ui_mouse())) { INT32 mouse_target_x, mouse_target_y; bool mouse_button; @@ -528,7 +528,7 @@ render_font *ui_manager::get_font() { // allocate the font and messagebox string if (m_font == nullptr) - m_font = machine().render().font_alloc(machine().options().ui_font()); + m_font = machine().render().font_alloc(machine().ui().options().ui_font()); return m_font; } @@ -1863,7 +1863,7 @@ UINT32 ui_manager::handler_load_save(running_machine &machine, render_container void ui_manager::request_quit() { - if (!machine().options().confirm_quit()) + if (!machine().ui().options().confirm_quit()) machine().schedule_exit(); else set_handler(handler_confirm_quit, 0); |