mirror of
https://github.com/holub/mame
synced 2025-10-05 16:50:57 +03:00
Reduction code for entries of "enum class ui_menu_item_type" and the use of item_append with separators.
This commit is contained in:
parent
edb0904e76
commit
a0715c7c40
@ -107,7 +107,6 @@ int cli_frontend::execute(int argc, char **argv)
|
||||
|
||||
m_options.parse_standard_inis(option_errors);
|
||||
|
||||
//load_translation();
|
||||
load_translation(m_options);
|
||||
|
||||
manager->start_luaengine();
|
||||
|
@ -72,7 +72,7 @@ void ui_menu_barcode_reader::populate()
|
||||
item_append(_("New Barcode:"), new_barcode, 0, ITEMREF_NEW_BARCODE);
|
||||
|
||||
// finish up the menu
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
item_append(_("Enter Code"), nullptr, 0, ITEMREF_ENTER_BARCODE);
|
||||
|
||||
customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
|
||||
|
@ -121,7 +121,7 @@ void ui_menu_cheat::populate()
|
||||
item_append(_("Autofire Settings"), nullptr, 0, (void *)ITEMREF_CHEATS_AUTOFIRE_SETTINGS);
|
||||
|
||||
/* add a separator */
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
|
||||
// add other cheats
|
||||
if (!machine().cheat().entries().empty()) {
|
||||
@ -133,7 +133,7 @@ void ui_menu_cheat::populate()
|
||||
}
|
||||
|
||||
/* add a separator */
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
|
||||
/* add a reset all option */
|
||||
item_append(_("Reset All"), nullptr, 0, (void *)ITEMREF_CHEATS_RESET_ALL);
|
||||
@ -272,7 +272,7 @@ void ui_menu_autofire::populate()
|
||||
if (is_first_button)
|
||||
{
|
||||
/* add a separator for each player */
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
is_first_button = false;
|
||||
}
|
||||
/* add an autofire item */
|
||||
@ -295,12 +295,12 @@ void ui_menu_autofire::populate()
|
||||
/* add text item if no buttons found */
|
||||
if (menu_items==0)
|
||||
{
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
item_append(_("No buttons found on this machine!"), nullptr, MENU_FLAG_DISABLE, nullptr);
|
||||
}
|
||||
|
||||
/* add a separator */
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
|
||||
/* add autofire delay item */
|
||||
int value = machine().ioport().get_autofire_delay();
|
||||
@ -315,7 +315,7 @@ void ui_menu_autofire::populate()
|
||||
}
|
||||
|
||||
/* add a separator */
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
|
||||
last_toggle = autofire_toggle;
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ void ui_menu_custom_filter::populate()
|
||||
// add other filters
|
||||
for (int x = 1; x <= custfltr::numother; x++)
|
||||
{
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
|
||||
// add filter items
|
||||
arrow_flags = get_arrow_flags((int)FILTER_UNAVAILABLE + 1, (int)FILTER_LAST - 1, custfltr::other[x]);
|
||||
@ -187,7 +187,7 @@ void ui_menu_custom_filter::populate()
|
||||
}
|
||||
}
|
||||
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
|
||||
if (custfltr::numother > 0)
|
||||
item_append(_("Remove last filter"), nullptr, 0, (void *)(FPTR)REMOVE_FILTER);
|
||||
@ -195,7 +195,7 @@ void ui_menu_custom_filter::populate()
|
||||
if (custfltr::numother < MAX_CUST_FILTER - 2)
|
||||
item_append(_("Add filter"), nullptr, 0, (void *)(FPTR)ADD_FILTER);
|
||||
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
|
||||
}
|
||||
|
||||
@ -447,7 +447,7 @@ void ui_menu_swcustom_filter::populate()
|
||||
// add other filters
|
||||
for (int x = 1; x <= sw_custfltr::numother; x++)
|
||||
{
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
|
||||
// add filter items
|
||||
arrow_flags = get_arrow_flags((int)UI_SW_UNAVAILABLE + 1, (int)UI_SW_LAST - 1, sw_custfltr::other[x]);
|
||||
@ -502,7 +502,7 @@ void ui_menu_swcustom_filter::populate()
|
||||
}
|
||||
}
|
||||
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
|
||||
if (sw_custfltr::numother > 0)
|
||||
item_append(_("Remove last filter"), nullptr, 0, (void *)(FPTR)REMOVE_FILTER);
|
||||
@ -510,7 +510,7 @@ void ui_menu_swcustom_filter::populate()
|
||||
if (sw_custfltr::numother < MAX_CUST_FILTER - 2)
|
||||
item_append(_("Add filter"), nullptr, 0, (void *)(FPTR)ADD_FILTER);
|
||||
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
|
||||
customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ void ui_menu_custom_ui::populate()
|
||||
arrow_flags = get_arrow_flags(0, (int)HIDE_BOTH, ui_globals::panels_status);
|
||||
item_append(_("Show side panels"), _(hide_status[ui_globals::panels_status]), arrow_flags, (void *)(FPTR)HIDE_MENU);
|
||||
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
|
||||
}
|
||||
|
||||
@ -357,13 +357,13 @@ void ui_menu_font_ui::populate()
|
||||
arrow_flags = get_arrow_flags(m_font_min, m_font_max, m_font_size);
|
||||
item_append(_("Lines"), string_format("%2d", m_font_size).c_str(), arrow_flags, (void *)(FPTR)FONT_SIZE);
|
||||
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
|
||||
// add item
|
||||
arrow_flags = get_arrow_flags(m_info_min, m_info_max, m_info_size);
|
||||
item_append(_("Infos text size"), string_format("%3.2f", m_info_size).c_str(), arrow_flags, (void *)(FPTR)INFOS_SIZE);
|
||||
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
|
||||
custombottom = customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
|
||||
}
|
||||
@ -520,7 +520,7 @@ void ui_menu_colors_ui::populate()
|
||||
item_append(_("Mouse down color"), nullptr, 0, (void *)(FPTR)MUI_MOUSEDOWN_COLOR);
|
||||
item_append(_("Mouse down background color"), nullptr, 0, (void *)(FPTR)MUI_MOUSEDOWN_BG_COLOR);
|
||||
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
item_append(_("Restore originals colors"), nullptr, 0, (void *)(FPTR)MUI_RESTORE);
|
||||
|
||||
custombottom = customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
|
||||
@ -863,9 +863,9 @@ void ui_menu_rgb_ui::populate()
|
||||
else
|
||||
item_append(_("Blue"), s_text.c_str(), 0, (void *)(FPTR)RGB_BLUE);
|
||||
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
item_append(_("Choose from palette"), nullptr, 0, (void *)(FPTR)PALETTE_CHOOSE);
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
|
||||
custombottom = customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
|
||||
}
|
||||
@ -1057,7 +1057,7 @@ void ui_menu_palette_sel::populate()
|
||||
for (int x = 0; x < ARRAY_LENGTH(m_palette); ++x)
|
||||
item_append(_(m_palette[x].name), m_palette[x].argb, MENU_FLAG_UI_PALETTE, (void *)(FPTR)(x + 1));
|
||||
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
|
@ -131,7 +131,7 @@ void ui_menu_dats_view::custom_render(void *selectedref, float top, float bottom
|
||||
mui.draw_text_full(container, driver.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
|
||||
width += 2 * UI_BOX_LR_BORDER;
|
||||
maxwidth = MAX(origx2 - origx1, width);
|
||||
maxwidth = MAX(maxwidth, width);
|
||||
|
||||
// compute our bounds
|
||||
float x1 = 0.5f - 0.5f * maxwidth;
|
||||
@ -246,8 +246,8 @@ void ui_menu_dats_view::get_data()
|
||||
else
|
||||
machine().datfile().load_data_info(m_driver, buffer, m_items_list[m_actual].option);
|
||||
|
||||
int totallines = machine().ui().wrap_text(container, buffer.c_str(), 0.0f, 0.0f, 1.0f - (4.0f * UI_BOX_LR_BORDER), xstart, xend);
|
||||
for (int x = 0; x < totallines; ++x)
|
||||
int lines = machine().ui().wrap_text(container, buffer.c_str(), 0.0f, 0.0f, 1.0f - (4.0f * UI_BOX_LR_BORDER), xstart, xend);
|
||||
for (int x = 0; x < lines; ++x)
|
||||
{
|
||||
std::string tempbuf(buffer.substr(xstart[x], xend[x] - xstart[x]));
|
||||
item_append(tempbuf.c_str(), nullptr, (MENU_FLAG_UI_DATS | MENU_FLAG_DISABLE), (void *)(FPTR)(x + 1));
|
||||
@ -269,8 +269,8 @@ void ui_menu_dats_view::get_data_sw()
|
||||
machine().datfile().load_software_info(m_swinfo->listname, buffer, m_swinfo->shortname, m_swinfo->parentname);
|
||||
}
|
||||
|
||||
int totallines = machine().ui().wrap_text(container, buffer.c_str(), 0.0f, 0.0f, 1.0f - (4.0f * UI_BOX_LR_BORDER), xstart, xend);
|
||||
for (int x = 0; x < totallines; ++x)
|
||||
int lines = machine().ui().wrap_text(container, buffer.c_str(), 0.0f, 0.0f, 1.0f - (4.0f * UI_BOX_LR_BORDER), xstart, xend);
|
||||
for (int x = 0; x < lines; ++x)
|
||||
{
|
||||
std::string tempbuf(buffer.substr(xstart[x], xend[x] - xstart[x]));
|
||||
item_append(tempbuf.c_str(), nullptr, (MENU_FLAG_UI_DATS | MENU_FLAG_DISABLE), (void *)(FPTR)(x + 1));
|
||||
|
@ -99,7 +99,7 @@ void ui_menu_directory::populate()
|
||||
for (auto & elem : s_folders)
|
||||
item_append(_(elem.name), nullptr, 0, (void *)(FPTR)elem.action);
|
||||
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
|
||||
}
|
||||
|
||||
@ -197,7 +197,7 @@ void ui_menu_display_actual::populate()
|
||||
if (m_folders.size() > 1)
|
||||
item_append(_("Remove Folder"), nullptr, 0, (void *)REMOVE);
|
||||
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
customtop = (m_folders.size() + 1) * machine().ui().get_line_height() + 6.0f * UI_BOX_TB_BORDER;
|
||||
}
|
||||
|
||||
@ -475,7 +475,7 @@ void ui_menu_add_change_folder::populate()
|
||||
item_append(dirent->name, "[DIR]", 0, (void *)(FPTR)++folders_count);
|
||||
}
|
||||
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
|
||||
// configure the custom rendering
|
||||
customtop = 2.0f * machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
|
||||
@ -625,7 +625,7 @@ void ui_menu_remove_folder::populate()
|
||||
for (auto & elem : m_folders)
|
||||
item_append(elem.c_str(), nullptr, 0, (void *)(FPTR)++folders_count);
|
||||
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
|
||||
}
|
||||
|
||||
|
@ -142,7 +142,7 @@ void ui_menu_file_manager::populate()
|
||||
if (first_entry)
|
||||
first_entry = false;
|
||||
else
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
item_append(string_format("[root%s]", dev->tag()).c_str(), nullptr, 0, nullptr);
|
||||
tag_appended = true;
|
||||
}
|
||||
@ -153,7 +153,7 @@ void ui_menu_file_manager::populate()
|
||||
}
|
||||
}
|
||||
}
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
item_append("Reset", nullptr, 0, (void *)1);
|
||||
|
||||
custombottom = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
|
||||
|
@ -283,7 +283,7 @@ void ui_menu_file_create::populate()
|
||||
}
|
||||
|
||||
// finish up the menu
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
item_append(_("Create"), nullptr, 0, ITEMREF_CREATE);
|
||||
|
||||
customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
|
||||
@ -809,7 +809,7 @@ void ui_menu_select_format::populate()
|
||||
const floppy_image_format_t *fmt = m_formats[i];
|
||||
|
||||
if (i && i == m_ext_match)
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
item_append(fmt->description(), fmt->name(), 0, (void *)(FPTR)i);
|
||||
}
|
||||
}
|
||||
|
@ -415,7 +415,7 @@ void ui_menu_input::populate_and_sort(input_item_data *itemlist)
|
||||
if (first_entry)
|
||||
first_entry = false;
|
||||
else
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
item_append(string_format("[root%s]", item->owner_name).c_str(), nullptr, 0, nullptr);
|
||||
prev_owner.assign(item->owner_name);
|
||||
}
|
||||
@ -565,7 +565,7 @@ void ui_menu_settings::populate()
|
||||
if (first_entry)
|
||||
first_entry = false;
|
||||
else
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
string_format("[root%s]", field.device().tag());
|
||||
item_append(string_format("[root%s]", field.device().tag()).c_str(), nullptr, 0, nullptr);
|
||||
prev_owner.assign(field.device().tag());
|
||||
@ -618,7 +618,7 @@ void ui_menu_settings::populate()
|
||||
if (type == IPT_DIPSWITCH)
|
||||
custombottom = dipcount ? dipcount * (DIP_SWITCH_HEIGHT + DIP_SWITCH_SPACING) + DIP_SWITCH_SPACING : 0;
|
||||
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
item_append(_("Reset"), nullptr, 0, (void *)1);
|
||||
}
|
||||
|
||||
@ -862,7 +862,7 @@ void ui_menu_analog::populate()
|
||||
if (first_entry)
|
||||
first_entry = false;
|
||||
else
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
item_append(string_format("[root%s]", field.device().tag()).c_str(), nullptr, 0, nullptr);
|
||||
prev_owner.assign(field.device().tag());
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ void ui_menu_main::populate()
|
||||
if (machine().ui().options().enabled_dats() && machine().datfile().has_data())
|
||||
item_append(_("External DAT View"), nullptr, 0, (void *)EXTERNAL_DATS);
|
||||
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
|
||||
/* add favorite menu */
|
||||
if (!machine().favorite().isgame_favorite())
|
||||
@ -146,7 +146,7 @@ void ui_menu_main::populate()
|
||||
else
|
||||
item_append(_("Remove From Favorites"), nullptr, 0, (void *)REMOVE_FAVORITE);
|
||||
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
|
||||
// item_append(_("Quit from Machine"), nullptr, 0, (void *)QUIT_GAME);
|
||||
|
||||
|
@ -306,6 +306,17 @@ void ui_menu::item_append(ui_menu_item item)
|
||||
// end of the menu
|
||||
//-------------------------------------------------
|
||||
|
||||
void ui_menu::item_append(ui_menu_item_type type)
|
||||
{
|
||||
if (type == ui_menu_item_type::SEPARATOR)
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// item_append - append a new item to the
|
||||
// end of the menu
|
||||
//-------------------------------------------------
|
||||
|
||||
void ui_menu::item_append(const char *text, const char *subtext, UINT32 flags, void *ref, ui_menu_item_type type)
|
||||
{
|
||||
// only allow multiline as the first item
|
||||
|
@ -56,9 +56,9 @@ enum ui_menu_reset_options
|
||||
// types of menu items (TODO: please expand)
|
||||
enum class ui_menu_item_type
|
||||
{
|
||||
UI_MENU_ITEM_TYPE_UNKNOWN,
|
||||
UI_MENU_ITEM_TYPE_SLIDER,
|
||||
UI_MENU_ITEM_TYPE_SEPARATOR
|
||||
UNKNOWN,
|
||||
SLIDER,
|
||||
SEPARATOR
|
||||
};
|
||||
|
||||
|
||||
@ -120,8 +120,9 @@ public:
|
||||
void reset(ui_menu_reset_options options);
|
||||
|
||||
// append a new item to the end of the menu
|
||||
void item_append(const char *text, const char *subtext, UINT32 flags, void *ref, ui_menu_item_type type = ui_menu_item_type::UI_MENU_ITEM_TYPE_UNKNOWN);
|
||||
void item_append(const char *text, const char *subtext, UINT32 flags, void *ref, ui_menu_item_type type = ui_menu_item_type::UNKNOWN);
|
||||
void item_append(ui_menu_item item);
|
||||
void item_append(ui_menu_item_type type);
|
||||
|
||||
// process a menu, drawing it and returning any interesting events
|
||||
const ui_menu_event *process(UINT32 flags);
|
||||
|
@ -255,7 +255,7 @@ void ui_menu_game_options::populate()
|
||||
item_append(fbuff.c_str(), nullptr, 0, (void *)(FPTR)CUSTOM_FILTER);
|
||||
}
|
||||
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
|
||||
// add options items
|
||||
item_append(_("Customize UI"), nullptr, 0, (void *)(FPTR)CUSTOM_MENU);
|
||||
@ -267,7 +267,7 @@ void ui_menu_game_options::populate()
|
||||
item_append(_(control_submenu_options[0].description), nullptr, 0, (void *)(FPTR)CONTROLLER_MENU);
|
||||
item_append(_("General Inputs"), nullptr, 0, (void *)(FPTR)CGI_MENU);
|
||||
item_append(_(advanced_submenu_options[0].description), nullptr, 0, (void *)(FPTR)ADVANCED_MENU);
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
item_append(_("Save Configuration"), nullptr, 0, (void *)(FPTR)SAVE_CONFIG);
|
||||
|
||||
custombottom = 2.0f * machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
|
||||
|
@ -34,7 +34,7 @@ void ui_menu_plugin::populate()
|
||||
{
|
||||
for (auto &curplugin : m_plugins)
|
||||
item_append(curplugin.c_str(), 0, 0, (void *)curplugin.c_str());
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
}
|
||||
|
||||
ui_menu_plugin::~ui_menu_plugin()
|
||||
@ -104,7 +104,7 @@ void ui_menu_plugin_opt::populate()
|
||||
|
||||
item_append(item.text.c_str(), item.subtext.c_str(), flags, (void *)i++);
|
||||
}
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
}
|
||||
|
||||
ui_menu_plugin_opt::~ui_menu_plugin_opt()
|
||||
|
@ -149,7 +149,7 @@ void ui_menu_selector::populate()
|
||||
}
|
||||
}
|
||||
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
customtop = custombottom = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
|
||||
m_first_pass = false;
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ bool compare_software(ui_software_info a, ui_software_info b)
|
||||
bool has_multiple_bios(const game_driver *driver, s_bios &biosname)
|
||||
{
|
||||
if (driver->rom == nullptr)
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
std::string default_name;
|
||||
for (const rom_entry *rom = driver->rom; !ROMENTRY_ISEND(rom); ++rom)
|
||||
@ -366,7 +366,7 @@ void ui_menu_select_software::handle()
|
||||
{
|
||||
highlight++;
|
||||
}
|
||||
else if (m_event->iptkey == IPT_UI_SELECT && m_focus == focused_menu::left)
|
||||
else if (m_event->iptkey == IPT_OTHER && m_focus == focused_menu::left)
|
||||
{
|
||||
l_sw_hover = highlight;
|
||||
check_filter = true;
|
||||
@ -1946,7 +1946,7 @@ void ui_software_parts::populate()
|
||||
for (auto & elem : m_parts)
|
||||
item_append(elem.first.c_str(), elem.second.c_str(), 0, (void *)&elem);
|
||||
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
customtop = machine().ui().get_line_height() + (3.0f * UI_BOX_TB_BORDER);
|
||||
}
|
||||
|
||||
@ -2041,7 +2041,7 @@ void ui_bios_selection::populate()
|
||||
for (auto & elem : m_bios)
|
||||
item_append(elem.first.c_str(), nullptr, 0, (void *)&elem.first);
|
||||
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
customtop = machine().ui().get_line_height() + (3.0f * UI_BOX_TB_BORDER);
|
||||
}
|
||||
|
||||
@ -2072,7 +2072,7 @@ void ui_bios_selection::handle()
|
||||
}
|
||||
|
||||
std::string error;
|
||||
moptions.set_value("bios", elem.second, OPTION_PRIORITY_CMDLINE, error);
|
||||
moptions.set_value(OPTION_BIOS, elem.second, OPTION_PRIORITY_CMDLINE, error);
|
||||
machine().manager().schedule_new_driver(*s_driver);
|
||||
machine().schedule_hard_reset();
|
||||
ui_menu::stack_reset(machine());
|
||||
@ -2081,7 +2081,7 @@ void ui_bios_selection::handle()
|
||||
{
|
||||
ui_software_info *ui_swinfo = (ui_software_info *)m_driver;
|
||||
std::string error;
|
||||
machine().options().set_value("bios", elem.second, OPTION_PRIORITY_CMDLINE, error);
|
||||
machine().options().set_value(OPTION_BIOS, elem.second, OPTION_PRIORITY_CMDLINE, error);
|
||||
driver_enumerator drivlist(machine().options(), *ui_swinfo->driver);
|
||||
drivlist.next();
|
||||
software_list_device *swlist = software_list_device::find_by_name(drivlist.config(), ui_swinfo->listname.c_str());
|
||||
|
@ -261,7 +261,7 @@ void ui_simple_menu_select_game::populate()
|
||||
// if we're forced into this, allow general input configuration as well
|
||||
if (ui_menu::stack_has_special_main_menu())
|
||||
{
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
item_append(_("Configure Options"), nullptr, 0, (void *)1);
|
||||
skip_main_items = 1;
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ void ui_menu_sliders::handle()
|
||||
if (menu_event != nullptr)
|
||||
{
|
||||
/* handle keys if there is a valid item selected */
|
||||
if (menu_event->itemref != nullptr && menu_event->type == ui_menu_item_type::UI_MENU_ITEM_TYPE_SLIDER)
|
||||
if (menu_event->itemref != nullptr && menu_event->type == ui_menu_item_type::SLIDER)
|
||||
{
|
||||
const slider_state *slider = (const slider_state *)menu_event->itemref;
|
||||
INT32 curvalue = (*slider->update)(machine(), slider->arg, slider->id, nullptr, SLIDER_NOCHANGE);
|
||||
@ -143,7 +143,7 @@ void ui_menu_sliders::populate()
|
||||
std::vector<ui_menu_item> ui_sliders = machine().ui().get_slider_list();
|
||||
for (ui_menu_item item : ui_sliders)
|
||||
{
|
||||
if (item.type == ui_menu_item_type::UI_MENU_ITEM_TYPE_SLIDER)
|
||||
if (item.type == ui_menu_item_type::SLIDER)
|
||||
{
|
||||
slider_state* slider = reinterpret_cast<slider_state *>(item.ref);
|
||||
INT32 curval = (*slider->update)(machine(), slider->arg, slider->id, &tempstring, SLIDER_NOCHANGE);
|
||||
@ -152,7 +152,7 @@ void ui_menu_sliders::populate()
|
||||
flags |= MENU_FLAG_LEFT_ARROW;
|
||||
if (curval < slider->maxval)
|
||||
flags |= MENU_FLAG_RIGHT_ARROW;
|
||||
item_append(slider->description, tempstring.c_str(), flags, (void *)slider, ui_menu_item_type::UI_MENU_ITEM_TYPE_SLIDER);
|
||||
item_append(slider->description, tempstring.c_str(), flags, (void *)slider, ui_menu_item_type::SLIDER);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -160,13 +160,13 @@ void ui_menu_sliders::populate()
|
||||
}
|
||||
}
|
||||
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
|
||||
/* add OSD options */
|
||||
std::vector<ui_menu_item> osd_sliders = machine().osd().get_slider_list();
|
||||
for (ui_menu_item item : osd_sliders)
|
||||
{
|
||||
if (item.type == ui_menu_item_type::UI_MENU_ITEM_TYPE_SLIDER)
|
||||
if (item.type == ui_menu_item_type::SLIDER)
|
||||
{
|
||||
slider_state* slider = reinterpret_cast<slider_state *>(item.ref);
|
||||
INT32 curval = (*slider->update)(machine(), slider->arg, slider->id, &tempstring, SLIDER_NOCHANGE);
|
||||
@ -175,7 +175,7 @@ void ui_menu_sliders::populate()
|
||||
flags |= MENU_FLAG_LEFT_ARROW;
|
||||
if (curval < slider->maxval)
|
||||
flags |= MENU_FLAG_RIGHT_ARROW;
|
||||
item_append(slider->description, tempstring.c_str(), flags, (void *)slider, ui_menu_item_type::UI_MENU_ITEM_TYPE_SLIDER);
|
||||
item_append(slider->description, tempstring.c_str(), flags, (void *)slider, ui_menu_item_type::SLIDER);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -168,7 +168,7 @@ void ui_menu_slot_devices::populate()
|
||||
|
||||
item_append(slot->device().tag() + 1, opt_name.c_str(), (slot->fixed() || slot_get_length(slot) == 0) ? 0 : (MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW), (void *)slot);
|
||||
}
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
item_append(_("Reset"), nullptr, 0, (void *)1);
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ void ui_menu_sound_options::populate()
|
||||
item_append(_("Sound"), m_sound ? _("On") : _("Off"), m_sound ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW, (void *)(FPTR)ENABLE_SOUND);
|
||||
item_append(_("Sample Rate"), string_format("%d", m_sample_rate).c_str(), arrow_flags, (void *)(FPTR)SAMPLE_RATE);
|
||||
item_append(_("Use External Samples"), m_samples ? _("On") : _("Off"), m_samples ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW, (void *)(FPTR)ENABLE_SAMPLES);
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
|
||||
customtop = machine().ui().get_line_height() + (3.0f * UI_BOX_TB_BORDER);
|
||||
}
|
||||
|
@ -2048,7 +2048,7 @@ std::vector<ui_menu_item> ui_manager::slider_init(running_machine &machine)
|
||||
item.subtext = "";
|
||||
item.flags = 0;
|
||||
item.ref = slider;
|
||||
item.type = ui_menu_item_type::UI_MENU_ITEM_TYPE_SLIDER;
|
||||
item.type = ui_menu_item_type::SLIDER;
|
||||
items.push_back(item);
|
||||
}
|
||||
|
||||
|
@ -190,7 +190,7 @@ void ui_menu_video_options::populate()
|
||||
}
|
||||
|
||||
/* add a separator */
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(ui_menu_item_type::SEPARATOR);
|
||||
|
||||
/* add a rotate item */
|
||||
switch (target->orientation())
|
||||
|
@ -1355,7 +1355,7 @@ static void CreateMainMenu(running_machine &machine)
|
||||
}
|
||||
|
||||
menu->item_append(title.append(focus_view->title).c_str(), nullptr, MENU_FLAG_DISABLE, nullptr);
|
||||
menu->item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
menu->item_append(ui_menu_item_type::SEPARATOR);
|
||||
|
||||
switch (focus_view->type)
|
||||
{
|
||||
@ -1375,7 +1375,7 @@ static void CreateMainMenu(running_machine &machine)
|
||||
{
|
||||
menu->item_append("CPU", focus_view->view->source()->name(), MENU_FLAG_RIGHT_ARROW, (void *)on_disasm_cpu_activate);
|
||||
}
|
||||
menu->item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
menu->item_append(ui_menu_item_type::SEPARATOR);
|
||||
break;
|
||||
}
|
||||
case DVT_MEMORY:
|
||||
@ -1399,7 +1399,7 @@ static void CreateMainMenu(running_machine &machine)
|
||||
case 11: subtext = "80-bit floating point"; break;
|
||||
}
|
||||
menu->item_append("Format", subtext, MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW, (void *)on_memory_data_format);
|
||||
menu->item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
menu->item_append(ui_menu_item_type::SEPARATOR);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1411,19 +1411,19 @@ static void CreateMainMenu(running_machine &machine)
|
||||
menu->item_append("New Error Log Window", "[Ctrl+L]", 0, (void *)on_log_window_activate);
|
||||
menu->item_append("New Breakpoints Window", "[Ctrl+B]", 0, (void *)on_bp_window_activate);
|
||||
menu->item_append("New Watchpoints Window", "[Ctrl+W]", 0, (void *)on_wp_window_activate);
|
||||
menu->item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
menu->item_append(ui_menu_item_type::SEPARATOR);
|
||||
menu->item_append("Run", "[F5]", 0, (void *)on_run_activate);
|
||||
menu->item_append("Run and Hide Debugger", "[F12]", 0, (void *)on_run_h_activate);
|
||||
menu->item_append("Run to Next CPU", "[F6]", 0, (void *)on_run_cpu_activate);
|
||||
menu->item_append("Run until Next Interrupt on This CPU", "[F7]", 0, (void *)on_run_irq_activate);
|
||||
menu->item_append("Run until Next VBLANK", "[F8]", 0, (void *)on_run_vbl_activate);
|
||||
menu->item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
menu->item_append(ui_menu_item_type::SEPARATOR);
|
||||
menu->item_append("Step Into", "[F11]", 0, (void *)on_step_into_activate);
|
||||
menu->item_append("Step Over", "[F10]", 0, (void *)on_step_over_activate);
|
||||
menu->item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
menu->item_append(ui_menu_item_type::SEPARATOR);
|
||||
menu->item_append("Soft Reset", "[F3]", 0, (void *)on_soft_reset_activate);
|
||||
menu->item_append("Hard Reset", "[Shift+F3]", 0, (void *)on_hard_reset_activate);
|
||||
menu->item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
menu->item_append(ui_menu_item_type::SEPARATOR);
|
||||
if (!dview_is_state(focus_view, VIEW_STATE_FOLLOW_CPU))
|
||||
menu->item_append("Close Window", "[Shift+F4]", 0, (void *)on_close_activate);
|
||||
menu->item_append("Exit", nullptr, 0, (void *)on_exit_activate);
|
||||
|
@ -373,7 +373,7 @@ void chain_manager::create_selection_slider(uint32_t screen_index)
|
||||
item.subtext = "";
|
||||
item.flags = 0;
|
||||
item.ref = state;
|
||||
item.type = ui_menu_item_type::UI_MENU_ITEM_TYPE_SLIDER;
|
||||
item.type = ui_menu_item_type::SLIDER;
|
||||
m_selection_sliders.push_back(item);
|
||||
}
|
||||
|
||||
@ -455,7 +455,7 @@ std::vector<ui_menu_item> chain_manager::get_slider_list()
|
||||
item.subtext = "";
|
||||
item.flags = 0;
|
||||
item.ref = core_slider;
|
||||
item.type = ui_menu_item_type::UI_MENU_ITEM_TYPE_SLIDER;
|
||||
item.type = ui_menu_item_type::SLIDER;
|
||||
m_selection_sliders.push_back(item);
|
||||
|
||||
sliders.push_back(item);
|
||||
@ -468,7 +468,7 @@ std::vector<ui_menu_item> chain_manager::get_slider_list()
|
||||
item.subtext = "";
|
||||
item.flags = 0;
|
||||
item.ref = nullptr;
|
||||
item.type = ui_menu_item_type::UI_MENU_ITEM_TYPE_SEPARATOR;
|
||||
item.type = ui_menu_item_type::SEPARATOR;
|
||||
|
||||
sliders.push_back(item);
|
||||
}
|
||||
|
@ -2530,7 +2530,7 @@ std::vector<ui_menu_item> shaders::init_slider_list()
|
||||
item.subtext = "";
|
||||
item.flags = 0;
|
||||
item.ref = core_slider;
|
||||
item.type = ui_menu_item_type::UI_MENU_ITEM_TYPE_SLIDER;
|
||||
item.type = ui_menu_item_type::SLIDER;
|
||||
sliders.push_back(item);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user