mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 06:44:27 +00:00
(XMB) History tab
This commit is contained in:
parent
2157e8389c
commit
6945489d96
@ -475,6 +475,7 @@ static int menu_cbs_init_bind_left_compare_type(menu_file_list_cbs_t *cbs,
|
|||||||
{
|
{
|
||||||
case MENU_VALUE_HORIZONTAL_MENU:
|
case MENU_VALUE_HORIZONTAL_MENU:
|
||||||
case MENU_VALUE_MAIN_MENU:
|
case MENU_VALUE_MAIN_MENU:
|
||||||
|
case MENU_VALUE_HISTORY_TAB:
|
||||||
BIND_ACTION_LEFT(cbs, action_left_mainmenu);
|
BIND_ACTION_LEFT(cbs, action_left_mainmenu);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -164,7 +164,7 @@ static int action_right_mainmenu(unsigned type, const char *label,
|
|||||||
if (list_size == 1)
|
if (list_size == 1)
|
||||||
{
|
{
|
||||||
menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &selection);
|
menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &selection);
|
||||||
if (menu_driver_list_get_selection() != (menu_driver_list_get_size(MENU_LIST_HORIZONTAL) + 1))
|
if (menu_driver_list_get_selection() != (menu_driver_list_get_size(MENU_LIST_HORIZONTAL) + 2))
|
||||||
push_list = 1;
|
push_list = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -65,6 +65,7 @@ enum
|
|||||||
{
|
{
|
||||||
XMB_TEXTURE_MAIN_MENU = 0,
|
XMB_TEXTURE_MAIN_MENU = 0,
|
||||||
XMB_TEXTURE_SETTINGS,
|
XMB_TEXTURE_SETTINGS,
|
||||||
|
XMB_TEXTURE_HISTORY,
|
||||||
XMB_TEXTURE_SETTING,
|
XMB_TEXTURE_SETTING,
|
||||||
XMB_TEXTURE_SUBSETTING,
|
XMB_TEXTURE_SUBSETTING,
|
||||||
XMB_TEXTURE_ARROW,
|
XMB_TEXTURE_ARROW,
|
||||||
@ -100,10 +101,11 @@ enum
|
|||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
XMB_SYSTEM_TAB_MAIN = 0,
|
XMB_SYSTEM_TAB_MAIN = 0,
|
||||||
XMB_SYSTEM_TAB_SETTINGS
|
XMB_SYSTEM_TAB_SETTINGS,
|
||||||
|
XMB_SYSTEM_TAB_HISTORY
|
||||||
};
|
};
|
||||||
|
|
||||||
#define XMB_SYSTEM_TAB_END XMB_SYSTEM_TAB_SETTINGS
|
#define XMB_SYSTEM_TAB_END XMB_SYSTEM_TAB_HISTORY
|
||||||
|
|
||||||
struct xmb_texture_item
|
struct xmb_texture_item
|
||||||
{
|
{
|
||||||
@ -232,6 +234,7 @@ typedef struct xmb_handle
|
|||||||
|
|
||||||
xmb_node_t main_menu_node;
|
xmb_node_t main_menu_node;
|
||||||
xmb_node_t settings_tab_node;
|
xmb_node_t settings_tab_node;
|
||||||
|
xmb_node_t history_tab_node;
|
||||||
bool prevent_populate;
|
bool prevent_populate;
|
||||||
|
|
||||||
gfx_font_raster_block_t raster_block;
|
gfx_font_raster_block_t raster_block;
|
||||||
@ -768,7 +771,7 @@ static xmb_node_t *xmb_node_allocate_userdata(xmb_handle_t *xmb, unsigned i)
|
|||||||
node->alpha = xmb->categories.passive.alpha;
|
node->alpha = xmb->categories.passive.alpha;
|
||||||
node->zoom = xmb->categories.passive.zoom;
|
node->zoom = xmb->categories.passive.zoom;
|
||||||
|
|
||||||
if ((i + 1) == xmb->categories.active.idx)
|
if ((i + 2) == xmb->categories.active.idx)
|
||||||
{
|
{
|
||||||
node->alpha = xmb->categories.active.alpha;
|
node->alpha = xmb->categories.active.alpha;
|
||||||
node->zoom = xmb->categories.active.zoom;
|
node->zoom = xmb->categories.active.zoom;
|
||||||
@ -865,31 +868,36 @@ static void xmb_list_switch_new(xmb_handle_t *xmb,
|
|||||||
|
|
||||||
static void xmb_set_title(xmb_handle_t *xmb)
|
static void xmb_set_title(xmb_handle_t *xmb)
|
||||||
{
|
{
|
||||||
if (xmb->categories.selection_ptr == 0)
|
switch (xmb->categories.selection_ptr)
|
||||||
menu_entries_get_title(xmb->title_name, sizeof(xmb->title_name));
|
|
||||||
else if (xmb->categories.selection_ptr == 1)
|
|
||||||
menu_entries_get_title(xmb->title_name, sizeof(xmb->title_name));
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
const char *path = NULL;
|
case 0:
|
||||||
menu_entries_get_at_offset(
|
case 1:
|
||||||
xmb->horizontal_list,
|
case 2:
|
||||||
xmb->categories.selection_ptr - 2,
|
menu_entries_get_title(xmb->title_name, sizeof(xmb->title_name));
|
||||||
&path, NULL, NULL, NULL, NULL);
|
break;
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
const char *path = NULL;
|
||||||
|
menu_entries_get_at_offset(
|
||||||
|
xmb->horizontal_list,
|
||||||
|
xmb->categories.selection_ptr - 3,
|
||||||
|
&path, NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
if (!path)
|
if (!path)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
strlcpy(xmb->title_name, path, sizeof(xmb->title_name));
|
strlcpy(xmb->title_name, path, sizeof(xmb->title_name));
|
||||||
|
|
||||||
path_remove_extension(xmb->title_name);
|
path_remove_extension(xmb->title_name);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xmb_list_switch_horizontal_list(xmb_handle_t *xmb, menu_handle_t *menu)
|
static void xmb_list_switch_horizontal_list(xmb_handle_t *xmb, menu_handle_t *menu)
|
||||||
{
|
{
|
||||||
unsigned j;
|
unsigned j;
|
||||||
size_t list_size = xmb_list_get_size(menu, MENU_LIST_HORIZONTAL) + 1;
|
size_t list_size = xmb_list_get_size(menu, MENU_LIST_HORIZONTAL) + 2;
|
||||||
|
|
||||||
for (j = 0; j <= list_size; j++)
|
for (j = 0; j <= list_size; j++)
|
||||||
{
|
{
|
||||||
@ -897,16 +905,18 @@ static void xmb_list_switch_horizontal_list(xmb_handle_t *xmb, menu_handle_t *me
|
|||||||
float iz = xmb->categories.passive.zoom;
|
float iz = xmb->categories.passive.zoom;
|
||||||
xmb_node_t *node = NULL;
|
xmb_node_t *node = NULL;
|
||||||
|
|
||||||
|
|
||||||
switch (j)
|
switch (j)
|
||||||
{
|
{
|
||||||
case XMB_SYSTEM_TAB_SETTINGS:
|
case XMB_SYSTEM_TAB_SETTINGS:
|
||||||
node = &xmb->settings_tab_node;
|
node = &xmb->settings_tab_node;
|
||||||
break;
|
break;
|
||||||
|
case XMB_SYSTEM_TAB_HISTORY:
|
||||||
|
node = &xmb->history_tab_node;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
node = &xmb->main_menu_node;
|
node = &xmb->main_menu_node;
|
||||||
if (j > XMB_SYSTEM_TAB_END)
|
if (j > XMB_SYSTEM_TAB_END)
|
||||||
node = xmb_get_userdata_from_horizontal_list(xmb, j - 2);
|
node = xmb_get_userdata_from_horizontal_list(xmb, j - 3);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -967,7 +977,7 @@ static void xmb_list_switch(xmb_handle_t *xmb)
|
|||||||
static void xmb_list_open_horizontal_list(xmb_handle_t *xmb, menu_handle_t *menu)
|
static void xmb_list_open_horizontal_list(xmb_handle_t *xmb, menu_handle_t *menu)
|
||||||
{
|
{
|
||||||
unsigned j;
|
unsigned j;
|
||||||
size_t list_size = xmb_list_get_size(menu, MENU_LIST_HORIZONTAL) + 1;
|
size_t list_size = xmb_list_get_size(menu, MENU_LIST_HORIZONTAL) + 2;
|
||||||
|
|
||||||
for (j = 0; j <= list_size; j++)
|
for (j = 0; j <= list_size; j++)
|
||||||
{
|
{
|
||||||
@ -979,10 +989,13 @@ static void xmb_list_open_horizontal_list(xmb_handle_t *xmb, menu_handle_t *menu
|
|||||||
case XMB_SYSTEM_TAB_SETTINGS:
|
case XMB_SYSTEM_TAB_SETTINGS:
|
||||||
node = &xmb->settings_tab_node;
|
node = &xmb->settings_tab_node;
|
||||||
break;
|
break;
|
||||||
|
case XMB_SYSTEM_TAB_HISTORY:
|
||||||
|
node = &xmb->history_tab_node;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
node = &xmb->main_menu_node;
|
node = &xmb->main_menu_node;
|
||||||
if (j > XMB_SYSTEM_TAB_END)
|
if (j > XMB_SYSTEM_TAB_END)
|
||||||
node = xmb_get_userdata_from_horizontal_list(xmb, j - 2);
|
node = xmb_get_userdata_from_horizontal_list(xmb, j - 3);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1201,7 +1214,7 @@ static void xmb_draw_items(xmb_handle_t *xmb, gl_t *gl,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (cat_selection_ptr > XMB_SYSTEM_TAB_END)
|
if (cat_selection_ptr > XMB_SYSTEM_TAB_END)
|
||||||
core_node = xmb_get_userdata_from_horizontal_list(xmb, cat_selection_ptr - 2);
|
core_node = xmb_get_userdata_from_horizontal_list(xmb, cat_selection_ptr - 3);
|
||||||
|
|
||||||
end = file_list_get_size(list);
|
end = file_list_get_size(list);
|
||||||
|
|
||||||
@ -1488,7 +1501,7 @@ static void xmb_frame_horizontal_list(xmb_handle_t *xmb,
|
|||||||
GRfloat *color)
|
GRfloat *color)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
size_t list_size = xmb_list_get_size(menu, MENU_LIST_HORIZONTAL) + 1;
|
size_t list_size = xmb_list_get_size(menu, MENU_LIST_HORIZONTAL) + 2;
|
||||||
|
|
||||||
for (i = 0; i <= list_size; i++)
|
for (i = 0; i <= list_size; i++)
|
||||||
{
|
{
|
||||||
@ -1499,10 +1512,13 @@ static void xmb_frame_horizontal_list(xmb_handle_t *xmb,
|
|||||||
case XMB_SYSTEM_TAB_SETTINGS:
|
case XMB_SYSTEM_TAB_SETTINGS:
|
||||||
node = &xmb->settings_tab_node;
|
node = &xmb->settings_tab_node;
|
||||||
break;
|
break;
|
||||||
|
case XMB_SYSTEM_TAB_HISTORY:
|
||||||
|
node = &xmb->history_tab_node;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
node = &xmb->main_menu_node;
|
node = &xmb->main_menu_node;
|
||||||
if (i > XMB_SYSTEM_TAB_END)
|
if (i > XMB_SYSTEM_TAB_END)
|
||||||
node = xmb_get_userdata_from_horizontal_list(xmb, i - 2);
|
node = xmb_get_userdata_from_horizontal_list(xmb, i - 3);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2008,7 +2024,7 @@ static bool xmb_load_image(void *data, menu_image_type_t type)
|
|||||||
static void xmb_toggle_horizontal_list(xmb_handle_t *xmb, menu_handle_t *menu)
|
static void xmb_toggle_horizontal_list(xmb_handle_t *xmb, menu_handle_t *menu)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
size_t list_size = xmb_list_get_size(menu, MENU_LIST_HORIZONTAL) + 1;
|
size_t list_size = xmb_list_get_size(menu, MENU_LIST_HORIZONTAL) + 2;
|
||||||
|
|
||||||
for (i = 0; i <= list_size; i++)
|
for (i = 0; i <= list_size; i++)
|
||||||
{
|
{
|
||||||
@ -2019,10 +2035,13 @@ static void xmb_toggle_horizontal_list(xmb_handle_t *xmb, menu_handle_t *menu)
|
|||||||
case XMB_SYSTEM_TAB_SETTINGS:
|
case XMB_SYSTEM_TAB_SETTINGS:
|
||||||
node = &xmb->settings_tab_node;
|
node = &xmb->settings_tab_node;
|
||||||
break;
|
break;
|
||||||
|
case XMB_SYSTEM_TAB_HISTORY:
|
||||||
|
node = &xmb->history_tab_node;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
node = &xmb->main_menu_node;
|
node = &xmb->main_menu_node;
|
||||||
if (i > XMB_SYSTEM_TAB_END)
|
if (i > XMB_SYSTEM_TAB_END)
|
||||||
node = xmb_get_userdata_from_horizontal_list(xmb, i - 2);
|
node = xmb_get_userdata_from_horizontal_list(xmb, i - 3);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2120,6 +2139,9 @@ static void xmb_context_reset_textures(xmb_handle_t *xmb, const char *iconpath)
|
|||||||
case XMB_TEXTURE_SETTINGS:
|
case XMB_TEXTURE_SETTINGS:
|
||||||
fill_pathname_join(path, iconpath, "settings.png", sizeof(path));
|
fill_pathname_join(path, iconpath, "settings.png", sizeof(path));
|
||||||
break;
|
break;
|
||||||
|
case XMB_TEXTURE_HISTORY:
|
||||||
|
fill_pathname_join(path, iconpath, "history.png", sizeof(path));
|
||||||
|
break;
|
||||||
case XMB_TEXTURE_SETTING:
|
case XMB_TEXTURE_SETTING:
|
||||||
fill_pathname_join(path, iconpath, "setting.png", sizeof(path));
|
fill_pathname_join(path, iconpath, "setting.png", sizeof(path));
|
||||||
break;
|
break;
|
||||||
@ -2227,6 +2249,10 @@ static void xmb_context_reset_textures(xmb_handle_t *xmb, const char *iconpath)
|
|||||||
xmb->settings_tab_node.icon = xmb->textures.list[XMB_TEXTURE_SETTINGS].id;
|
xmb->settings_tab_node.icon = xmb->textures.list[XMB_TEXTURE_SETTINGS].id;
|
||||||
xmb->settings_tab_node.alpha = xmb->categories.active.alpha;
|
xmb->settings_tab_node.alpha = xmb->categories.active.alpha;
|
||||||
xmb->settings_tab_node.zoom = xmb->categories.active.zoom;
|
xmb->settings_tab_node.zoom = xmb->categories.active.zoom;
|
||||||
|
|
||||||
|
xmb->history_tab_node.icon = xmb->textures.list[XMB_TEXTURE_HISTORY].id;
|
||||||
|
xmb->history_tab_node.alpha = xmb->categories.active.alpha;
|
||||||
|
xmb->history_tab_node.zoom = xmb->categories.active.zoom;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xmb_context_reset_background(const char *iconpath)
|
static void xmb_context_reset_background(const char *iconpath)
|
||||||
@ -2469,7 +2495,7 @@ static void xmb_list_cache(menu_list_type_t type, unsigned action)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
list_size = xmb_list_get_size(menu, MENU_LIST_HORIZONTAL) + 1;
|
list_size = xmb_list_get_size(menu, MENU_LIST_HORIZONTAL) + 2;
|
||||||
if (xmb->categories.selection_ptr > list_size)
|
if (xmb->categories.selection_ptr > list_size)
|
||||||
{
|
{
|
||||||
xmb->categories.selection_ptr = list_size;
|
xmb->categories.selection_ptr = list_size;
|
||||||
@ -2496,6 +2522,12 @@ static void xmb_list_cache(menu_list_type_t type, unsigned action)
|
|||||||
menu_stack->list[stack_size - 1].type =
|
menu_stack->list[stack_size - 1].type =
|
||||||
MENU_SETTINGS_TAB;
|
MENU_SETTINGS_TAB;
|
||||||
break;
|
break;
|
||||||
|
case XMB_SYSTEM_TAB_HISTORY:
|
||||||
|
menu_stack->list[stack_size - 1].label =
|
||||||
|
strdup(menu_hash_to_str(MENU_VALUE_HISTORY_TAB));
|
||||||
|
menu_stack->list[stack_size - 1].type =
|
||||||
|
MENU_HISTORY_TAB;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
menu_stack->list[stack_size - 1].label =
|
menu_stack->list[stack_size - 1].label =
|
||||||
strdup(menu_hash_to_str(MENU_VALUE_HORIZONTAL_MENU));
|
strdup(menu_hash_to_str(MENU_VALUE_HORIZONTAL_MENU));
|
||||||
|
@ -760,6 +760,8 @@ const char *menu_hash_to_str_us(uint32_t hash)
|
|||||||
return "Horizontal Menu";
|
return "Horizontal Menu";
|
||||||
case MENU_VALUE_SETTINGS_TAB:
|
case MENU_VALUE_SETTINGS_TAB:
|
||||||
return "Settings tab";
|
return "Settings tab";
|
||||||
|
case MENU_VALUE_HISTORY_TAB:
|
||||||
|
return "History tab";
|
||||||
case MENU_LABEL_VALUE_NO_SETTINGS_FOUND:
|
case MENU_LABEL_VALUE_NO_SETTINGS_FOUND:
|
||||||
return "No settings found.";
|
return "No settings found.";
|
||||||
case MENU_LABEL_VALUE_NO_PERFORMANCE_COUNTERS:
|
case MENU_LABEL_VALUE_NO_PERFORMANCE_COUNTERS:
|
||||||
|
@ -99,6 +99,7 @@ typedef enum
|
|||||||
MENU_FILE_MUSIC,
|
MENU_FILE_MUSIC,
|
||||||
MENU_SETTINGS,
|
MENU_SETTINGS,
|
||||||
MENU_SETTINGS_TAB,
|
MENU_SETTINGS_TAB,
|
||||||
|
MENU_HISTORY_TAB,
|
||||||
MENU_SETTING_DRIVER,
|
MENU_SETTING_DRIVER,
|
||||||
MENU_SETTING_ACTION,
|
MENU_SETTING_ACTION,
|
||||||
MENU_SETTING_ACTION_RUN,
|
MENU_SETTING_ACTION_RUN,
|
||||||
|
@ -1572,7 +1572,7 @@ static int menu_displaylist_parse_horizontal_list(menu_displaylist_info_t *info)
|
|||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
struct item_file *item = (struct item_file*)
|
struct item_file *item = (struct item_file*)
|
||||||
menu_driver_list_get_entry(MENU_LIST_HORIZONTAL, menu_driver_list_get_selection() - 2);
|
menu_driver_list_get_entry(MENU_LIST_HORIZONTAL, menu_driver_list_get_selection() - 3);
|
||||||
|
|
||||||
if (!item)
|
if (!item)
|
||||||
return -1;
|
return -1;
|
||||||
@ -2879,6 +2879,11 @@ int menu_displaylist_push(file_list_t *list, file_list_t *menu_list)
|
|||||||
return -1;
|
return -1;
|
||||||
menu_displaylist_push_list_process(&info);
|
menu_displaylist_push_list_process(&info);
|
||||||
return 0;
|
return 0;
|
||||||
|
case MENU_VALUE_HISTORY_TAB:
|
||||||
|
if (menu_displaylist_push_list(&info, DISPLAYLIST_HISTORY) != 0)
|
||||||
|
return -1;
|
||||||
|
menu_displaylist_push_list_process(&info);
|
||||||
|
return 0;
|
||||||
case MENU_VALUE_HORIZONTAL_MENU:
|
case MENU_VALUE_HORIZONTAL_MENU:
|
||||||
if (menu_displaylist_push_list(&info, DISPLAYLIST_HORIZONTAL) != 0)
|
if (menu_displaylist_push_list(&info, DISPLAYLIST_HORIZONTAL) != 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -555,6 +555,7 @@ extern "C" {
|
|||||||
#define MENU_VALUE_MORE 0x0b877cafU
|
#define MENU_VALUE_MORE 0x0b877cafU
|
||||||
#define MENU_VALUE_HORIZONTAL_MENU 0x35761704U
|
#define MENU_VALUE_HORIZONTAL_MENU 0x35761704U
|
||||||
#define MENU_VALUE_SETTINGS_TAB 0x6548d16dU
|
#define MENU_VALUE_SETTINGS_TAB 0x6548d16dU
|
||||||
|
#define MENU_VALUE_HISTORY_TAB 0xea9b0ceeU
|
||||||
#define MENU_VALUE_MAIN_MENU 0x1625971fU
|
#define MENU_VALUE_MAIN_MENU 0x1625971fU
|
||||||
#define MENU_LABEL_VALUE_SETTINGS 0x8aca3ff6U
|
#define MENU_LABEL_VALUE_SETTINGS 0x8aca3ff6U
|
||||||
#define MENU_VALUE_INPUT_SETTINGS 0xddd30846U
|
#define MENU_VALUE_INPUT_SETTINGS 0xddd30846U
|
||||||
|
Loading…
x
Reference in New Issue
Block a user