(Menu sublabels) Add sublabel showing the license
This commit is contained in:
parent
68d7411edf
commit
0fedbe837c
|
@ -23,6 +23,7 @@
|
||||||
#include "../../cheevos/cheevos.h"
|
#include "../../cheevos/cheevos.h"
|
||||||
#include "../../cheevos-new/cheevos.h" /* RCHEEVOS TODO: remove line */
|
#include "../../cheevos-new/cheevos.h" /* RCHEEVOS TODO: remove line */
|
||||||
#endif
|
#endif
|
||||||
|
#include "../../core_info.h"
|
||||||
#include "../../verbosity.h"
|
#include "../../verbosity.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -58,6 +59,38 @@
|
||||||
return 1; \
|
return 1; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int menu_action_sublabel_file_browser_core(file_list_t *list, unsigned type, unsigned i, const char *label, const char *path, char *s, size_t len)
|
||||||
|
{
|
||||||
|
core_info_list_t *core_list = NULL;
|
||||||
|
|
||||||
|
core_info_get_list(&core_list);
|
||||||
|
|
||||||
|
if (core_list)
|
||||||
|
{
|
||||||
|
unsigned j;
|
||||||
|
for (j = 0; j < core_list->count; j++)
|
||||||
|
{
|
||||||
|
if (string_is_equal(path_basename(core_list->list[j].path),
|
||||||
|
path))
|
||||||
|
{
|
||||||
|
if (core_list->list[j].licenses_list)
|
||||||
|
{
|
||||||
|
char tmp[PATH_MAX_LENGTH];
|
||||||
|
tmp[0] = '\0';
|
||||||
|
|
||||||
|
string_list_join_concat(tmp, sizeof(tmp),
|
||||||
|
core_list->list[j].licenses_list, ", ");
|
||||||
|
snprintf(s, len, "License: %s", tmp);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
strlcpy(s, "License: N/A", len);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
default_sublabel_macro(menu_action_sublabel_setting_audio_mixer_add_to_mixer_and_play,
|
default_sublabel_macro(menu_action_sublabel_setting_audio_mixer_add_to_mixer_and_play,
|
||||||
MENU_ENUM_SUBLABEL_ADD_TO_MIXER_AND_PLAY)
|
MENU_ENUM_SUBLABEL_ADD_TO_MIXER_AND_PLAY)
|
||||||
default_sublabel_macro(menu_action_sublabel_setting_audio_mixer_add_to_mixer,
|
default_sublabel_macro(menu_action_sublabel_setting_audio_mixer_add_to_mixer,
|
||||||
|
@ -604,6 +637,7 @@ static int action_bind_sublabel_systeminfo_controller_entry(
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_bind_sublabel_cheevos_entry(
|
static int action_bind_sublabel_cheevos_entry(
|
||||||
file_list_t *list,
|
file_list_t *list,
|
||||||
unsigned type, unsigned i,
|
unsigned type, unsigned i,
|
||||||
|
@ -1042,6 +1076,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
||||||
|
|
||||||
switch (cbs->enum_idx)
|
switch (cbs->enum_idx)
|
||||||
{
|
{
|
||||||
|
case MENU_ENUM_LABEL_FILE_BROWSER_CORE:
|
||||||
|
BIND_ACTION_SUBLABEL(cbs, menu_action_sublabel_file_browser_core);
|
||||||
|
break;
|
||||||
case MENU_ENUM_LABEL_ADD_TO_MIXER:
|
case MENU_ENUM_LABEL_ADD_TO_MIXER:
|
||||||
case MENU_ENUM_LABEL_ADD_TO_MIXER_AND_COLLECTION:
|
case MENU_ENUM_LABEL_ADD_TO_MIXER_AND_COLLECTION:
|
||||||
BIND_ACTION_SUBLABEL(cbs, menu_action_sublabel_setting_audio_mixer_add_to_mixer);
|
BIND_ACTION_SUBLABEL(cbs, menu_action_sublabel_setting_audio_mixer_add_to_mixer);
|
||||||
|
|
Loading…
Reference in New Issue