Attempt to bring the mouse menu click back
This commit is contained in:
parent
35c3be45e0
commit
961060901c
|
@ -158,14 +158,17 @@ handle_mouse_motion(Menu *m, Input *input)
|
||||||
|
|
||||||
Position p = { input->mouseX, input->mouseY };
|
Position p = { input->mouseX, input->mouseY };
|
||||||
|
|
||||||
LinkedList *items = m->items;
|
int lastSelect = m->selected;
|
||||||
int index = 0;
|
int index = 0;
|
||||||
|
LinkedList *items = m->items;
|
||||||
while (items) {
|
while (items) {
|
||||||
MenuItem *item = items->data;
|
MenuItem *item = items->data;
|
||||||
items = items->next;
|
items = items->next;
|
||||||
|
|
||||||
if (position_in_rect(&p, &item->button->area)) {
|
if (position_in_rect(&p, &item->button->area)) {
|
||||||
m->selected = index;
|
m->selected = index;
|
||||||
|
if (index != lastSelect)
|
||||||
|
mixer_play_effect(CLICK);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
index++;
|
index++;
|
||||||
|
|
Loading…
Reference in New Issue