Start changing signature of menu_entry_is_currently_selected

This commit is contained in:
twinaphex 2015-06-01 15:08:58 +02:00
parent bc843adc01
commit 26c75a8a1c
5 changed files with 8 additions and 8 deletions

View File

@ -300,7 +300,7 @@ static void glui_render_menu_list(glui_handle_t *glui,
bool selected = false;
menu_entry_get(&entry, i, NULL, true);
selected = menu_entry_is_currently_selected(&entry);
selected = menu_entry_is_currently_selected(i);
menu_entry_get_value(i, entry_value, sizeof(entry_value));
menu_entry_get_label(i, entry_label, sizeof(entry_label));

View File

@ -448,7 +448,7 @@ static void rgui_render(void)
bool selected = false;
menu_entry_get(&entry, i, NULL, true);
selected = menu_entry_is_currently_selected(&entry);
selected = menu_entry_is_currently_selected(i);
if (i > (menu->navigation.selection_ptr + 100))
continue;

View File

@ -196,7 +196,7 @@ static void rmenu_render(void)
bool selected = false;
menu_entry_get(&entry, i, NULL, true);
selected = menu_entry_is_currently_selected(&entry);
selected = menu_entry_is_currently_selected(i);
menu_entry_get_value(i, entry_value, sizeof(entry_value));
menu_entry_get_label(i, entry_label, sizeof(entry_label));

View File

@ -368,12 +368,12 @@ void menu_entry_get(menu_entry_t *entry, size_t i,
strlcpy(entry->label, entry_label, sizeof(entry->label));
}
bool menu_entry_is_currently_selected(menu_entry_t *entry)
bool menu_entry_is_currently_selected(unsigned id)
{
menu_navigation_t *nav = menu_navigation_get_ptr();
if (!entry || !nav)
if (!nav)
return false;
return (entry->id == nav->selection_ptr);
return (id == nav->selection_ptr);
}
int menu_entry_get_current_id(bool use_representation)
@ -387,7 +387,7 @@ int menu_entry_get_current_id(bool use_representation)
menu_entry_t entry;
menu_entry_get(&entry, i, NULL, use_representation);
if (menu_entry_is_currently_selected(&entry))
if (menu_entry_is_currently_selected(entry.id))
return i;
}

View File

@ -107,7 +107,7 @@ float menu_entry_num_max(uint32_t i);
int menu_entry_get_current_id(bool use_representation);
bool menu_entry_is_currently_selected(menu_entry_t *entry);
bool menu_entry_is_currently_selected(unsigned id);
void menu_entry_get(menu_entry_t *entry, size_t i,
void *userdata, bool use_representation);