Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/frontend/mame/ui/confswitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ void menu_confswitch::populate()
if (field.has_next_setting())
flags |= FLAG_RIGHT_ARROW;

if (field.live().value == field.defvalue())
flags |= FLAG_AT_DEFAULT;

// add the menu item
item_append(field.name(), field.setting_name(), flags, &field);
}
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/mame/ui/inputmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,9 +602,9 @@ void menu_input::populate_sorted()
}
else
{
// otherwise, generate the sequence name and invert it if different from the default
// otherwise, generate the sequence name and invert it if same as the default
subtext = machine().input().seq_name(item.seq);
flags |= (item.seq != *item.defseq) ? FLAG_INVERT : 0;
flags |= (item.seq == *item.defseq) ? FLAG_AT_DEFAULT : 0;
}

// add the item
Expand Down
7 changes: 6 additions & 1 deletion src/frontend/mame/ui/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -889,13 +889,18 @@ void menu::draw(uint32_t flags)
if (!core_stricmp(pitem.subtext(), _("Auto")))
fgcolor2 = rgb_t(0xff,0xff,0x00);

if (subitem_invert) // disabled items are drawn with a dimmer color
fgcolor2 = fgcolor2.scale8(0.4f * 256); // 40%
else if ((pitem.flags() & FLAG_AT_DEFAULT) && !is_selected(itemnum)) // if at default value and not selected, draw with a dimmer color
fgcolor2 = fgcolor2.scale8(0.7F * 256); // 70%

// draw the subitem right-justified
ui().draw_text_full(
container(),
subitem_text,
effective_left + item_width, line_y0, effective_width - item_width,
text_layout::text_justify::RIGHT, text_layout::word_wrapping::TRUNCATE,
mame_ui_manager::NORMAL, subitem_invert ? fgcolor3 : fgcolor2, bgcolor,
mame_ui_manager::NORMAL, fgcolor2, bgcolor,
&subitem_width, nullptr,
line_height());
}
Expand Down
3 changes: 2 additions & 1 deletion src/frontend/mame/ui/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ class menu
FLAG_INVERT = 1U << 2,
FLAG_DISABLE = 1U << 4,
FLAG_UI_HEADING = 1U << 5,
FLAG_COLOR_BOX = 1U << 6
FLAG_COLOR_BOX = 1U << 6,
FLAG_AT_DEFAULT = 1U << 7
};

virtual ~menu();
Expand Down
4 changes: 4 additions & 0 deletions src/frontend/mame/ui/sliders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ void menu_sliders::populate()
flags |= FLAG_LEFT_ARROW;
if (curval < slider->maxval)
flags |= FLAG_RIGHT_ARROW;
if (curval == slider->defval)
flags |= FLAG_AT_DEFAULT;
item_append(slider->description, tempstring, flags, (void *)slider, menu_item_type::SLIDER);
}
}
Expand All @@ -225,6 +227,8 @@ void menu_sliders::populate()
flags |= FLAG_LEFT_ARROW;
if (curval < slider->maxval)
flags |= FLAG_RIGHT_ARROW;
if (curval == slider->defval)
flags |= FLAG_AT_DEFAULT;
item_append(slider->description, tempstring, flags, (void *)slider, menu_item_type::SLIDER);
}
else
Expand Down
Loading