Added titles reloading when database titles are disabled. Fixed Germanic lapsus clavis of r690.

This commit is contained in:
lustar.mii 2009-08-02 13:56:01 +00:00
parent d4a06f006e
commit 7ca68b46b8
4 changed files with 25 additions and 13 deletions

File diff suppressed because one or more lines are too long

View File

@ -22,8 +22,9 @@
/*** Extern functions ***/ /*** Extern functions ***/
extern void ResumeGui(); extern void ResumeGui();
extern void HaltGui(); extern void HaltGui();
extern bool OpenXMLDatabase(char* xmlfilepath, char* argdblang, bool argJPtoEN, bool openfile, bool loadtitles, bool keepopen); extern bool
extern void title_set(char *id, char *title); Database(char* xmlfilepath, char* argdblang, bool argJPtoEN, bool openfile, bool loadtitles, bool keepopen);
extern void titles_default();
/*** Extern variables ***/ /*** Extern variables ***/
extern GuiWindow * mainWindow; extern GuiWindow * mainWindow;
@ -33,9 +34,6 @@ extern GuiImageData * pointer[4];
extern GuiImageData * background; extern GuiImageData * background;
extern u8 shutdown; extern u8 shutdown;
extern u8 reset; extern u8 reset;
extern struct discHdr * gameList;
extern u32 gameCnt;
/**************************************************************************** /****************************************************************************
* MenuSettings * MenuSettings
@ -1698,6 +1696,10 @@ int MenuSettings() {
if (strcmp(opt_lang,opt_langnew) || (opt_override != opt_overridenew && Settings.titlesOverride==1)) { if (strcmp(opt_lang,opt_langnew) || (opt_override != opt_overridenew && Settings.titlesOverride==1)) {
OpenXMLDatabase(Settings.titlestxt_path, Settings.db_language, Settings.db_JPtoEN, false, Settings.titlesOverride==1?true:false, true); // open file, reload titles, keep in memory OpenXMLDatabase(Settings.titlestxt_path, Settings.db_language, Settings.db_JPtoEN, false, Settings.titlesOverride==1?true:false, true); // open file, reload titles, keep in memory
} }
// disable titles from database
if (opt_override != opt_overridenew && Settings.titlesOverride==0) {
titles_default();
}
HaltGui(); HaltGui();

View File

@ -365,6 +365,15 @@ void title_set(char *id, char *title) {
} }
} }
void titles_default() {
int i;
for (i=0; i<num_title; i++) {
memcpy(cfg_title[i].id, "", 4);
cfg_title[i].id[4] = 0;
strcopy(cfg_title[i].title, "", TITLE_MAX);
}
}
u8 cfg_get_block(u8 *id) { u8 cfg_get_block(u8 *id) {
int i; int i;
for (i=0; i<num_control; i++) { for (i=0; i<num_control; i++) {
@ -1679,14 +1688,14 @@ void CFG_Load(void) {
int mainlangid = -1; int mainlangid = -1;
int i; int i;
if(strcmp("notset", Settings.language_path)) { if(strcmp("notset", Settings.language_path)) {
for (i=0; map_language[i].name != NULL; i++) { for (i=0; map_language[i].name != NULL; i++) {
if (strstr(languagefile, map_language[i].name) != NULL) { if (strstr(languagefile, map_language[i].name) != NULL) {
mainlangid = i - 1; // - 1 because CONF_LANG starts at 0 mainlangid = i - 1; // - 1 because CONF_LANG starts at 0
break; break;
}
} }
}
} else { } else {
mainlangid = 2; mainlangid = wiilang;
} }
GetLanguageToLangCode(&mainlangid, Settings.db_language); GetLanguageToLangCode(&mainlangid, Settings.db_language);

View File

@ -374,6 +374,7 @@ extern "C" {
char *get_title(struct discHdr *header); char *get_title(struct discHdr *header);
char *cfg_get_title(u8 *id) ; char *cfg_get_title(u8 *id) ;
void title_set(char *id, char *title); void title_set(char *id, char *title);
void titles_default();
u8 get_block(struct discHdr *header); u8 get_block(struct discHdr *header);
void CFG_Cleanup(void); void CFG_Cleanup(void);