*Some fixes.

*Instant change of Language now
This commit is contained in:
dimok321 2009-05-16 19:12:36 +00:00
parent 5a535a61a6
commit 250fe45e81
5 changed files with 49 additions and 88 deletions

View File

@ -7,10 +7,7 @@
#include <ogcsys.h>
#include "cfg.h"
#include "language.h"
//#include "language.c"
extern void language_set();
extern void lang_default();
extern char* strcopy();
struct SSettings Settings;
//struct SSettings2 Settings2;
@ -1145,7 +1142,7 @@ bool CFG_forget_game_opt(u8 *id)
return cfg_save_games();
}
void CFG_Load(int argc, char **argv)
void CFG_Load()
{
char pathname[200];
// bool ret = false;
@ -1179,46 +1176,6 @@ void CFG_Load(int argc, char **argv)
// load per-game settings
cfg_load_games();
// cfg_parsearg(argc, argv);
}
void CFG_ReLoad()
{
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
snprintf(pathname, sizeof(pathname), "%slanguage.txt",CFG.language_path);
cfg_parsefile(pathname, &language_set);
// 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();
lang_default();
// cfg_parsearg(argc, argv);
}

View File

@ -159,8 +159,7 @@ struct Game_CFG
void CFG_Default(int widescreen); // -1 = non forced mode
void CFG_Load(int argc, char **argv);
void CFG_ReLoad();
void CFG_Load();
void lang_defualt();
struct Game_CFG* CFG_get_game_opt(u8 *id);
bool CFG_save_game_opt(u8 *id);

View File

@ -12,18 +12,18 @@ extern "C"
struct LANGUAGE
{
char t3Covers[10];
char AppLanguage[10];
char t3Covers[20];
char AppLanguage[20];
char Areyousure[15];
char AutoPatch[15];
char Back[10];
char Back[15];
char BacktoHBCorWiiMenu[25];
char BacktoLoader[20];
char BacktoWiiMenu[20];
char BootStandard[20];
char Both[8];
char Cantcreatedirectory[25];
char Cancel[10];
char Cancel[20];
char Cantbeformated[30];
char Cantdelete[25];
char ClicktoDownloadCovers[30];
@ -115,10 +115,10 @@ struct LANGUAGE
char Notenoughfreespace[50];
char notset[30];
char of[10];
char OFF[10];
char OFF[15];
char OfficialSite[30];
char ok[8];
char ON[10];
char ON[15];
char Parentalcontrol[25];
char Partition[20];
char Password[20];
@ -126,7 +126,7 @@ struct LANGUAGE
char Passwordhasbeenchanged[50];
char Passwordchange[30];
char PowerofftheWii[30];
char Prev[10];
char Prev[20];
char PromptsButtons[30];
char ReloadSD[20];
char RenameGameonWBFS[30];
@ -144,7 +144,7 @@ struct LANGUAGE
char secondsleft[20];
char SelectthePartition[25];
char youwanttoformat[20];
char settings[15];
char settings[25];
char ShutdowntoIdle[25];
char ShutdownSystem[25];
char Success[15];
@ -155,10 +155,10 @@ struct LANGUAGE
char ThemePath[20];
char ThemepathChanged[30];
char Themepathchange[30];
char Try[10];
char Try[20];
char Tooltips[15];
char Timeleft[15];
char Unlock[10];
char Unlock[20];
char Uninstall[15];
char USBLoaderisprotected[40];
char USBDevicenotfound[40];
@ -170,7 +170,7 @@ struct LANGUAGE
char WidescreenFix[40];
char WiiMenu[15];
char WrongPassword[30];
char Yes[10];
char Yes[20];
char YoudonthavecIOS[30];
char Japanese[20];
char German[20];
@ -184,9 +184,12 @@ struct LANGUAGE
char Korean[20];
};
extern struct LANGUAGE LANGUAGE;
char* strcopy(char *dest, char *src, int size);
void lang_default();
void language_set(char *name, char *val);
#ifdef __cplusplus
}
#endif

View File

@ -31,7 +31,7 @@
#include "video2.h"
#include "wpad.h"
#include "cfg.h"
#include "language.c"
#include "language.h"
/* Constants */
@ -111,7 +111,7 @@ main(int argc, char *argv[])
SDCard_Init();
lang_default();
CFG_Load(argc, argv);
CFG_Load();
DefaultSettings();

View File

@ -3943,7 +3943,7 @@ static int MenuSettings()
}
/////load new theme//////////////
mainWindow->Remove(bgImg);
CFG_ReLoad();
CFG_Load();
CFG_LoadGlobal();
menu = MENU_SETTINGS;
#ifdef HW_RVL
@ -4044,9 +4044,11 @@ static int MenuSettings()
{ strncpy(CFG.language_path, entered, sizeof(CFG.language_path));
if(isSdInserted() == 1) {
cfg_save_global();
//CFG_ReLoad();
//CFG_LoadGlobal();
CFG_ReLoad();
lang_default();
CFG_Load();
menu = MENU_SETTINGS;
pageToDisplay = 0;
} else {
WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0);
}