From ce921b5bb9f6aba51fb1be80bde73281bf592465 Mon Sep 17 00:00:00 2001 From: hungyip Date: Tue, 5 May 2009 02:56:01 +0000 Subject: [PATCH] 1. Added custom images for game setting screen (you could use a different background for game settings now. You need to have gamesettings_background.png and bg_options_gamesettings.png 2. Added custom game list color (gametext_color = r, g, b) --- source/cfg.c | 12 ++++++++++++ source/cfg.h | 3 +++ source/libwiigui/gui_gamebrowser.cpp | 4 ++-- source/menu.cpp | 4 ++-- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/source/cfg.c b/source/cfg.c index 79523894..bdb64f21 100644 --- a/source/cfg.c +++ b/source/cfg.c @@ -247,6 +247,9 @@ void CFG_Default(int widescreen) // -1 = non forced Mode THEME.clockAlign = CFG_ALIGN_CENTRE; THEME.sdcard_x = 160; THEME.sdcard_y = 390; + THEME.gameText_r = 0; + THEME.gameText_g = 0; + THEME.gameText_b = 0; } @@ -582,6 +585,15 @@ void theme_set(char *name, char *val) THEME.info_b = z; } } + + else if (strcmp(cfg_name, "gametext_color") == 0) { + short x,y,z; + if (sscanf(val, "%hd,%hd, %hd", &x, &y, &z) == 3) { + THEME.gameText_r = x; + THEME.gameText_g = y; + THEME.gameText_b = z; + } + } cfg_bool("show_id", &THEME.showID); cfg_bool("show_tooltip", &THEME.showToolTip); diff --git a/source/cfg.h b/source/cfg.h index e6144fe7..20ec8da1 100644 --- a/source/cfg.h +++ b/source/cfg.h @@ -119,6 +119,9 @@ struct THEME short clockAlign; short sdcard_x; short sdcard_y; + short gameText_r; + short gameText_g; + short gameText_b; }; extern struct CFG CFG; diff --git a/source/libwiigui/gui_gamebrowser.cpp b/source/libwiigui/gui_gamebrowser.cpp index 48ae2011..f8278a45 100644 --- a/source/libwiigui/gui_gamebrowser.cpp +++ b/source/libwiigui/gui_gamebrowser.cpp @@ -11,7 +11,7 @@ #include #include "gui_gamebrowser.h" -#include "cfg.h" +#include "../cfg.h" #define GAMESELECTSIZE 30 extern const int vol; @@ -129,7 +129,7 @@ GuiGameBrowser::GuiGameBrowser(int w, int h, struct discHdr * l, int gameCnt, co strncat(buffer, "...", 3); } - gameTxt[i] = new GuiText(buffer, 20, (GXColor){0, 0, 0, 0xff}); + gameTxt[i] = new GuiText(buffer, 20, (GXColor){THEME.gameText_r, THEME.gameText_g, THEME.gameText_b, 0xff}); gameTxt[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); gameTxt[i]->SetPosition(24,0); diff --git a/source/menu.cpp b/source/menu.cpp index c78bb90e..3adbbe7a 100644 --- a/source/menu.cpp +++ b/source/menu.cpp @@ -3597,7 +3597,7 @@ int GameSettings(struct discHdr * header) char imgPath[100]; GuiImageData btnOutline(settings_menu_button_png); - snprintf(imgPath, sizeof(imgPath), "%ssettings_background.png", CFG.theme_path); + snprintf(imgPath, sizeof(imgPath), "%sgamesettings_background.png", CFG.theme_path); GuiImageData settingsbg(imgPath, settings_background_png); GuiTrigger trigA; @@ -3657,7 +3657,7 @@ int GameSettings(struct discHdr * header) deleteBtn.SetTrigger(&trigA); deleteBtn.SetEffectGrow(); - GuiCustomOptionBrowser optionBrowser3(396, 280, &options3, CFG.theme_path, "bg_options_settings", bg_options_settings_png, 0); + GuiCustomOptionBrowser optionBrowser3(396, 280, &options3, CFG.theme_path, "bg_options_gamesettings", bg_options_settings_png, 0); optionBrowser3.SetPosition(0, 90); optionBrowser3.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); optionBrowser3.SetCol2Position(150);