mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 08:43:10 +00:00
Horizontal Playlists tab now shows playlist names without '.lpl'
extension
This commit is contained in:
parent
180c0c87c1
commit
c8415e9194
@ -1184,6 +1184,8 @@ static const char *menu_hash_to_str_us_label_enum(enum msg_hash_enums msg)
|
|||||||
return "input_libretro_device_p%u";
|
return "input_libretro_device_p%u";
|
||||||
case MENU_ENUM_LABEL_RUN:
|
case MENU_ENUM_LABEL_RUN:
|
||||||
return "collection";
|
return "collection";
|
||||||
|
case MENU_ENUM_LABEL_PLAYLIST_COLLECTION_ENTRY:
|
||||||
|
return "playlist_collection_entry";
|
||||||
case MENU_ENUM_LABEL_CHEEVOS_LOCKED_ENTRY:
|
case MENU_ENUM_LABEL_CHEEVOS_LOCKED_ENTRY:
|
||||||
return "cheevos_locked_entry";
|
return "cheevos_locked_entry";
|
||||||
case MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ENTRY:
|
case MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ENTRY:
|
||||||
|
@ -14,10 +14,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <compat/strl.h>
|
#include <compat/strl.h>
|
||||||
|
#include <file/file_path.h>
|
||||||
|
|
||||||
#include "../menu_driver.h"
|
#include "../menu_driver.h"
|
||||||
#include "../menu_cbs.h"
|
#include "../menu_cbs.h"
|
||||||
#include "../menu_navigation.h"
|
#include "../menu_navigation.h"
|
||||||
|
#include "../../file_path_special.h"
|
||||||
|
|
||||||
#ifndef BIND_ACTION_LABEL
|
#ifndef BIND_ACTION_LABEL
|
||||||
#define BIND_ACTION_LABEL(cbs, name) \
|
#define BIND_ACTION_LABEL(cbs, name) \
|
||||||
@ -25,35 +27,72 @@
|
|||||||
cbs->action_label_ident = #name;
|
cbs->action_label_ident = #name;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int action_bind_label_generic(char *s, size_t len)
|
static int action_bind_label_generic(
|
||||||
|
file_list_t *list,
|
||||||
|
unsigned type, unsigned i,
|
||||||
|
const char *label, const char *path,
|
||||||
|
char *s, size_t len)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_bind_label_information(char *s, size_t len)
|
static int action_bind_label_information(
|
||||||
|
file_list_t *list,
|
||||||
|
unsigned type, unsigned i,
|
||||||
|
const char *label, const char *path,
|
||||||
|
char *s, size_t len)
|
||||||
{
|
{
|
||||||
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_INFORMATION), len);
|
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_INFORMATION), len);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_bind_label_internal_memory(char *s, size_t len)
|
static int action_bind_label_internal_memory(
|
||||||
|
file_list_t *list,
|
||||||
|
unsigned type, unsigned i,
|
||||||
|
const char *label, const char *path,
|
||||||
|
char *s, size_t len)
|
||||||
{
|
{
|
||||||
strlcpy(s, msg_hash_to_str(MSG_INTERNAL_MEMORY), len);
|
strlcpy(s, msg_hash_to_str(MSG_INTERNAL_MEMORY), len);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_bind_label_external_application_dir(char *s, size_t len)
|
static int action_bind_label_external_application_dir(
|
||||||
|
file_list_t *list,
|
||||||
|
unsigned type, unsigned i,
|
||||||
|
const char *label, const char *path,
|
||||||
|
char *s, size_t len)
|
||||||
{
|
{
|
||||||
strlcpy(s, msg_hash_to_str(MSG_EXTERNAL_APPLICATION_DIR), len);
|
strlcpy(s, msg_hash_to_str(MSG_EXTERNAL_APPLICATION_DIR), len);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_bind_label_application_dir(char *s, size_t len)
|
static int action_bind_label_application_dir(
|
||||||
|
file_list_t *list,
|
||||||
|
unsigned type, unsigned i,
|
||||||
|
const char *label, const char *path,
|
||||||
|
char *s, size_t len)
|
||||||
{
|
{
|
||||||
strlcpy(s, msg_hash_to_str(MSG_APPLICATION_DIR), len);
|
strlcpy(s, msg_hash_to_str(MSG_APPLICATION_DIR), len);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int action_bind_label_playlist_collection_entry(
|
||||||
|
file_list_t *list,
|
||||||
|
unsigned type, unsigned i,
|
||||||
|
const char *label, const char *path,
|
||||||
|
char *s, size_t len)
|
||||||
|
{
|
||||||
|
if (strstr(path, file_path_str(FILE_PATH_LPL_EXTENSION)))
|
||||||
|
{
|
||||||
|
char path_base[PATH_MAX_LENGTH] = {0};
|
||||||
|
fill_short_pathname_representation_noext(path_base, path,
|
||||||
|
sizeof(path_base));
|
||||||
|
|
||||||
|
strlcpy(s, path_base, len);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int menu_cbs_init_bind_label(menu_file_list_cbs_t *cbs,
|
int menu_cbs_init_bind_label(menu_file_list_cbs_t *cbs,
|
||||||
const char *path, const char *label, unsigned type, size_t idx)
|
const char *path, const char *label, unsigned type, size_t idx)
|
||||||
{
|
{
|
||||||
@ -66,6 +105,9 @@ int menu_cbs_init_bind_label(menu_file_list_cbs_t *cbs,
|
|||||||
{
|
{
|
||||||
switch (cbs->enum_idx)
|
switch (cbs->enum_idx)
|
||||||
{
|
{
|
||||||
|
case MENU_ENUM_LABEL_PLAYLIST_COLLECTION_ENTRY:
|
||||||
|
BIND_ACTION_LABEL(cbs, action_bind_label_playlist_collection_entry);
|
||||||
|
break;
|
||||||
case MSG_INTERNAL_MEMORY:
|
case MSG_INTERNAL_MEMORY:
|
||||||
BIND_ACTION_LABEL(cbs, action_bind_label_internal_memory);
|
BIND_ACTION_LABEL(cbs, action_bind_label_internal_memory);
|
||||||
break;
|
break;
|
||||||
|
@ -3290,7 +3290,7 @@ static int menu_displaylist_parse_playlists_horizontal(
|
|||||||
|
|
||||||
items_found++;
|
items_found++;
|
||||||
menu_entries_add_enum(info->list, path, label,
|
menu_entries_add_enum(info->list, path, label,
|
||||||
MSG_UNKNOWN,
|
MENU_ENUM_LABEL_PLAYLIST_COLLECTION_ENTRY,
|
||||||
file_type, 0, 0);
|
file_type, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,7 +111,10 @@ typedef struct menu_file_list_cbs
|
|||||||
int (*action_up)(unsigned type, const char *label);
|
int (*action_up)(unsigned type, const char *label);
|
||||||
const char *action_up_ident;
|
const char *action_up_ident;
|
||||||
|
|
||||||
int (*action_label)(char *s, size_t len);
|
int (*action_label)(file_list_t *list,
|
||||||
|
unsigned type, unsigned i,
|
||||||
|
const char *label, const char *path,
|
||||||
|
char *s, size_t len);
|
||||||
const char *action_label_ident;
|
const char *action_label_ident;
|
||||||
|
|
||||||
int (*action_down)(unsigned type, const char *label);
|
int (*action_down)(unsigned type, const char *label);
|
||||||
|
@ -290,23 +290,25 @@ void menu_entry_get(menu_entry_t *entry, size_t stack_idx,
|
|||||||
|
|
||||||
if (cbs)
|
if (cbs)
|
||||||
{
|
{
|
||||||
|
const char *label = NULL;
|
||||||
|
enum msg_hash_enums enum_idx = MSG_UNKNOWN;
|
||||||
|
|
||||||
entry->enum_idx = cbs->enum_idx;
|
entry->enum_idx = cbs->enum_idx;
|
||||||
|
|
||||||
if (cbs->action_get_value && use_representation)
|
menu_entries_get_last_stack(NULL, &label, NULL, &enum_idx, NULL);
|
||||||
{
|
|
||||||
enum msg_hash_enums enum_idx = MSG_UNKNOWN;
|
|
||||||
const char *label = NULL;
|
|
||||||
menu_entries_get_last_stack(NULL, &label, NULL, &enum_idx, NULL);
|
|
||||||
|
|
||||||
|
if (cbs->action_get_value && use_representation)
|
||||||
cbs->action_get_value(list,
|
cbs->action_get_value(list,
|
||||||
&entry->spacing, entry->type, i, label,
|
&entry->spacing, entry->type, i, label,
|
||||||
entry->value, sizeof(entry->value),
|
entry->value, sizeof(entry->value),
|
||||||
entry_label, path,
|
entry_label, path,
|
||||||
entry->path, sizeof(entry->path));
|
entry->path, sizeof(entry->path));
|
||||||
}
|
|
||||||
|
|
||||||
if (cbs->action_label)
|
if (cbs->action_label)
|
||||||
cbs->action_label(entry->rich_label,
|
cbs->action_label(list,
|
||||||
|
entry->type, i,
|
||||||
|
label, path,
|
||||||
|
entry->rich_label,
|
||||||
sizeof(entry->rich_label));
|
sizeof(entry->rich_label));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -284,6 +284,7 @@ enum msg_hash_enums
|
|||||||
MSG_EXTRACTING_FILE,
|
MSG_EXTRACTING_FILE,
|
||||||
MSG_NO_CONTENT_STARTING_DUMMY_CORE,
|
MSG_NO_CONTENT_STARTING_DUMMY_CORE,
|
||||||
|
|
||||||
|
MENU_ENUM_LABEL_PLAYLIST_COLLECTION_ENTRY,
|
||||||
MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ENTRY,
|
MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ENTRY,
|
||||||
MENU_ENUM_LABEL_CHEEVOS_LOCKED_ENTRY,
|
MENU_ENUM_LABEL_CHEEVOS_LOCKED_ENTRY,
|
||||||
MENU_ENUM_LABEL_FILEBROWSER_ENTRY,
|
MENU_ENUM_LABEL_FILEBROWSER_ENTRY,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user