mirror of
https://github.com/libretro/RetroArch
synced 2025-02-01 09:32:58 +00:00
Create menu_entry_get_spacing
This commit is contained in:
parent
26c75a8a1c
commit
ee6f54baa7
@ -293,13 +293,11 @@ static void glui_render_menu_list(glui_handle_t *glui,
|
||||
for (i = 0; i < end; i++)
|
||||
{
|
||||
unsigned y;
|
||||
menu_entry_t entry;
|
||||
char entry_label[PATH_MAX_LENGTH], entry_value[PATH_MAX_LENGTH];
|
||||
char message[PATH_MAX_LENGTH],
|
||||
entry_title_buf[PATH_MAX_LENGTH], type_str_buf[PATH_MAX_LENGTH];
|
||||
bool selected = false;
|
||||
|
||||
menu_entry_get(&entry, i, NULL, true);
|
||||
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));
|
||||
|
@ -441,14 +441,11 @@ static void rgui_render(void)
|
||||
|
||||
for (; i < end; i++, y += FONT_HEIGHT_STRIDE)
|
||||
{
|
||||
menu_entry_t entry;
|
||||
char entry_label[PATH_MAX_LENGTH], entry_value[PATH_MAX_LENGTH];
|
||||
char message[PATH_MAX_LENGTH],
|
||||
entry_title_buf[PATH_MAX_LENGTH], type_str_buf[PATH_MAX_LENGTH];
|
||||
bool selected = false;
|
||||
|
||||
menu_entry_get(&entry, i, NULL, true);
|
||||
selected = menu_entry_is_currently_selected(i);
|
||||
unsigned entry_spacing = menu_entry_get_spacing(i);
|
||||
bool entry_selected = menu_entry_is_currently_selected(i);
|
||||
|
||||
if (i > (menu->navigation.selection_ptr + 100))
|
||||
continue;
|
||||
@ -456,21 +453,21 @@ static void rgui_render(void)
|
||||
menu_entry_get_value(i, entry_value, sizeof(entry_value));
|
||||
menu_entry_get_label(i, entry_label, sizeof(entry_label));
|
||||
|
||||
menu_animation_ticker_line(entry_title_buf, RGUI_TERM_WIDTH - (entry.spacing + 1 + 2),
|
||||
frame_count / RGUI_TERM_START_X, entry_label, selected);
|
||||
menu_animation_ticker_line(type_str_buf, entry.spacing,
|
||||
menu_animation_ticker_line(entry_title_buf, RGUI_TERM_WIDTH - (entry_spacing + 1 + 2),
|
||||
frame_count / RGUI_TERM_START_X, entry_label, entry_selected);
|
||||
menu_animation_ticker_line(type_str_buf, entry_spacing,
|
||||
frame_count / RGUI_TERM_START_X,
|
||||
entry_value, selected);
|
||||
entry_value, entry_selected);
|
||||
|
||||
snprintf(message, sizeof(message), "%c %-*.*s %-*s",
|
||||
selected ? '>' : ' ',
|
||||
RGUI_TERM_WIDTH - (entry.spacing + 1 + 2),
|
||||
RGUI_TERM_WIDTH - (entry.spacing + 1 + 2),
|
||||
entry_selected ? '>' : ' ',
|
||||
RGUI_TERM_WIDTH - (entry_spacing + 1 + 2),
|
||||
RGUI_TERM_WIDTH - (entry_spacing + 1 + 2),
|
||||
entry_title_buf,
|
||||
entry.spacing,
|
||||
entry_spacing,
|
||||
type_str_buf);
|
||||
|
||||
blit_line(menu, x, y, message, selected ? hover_color : normal_color);
|
||||
blit_line(menu, x, y, message, entry_selected ? hover_color : normal_color);
|
||||
}
|
||||
|
||||
#ifdef GEKKO
|
||||
|
@ -189,24 +189,22 @@ static void rmenu_render(void)
|
||||
|
||||
for (i = begin; i < end; i++, j++)
|
||||
{
|
||||
menu_entry_t entry;
|
||||
char entry_label[PATH_MAX_LENGTH], entry_value[PATH_MAX_LENGTH];
|
||||
char message[PATH_MAX_LENGTH],
|
||||
entry_title_buf[PATH_MAX_LENGTH], type_str_buf[PATH_MAX_LENGTH];
|
||||
bool selected = false;
|
||||
unsigned entry_spacing = menu_entry_get_spacing(i);
|
||||
bool entry_selected = menu_entry_is_currently_selected(i);
|
||||
|
||||
menu_entry_get(&entry, i, NULL, true);
|
||||
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));
|
||||
|
||||
menu_animation_ticker_line(entry_title_buf, RMENU_TERM_WIDTH - (entry.spacing + 1 + 2),
|
||||
frame_count / 15, entry_label, selected);
|
||||
menu_animation_ticker_line(type_str_buf, entry.spacing,
|
||||
frame_count / 15, entry_value, selected);
|
||||
menu_animation_ticker_line(entry_title_buf, RMENU_TERM_WIDTH - (entry_spacing + 1 + 2),
|
||||
frame_count / 15, entry_label, entry_selected);
|
||||
menu_animation_ticker_line(type_str_buf, entry_spacing,
|
||||
frame_count / 15, entry_value, entry_selected);
|
||||
|
||||
snprintf(message, sizeof(message), "%c %s",
|
||||
selected ? '>' : ' ', entry_title_buf);
|
||||
entry_selected ? '>' : ' ', entry_title_buf);
|
||||
|
||||
font_parms.x = POSITION_EDGE_MIN + POSITION_OFFSET;
|
||||
font_parms.y = POSITION_EDGE_MIN + POSITION_RENDER_OFFSET
|
||||
|
@ -201,6 +201,14 @@ void menu_entry_get_label(uint32_t i, char *label, size_t sizeof_label)
|
||||
strlcpy(label, entry.path, sizeof_label);
|
||||
}
|
||||
|
||||
unsigned menu_entry_get_spacing(uint32_t i)
|
||||
{
|
||||
menu_entry_t entry;
|
||||
menu_entry_get(&entry, i, NULL, true);
|
||||
|
||||
return entry.spacing;
|
||||
}
|
||||
|
||||
uint32_t menu_entry_get_bool_value(uint32_t i)
|
||||
{
|
||||
rarch_setting_t *setting = menu_entry_get_setting(i);
|
||||
|
@ -65,6 +65,8 @@ enum menu_entry_type menu_entry_get_type(uint32_t i);
|
||||
|
||||
void menu_entry_get_label(uint32_t i, char *label, size_t sizeof_label);
|
||||
|
||||
unsigned menu_entry_get_spacing(uint32_t i);
|
||||
|
||||
uint32_t menu_entry_get_bool_value(uint32_t i);
|
||||
|
||||
void menu_entry_set_bool_value(uint32_t i, uint32_t new_val);
|
||||
|
Loading…
x
Reference in New Issue
Block a user