(RGUI) Overhaul custom theme interface + add wallpaper support

This commit is contained in:
jdgleaver 2019-01-29 17:03:44 +00:00
parent d357cf9986
commit 99fa2b54eb
30 changed files with 320 additions and 412 deletions

View File

@ -373,14 +373,7 @@ static unsigned menu_shader_pipeline = 2;
#endif
static bool show_advanced_settings = false;
static const uint32_t menu_entry_normal_color = 0xffffffff;
static const uint32_t menu_entry_hover_color = 0xff64ff64;
static const uint32_t menu_title_color = 0xff64ff64;
static const uint32_t menu_bg_dark_color = 0xc0202020;
static const uint32_t menu_bg_light_color = 0xc0404040;
static const uint32_t menu_border_dark_color = 0xc0204020;
static const uint32_t menu_border_light_color = 0xc0408040;
static unsigned rgui_color_theme = RGUI_THEME_CUSTOM;
static unsigned rgui_color_theme = RGUI_THEME_CLASSIC_GREEN;
#else
static bool default_block_config_read = false;

View File

@ -1216,6 +1216,8 @@ static struct config_path_setting *populate_settings_path(settings_t *settings,
#ifdef HAVE_MENU
SETTING_PATH("menu_wallpaper",
settings->paths.path_menu_wallpaper, false, NULL, true);
SETTING_PATH("rgui_menu_theme_preset",
settings->paths.path_rgui_theme_preset, false, NULL, true);
#endif
SETTING_PATH("content_history_path",
settings->paths.path_content_history, false, NULL, true);
@ -1965,13 +1967,6 @@ void config_set_defaults(void)
#ifdef HAVE_MENU
if (first_initialized)
settings->bools.menu_show_start_screen = default_menu_show_start_screen;
settings->uints.menu_entry_normal_color = menu_entry_normal_color;
settings->uints.menu_entry_hover_color = menu_entry_hover_color;
settings->uints.menu_title_color = menu_title_color;
settings->uints.menu_bg_dark_color = menu_bg_dark_color;
settings->uints.menu_bg_light_color = menu_bg_light_color;
settings->uints.menu_border_dark_color = menu_border_dark_color;
settings->uints.menu_border_light_color = menu_border_light_color;
#endif
#ifdef HAVE_CHEEVOS
@ -2074,6 +2069,7 @@ void config_set_defaults(void)
#endif
*settings->paths.path_cheat_database = '\0';
*settings->paths.path_menu_wallpaper = '\0';
*settings->paths.path_rgui_theme_preset = '\0';
*settings->paths.path_content_database = '\0';
*settings->paths.path_overlay = '\0';
*settings->paths.path_record_config = '\0';
@ -2658,6 +2654,8 @@ static void config_file_dump_all(config_file_t *conf)
}
#endif
/*
* This is no longer used, so comment out to silence warnings...
#ifdef HAVE_MENU
static void config_get_hex_base(config_file_t *conf,
const char *key, unsigned *base)
@ -2669,6 +2667,7 @@ static void config_get_hex_base(config_file_t *conf,
*base = tmp;
}
#endif
*/
/**
* config_load:
@ -2884,22 +2883,6 @@ static bool config_load_file(const char *path, bool set_defaults,
settings->floats.video_msg_color_g = ((msg_color >> 8) & 0xff) / 255.0f;
settings->floats.video_msg_color_b = ((msg_color >> 0) & 0xff) / 255.0f;
}
#ifdef HAVE_MENU
config_get_hex_base(conf, "menu_entry_normal_color",
&settings->uints.menu_entry_normal_color);
config_get_hex_base(conf, "menu_entry_hover_color",
&settings->uints.menu_entry_hover_color);
config_get_hex_base(conf, "menu_title_color",
&settings->uints.menu_title_color);
config_get_hex_base(conf, "menu_bg_dark_color",
&settings->uints.menu_bg_dark_color);
config_get_hex_base(conf, "menu_bg_light_color",
&settings->uints.menu_bg_light_color);
config_get_hex_base(conf, "menu_border_dark_color",
&settings->uints.menu_border_dark_color);
config_get_hex_base(conf, "menu_border_light_color",
&settings->uints.menu_border_light_color);
#endif
/* Float settings */
for (i = 0; i < (unsigned)float_settings_size; i++)
@ -3088,6 +3071,8 @@ static bool config_load_file(const char *path, bool set_defaults,
if (string_is_equal(settings->paths.path_menu_wallpaper, "default"))
*settings->paths.path_menu_wallpaper = '\0';
if (string_is_equal(settings->paths.path_rgui_theme_preset, "default"))
*settings->paths.path_rgui_theme_preset = '\0';
if (string_is_equal(settings->paths.directory_video_shader, "default"))
*settings->paths.directory_video_shader = '\0';
if (string_is_equal(settings->paths.directory_video_filter, "default"))
@ -4387,22 +4372,6 @@ bool config_save_file(const char *path)
/* Hexadecimal settings */
config_set_hex(conf, "video_message_color", msg_color);
#ifdef HAVE_MENU
config_set_hex(conf, "menu_entry_normal_color",
settings->uints.menu_entry_normal_color);
config_set_hex(conf, "menu_entry_hover_color",
settings->uints.menu_entry_hover_color);
config_set_hex(conf, "menu_title_color",
settings->uints.menu_title_color);
config_set_hex(conf, "menu_bg_dark_color",
settings->uints.menu_bg_dark_color);
config_set_hex(conf, "menu_bg_light_color",
settings->uints.menu_bg_light_color);
config_set_hex(conf, "menu_border_dark_color",
settings->uints.menu_border_dark_color);
config_set_hex(conf, "menu_border_light_color",
settings->uints.menu_border_light_color);
#endif
video_driver_save_settings(conf);

View File

@ -409,13 +409,6 @@ typedef struct settings
unsigned menu_left_thumbnails;
unsigned menu_rgui_thumbnail_downscaler;
unsigned menu_dpi_override_value;
unsigned menu_entry_normal_color;
unsigned menu_entry_hover_color;
unsigned menu_title_color;
unsigned menu_bg_dark_color;
unsigned menu_bg_light_color;
unsigned menu_border_dark_color;
unsigned menu_border_light_color;
unsigned menu_rgui_color_theme;
unsigned menu_xmb_layout;
unsigned menu_xmb_shader_pipeline;
@ -547,6 +540,7 @@ typedef struct settings
char path_cheat_settings[PATH_MAX_LENGTH];
char path_shader[PATH_MAX_LENGTH];
char path_font[PATH_MAX_LENGTH];
char path_rgui_theme_preset[PATH_MAX_LENGTH];
char directory_audio_filter[PATH_MAX_LENGTH];
char directory_autoconfig[PATH_MAX_LENGTH];

View File

@ -659,10 +659,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_DYNAMIC_WALLPAPERS_DIRECTORY,
"Dynamic Backgrounds")
MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEEVOS_ENABLE,
"Enable Achievements")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_HOVER_COLOR,
"Menu entry hover color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_NORMAL_COLOR,
"Menu entry normal color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FALSE,
"False")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FASTFORWARD_RATIO,
@ -1653,8 +1649,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_THUMBNAIL_MODE_TITLE_SCREENS,
"Title Screens")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TIMEDATE_ENABLE,
"Show date / time")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TITLE_COLOR,
"Menu title color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TRUE,
"True")
MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_COMPANION_ENABLE,

View File

@ -652,10 +652,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_DYNAMIC_WALLPAPERS_DIRECTORY,
"动态壁纸文件夹")
MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEEVOS_ENABLE,
"启用成就系统")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_HOVER_COLOR,
"菜单项悬停颜色")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_NORMAL_COLOR,
"菜单项正常颜色")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FALSE,
"")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FASTFORWARD_RATIO,
@ -1713,8 +1709,6 @@ MSG_HASH(
MSG_HASH(
MENU_ENUM_LABEL_VALUE_TIMEDATE_STYLE_AM_PM,
"HH:MM:SS (AM/PM)")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TITLE_COLOR,
"菜单标题颜色")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TRUE,
"")
MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_COMPANION_ENABLE,

View File

@ -604,10 +604,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_DYNAMIC_WALLPAPERS_DIRECTORY,
MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEEVOS_ENABLE,
/* FIXME? Translate 'Enable Achievements' */
"啟用成就系統")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_HOVER_COLOR,
"選單項懸停顏色")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_NORMAL_COLOR,
"選單項正常顏色")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FALSE,
"取消")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FASTFORWARD_RATIO,
@ -1531,8 +1527,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_THUMBNAIL_MODE_TITLE_SCREENS,
"標題畫面")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TIMEDATE_ENABLE,
"顯示時間日期")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TITLE_COLOR,
"選單標題顏色")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TRUE,
"")
MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_COMPANION_ENABLE,

View File

@ -635,10 +635,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_DYNAMIC_WALLPAPERS_DIRECTORY,
"Dynamische Hintergrundbilder")
MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEEVOS_ENABLE,
"Aktiviert Errungenschaften")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_HOVER_COLOR,
"Farbe für gewählte Menü-Einträge")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_NORMAL_COLOR,
"Farbe für nicht gewählte Menü-Einträge")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FALSE,
"Aus")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FASTFORWARD_RATIO,
@ -1600,8 +1596,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_THUMBNAIL_MODE_TITLE_SCREENS,
"Titelbildschirm")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TIMEDATE_ENABLE,
"Uhrzeit / Datum anzeigen")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TITLE_COLOR,
"Menü-Titelfarbe")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TRUE,
"An")
MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_COMPANION_ENABLE,

View File

@ -798,14 +798,6 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_CHEEVOS_ENABLE,
"Ενεργοποίηση Επιτευγμάτων"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_ENTRY_HOVER_COLOR,
"Χρώμα καταχώρησης μενού όταν το ποντίκι βρίσκεται από πάνω"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_ENTRY_NORMAL_COLOR,
"Χρώμα καταχώρησης μενού"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_FALSE,
"Ψευδές"
@ -2922,10 +2914,6 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_TIMEDATE_STYLE_AM_PM,
"ΩΩ:ΛΛ:ΔΔ (ΠΜ/ΜΜ)"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_TITLE_COLOR,
"Χρώμα τίτλου μενού"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_TRUE,
"Αληθές"

View File

@ -524,10 +524,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_DYNAMIC_WALLPAPERS_DIRECTORY,
"Dynamic Wallpapers")
MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEEVOS_ENABLE,
"Enable Achievements")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_HOVER_COLOR,
"Menu entry hover color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_NORMAL_COLOR,
"Menu entry normal color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FALSE,
"False")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FASTFORWARD_RATIO,
@ -1441,8 +1437,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_THUMBNAIL_MODE_TITLE_SCREENS,
"Title Screens")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TIMEDATE_ENABLE,
"Display time / date")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TITLE_COLOR,
"Menu title color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TRUE,
"True")
MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_COMPANION_ENABLE,

View File

@ -837,14 +837,6 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_CHEEVOS_ENABLE,
"Activar logros"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_ENTRY_HOVER_COLOR,
"Color de resaltado del menú"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_ENTRY_NORMAL_COLOR,
"Color normal del menú"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_FALSE,
"Desactivado"
@ -2990,26 +2982,6 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_TIMEDATE_STYLE_AM_PM,
"HH:MM:SS (AM/PM)"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_TITLE_COLOR,
"Color de títulos del menú"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_BG_DARK_COLOR,
"Color oscuro del fondo del menú"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_BG_LIGHT_COLOR,
"Color claro del fondo del menú"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_BORDER_DARK_COLOR,
"Color oscuro del borde del menú"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_BORDER_LIGHT_COLOR,
"Color claro del borde del menú"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_TRUE,
"Activado"

View File

@ -603,10 +603,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_DYNAMIC_WALLPAPERS_DIRECTORY,
"Fonds d'écran dynamique")
MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEEVOS_ENABLE,
"Activer les trophées")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_HOVER_COLOR,
"Couleur de l'entrée menu active")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_NORMAL_COLOR,
"Couleur des entrées du menu")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FALSE,
"Faux")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FASTFORWARD_RATIO,
@ -1556,8 +1552,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_THUMBNAIL_MODE_TITLE_SCREENS,
"Écrans titres")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TIMEDATE_ENABLE,
"Afficher la date et l'heure")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TITLE_COLOR,
"Couleur du titre du menu")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TRUE,
"Vrai")
MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_COMPANION_ENABLE,

View File

@ -607,10 +607,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_DYNAMIC_WALLPAPERS_DIRECTORY,
"Sfondi dinamici")
MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEEVOS_ENABLE,
"Abilita Achievements")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_HOVER_COLOR,
"Colore al passaggio del mouse")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_NORMAL_COLOR,
"Voce di Menu con colore normale")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FALSE,
"Falso")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FASTFORWARD_RATIO,
@ -1574,8 +1570,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_THUMBNAIL_MODE_TITLE_SCREENS,
"Title Screens")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TIMEDATE_ENABLE,
"Visualizza data / ora")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TITLE_COLOR,
"Colore titolo del Menu")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TRUE,
"Vero")
MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_COMPANION_ENABLE,

View File

@ -707,10 +707,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_DYNAMIC_WALLPAPERS_DIRECTORY,
"ダイナミック壁紙")
MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEEVOS_ENABLE,
"有効")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_HOVER_COLOR,
"メニュー項目の選択色")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_NORMAL_COLOR,
"メニュー項目の通常色")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FALSE,
"")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FASTFORWARD_RATIO,
@ -1746,8 +1742,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_THUMBNAIL_MODE_TITLE_SCREENS,
"タイトルスクリーン")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TIMEDATE_ENABLE,
"日付と時刻を表示")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TITLE_COLOR,
"メニューのタイトル色")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TRUE,
"")
MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_COMPANION_ENABLE,

View File

@ -591,10 +591,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_DYNAMIC_WALLPAPERS_DIRECTORY,
"다이나믹 백그라운드")
MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEEVOS_ENABLE,
"도전과제 사용")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_HOVER_COLOR,
"메뉴 항목 하이라이트 색상")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_NORMAL_COLOR,
"메뉴 항목 일반 색상")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FALSE,
"False")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FASTFORWARD_RATIO,
@ -1528,8 +1524,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_THUMBNAIL_MODE_TITLE_SCREENS,
"타이틀 화면")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TIMEDATE_ENABLE,
"시간/날짜 표시")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TITLE_COLOR,
"메뉴 타이틀 색상")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TRUE,
"True")
MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_COMPANION_ENABLE,

View File

@ -437,10 +437,6 @@ MSG_HASH(MENU_ENUM_LABEL_DYNAMIC_WALLPAPER,
"menu_dynamic_wallpaper_enable")
MSG_HASH(MENU_ENUM_LABEL_DYNAMIC_WALLPAPERS_DIRECTORY,
"dynamic_wallpapers_directory")
MSG_HASH(MENU_ENUM_LABEL_ENTRY_HOVER_COLOR,
"menu_entry_hover_color")
MSG_HASH(MENU_ENUM_LABEL_ENTRY_NORMAL_COLOR,
"menu_entry_normal_color")
MSG_HASH(MENU_ENUM_LABEL_FASTFORWARD_RATIO,
"fastforward_ratio")
MSG_HASH(MENU_ENUM_LABEL_FILE_BROWSER_CORE,
@ -655,6 +651,8 @@ MSG_HASH(MENU_ENUM_LABEL_MANAGEMENT,
"database_settings")
MSG_HASH(MENU_ENUM_LABEL_RGUI_MENU_COLOR_THEME,
"rgui_menu_color_theme")
MSG_HASH(MENU_ENUM_LABEL_RGUI_MENU_THEME_PRESET,
"rgui_menu_theme_preset")
MSG_HASH(MENU_ENUM_LABEL_OZONE_MENU_COLOR_THEME,
"ozone_menu_color_theme")
MSG_HASH(MENU_ENUM_LABEL_MATERIALUI_MENU_COLOR_THEME,
@ -1129,16 +1127,6 @@ MSG_HASH(MENU_ENUM_LABEL_TIMEDATE_ENABLE,
"menu_timedate_enable")
MSG_HASH(MENU_ENUM_LABEL_TIMEDATE_STYLE,
"menu_timedate_style")
MSG_HASH(MENU_ENUM_LABEL_TITLE_COLOR,
"menu_title_color")
MSG_HASH(MENU_ENUM_LABEL_BG_DARK_COLOR,
"menu_bg_dark_color")
MSG_HASH(MENU_ENUM_LABEL_BG_LIGHT_COLOR,
"menu_bg_light_color")
MSG_HASH(MENU_ENUM_LABEL_BORDER_DARK_COLOR,
"menu_border_dark_color")
MSG_HASH(MENU_ENUM_LABEL_BORDER_LIGHT_COLOR,
"menu_border_light_color")
MSG_HASH(MENU_ENUM_LABEL_UI_COMPANION_ENABLE,
"ui_companion_enable")
MSG_HASH(MENU_ENUM_LABEL_UI_COMPANION_START_ON_BOOT,

View File

@ -524,10 +524,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_DYNAMIC_WALLPAPERS_DIRECTORY,
"Dynamische Wallpapers")
MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEEVOS_ENABLE,
"Achievements Activeren")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_HOVER_COLOR,
"Menu entry hover kleur")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_NORMAL_COLOR,
"Menu entry normale kleur")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FALSE,
"Niet waar")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FASTFORWARD_RATIO,
@ -1443,8 +1439,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_THUMBNAIL_MODE_TITLE_SCREENS,
"Title Screens")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TIMEDATE_ENABLE,
"Tijd/datum weergeven")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TITLE_COLOR,
"Menu titelkleur")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TRUE,
"Waar")
MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_COMPANION_ENABLE,

View File

@ -663,10 +663,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_DYNAMIC_WALLPAPERS_DIRECTORY,
"Dynamiczne tła")
MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEEVOS_ENABLE,
"Włącz osiągnięcia")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_HOVER_COLOR,
"Zmodyfikowany kolor menu")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_NORMAL_COLOR,
"Normalny kolor menu")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FALSE,
"Fałszywy")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FASTFORWARD_RATIO,
@ -1672,8 +1668,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_THUMBNAIL_MODE_TITLE_SCREENS,
"Ekrany tytułowe")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TIMEDATE_ENABLE,
"Pokaż datę/czas")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TITLE_COLOR,
"Kolor tytułu menu")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TRUE,
"Prawdziwe")
MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_COMPANION_ENABLE,

View File

@ -845,14 +845,6 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_CHEEVOS_ENABLE,
"Habilitar Conquistas"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_ENTRY_HOVER_COLOR,
"Cor do item de menu ao passar o cursor"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_ENTRY_NORMAL_COLOR,
"Cor normal do item de menu"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_FALSE,
"Falso"
@ -2994,26 +2986,6 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_TIMEDATE_STYLE_AM_PM,
"HH:MM:SS (AM/PM)"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_TITLE_COLOR,
"Cor de título do menu personalizado"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_BG_DARK_COLOR,
"Cor escura do fundo do menu personalizado"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_BG_LIGHT_COLOR,
"Cor clara do fundo do menu personalizado"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_BORDER_DARK_COLOR,
"Cor escura da borda do menu personalizado"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_BORDER_LIGHT_COLOR,
"Cor clara da borda do menu personalizado"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_RGUI_MENU_COLOR_THEME,
"Tema da Cor do Menu"

View File

@ -591,10 +591,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_DYNAMIC_WALLPAPERS_DIRECTORY,
"Fundos dinâmicos")
MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEEVOS_ENABLE,
"Ativar conquistas")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_HOVER_COLOR,
"Cor da entrada do menu quando sobreposta pelo cursor")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_NORMAL_COLOR,
"Cor normal da entrada do menu")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FALSE,
"Falso")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FASTFORWARD_RATIO,
@ -1520,8 +1516,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_THUMBNAIL_MODE_TITLE_SCREENS,
"Títulos do ecrã")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TIMEDATE_ENABLE,
"Mostrar data e hora")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TITLE_COLOR,
"Cor do menu de título")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TRUE,
"Verdadeiro")
MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_COMPANION_ENABLE,

View File

@ -612,10 +612,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_DYNAMIC_WALLPAPERS_DIRECTORY,
"Каталог с динамическими обоями")
MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEEVOS_ENABLE,
"Включить достижения")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_HOVER_COLOR,
"Цвет наведения указателя меню")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_NORMAL_COLOR,
"Нормальный цвет ввода в меню")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FALSE,
"Выключено")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FASTFORWARD_RATIO,
@ -1555,8 +1551,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_THUMBNAIL_MODE_TITLE_SCREENS,
"Экраны заголовков")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TIMEDATE_ENABLE,
"Показать дату/время")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TITLE_COLOR,
"Цвет заголовков в меню")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TRUE,
"True")
MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_COMPANION_ENABLE,

View File

@ -845,14 +845,6 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_CHEEVOS_ENABLE,
"Enable Achievements"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_ENTRY_HOVER_COLOR,
"Custom menu entry hover color"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_ENTRY_NORMAL_COLOR,
"Custom menu entry normal color"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_FALSE,
"False"
@ -3030,30 +3022,14 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_TIMEDATE_STYLE_AM_PM,
"HH:MM:SS (AM/PM)"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_TITLE_COLOR,
"Custom menu title color"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_BG_DARK_COLOR,
"Custom menu background dark color"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_BG_LIGHT_COLOR,
"Custom menu background light color"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_BORDER_DARK_COLOR,
"Custom menu border dark color"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_BORDER_LIGHT_COLOR,
"Custom menu border light color"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_RGUI_MENU_COLOR_THEME,
"Menu Color Theme"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_RGUI_MENU_THEME_PRESET,
"Custom Menu Theme Preset"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_RGUI_MENU_COLOR_THEME_CUSTOM,
"Custom"

View File

@ -603,10 +603,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_DYNAMIC_WALLPAPERS_DIRECTORY,
"Mục nền năng động")
MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEEVOS_ENABLE,
"Kích hoạt")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_HOVER_COLOR,
"Menu entry hover color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_NORMAL_COLOR,
"Menu entry normal color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FALSE,
"False")
MSG_HASH(MENU_ENUM_LABEL_VALUE_FASTFORWARD_RATIO,
@ -1549,8 +1545,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_THUMBNAIL_MODE_TITLE_SCREENS,
"Title Screens")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TIMEDATE_ENABLE,
"Display time / date")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TITLE_COLOR,
"Menu title color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_TRUE,
"True")
MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_COMPANION_ENABLE,

View File

@ -178,6 +178,7 @@ generic_deferred_push(deferred_push_rpl_entry_actions, DISPLAYLIST_
generic_deferred_push(deferred_push_core_list_deferred, DISPLAYLIST_CORES_SUPPORTED)
generic_deferred_push(deferred_push_core_collection_list_deferred, DISPLAYLIST_CORES_COLLECTION_SUPPORTED)
generic_deferred_push(deferred_push_menu_sounds_list, DISPLAYLIST_MENU_SOUNDS_LIST)
generic_deferred_push(deferred_push_rgui_theme_preset, DISPLAYLIST_RGUI_THEME_PRESETS)
#ifdef HAVE_NETWORKING
generic_deferred_push(deferred_push_thumbnails_updater_list, DISPLAYLIST_THUMBNAILS_UPDATER)
@ -1103,6 +1104,9 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
case MENU_ENUM_LABEL_STREAM_CONFIG:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_stream_configfile);
break;
case MENU_ENUM_LABEL_RGUI_MENU_THEME_PRESET:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_rgui_theme_preset);
break;
case MENU_ENUM_LABEL_SHADER_OPTIONS:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_shader_options);
break;
@ -1368,6 +1372,9 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
case MENU_LABEL_STREAM_CONFIG:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_stream_configfile);
break;
case MENU_LABEL_RGUI_MENU_THEME_PRESET:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_rgui_theme_preset);
break;
case MENU_LABEL_NETPLAY:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_netplay);
break;

View File

@ -105,7 +105,8 @@ enum
ACTION_OK_SET_PATH_OVERLAY,
ACTION_OK_SET_DIRECTORY,
ACTION_OK_SHOW_WIMP,
ACTION_OK_LOAD_CHEAT_FILE_APPEND
ACTION_OK_LOAD_CHEAT_FILE_APPEND,
ACTION_OK_LOAD_RGUI_MENU_THEME_PRESET
};
enum
@ -598,6 +599,14 @@ int generic_action_ok_displaylist_push(const char *path,
info_label = label;
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_FILE;
break;
case ACTION_OK_DL_RGUI_MENU_THEME_PRESET:
filebrowser_clear_type();
info.type = type;
info.directory_ptr = idx;
info_path = settings->paths.directory_assets;
info_label = label;
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_FILE;
break;
case ACTION_OK_DL_CORE_LIST:
filebrowser_clear_type();
info.type = type;
@ -1499,6 +1508,16 @@ static int generic_action_ok(const char *path,
if (!cheat_manager_load(action_path,true))
goto error;
break;
case ACTION_OK_LOAD_RGUI_MENU_THEME_PRESET:
{
settings_t *settings = config_get_ptr();
flush_char = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_MENU_SETTINGS_LIST);
if (settings)
strlcpy(settings->paths.path_rgui_theme_preset, action_path,
sizeof(settings->paths.path_rgui_theme_preset));
}
break;
case ACTION_OK_APPEND_DISK_IMAGE:
flush_type = MENU_SETTINGS;
command_event(CMD_EVENT_DISK_APPEND_IMAGE, action_path);
@ -1594,6 +1613,7 @@ default_action_ok_set(action_ok_stream_configfile_load, ACTION_OK_LOAD_STRE
default_action_ok_set(action_ok_remap_file_load, ACTION_OK_LOAD_REMAPPING_FILE, MENU_ENUM_LABEL_CORE_INPUT_REMAPPING_OPTIONS )
default_action_ok_set(action_ok_shader_preset_load, ACTION_OK_LOAD_PRESET , MENU_ENUM_LABEL_SHADER_OPTIONS)
default_action_ok_set(action_ok_shader_pass_load, ACTION_OK_LOAD_SHADER_PASS, MENU_ENUM_LABEL_SHADER_OPTIONS)
default_action_ok_set(action_ok_rgui_menu_theme_preset_load, ACTION_OK_LOAD_RGUI_MENU_THEME_PRESET, MENU_ENUM_LABEL_MENU_SETTINGS)
static int action_ok_file_load(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
@ -3995,6 +4015,7 @@ default_action_ok_func(action_ok_push_accounts_cheevos_list, ACTION_OK_DL_ACCOUN
default_action_ok_func(action_ok_push_accounts_youtube_list, ACTION_OK_DL_ACCOUNTS_YOUTUBE_LIST)
default_action_ok_func(action_ok_push_accounts_twitch_list, ACTION_OK_DL_ACCOUNTS_TWITCH_LIST)
default_action_ok_func(action_ok_open_archive, ACTION_OK_DL_OPEN_ARCHIVE)
default_action_ok_func(action_ok_rgui_menu_theme_preset, ACTION_OK_DL_RGUI_MENU_THEME_PRESET)
static int action_ok_open_uwp_permission_settings(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
@ -5290,6 +5311,9 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_STREAM_CONFIG:
BIND_ACTION_OK(cbs, action_ok_stream_configfile);
break;
case MENU_ENUM_LABEL_RGUI_MENU_THEME_PRESET:
BIND_ACTION_OK(cbs, action_ok_rgui_menu_theme_preset);
break;
#ifdef HAVE_NETWORKING
case MENU_ENUM_LABEL_DOWNLOAD_CORE_CONTENT:
BIND_ACTION_OK(cbs, action_ok_core_content_list);
@ -5664,6 +5688,9 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
case MENU_LABEL_STREAM_CONFIG:
BIND_ACTION_OK(cbs, action_ok_stream_configfile);
break;
case MENU_LABEL_RGUI_MENU_THEME_PRESET:
BIND_ACTION_OK(cbs, action_ok_rgui_menu_theme_preset);
break;
#ifdef HAVE_NETWORKING
case MENU_LABEL_UPDATE_LAKKA:
BIND_ACTION_OK(cbs, action_ok_lakka_list);
@ -5882,6 +5909,9 @@ static int menu_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs,
case FILE_TYPE_STREAM_CONFIG:
BIND_ACTION_OK(cbs, action_ok_stream_configfile_load);
break;
case FILE_TYPE_RGUI_THEME_PRESET:
BIND_ACTION_OK(cbs, action_ok_rgui_menu_theme_preset_load);
break;
case FILE_TYPE_REMAP:
BIND_ACTION_OK(cbs, action_ok_remap_file_load);
break;

View File

@ -50,6 +50,8 @@
#include "../../configuration.h"
#include "../../gfx/drivers_font_renderer/bitmap.h"
#include <file/config_file.h>
/* Thumbnail additions */
#include <streams/file_stream.h>
#include "../../tasks/tasks_internal.h"
@ -423,6 +425,8 @@ typedef struct
char *thumbnail_path;
char *thumbnail_playlist;
uint32_t thumbnail_queue_size;
bool show_wallpaper;
char theme_preset_path[PATH_MAX_LENGTH]; /* Must be a fixed length array... */
struct scaler_ctx image_scaler;
} rgui_t;
@ -446,6 +450,24 @@ static thumbnail_t thumbnail = {
{0}
};
/* Identical to thumbnail max width/height, but cannot
* assume this will always be the case... */
#define WALLPAPER_WIDTH 320
#define WALLPAPER_HEIGHT 240
typedef struct
{
bool is_valid;
char *path;
uint16_t data[WALLPAPER_WIDTH * WALLPAPER_HEIGHT];
} wallpaper_t;
static wallpaper_t wallpaper = {
false,
NULL,
{0}
};
static uint16_t *rgui_framebuf_data = NULL;
#if defined(PS2)
@ -559,6 +581,61 @@ static uint16_t argb32_to_rgba4444(uint32_t col)
#endif
static bool request_wallpaper(const char *path)
{
/* Do nothing if current wallpaper path hasn't changed */
if (!string_is_empty(path) && !string_is_empty(wallpaper.path))
{
if (string_is_equal(wallpaper.path, path))
return true;
}
/* 'Reset' current wallpaper */
wallpaper.is_valid = false;
free(wallpaper.path);
wallpaper.path = NULL;
/* Ensure that new path is valid... */
if (!string_is_empty(path))
{
wallpaper.path = strdup(path);
if (filestream_exists(path))
{
/* Unlike thumbnails, we don't worry about queued images
* here - in general, wallpaper is loaded once per session
* and then forgotten, so performance issues are not a concern */
task_push_image_load(wallpaper.path, menu_display_handle_wallpaper_upload, NULL);
return true;
}
}
return false;
}
static void process_wallpaper(rgui_t *rgui, struct texture_image *image)
{
unsigned x, y;
/* Sanity check */
if (!image->pixels || (image->width != WALLPAPER_WIDTH) || (image->height != WALLPAPER_HEIGHT))
return;
/* Copy image to wallpaper buffer, performing pixel format conversion */
for (x = 0; x < WALLPAPER_WIDTH; x++)
{
for (y = 0; y < WALLPAPER_HEIGHT; y++)
{
wallpaper.data[x + (y * WALLPAPER_WIDTH)] =
argb32_to_pixel_platform_format(image->pixels[x + (y * WALLPAPER_WIDTH)]);
}
}
wallpaper.is_valid = true;
/* Tell menu that a display update is required */
rgui->force_redraw = true;
}
static void request_thumbnail(rgui_t *rgui, const char *path)
{
/* Do nothing if current thumbnail path hasn't changed */
@ -758,7 +835,10 @@ static bool rgui_load_image(void *userdata, void *data, enum menu_image_type typ
switch (type)
{
case MENU_IMAGE_WALLPAPER:
/* Add this later... :) */
{
struct texture_image *image = (struct texture_image*)data;
process_wallpaper(rgui, image);
}
break;
case MENU_IMAGE_THUMBNAIL:
{
@ -773,6 +853,28 @@ static bool rgui_load_image(void *userdata, void *data, enum menu_image_type typ
return true;
}
static bool rgui_render_wallpaper(void)
{
size_t fb_pitch;
unsigned fb_width, fb_height;
if (wallpaper.is_valid && rgui_framebuf_data)
{
menu_display_get_fb_size(&fb_width, &fb_height, &fb_pitch);
/* Sanity check */
if ((fb_width != WALLPAPER_WIDTH) || (fb_height != WALLPAPER_HEIGHT) || (fb_pitch != WALLPAPER_WIDTH << 1))
return false;
/* Copy wallpaper to framebuffer */
memcpy(rgui_framebuf_data, wallpaper.data, WALLPAPER_WIDTH * WALLPAPER_HEIGHT * sizeof(uint16_t));
return true;
}
return false;
}
static void rgui_render_thumbnail(void)
{
size_t fb_pitch;
@ -903,20 +1005,103 @@ static const rgui_theme_t *get_theme(rgui_t *rgui)
return &rgui_theme_classic_green;
}
static void load_custom_theme(rgui_t *rgui, rgui_theme_t *theme_colors, const char *theme_path)
{
config_file_t *conf = NULL;
unsigned normal_color, hover_color, title_color,
bg_dark_color, bg_light_color,
border_dark_color, border_light_color;
char wallpaper_file[PATH_MAX_LENGTH];
bool success = false;
wallpaper_file[0] = '\0';
/* Sanity check */
if (string_is_empty(theme_path))
goto end;
if (!filestream_exists(theme_path))
goto end;
/* Open config file */
conf = config_file_new(theme_path);
if (!conf)
goto end;
/* Parse config file */
if(!config_get_hex(conf, "rgui_entry_normal_color", &normal_color))
goto end;
if(!config_get_hex(conf, "rgui_entry_hover_color", &hover_color))
goto end;
if(!config_get_hex(conf, "rgui_title_color", &title_color))
goto end;
if(!config_get_hex(conf, "rgui_bg_dark_color", &bg_dark_color))
goto end;
if(!config_get_hex(conf, "rgui_bg_light_color", &bg_light_color))
goto end;
if(!config_get_hex(conf, "rgui_border_dark_color", &border_dark_color))
goto end;
if(!config_get_hex(conf, "rgui_border_light_color", &border_light_color))
goto end;
config_get_array(conf, "rgui_wallpaper", wallpaper_file, sizeof(wallpaper_file));
success = true;
end:
if (success)
{
theme_colors->normal_color = (uint32_t)normal_color;
theme_colors->hover_color = (uint32_t)hover_color;
theme_colors->title_color = (uint32_t)title_color;
theme_colors->bg_dark_color = (uint32_t)bg_dark_color;
theme_colors->bg_light_color = (uint32_t)bg_light_color;
theme_colors->border_dark_color = (uint32_t)border_dark_color;
theme_colors->border_light_color = (uint32_t)border_light_color;
/* Load wallpaper, if required */
if (!string_is_empty(wallpaper_file))
{
char wallpaper_path[PATH_MAX_LENGTH];
wallpaper_path[0] = '\0';
fill_pathname_resolve_relative(wallpaper_path, theme_path, wallpaper_file, sizeof(wallpaper_path));
rgui->show_wallpaper = request_wallpaper(wallpaper_path);
}
}
else
{
/* Use 'Classic Green' fallback */
theme_colors->normal_color = rgui_theme_classic_green.normal_color;
theme_colors->hover_color = rgui_theme_classic_green.hover_color;
theme_colors->title_color = rgui_theme_classic_green.title_color;
theme_colors->bg_dark_color = rgui_theme_classic_green.bg_dark_color;
theme_colors->bg_light_color = rgui_theme_classic_green.bg_light_color;
theme_colors->border_dark_color = rgui_theme_classic_green.border_dark_color;
theme_colors->border_light_color = rgui_theme_classic_green.border_light_color;
}
if (conf)
config_file_free(conf);
conf = NULL;
}
static void prepare_rgui_colors(rgui_t *rgui, settings_t *settings)
{
rgui_theme_t theme_colors;
rgui->color_theme = settings->uints.menu_rgui_color_theme;
rgui->show_wallpaper = false;
if (rgui->color_theme == RGUI_THEME_CUSTOM)
{
theme_colors.hover_color = settings->uints.menu_entry_hover_color;
theme_colors.normal_color = settings->uints.menu_entry_normal_color;
theme_colors.title_color = settings->uints.menu_title_color;
theme_colors.bg_dark_color = settings->uints.menu_bg_dark_color;
theme_colors.bg_light_color = settings->uints.menu_bg_light_color;
theme_colors.border_dark_color = settings->uints.menu_border_dark_color;
theme_colors.border_light_color = settings->uints.menu_border_light_color;
memcpy(rgui->theme_preset_path, settings->paths.path_rgui_theme_preset, sizeof(rgui->theme_preset_path));
load_custom_theme(rgui, &theme_colors, settings->paths.path_rgui_theme_preset);
}
else
{
@ -936,6 +1121,8 @@ static void prepare_rgui_colors(rgui_t *rgui, settings_t *settings)
rgui->colors.bg_light_color = argb32_to_pixel_platform_format(theme_colors.bg_light_color);
rgui->colors.border_dark_color = argb32_to_pixel_platform_format(theme_colors.border_dark_color);
rgui->colors.border_light_color = argb32_to_pixel_platform_format(theme_colors.border_light_color);
rgui->bg_modified = true;
}
static uint16_t rgui_bg_filler(rgui_t *rgui, unsigned x, unsigned y)
@ -1248,7 +1435,13 @@ static void rgui_frame(void *data, video_frame_info_t *video_info)
if (settings->uints.menu_rgui_color_theme != rgui->color_theme)
{
prepare_rgui_colors(rgui, settings);
rgui->bg_modified = true;
}
else if (settings->uints.menu_rgui_color_theme == RGUI_THEME_CUSTOM)
{
if (string_is_not_equal_fast(settings->paths.path_rgui_theme_preset, rgui->theme_preset_path, sizeof(rgui->theme_preset_path)))
{
prepare_rgui_colors(rgui, settings);
}
}
rgui->frame_count++;
@ -1261,18 +1454,12 @@ static void rgui_render(void *data, bool is_idle)
size_t i, end, fb_pitch, old_start;
unsigned fb_width, fb_height;
int bottom;
char title[255];
char title_buf[255];
char title_msg[64];
char msg[255];
size_t entries_end = 0;
bool msg_force = false;
settings_t *settings = config_get_ptr();
rgui_t *rgui = (rgui_t*)data;
uint64_t frame_count = rgui->frame_count;
msg[0] = title[0] = title_buf[0] = title_msg[0] = '\0';
if (!rgui->force_redraw)
{
msg_force = menu_display_get_msg_force();
@ -1365,7 +1552,18 @@ static void rgui_render(void *data, bool is_idle)
end = ((old_start + RGUI_TERM_HEIGHT(fb_width, fb_height)) <= (entries_end)) ?
old_start + RGUI_TERM_HEIGHT(fb_width, fb_height) : entries_end;
rgui_render_background(rgui);
/* Render wallpaper or 'normal' background */
if (rgui->show_wallpaper && wallpaper.is_valid)
{
/* If rgui_render_wallpaper() fails (can't actually happen...)
* then use 'normal' background fallback */
if (!rgui_render_wallpaper())
rgui_render_background(rgui);
}
else
{
rgui_render_background(rgui);
}
/* If thumbnails are enabled and we are viewing a playlist,
* switch to thumbnail view mode if either current thumbnail
@ -1408,6 +1606,14 @@ static void rgui_render(void *data, bool is_idle)
else
{
/* No thumbnail - render usual text */
char title[255];
char title_buf[255];
char core_title[64];
char core_title_buf[64];
title[0] = title_buf[0] = core_title[0] = core_title_buf[0] = '\0';
/* Need this in two places, so cache here */
unsigned timedate_x = RGUI_TERM_WIDTH(fb_width) * FONT_WIDTH_STRIDE - RGUI_TERM_START_X(fb_width);
menu_entries_get_title(title, sizeof(title));
ticker.s = title_buf;
@ -1418,23 +1624,6 @@ static void rgui_render(void *data, bool is_idle)
menu_animation_ticker(&ticker);
if (menu_entries_ctl(MENU_ENTRIES_CTL_SHOW_BACK, NULL))
{
char back_buf[32];
char back_msg[32];
back_buf[0] = back_msg[0] = '\0';
strlcpy(back_buf, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_BASIC_MENU_CONTROLS_BACK), sizeof(back_buf));
string_to_upper(back_buf);
if (rgui_framebuf_data)
blit_line(
RGUI_TERM_START_X(fb_width),
RGUI_TERM_START_X(fb_width),
back_msg,
rgui->colors.title_color);
}
string_to_upper(title_buf);
if (rgui_framebuf_data)
@ -1445,13 +1634,21 @@ static void rgui_render(void *data, bool is_idle)
title_buf, rgui->colors.title_color);
if (settings->bools.menu_core_enable &&
menu_entries_get_core_title(title_msg, sizeof(title_msg)) == 0)
menu_entries_get_core_title(core_title, sizeof(core_title)) == 0)
{
ticker.s = core_title_buf;
ticker.len = ((timedate_x - RGUI_TERM_START_X(fb_width)) / FONT_WIDTH_STRIDE) - 3;
ticker.idx = frame_count / RGUI_TERM_START_X(fb_width);
ticker.str = core_title;
ticker.selected = true;
menu_animation_ticker(&ticker);
if (rgui_framebuf_data)
blit_line(
RGUI_TERM_START_X(fb_width),
RGUI_TERM_START_X(fb_width) + FONT_WIDTH_STRIDE,
(RGUI_TERM_HEIGHT(fb_width, fb_height) * FONT_HEIGHT_STRIDE) +
RGUI_TERM_START_Y(fb_height) + 2, title_msg, rgui->colors.hover_color);
RGUI_TERM_START_Y(fb_height) + 2, core_title_buf, rgui->colors.hover_color);
}
if (settings->bools.menu_timedate_enable)
@ -1469,7 +1666,7 @@ static void rgui_render(void *data, bool is_idle)
if (rgui_framebuf_data)
blit_line(
RGUI_TERM_WIDTH(fb_width) * FONT_WIDTH_STRIDE - RGUI_TERM_START_X(fb_width),
timedate_x,
(RGUI_TERM_HEIGHT(fb_width, fb_height) * FONT_HEIGHT_STRIDE) +
RGUI_TERM_START_Y(fb_height) + 2, timedate, rgui->colors.hover_color);
}
@ -1546,8 +1743,10 @@ static void rgui_render(void *data, bool is_idle)
if (menu_input_dialog_get_display_kb())
{
char msg[255];
const char *str = menu_input_dialog_get_buffer();
const char *label = menu_input_dialog_get_label_buffer();
msg[0] = '\0';
snprintf(msg, sizeof(msg), "%s\n%s", label, str);
rgui_render_messagebox(rgui, msg);
@ -1599,6 +1798,7 @@ static void *rgui_init(void **userdata, bool video_is_threaded)
*userdata = rgui;
/* Prepare RGUI colors, to improve performance */
rgui->theme_preset_path[0] = '\0';
prepare_rgui_colors(rgui, settings);
/* 4 extra lines to cache the checked background */
@ -1636,7 +1836,7 @@ static void *rgui_init(void **userdata, bool video_is_threaded)
rgui->thumbnail_queue_size = 0;
/* Ensure that we start with thumbnails disabled */
rgui->show_thumbnail = false;
return menu;
error:
@ -1677,6 +1877,9 @@ static void rgui_free(void *data)
if (!string_is_empty(thumbnail.path))
free(thumbnail.path);
if (!string_is_empty(wallpaper.path))
free(wallpaper.path);
}
static void rgui_set_texture(void)

View File

@ -142,7 +142,8 @@ enum
ACTION_OK_DL_PRIVACY_SETTINGS_LIST,
ACTION_OK_DL_MIDI_SETTINGS_LIST,
ACTION_OK_DL_BROWSE_URL_START,
ACTION_OK_DL_CONTENT_SETTINGS
ACTION_OK_DL_CONTENT_SETTINGS,
ACTION_OK_DL_RGUI_MENU_THEME_PRESET
};
/* Function callbacks */

View File

@ -6004,32 +6004,8 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist
PARSE_ONLY_UINT, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_ENTRY_NORMAL_COLOR,
PARSE_ONLY_HEX, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_ENTRY_HOVER_COLOR,
PARSE_ONLY_HEX, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_TITLE_COLOR,
PARSE_ONLY_HEX, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_BG_DARK_COLOR,
PARSE_ONLY_HEX, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_BG_LIGHT_COLOR,
PARSE_ONLY_HEX, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_BORDER_DARK_COLOR,
PARSE_ONLY_HEX, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_BORDER_LIGHT_COLOR,
PARSE_ONLY_HEX, false) == 0)
MENU_ENUM_LABEL_RGUI_MENU_THEME_PRESET,
PARSE_ONLY_PATH, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_DPI_OVERRIDE_ENABLE,
@ -8118,6 +8094,16 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist
free(info->exts);
info->exts = strdup("cfg");
break;
case DISPLAYLIST_RGUI_THEME_PRESETS:
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
filebrowser_clear_type();
info->type_default = FILE_TYPE_RGUI_THEME_PRESET;
load_content = false;
use_filebrowser = true;
if (!string_is_empty(info->exts))
free(info->exts);
info->exts = strdup("cfg");
break;
case DISPLAYLIST_REMAP_FILES:
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
filebrowser_clear_type();

View File

@ -105,6 +105,7 @@ enum menu_displaylist_ctl_state
DISPLAYLIST_REMAP_FILES,
DISPLAYLIST_RECORD_CONFIG_FILES,
DISPLAYLIST_STREAM_CONFIG_FILES,
DISPLAYLIST_RGUI_THEME_PRESETS,
DISPLAYLIST_CONFIG_FILES,
DISPLAYLIST_CONTENT_HISTORY,
DISPLAYLIST_IMAGES,

View File

@ -7966,103 +7966,19 @@ static bool setting_append_list(
&setting_get_string_representation_uint_rgui_menu_color_theme;
menu_settings_list_current_add_range(list, list_info, 0, RGUI_THEME_LAST-1, 1, true, true);
CONFIG_HEX(
CONFIG_PATH(
list, list_info,
&settings->uints.menu_entry_normal_color,
MENU_ENUM_LABEL_ENTRY_NORMAL_COLOR,
MENU_ENUM_LABEL_VALUE_ENTRY_NORMAL_COLOR,
menu_entry_normal_color,
settings->paths.path_rgui_theme_preset,
sizeof(settings->paths.path_rgui_theme_preset),
MENU_ENUM_LABEL_RGUI_MENU_THEME_PRESET,
MENU_ENUM_LABEL_VALUE_RGUI_MENU_THEME_PRESET,
settings->paths.directory_assets,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ALLOW_INPUT);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ADVANCED);
CONFIG_HEX(
list, list_info,
&settings->uints.menu_entry_hover_color,
MENU_ENUM_LABEL_ENTRY_HOVER_COLOR,
MENU_ENUM_LABEL_VALUE_ENTRY_HOVER_COLOR,
menu_entry_hover_color,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ALLOW_INPUT);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ADVANCED);
CONFIG_HEX(
list, list_info,
&settings->uints.menu_title_color,
MENU_ENUM_LABEL_TITLE_COLOR,
MENU_ENUM_LABEL_VALUE_TITLE_COLOR,
menu_title_color,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ALLOW_INPUT);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ADVANCED);
CONFIG_HEX(
list, list_info,
&settings->uints.menu_bg_dark_color,
MENU_ENUM_LABEL_BG_DARK_COLOR,
MENU_ENUM_LABEL_VALUE_BG_DARK_COLOR,
menu_bg_dark_color,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ALLOW_INPUT);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ADVANCED);
CONFIG_HEX(
list, list_info,
&settings->uints.menu_bg_light_color,
MENU_ENUM_LABEL_BG_LIGHT_COLOR,
MENU_ENUM_LABEL_VALUE_BG_LIGHT_COLOR,
menu_bg_light_color,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ALLOW_INPUT);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ADVANCED);
CONFIG_HEX(
list, list_info,
&settings->uints.menu_border_dark_color,
MENU_ENUM_LABEL_BORDER_DARK_COLOR,
MENU_ENUM_LABEL_VALUE_BORDER_DARK_COLOR,
menu_border_dark_color,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ALLOW_INPUT);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ADVANCED);
CONFIG_HEX(
list, list_info,
&settings->uints.menu_border_light_color,
MENU_ENUM_LABEL_BORDER_LIGHT_COLOR,
MENU_ENUM_LABEL_VALUE_BORDER_LIGHT_COLOR,
menu_border_light_color,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ALLOW_INPUT);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ADVANCED);
menu_settings_list_current_add_values(list, list_info, "cfg");
}
if (string_is_equal(settings->arrays.menu_driver, "xmb"))

View File

@ -93,6 +93,7 @@ enum msg_file_type
FILE_TYPE_SHA1,
FILE_TYPE_MD5,
FILE_TYPE_CRC,
FILE_TYPE_RGUI_THEME_PRESET,
FILE_TYPE_WEBM,
FILE_TYPE_F4F,
@ -858,8 +859,6 @@ enum msg_hash_enums
MENU_LABEL(NAVIGATION_WRAPAROUND),
MENU_LABEL(SHOW_ADVANCED_SETTINGS),
MENU_LABEL(THREADED_DATA_RUNLOOP_ENABLE),
MENU_LABEL(ENTRY_NORMAL_COLOR),
MENU_LABEL(ENTRY_HOVER_COLOR),
MENU_LABEL(XMB_ALPHA_FACTOR),
MENU_LABEL(XMB_SCALE_FACTOR),
MENU_LABEL(MENU_FONT_COLOR_RED),
@ -892,6 +891,7 @@ enum msg_hash_enums
MENU_LABEL(TIMEDATE_STYLE),
MENU_LABEL(BATTERY_LEVEL_ENABLE),
MENU_LABEL(RGUI_MENU_COLOR_THEME),
MENU_LABEL(RGUI_MENU_THEME_PRESET),
MENU_LABEL(XMB_MENU_COLOR_THEME),
MENU_LABEL(OZONE_MENU_COLOR_THEME),
MENU_LABEL(MATERIALUI_MENU_COLOR_THEME),
@ -1358,11 +1358,6 @@ enum msg_hash_enums
MENU_LABEL(CHEAT_COPY_MATCH),
MENU_LABEL(CHEAT_DELETE_MATCH),
MENU_LABEL(SCREEN_RESOLUTION),
MENU_LABEL(TITLE_COLOR),
MENU_LABEL(BG_DARK_COLOR),
MENU_LABEL(BG_LIGHT_COLOR),
MENU_LABEL(BORDER_DARK_COLOR),
MENU_LABEL(BORDER_LIGHT_COLOR),
MENU_LABEL(SAVESTATE_AUTO_INDEX),
MENU_LABEL(SAVESTATE_AUTO_SAVE),
MENU_LABEL(SAVESTATE_AUTO_LOAD),
@ -2370,6 +2365,7 @@ enum msg_hash_enums
#define MENU_LABEL_MENU_WALLPAPER 0x3b84de01U
#define MENU_LABEL_MENU_SETTINGS 0x61e4544bU
#define MENU_LABEL_RGUI_MENU_THEME_PRESET 0x983AD734U
/* Directory settings */