mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-28 02:30:35 +00:00
Create menu_display_setting_label
This commit is contained in:
parent
02d429b2dd
commit
caaf6a8aa9
@ -491,24 +491,12 @@ static void rgui_render(void)
|
||||
char message[PATH_MAX_LENGTH], type_str[PATH_MAX_LENGTH],
|
||||
entry_title_buf[PATH_MAX_LENGTH], type_str_buf[PATH_MAX_LENGTH],
|
||||
path_buf[PATH_MAX_LENGTH];
|
||||
const char *path = NULL, *entry_label = NULL;
|
||||
unsigned type = 0, w = 0;
|
||||
unsigned w = 0;
|
||||
bool selected = false;
|
||||
menu_file_list_cbs_t *cbs = NULL;
|
||||
|
||||
menu_list_get_at_offset(menu->menu_list->selection_buf, i, &path,
|
||||
&entry_label, &type);
|
||||
|
||||
cbs = (menu_file_list_cbs_t*)
|
||||
menu_list_get_actiondata_at_offset(menu->menu_list->selection_buf,
|
||||
i);
|
||||
|
||||
if (cbs && cbs->action_get_representation)
|
||||
cbs->action_get_representation(menu->menu_list->selection_buf,
|
||||
&w, type, i, label,
|
||||
type_str, sizeof(type_str),
|
||||
entry_label, path,
|
||||
path_buf, sizeof(path_buf));
|
||||
menu_display_setting_label(i, &w, label,
|
||||
type_str, sizeof(type_str),
|
||||
path_buf, sizeof(path_buf));
|
||||
|
||||
selected = (i == menu->navigation.selection_ptr);
|
||||
|
||||
|
@ -206,3 +206,29 @@ void menu_display_unset_viewport(menu_handle_t *menu)
|
||||
video_driver_set_viewport(global->video_data.width,
|
||||
global->video_data.height, false, true);
|
||||
}
|
||||
|
||||
void menu_display_setting_label(unsigned i, unsigned *w,
|
||||
const char *label,
|
||||
char *type_str, size_t sizeof_type_str,
|
||||
char *path_buf, size_t sizeof_path_buf)
|
||||
{
|
||||
unsigned type = 0;
|
||||
const char *path = NULL;
|
||||
const char *entry_label = NULL;
|
||||
menu_file_list_cbs_t *cbs = NULL;
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
|
||||
menu_list_get_at_offset(menu->menu_list->selection_buf, i, &path,
|
||||
&entry_label, &type);
|
||||
|
||||
cbs = (menu_file_list_cbs_t*)
|
||||
menu_list_get_actiondata_at_offset(menu->menu_list->selection_buf,
|
||||
i);
|
||||
|
||||
if (cbs && cbs->action_get_representation)
|
||||
cbs->action_get_representation(menu->menu_list->selection_buf,
|
||||
w, type, i, label,
|
||||
type_str, sizeof_type_str,
|
||||
entry_label, path,
|
||||
path_buf, sizeof_path_buf);
|
||||
}
|
||||
|
@ -53,6 +53,11 @@ void menu_display_set_viewport(menu_handle_t *menu);
|
||||
|
||||
void menu_display_unset_viewport(menu_handle_t *menu);
|
||||
|
||||
void menu_display_setting_label(unsigned i, unsigned *w,
|
||||
const char *label,
|
||||
char *type_str, size_t sizeof_type_str,
|
||||
char *path_buf, size_t sizeof_path_buf);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user