placing back UI related settings to emu_options on popular demand (nw)

This commit is contained in:
Miodrag Milanovic 2016-02-22 09:14:49 +01:00
parent 96aee620d6
commit b2a230cd15
7 changed files with 24 additions and 23 deletions

View File

@ -183,8 +183,12 @@ const options_entry emu_options::s_option_entries[] =
{ OPTION_DRC_LOG_NATIVE, "0", OPTION_BOOLEAN, "write DRC native disassembly log" }, { OPTION_DRC_LOG_NATIVE, "0", OPTION_BOOLEAN, "write DRC native disassembly log" },
{ OPTION_BIOS, nullptr, OPTION_STRING, "select the system BIOS to use" }, { OPTION_BIOS, nullptr, OPTION_STRING, "select the system BIOS to use" },
{ OPTION_CHEAT ";c", "0", OPTION_BOOLEAN, "enable cheat subsystem" }, { 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_UI, "cabinet", OPTION_STRING, "type of UI (simple|cabinet)" },
{ OPTION_RAMSIZE ";ram", nullptr, OPTION_STRING, "size of RAM (if supported by driver)" }, { 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_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_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" }, { OPTION_AUTOBOOT_SCRIPT ";script", nullptr, OPTION_STRING, "lua script to execute after machine boot" },

View File

@ -176,6 +176,8 @@ enum
#define OPTION_DRC_LOG_NATIVE "drc_log_native" #define OPTION_DRC_LOG_NATIVE "drc_log_native"
#define OPTION_BIOS "bios" #define OPTION_BIOS "bios"
#define OPTION_CHEAT "cheat" #define OPTION_CHEAT "cheat"
#define OPTION_SKIP_GAMEINFO "skip_gameinfo"
#define OPTION_UI_FONT "uifont"
#define OPTION_UI "ui" #define OPTION_UI "ui"
#define OPTION_RAMSIZE "ramsize" #define OPTION_RAMSIZE "ramsize"
@ -185,6 +187,9 @@ enum
#define OPTION_COMM_REMOTE_HOST "comm_remotehost" #define OPTION_COMM_REMOTE_HOST "comm_remotehost"
#define OPTION_COMM_REMOTE_PORT "comm_remoteport" #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_COMMAND "autoboot_command"
#define OPTION_AUTOBOOT_DELAY "autoboot_delay" #define OPTION_AUTOBOOT_DELAY "autoboot_delay"
#define OPTION_AUTOBOOT_SCRIPT "autoboot_script" #define OPTION_AUTOBOOT_SCRIPT "autoboot_script"
@ -353,6 +358,8 @@ public:
bool drc_log_native() const { return bool_value(OPTION_DRC_LOG_NATIVE); } bool drc_log_native() const { return bool_value(OPTION_DRC_LOG_NATIVE); }
const char *bios() const { return value(OPTION_BIOS); } const char *bios() const { return value(OPTION_BIOS); }
bool cheat() const { return bool_value(OPTION_CHEAT); } 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 *ui() const { return value(OPTION_UI); }
const char *ram_size() const { return value(OPTION_RAMSIZE); } const char *ram_size() const { return value(OPTION_RAMSIZE); }
@ -362,6 +369,10 @@ public:
const char *comm_remotehost() const { return value(OPTION_COMM_REMOTE_HOST); } const char *comm_remotehost() const { return value(OPTION_COMM_REMOTE_HOST); }
const char *comm_remoteport() const { return value(OPTION_COMM_REMOTE_PORT); } 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); } const char *autoboot_command() const { return value(OPTION_AUTOBOOT_COMMAND); }
int autoboot_delay() const { return int_value(OPTION_AUTOBOOT_DELAY); } int autoboot_delay() const { return int_value(OPTION_AUTOBOOT_DELAY); }
const char *autoboot_script() const { return value(OPTION_AUTOBOOT_SCRIPT); } const char *autoboot_script() const { return value(OPTION_AUTOBOOT_SCRIPT); }

View File

@ -192,7 +192,7 @@ ui_menu_font_ui::ui_menu_font_ui(running_machine &machine, render_container *con
ui_options &moptions = machine.ui().options(); ui_options &moptions = machine.ui().options();
#ifdef UI_WINDOWS #ifdef UI_WINDOWS
std::string name(machine.ui().options().ui_font()); std::string name(machine.options().ui_font());
list(); list();
m_bold = (strreplace(name, "[B]", "") + strreplace(name, "[b]", "") > 0); m_bold = (strreplace(name, "[B]", "") + strreplace(name, "[b]", "") > 0);
@ -285,7 +285,8 @@ ui_menu_font_ui::~ui_menu_font_ui()
if (m_bold) if (m_bold)
name.insert(0, "[B]"); name.insert(0, "[B]");
} }
moptions.set_value(OPTION_UI_FONT, name.c_str(), OPTION_PRIORITY_CMDLINE, error_string); machine().options().set_value(OPTION_UI_FONT, name.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
machine().options().mark_changed(OPTION_UI_FONT);
#endif #endif
moptions.set_value(OPTION_INFOS_SIZE, m_info_size, OPTION_PRIORITY_CMDLINE, error_string); moptions.set_value(OPTION_INFOS_SIZE, m_info_size, OPTION_PRIORITY_CMDLINE, error_string);

View File

@ -564,8 +564,8 @@ ui_menu_misc_options::misc_option ui_menu_misc_options::m_options[] = {
{ 0, __("DATs info"), OPTION_DATS_ENABLED }, { 0, __("DATs info"), OPTION_DATS_ENABLED },
{ 0, __("Cheats"), OPTION_CHEAT }, { 0, __("Cheats"), OPTION_CHEAT },
{ 0, __("Show mouse pointer"), OPTION_UI_MOUSE }, { 0, __("Show mouse pointer"), OPTION_UI_MOUSE },
{ 0, __("Confirm quit from machines"), OPTION_UI_CONFIRM_QUIT }, { 0, __("Confirm quit from machines"), OPTION_CONFIRM_QUIT },
{ 0, __("Skip displaying information's screen at startup"), OPTION_UI_SKIP_GAMEINFO }, { 0, __("Skip displaying information's screen at startup"), OPTION_SKIP_GAMEINFO },
{ 0, __("Force 4:3 appearance for software snapshot"), OPTION_FORCED4X3 }, { 0, __("Force 4:3 appearance for software snapshot"), OPTION_FORCED4X3 },
{ 0, __("Use image as background"), OPTION_USE_BACKGROUND }, { 0, __("Use image as background"), OPTION_USE_BACKGROUND },
{ 0, __("Skip bios selection menu"), OPTION_SKIP_BIOS_MENU }, { 0, __("Skip bios selection menu"), OPTION_SKIP_BIOS_MENU },

View File

@ -52,10 +52,6 @@ const options_entry ui_options::s_option_entries[] =
{ OPTION_LAST_USED_FILTER, "", OPTION_STRING, "latest used filter" }, { OPTION_LAST_USED_FILTER, "", OPTION_STRING, "latest used filter" },
{ OPTION_LAST_USED_MACHINE, "", OPTION_STRING, "latest used machine" }, { 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_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 // UI options
{ nullptr, nullptr, OPTION_HEADER, "UI OPTIONS" }, { nullptr, nullptr, OPTION_HEADER, "UI OPTIONS" },

View File

@ -70,12 +70,6 @@
#define OPTION_UI_DIPSW_COLOR "ui_dipsw_color" #define OPTION_UI_DIPSW_COLOR "ui_dipsw_color"
#define OPTION_UI_SLIDER_COLOR "ui_slider_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 class ui_options : public core_options
{ {
public: public:
@ -136,11 +130,6 @@ public:
const char *ui_mousedown_bg_color() const { return value(OPTION_UI_MOUSEDOWN_BG_COLOR); } const char *ui_mousedown_bg_color() const { return value(OPTION_UI_MOUSEDOWN_BG_COLOR); }
const char *ui_dipsw_color() const { return value(OPTION_UI_DIPSW_COLOR); } const char *ui_dipsw_color() const { return value(OPTION_UI_DIPSW_COLOR); }
const char *ui_slider_color() const { return value(OPTION_UI_SLIDER_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: private:
static const options_entry s_option_entries[]; static const options_entry s_option_entries[];
}; };

View File

@ -363,7 +363,7 @@ void ui_manager::display_startup_screens(bool first_time, bool show_disclaimer)
{ {
const int maxstate = 4; const int maxstate = 4;
int str = machine().options().seconds_to_run(); int str = machine().options().seconds_to_run();
bool show_gameinfo = !machine().ui().options().skip_gameinfo(); bool show_gameinfo = !machine().options().skip_gameinfo();
bool show_warnings = true, show_mandatory_fileman = true; bool show_warnings = true, show_mandatory_fileman = true;
int state; int state;
@ -499,7 +499,7 @@ void ui_manager::update_and_render(render_container *container)
m_popup_text_end = 0; m_popup_text_end = 0;
// display the internal mouse cursor // display the internal mouse cursor
if (m_mouse_show || (is_menu_active() && machine().ui().options().ui_mouse())) if (m_mouse_show || (is_menu_active() && machine().options().ui_mouse()))
{ {
INT32 mouse_target_x, mouse_target_y; INT32 mouse_target_x, mouse_target_y;
bool mouse_button; bool mouse_button;
@ -530,7 +530,7 @@ render_font *ui_manager::get_font()
{ {
// allocate the font and messagebox string // allocate the font and messagebox string
if (m_font == nullptr) if (m_font == nullptr)
m_font = machine().render().font_alloc(machine().ui().options().ui_font()); m_font = machine().render().font_alloc(machine().options().ui_font());
return m_font; return m_font;
} }
@ -1880,7 +1880,7 @@ UINT32 ui_manager::handler_load_save(running_machine &machine, render_container
void ui_manager::request_quit() void ui_manager::request_quit()
{ {
if (!machine().ui().options().confirm_quit()) if (!machine().options().confirm_quit())
machine().schedule_exit(); machine().schedule_exit();
else else
set_handler(handler_confirm_quit, 0); set_handler(handler_confirm_quit, 0);