From ecac25b281a0d7bcdc5da1515f35a52427243014 Mon Sep 17 00:00:00 2001 From: Derrick Renaud Date: Mon, 13 Apr 2009 03:42:53 +0000 Subject: [PATCH] Changed Player Input menu to be based off of sortorder instead of item->ref. Currently an analog control creates the axis;inc;dec menu items all under the same ref. This means the UI still thinks it is adding items when you move between any of the three for the same control. You have to move to a different control before sequences are no longer added to that control. Harder to describe then to try. Try the current code. Map an INC button, move to DEC and map a button. Go back to INC and the old value is not cleared first. --- src/emu/uimenu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/emu/uimenu.c b/src/emu/uimenu.c index 331071ab182..0457dec6bca 100644 --- a/src/emu/uimenu.c +++ b/src/emu/uimenu.c @@ -190,7 +190,7 @@ struct _settings_menu_state typedef struct _input_menu_state input_menu_state; struct _input_menu_state { - const void * lastref; + UINT16 last_sortorder; const void * pollingref; input_item_data * pollingitem; UINT8 record_next; @@ -1779,7 +1779,7 @@ static void menu_input_common(running_machine *machine, ui_menu *menu, void *par /* an item was selected: begin polling */ case IPT_UI_SELECT: menustate->pollingitem = item; - menustate->lastref = item->ref; + menustate->last_sortorder = item->sortorder; menustate->starting_seq = item->seq; input_seq_poll_start((item->type == INPUT_TYPE_ANALOG) ? ITEM_CLASS_ABSOLUTE : ITEM_CLASS_SWITCH, menustate->record_next ? &item->seq : NULL); invalidate = TRUE; @@ -1794,9 +1794,9 @@ static void menu_input_common(running_machine *machine, ui_menu *menu, void *par } /* if the selection changed, reset the "record next" flag */ - if (item->ref != menustate->lastref) + if (item->sortorder != menustate->last_sortorder) menustate->record_next = FALSE; - menustate->lastref = item->ref; + menustate->last_sortorder = item->sortorder; } /* if the sequence changed, update it */