mirror of
https://github.com/holub/mame
synced 2025-07-06 10:29:38 +03:00
move some options to ui.ini (nw)
This commit is contained in:
parent
d0162765cd
commit
6fb757d6a6
@ -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" },
|
||||
|
@ -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); }
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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))
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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" },
|
||||
|
@ -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[];
|
||||
};
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user