Previous 199869 Revisions Next

r45125 Monday 22nd February, 2016 at 08:14:49 UTC by Miodrag Milanović
placing back UI related settings to emu_options on popular demand (nw)
[src/emu]emuopts.cpp emuopts.h
[src/emu/ui]custui.cpp miscmenu.cpp moptions.cpp moptions.h ui.cpp

trunk/src/emu/emuopts.cpp
r253636r253637
183183   { OPTION_DRC_LOG_NATIVE,                             "0",         OPTION_BOOLEAN,    "write DRC native disassembly log" },
184184   { OPTION_BIOS,                                       nullptr,        OPTION_STRING,     "select the system BIOS to use" },
185185   { OPTION_CHEAT ";c",                                 "0",         OPTION_BOOLEAN,    "enable cheat subsystem" },
186   { OPTION_SKIP_GAMEINFO,                              "0",         OPTION_BOOLEAN,    "skip displaying the information screen at startup" },
187   { OPTION_UI_FONT,                                    "default",   OPTION_STRING,     "specify a font to use" },   
186188   { OPTION_UI,                                          "cabinet",   OPTION_STRING,     "type of UI (simple|cabinet)" },
187189   { OPTION_RAMSIZE ";ram",                             nullptr,        OPTION_STRING,     "size of RAM (if supported by driver)" },
190   { OPTION_CONFIRM_QUIT,                               "0",         OPTION_BOOLEAN,    "display confirm quit screen on exit" },
191   { OPTION_UI_MOUSE,                                   "1",         OPTION_BOOLEAN,    "display ui mouse cursor" },
188192   { OPTION_AUTOBOOT_COMMAND ";ab",                     nullptr,        OPTION_STRING,     "command to execute after machine boot" },
189193   { OPTION_AUTOBOOT_DELAY,                             "2",         OPTION_INTEGER,    "timer delay in sec to trigger command execution on autoboot" },
190194   { OPTION_AUTOBOOT_SCRIPT ";script",                  nullptr,        OPTION_STRING,     "lua script to execute after machine boot" },
trunk/src/emu/emuopts.h
r253636r253637
176176#define OPTION_DRC_LOG_NATIVE       "drc_log_native"
177177#define OPTION_BIOS                 "bios"
178178#define OPTION_CHEAT                "cheat"
179#define OPTION_SKIP_GAMEINFO        "skip_gameinfo"
180#define OPTION_UI_FONT              "uifont"
179181#define OPTION_UI                   "ui"
180182#define OPTION_RAMSIZE              "ramsize"
181183
r253636r253637
185187#define OPTION_COMM_REMOTE_HOST     "comm_remotehost"
186188#define OPTION_COMM_REMOTE_PORT     "comm_remoteport"
187189
190#define OPTION_CONFIRM_QUIT         "confirm_quit"
191#define OPTION_UI_MOUSE             "ui_mouse"
192
188193#define OPTION_AUTOBOOT_COMMAND     "autoboot_command"
189194#define OPTION_AUTOBOOT_DELAY       "autoboot_delay"
190195#define OPTION_AUTOBOOT_SCRIPT      "autoboot_script"
r253636r253637
353358   bool drc_log_native() const { return bool_value(OPTION_DRC_LOG_NATIVE); }
354359   const char *bios() const { return value(OPTION_BIOS); }
355360   bool cheat() const { return bool_value(OPTION_CHEAT); }
361   bool skip_gameinfo() const { return bool_value(OPTION_SKIP_GAMEINFO); }
362   const char *ui_font() const { return value(OPTION_UI_FONT); }   
356363   const char *ui() const { return value(OPTION_UI); }
357364   const char *ram_size() const { return value(OPTION_RAMSIZE); }
358365
r253636r253637
362369   const char *comm_remotehost() const { return value(OPTION_COMM_REMOTE_HOST); }
363370   const char *comm_remoteport() const { return value(OPTION_COMM_REMOTE_PORT); }
364371   
372
373   bool confirm_quit() const { return bool_value(OPTION_CONFIRM_QUIT); }
374   bool ui_mouse() const { return bool_value(OPTION_UI_MOUSE); }
375
365376   const char *autoboot_command() const { return value(OPTION_AUTOBOOT_COMMAND); }
366377   int autoboot_delay() const { return int_value(OPTION_AUTOBOOT_DELAY); }
367378   const char *autoboot_script() const { return value(OPTION_AUTOBOOT_SCRIPT); }
trunk/src/emu/ui/custui.cpp
r253636r253637
192192   ui_options &moptions = machine.ui().options();
193193#ifdef UI_WINDOWS
194194
195   std::string name(machine.ui().options().ui_font());
195   std::string name(machine.options().ui_font());
196196   list();
197197
198198   m_bold = (strreplace(name, "[B]", "") + strreplace(name, "[b]", "") > 0);
r253636r253637
285285      if (m_bold)
286286         name.insert(0, "[B]");
287287   }
288   moptions.set_value(OPTION_UI_FONT, name.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
288   machine().options().set_value(OPTION_UI_FONT, name.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
289   machine().options().mark_changed(OPTION_UI_FONT);
289290#endif
290291
291292   moptions.set_value(OPTION_INFOS_SIZE, m_info_size, OPTION_PRIORITY_CMDLINE, error_string);
trunk/src/emu/ui/miscmenu.cpp
r253636r253637
564564   { 0, __("DATs info"),                                       OPTION_DATS_ENABLED },
565565   { 0, __("Cheats"),                                          OPTION_CHEAT },
566566   { 0, __("Show mouse pointer"),                              OPTION_UI_MOUSE },
567   { 0, __("Confirm quit from machines"),                      OPTION_UI_CONFIRM_QUIT },
568   { 0, __("Skip displaying information's screen at startup"), OPTION_UI_SKIP_GAMEINFO },
567   { 0, __("Confirm quit from machines"),                      OPTION_CONFIRM_QUIT },
568   { 0, __("Skip displaying information's screen at startup"), OPTION_SKIP_GAMEINFO },
569569   { 0, __("Force 4:3 appearance for software snapshot"),      OPTION_FORCED4X3 },
570570   { 0, __("Use image as background"),                         OPTION_USE_BACKGROUND },
571571   { 0, __("Skip bios selection menu"),                        OPTION_SKIP_BIOS_MENU },
trunk/src/emu/ui/moptions.cpp
r253636r253637
5252   { OPTION_LAST_USED_FILTER,              "",         OPTION_STRING,      "latest used filter" },
5353   { OPTION_LAST_USED_MACHINE,             "",         OPTION_STRING,      "latest used machine" },
5454   { OPTION_INFO_AUTO_AUDIT,               "0",      OPTION_BOOLEAN,      "enable auto audit in the general info panel" },
55   { OPTION_UI_SKIP_GAMEINFO,              "0",        OPTION_BOOLEAN,     "skip displaying the information screen at startup" },
56   { OPTION_UI_FONT,                       "default",  OPTION_STRING,      "specify a font to use" },
57   { OPTION_UI_CONFIRM_QUIT,               "0",        OPTION_BOOLEAN,     "display confirm quit screen on exit" },
58   { OPTION_UI_MOUSE,                      "1",        OPTION_BOOLEAN,     "display ui mouse cursor" },
5955
6056   // UI options
6157   { nullptr,                              nullptr,      OPTION_HEADER,      "UI OPTIONS" },
trunk/src/emu/ui/moptions.h
r253636r253637
7070#define OPTION_UI_DIPSW_COLOR         "ui_dipsw_color"
7171#define OPTION_UI_SLIDER_COLOR        "ui_slider_color"
7272
73#define OPTION_UI_FONT                "uifont"
74#define OPTION_UI_CONFIRM_QUIT        "confirm_quit"
75#define OPTION_UI_MOUSE               "ui_mouse"
76#define OPTION_UI_SKIP_GAMEINFO       "skip_gameinfo"
77
78
7973class ui_options : public core_options
8074{
8175public:
r253636r253637
136130   const char *ui_mousedown_bg_color() const { return value(OPTION_UI_MOUSEDOWN_BG_COLOR); }
137131   const char *ui_dipsw_color() const { return value(OPTION_UI_DIPSW_COLOR); }
138132   const char *ui_slider_color() const { return value(OPTION_UI_SLIDER_COLOR); }
139
140   bool skip_gameinfo() const { return bool_value(OPTION_UI_SKIP_GAMEINFO); }
141   const char *ui_font() const { return value(OPTION_UI_FONT); }
142   bool confirm_quit() const { return bool_value(OPTION_UI_CONFIRM_QUIT); }
143   bool ui_mouse() const { return bool_value(OPTION_UI_MOUSE); }
144133private:
145134   static const options_entry s_option_entries[];
146135};
trunk/src/emu/ui/ui.cpp
r253636r253637
363363{
364364   const int maxstate = 4;
365365   int str = machine().options().seconds_to_run();
366   bool show_gameinfo = !machine().ui().options().skip_gameinfo();
366   bool show_gameinfo = !machine().options().skip_gameinfo();
367367   bool show_warnings = true, show_mandatory_fileman = true;
368368   int state;
369369
r253636r253637
499499      m_popup_text_end = 0;
500500
501501   // display the internal mouse cursor
502   if (m_mouse_show || (is_menu_active() && machine().ui().options().ui_mouse()))
502   if (m_mouse_show || (is_menu_active() && machine().options().ui_mouse()))
503503   {
504504      INT32 mouse_target_x, mouse_target_y;
505505      bool mouse_button;
r253636r253637
530530{
531531   // allocate the font and messagebox string
532532   if (m_font == nullptr)
533      m_font = machine().render().font_alloc(machine().ui().options().ui_font());
533      m_font = machine().render().font_alloc(machine().options().ui_font());
534534   return m_font;
535535}
536536
r253636r253637
18801880
18811881void ui_manager::request_quit()
18821882{
1883   if (!machine().ui().options().confirm_quit())
1883   if (!machine().options().confirm_quit())
18841884      machine().schedule_exit();
18851885   else
18861886      set_handler(handler_confirm_quit, 0);


Previous 199869 Revisions Next


© 1997-2024 The MAME Team