Dehardcode enums for XMB themes

This commit is contained in:
twinaphex 2016-07-14 18:19:59 +02:00
parent 68a5cdb984
commit 14797ae18e
4 changed files with 33 additions and 18 deletions

View File

@ -512,11 +512,13 @@ static const bool default_overlay_enable = false;
static const bool overlay_hide_in_menu = true;
#ifdef HAVE_MENU
#include "menu/menu_display.h"
static bool default_block_config_read = true;
static unsigned xmb_scale_factor = 100;
static unsigned xmb_alpha_factor = 75;
static unsigned xmb_theme = 0;
static unsigned xmb_theme = XMB_THEME_ELECTRIC_BLUE;
#ifdef HAVE_LAKKA
static bool xmb_shadows_enable = false;

View File

@ -715,55 +715,55 @@ static void menu_action_setting_disp_set_label_xmb_menu_color_theme(
switch (settings->menu.xmb.menu_color_theme)
{
case 0:
case XMB_THEME_LEGACY_RED:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_XMB_MENU_COLOR_THEME_LEGACY_RED),
len);
break;
case 1:
case XMB_THEME_DARK_PURPLE:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_XMB_MENU_COLOR_THEME_DARK_PURPLE),
len);
break;
case 2:
case XMB_THEME_MIDNIGHT_BLUE:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_XMB_MENU_COLOR_THEME_MIDNIGHT_BLUE),
len);
break;
case 3:
case XMB_THEME_GOLDEN:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_XMB_MENU_COLOR_THEME_GOLDEN),
len);
break;
case 4:
case XMB_THEME_ELECTRIC_BLUE:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_XMB_MENU_COLOR_THEME_ELECTRIC_BLUE),
len);
break;
case 5:
case XMB_THEME_APPLE_GREEN:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_XMB_MENU_COLOR_THEME_APPLE_GREEN),
len);
break;
case 6:
case XMB_THEME_UNDERSEA:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_XMB_MENU_COLOR_THEME_UNDERSEA),
len);
break;
case 7:
case XMB_THEME_VOLCANIC_RED:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_XMB_MENU_COLOR_THEME_VOLCANIC_RED),
len);
break;
case 8:
case XMB_THEME_DARK:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_XMB_MENU_COLOR_THEME_DARK),

View File

@ -357,21 +357,21 @@ static float *xmb_gradient_ident(void)
switch (settings->menu.xmb.menu_color_theme)
{
case 1:
case XMB_THEME_DARK_PURPLE:
return &gradient_dark_purple[0];
case 2:
case XMB_THEME_MIDNIGHT_BLUE:
return &gradient_midnight_blue[0];
case 3:
case XMB_THEME_GOLDEN:
return &gradient_golden[0];
case 4:
case XMB_THEME_ELECTRIC_BLUE:
return &gradient_electric_blue[0];
case 5:
case XMB_THEME_APPLE_GREEN:
return &gradient_apple_green[0];
case 6:
case XMB_THEME_UNDERSEA:
return &gradient_undersea[0];
case 7:
case XMB_THEME_VOLCANIC_RED:
return &gradient_volcanic_red[0];
case 8:
case XMB_THEME_DARK:
return &gradient_dark[0];
case 0:
default:

View File

@ -40,6 +40,19 @@ enum materialui_color_theme
MATERIALUI_THEME_NVIDIA_SHIELD
};
enum xmb_color_theme
{
XMB_THEME_LEGACY_RED = 0,
XMB_THEME_DARK_PURPLE,
XMB_THEME_MIDNIGHT_BLUE,
XMB_THEME_GOLDEN,
XMB_THEME_ELECTRIC_BLUE,
XMB_THEME_APPLE_GREEN,
XMB_THEME_UNDERSEA,
XMB_THEME_VOLCANIC_RED,
XMB_THEME_DARK
};
enum menu_display_prim_type
{
MENU_DISPLAY_PRIM_NONE = 0,