mirror of
https://github.com/holub/mame
synced 2025-04-23 08:49:55 +03:00
Merge pull request #783 from h0tw1r3/feature-extmenu
submenu lang and cosmetic (nw)
This commit is contained in:
commit
91f12fe796
@ -658,8 +658,16 @@ void ui_menu::draw(bool customonly, bool noimage, bool noinput)
|
||||
|
||||
// if we don't have a subitem, just draw the string centered
|
||||
else if (pitem.subtext == nullptr)
|
||||
{
|
||||
if (pitem.flags & MENU_FLAG_UI_HEADING)
|
||||
{
|
||||
float heading_width = machine().ui().get_string_width(itemtext);
|
||||
container->add_line(visible_left, line_y + 0.5f * line_height, visible_left + ((visible_width - heading_width) / 2) - UI_BOX_LR_BORDER, line_y + 0.5f * line_height, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
|
||||
container->add_line(visible_left + visible_width - ((visible_width - heading_width) / 2) + UI_BOX_LR_BORDER, line_y + 0.5f * line_height, visible_left + visible_width, line_y + 0.5f * line_height, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
|
||||
}
|
||||
machine().ui().draw_text_full(container, itemtext, effective_left, line_y, effective_width,
|
||||
JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr);
|
||||
}
|
||||
|
||||
// otherwise, draw the item on the left and the subitem text on the right
|
||||
else
|
||||
|
@ -32,6 +32,7 @@
|
||||
#define MENU_FLAG_UI_SWLIST (1 << 8)
|
||||
#define MENU_FLAG_UI_FAVORITE (1 << 9)
|
||||
#define MENU_FLAG_UI_PALETTE (1 << 10)
|
||||
#define MENU_FLAG_UI_HEADING (1 << 11)
|
||||
|
||||
// special menu item for separators
|
||||
#define MENU_SEPARATOR_ITEM "---"
|
||||
|
@ -265,10 +265,10 @@ void ui_menu_game_options::populate()
|
||||
}
|
||||
item_append(_("Display Options"), nullptr, 0, (void *)(FPTR)DISPLAY_MENU);
|
||||
item_append(_("Sound Options"), nullptr, 0, (void *)(FPTR)SOUND_MENU);
|
||||
item_append(misc_submenu_options[0].description, nullptr, 0, (void *)(FPTR)MISC_MENU);
|
||||
item_append(_(misc_submenu_options[0].description), nullptr, 0, (void *)(FPTR)MISC_MENU);
|
||||
item_append(_("Device Mapping"), 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(_(advanced_submenu_options[0].description), nullptr, 0, (void *)(FPTR)ADVANCED_MENU);
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
item_append(_("Save Configuration"), nullptr, 0, (void *)(FPTR)SAVE_CONFIG);
|
||||
|
||||
|
@ -148,7 +148,7 @@ void ui_submenu::populate()
|
||||
switch (sm_option->type)
|
||||
{
|
||||
case ui_submenu::HEAD:
|
||||
item_append(_(sm_option->description), nullptr, MENU_FLAG_INVERT | MENU_FLAG_DISABLE, nullptr);
|
||||
item_append(_(sm_option->description), nullptr, MENU_FLAG_DISABLE | MENU_FLAG_UI_HEADING, nullptr);
|
||||
break;
|
||||
case ui_submenu::SEP:
|
||||
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
|
||||
|
Loading…
Reference in New Issue
Block a user