mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-12 12:39:56 +00:00
Create menu_list_entry_is_currently_selected
This commit is contained in:
parent
ed3f7ccf7c
commit
f9713ab764
@ -306,8 +306,7 @@ static void glui_render_menu_list(runloop_t *runloop,
|
||||
bool selected = false;
|
||||
|
||||
menu_list_get_entry(&entry, i, label, NULL);
|
||||
|
||||
selected = (i == menu->navigation.selection_ptr);
|
||||
selected = menu_list_entry_is_currently_selected(&entry);
|
||||
|
||||
menu_animation_ticker_line(entry_title_buf, glui->ticker_limit,
|
||||
runloop->frames.video.count / 100, entry.path, selected);
|
||||
|
@ -494,8 +494,7 @@ static void rgui_render(void)
|
||||
bool selected = false;
|
||||
|
||||
menu_list_get_entry(&entry, i, label, NULL);
|
||||
|
||||
selected = (i == menu->navigation.selection_ptr);
|
||||
selected = menu_list_entry_is_currently_selected(&entry);
|
||||
|
||||
if (i > (menu->navigation.selection_ptr + 100))
|
||||
continue;
|
||||
|
@ -235,8 +235,7 @@ static void rmenu_render(void)
|
||||
bool selected = false;
|
||||
|
||||
menu_list_get_entry(&entry, i, label, NULL);
|
||||
|
||||
selected = (i == menu->navigation.selection_ptr);
|
||||
selected = menu_list_entry_is_currently_selected(&entry);
|
||||
|
||||
menu_animation_ticker_line(entry_title_buf, RMENU_TERM_WIDTH - (entry.spacing + 1 + 2),
|
||||
runloop->frames.video.count / 15, entry.path, selected);
|
||||
|
@ -475,6 +475,16 @@ void menu_list_get_entry(menu_entry_t *entry, size_t i,
|
||||
entry_label, path,
|
||||
entry->path, sizeof(entry->path));
|
||||
|
||||
entry->id = i;
|
||||
|
||||
if (entry_label)
|
||||
strlcpy(entry->label, entry_label, sizeof(entry->label));
|
||||
}
|
||||
|
||||
bool menu_list_entry_is_currently_selected(menu_entry_t *entry)
|
||||
{
|
||||
menu_navigation_t *nav = menu_navigation_get_ptr();
|
||||
if (!entry || !nav)
|
||||
return false;
|
||||
return (entry->id == nav->selection_ptr);
|
||||
}
|
||||
|
@ -110,6 +110,8 @@ int menu_list_populate_generic(file_list_t *list,
|
||||
void menu_list_get_entry(menu_entry_t *entry, size_t i, const char *label,
|
||||
void *userdata);
|
||||
|
||||
bool menu_list_entry_is_currently_selected(menu_entry_t *entry);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user