mirror of
https://github.com/holub/mame
synced 2025-07-01 16:19:38 +03:00
Parenthesize optional items in input menus
This commit is contained in:
parent
b01c431ac3
commit
80a5c58c9c
@ -122,6 +122,7 @@ void menu_input_general::populate()
|
|||||||
item->defseq = &entry.defseq(seqtype);
|
item->defseq = &entry.defseq(seqtype);
|
||||||
item->sortorder = sortorder * 4 + suborder[seqtype];
|
item->sortorder = sortorder * 4 + suborder[seqtype];
|
||||||
item->type = ioport_manager::type_is_analog(entry.type()) ? (INPUT_TYPE_ANALOG + seqtype) : INPUT_TYPE_DIGITAL;
|
item->type = ioport_manager::type_is_analog(entry.type()) ? (INPUT_TYPE_ANALOG + seqtype) : INPUT_TYPE_DIGITAL;
|
||||||
|
item->is_optional = false;
|
||||||
item->name = entry.name();
|
item->name = entry.name();
|
||||||
item->owner_name = nullptr;
|
item->owner_name = nullptr;
|
||||||
item->next = itemlist;
|
item->next = itemlist;
|
||||||
@ -199,6 +200,7 @@ void menu_input_specific::populate()
|
|||||||
item->defseq = &field.defseq(seqtype);
|
item->defseq = &field.defseq(seqtype);
|
||||||
item->sortorder = sortorder + suborder[seqtype];
|
item->sortorder = sortorder + suborder[seqtype];
|
||||||
item->type = field.is_analog() ? (INPUT_TYPE_ANALOG + seqtype) : INPUT_TYPE_DIGITAL;
|
item->type = field.is_analog() ? (INPUT_TYPE_ANALOG + seqtype) : INPUT_TYPE_DIGITAL;
|
||||||
|
item->is_optional = field.optional();
|
||||||
item->name = field.name();
|
item->name = field.name();
|
||||||
item->owner_name = field.device().tag();
|
item->owner_name = field.device().tag();
|
||||||
item->next = itemlist;
|
item->next = itemlist;
|
||||||
@ -420,6 +422,8 @@ void menu_input::populate_and_sort(input_item_data *itemlist)
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string text = string_format(nameformat[item->type], item->name);
|
std::string text = string_format(nameformat[item->type], item->name);
|
||||||
|
if (item->is_optional)
|
||||||
|
text = "(" + text + ")";
|
||||||
|
|
||||||
/* if we're polling this item, use some spaces with left/right arrows */
|
/* if we're polling this item, use some spaces with left/right arrows */
|
||||||
if (pollingref == item->ref)
|
if (pollingref == item->ref)
|
||||||
|
@ -55,6 +55,7 @@ protected:
|
|||||||
const char * owner_name; /* pointer to the name of the owner of the item */
|
const char * owner_name; /* pointer to the name of the owner of the item */
|
||||||
UINT32 sortorder; /* sorting information */
|
UINT32 sortorder; /* sorting information */
|
||||||
UINT8 type; /* type of port */
|
UINT8 type; /* type of port */
|
||||||
|
bool is_optional; /* true if this input is considered optional */
|
||||||
};
|
};
|
||||||
|
|
||||||
void populate_and_sort(struct input_item_data *itemlist);
|
void populate_and_sort(struct input_item_data *itemlist);
|
||||||
|
Loading…
Reference in New Issue
Block a user