mirror of
https://github.com/libretro/RetroArch
synced 2025-03-01 07:13:35 +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;
|
bool selected = false;
|
||||||
|
|
||||||
menu_list_get_entry(&entry, i, label, NULL);
|
menu_list_get_entry(&entry, i, label, NULL);
|
||||||
|
selected = menu_list_entry_is_currently_selected(&entry);
|
||||||
selected = (i == menu->navigation.selection_ptr);
|
|
||||||
|
|
||||||
menu_animation_ticker_line(entry_title_buf, glui->ticker_limit,
|
menu_animation_ticker_line(entry_title_buf, glui->ticker_limit,
|
||||||
runloop->frames.video.count / 100, entry.path, selected);
|
runloop->frames.video.count / 100, entry.path, selected);
|
||||||
|
@ -494,8 +494,7 @@ static void rgui_render(void)
|
|||||||
bool selected = false;
|
bool selected = false;
|
||||||
|
|
||||||
menu_list_get_entry(&entry, i, label, NULL);
|
menu_list_get_entry(&entry, i, label, NULL);
|
||||||
|
selected = menu_list_entry_is_currently_selected(&entry);
|
||||||
selected = (i == menu->navigation.selection_ptr);
|
|
||||||
|
|
||||||
if (i > (menu->navigation.selection_ptr + 100))
|
if (i > (menu->navigation.selection_ptr + 100))
|
||||||
continue;
|
continue;
|
||||||
|
@ -235,8 +235,7 @@ static void rmenu_render(void)
|
|||||||
bool selected = false;
|
bool selected = false;
|
||||||
|
|
||||||
menu_list_get_entry(&entry, i, label, NULL);
|
menu_list_get_entry(&entry, i, label, NULL);
|
||||||
|
selected = menu_list_entry_is_currently_selected(&entry);
|
||||||
selected = (i == menu->navigation.selection_ptr);
|
|
||||||
|
|
||||||
menu_animation_ticker_line(entry_title_buf, RMENU_TERM_WIDTH - (entry.spacing + 1 + 2),
|
menu_animation_ticker_line(entry_title_buf, RMENU_TERM_WIDTH - (entry.spacing + 1 + 2),
|
||||||
runloop->frames.video.count / 15, entry.path, selected);
|
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_label, path,
|
||||||
entry->path, sizeof(entry->path));
|
entry->path, sizeof(entry->path));
|
||||||
|
|
||||||
|
entry->id = i;
|
||||||
|
|
||||||
if (entry_label)
|
if (entry_label)
|
||||||
strlcpy(entry->label, entry_label, sizeof(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 menu_list_get_entry(menu_entry_t *entry, size_t i, const char *label,
|
||||||
void *userdata);
|
void *userdata);
|
||||||
|
|
||||||
|
bool menu_list_entry_is_currently_selected(menu_entry_t *entry);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user