diff --git a/source/cfg.c b/source/cfg.c index fc8b1ac2..af55286f 100644 --- a/source/cfg.c +++ b/source/cfg.c @@ -1141,6 +1141,40 @@ void CFG_Load(int argc, char **argv) cfg_load_games(); +// cfg_parsearg(argc, argv); +} +void CFG_Load1() +{ + char pathname[200]; +// bool ret = false; + + //set app path +// chdir_app(argv[0]); + + CFG_Default(-1); // set defaults non forced + + snprintf(pathname, sizeof(pathname), "SD:/config/global_settings.cfg"); + + cfg_parsefile(pathname, &widescreen_set); //first set widescreen + cfg_parsefile(pathname, &cfg_set); //then set config and layout options + + snprintf(pathname, sizeof(pathname), "%stheme.txt", CFG.theme_path); + cfg_parsefile(pathname, &theme_set); //finally set console information + +// if (!ret) +// { +// cfg_parsefile("SD:/config.txt", &widescreen_set); +// cfg_parsefile("SD:/config.txt", &cfg_set); +// cfg_parsefile("SD:/config.txt", &console_set); +// } + + snprintf(pathname, sizeof(pathname), "SD:/config/titles.txt"); + cfg_parsetitlefile(pathname, &title_set); + + // load per-game settings + cfg_load_games(); + + // cfg_parsearg(argc, argv); } diff --git a/source/cfg.h b/source/cfg.h index 9ee27d5e..fe637e9e 100644 --- a/source/cfg.h +++ b/source/cfg.h @@ -153,6 +153,7 @@ struct Game_CFG void CFG_Default(int widescreen); // -1 = non forced mode void CFG_Load(int argc, char **argv); +void CFG_Load1(); struct Game_CFG* CFG_get_game_opt(u8 *id); bool CFG_save_game_opt(u8 *id); bool CFG_forget_game_opt(u8 *id); diff --git a/source/main.cpp b/source/main.cpp index 71e7ccfb..d95657ca 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -46,6 +46,7 @@ FreeTypeGX *fontClock=0; int ExitRequested = 0; bool netcheck = false; + /*Networking - Forsaekn*/ int Net_Init(char *ip){ @@ -108,6 +109,8 @@ int main(int argc, char *argv[]) { + + s32 ret2; __io_wiisd.startup(); diff --git a/source/menu.cpp b/source/menu.cpp index b7afda90..44503ca6 100644 --- a/source/menu.cpp +++ b/source/menu.cpp @@ -49,6 +49,11 @@ static GuiImageData * cover = NULL; //char GamesHDD[320][14]; +static GuiButton * settingsBtn = NULL; +static GuiButton * homeBtn = NULL; +static GuiButton * poweroffBtn = NULL; +static GuiButton * installBtn = NULL; + static struct discHdr *gameList = NULL; static GuiImageData * pointer[4]; static GuiImage * bgImg = NULL; @@ -3748,6 +3753,46 @@ static int MenuSettings() strncpy(CFG.theme_path, entered, sizeof(CFG.theme_path)); WindowPrompt("Themepath Changed",0,"OK",0,0,0); cfg_save_global(); + mainWindow->Remove(bgImg); + CFG_Load1(); + CFG_LoadGlobal(); + menu = MENU_SETTINGS; + #ifdef HW_RVL + snprintf(imgPath, sizeof(imgPath), "%splayer1_point.png", CFG.theme_path); + pointer[0] = new GuiImageData(imgPath, player1_point_png); + snprintf(imgPath, sizeof(imgPath), "%splayer2_point.png", CFG.theme_path); + pointer[1] = new GuiImageData(imgPath, player2_point_png); + snprintf(imgPath, sizeof(imgPath), "%splayer3_point.png", CFG.theme_path); + pointer[2] = new GuiImageData(imgPath, player3_point_png); + snprintf(imgPath, sizeof(imgPath), "%splayer4_point.png", CFG.theme_path); + pointer[3] = new GuiImageData(imgPath, player4_point_png); + #endif + if (CFG.widescreen) + snprintf(imgPath, sizeof(imgPath), "%swbackground.png", CFG.theme_path); + else + snprintf(imgPath, sizeof(imgPath), "%sbackground.png", CFG.theme_path); + + background = new GuiImageData(imgPath, CFG.widescreen? wbackground_png : background_png); + + bgImg = new GuiImage(background); + mainWindow->Append(bgImg); + mainWindow->Append(&w); + + w.Append(&settingsbackgroundbtn); + w.Append(&titleTxt); + w.Append(&backBtn); + w.Append(&lockBtn); + w.Append(btnLogo); + + mainWindow->Append(&optionBrowser2); + mainWindow->Append(&page1Btn); + mainWindow->Append(&page2Btn); + w.Append(&backBtn); + w.Append(&lockBtn); + //installBtn->SetPosition(THEME.install_x, THEME.install_y); + //poweroffBtn->SetPosition(THEME.power_x, THEME.power_y); + ////homeBtn->SetPosition(THEME.home_x, THEME.home_y); + //settingsBtn->SetPosition(THEME.setting_x, THEME.setting_y); } } else