Because Action needs a big A, added Capitalization to the Genre on Game Info Page. Title language should refresh properly when the config for a game was deleted using the Settings menu (to delete the config, use the "default" option, without saving)

This commit is contained in:
lustar.mii 2009-06-14 11:47:21 +00:00
parent 71e9fe1169
commit 51afe469cc
4 changed files with 21 additions and 55 deletions

View File

@ -593,10 +593,14 @@ showGameInfo(char *ID, u8 *headerID)
int wifiY=0;
for (int i=1;i<=gameinfo.wifiCnt;i++)
{
snprintf(linebuf, sizeof(linebuf), "%s",gameinfo.wififeatures[i]);
wifiTxt[i] = new GuiText(linebuf, 16, (GXColor){0,0,0, 255});
wifiTxt[i]->SetAlignment(ALIGN_LEFT, ALIGN_TOP); wifiTxt[i]->SetPosition(215,200+wifiY); wifiY-=(20 * newline);
gameinfoWindow.Append(wifiTxt[i]);
if (strcmp(gameinfo.wififeatures[i],"Nintendods") == 0) {
snprintf(linebuf, sizeof(linebuf), "Nintendo DS");
} else {
snprintf(linebuf, sizeof(linebuf), "%s",gameinfo.wififeatures[i]);
}
wifiTxt[i] = new GuiText(linebuf, 16, (GXColor){0,0,0, 255});
wifiTxt[i]->SetAlignment(ALIGN_LEFT, ALIGN_TOP); wifiTxt[i]->SetPosition(215,200+wifiY); wifiY-=(20 * newline);
gameinfoWindow.Append(wifiTxt[i]);
}
if (strcmp(gameinfo.wififeatures[1],"") != 0){

View File

@ -1884,13 +1884,18 @@ int GameSettings(struct discHdr * header)
}
parentalcontrolChoice = 0;
CFG_forget_game_opt(header->id);
// if default language is different than language from main settings, reload titles
int opt_langnew = 0;
opt_langnew = Settings.language;
if (Settings.titlesOverride==1 && opt_lang != opt_langnew)
CFG_LoadXml(true, true, false); // open file, reload titles, do not keep in memory
// titles are refreshed in menu.cpp as soon as this function returns
}
break;
}
if(saveBtn.GetState() == STATE_CLICKED)
{
// if(isSdInserted()) {
if(isInserted(bootDevice)) {
if (CFG_save_game_opt(header->id))
@ -1899,10 +1904,9 @@ int GameSettings(struct discHdr * header)
int opt_langnew = 0;
game_cfg = CFG_get_game_opt(header->id);
if (game_cfg) opt_langnew = game_cfg->language;
if (Settings.titlesOverride==1 && opt_lang != opt_langnew) {
if (Settings.titlesOverride==1 && opt_lang != opt_langnew)
CFG_LoadXml(true, true, false); // open file, reload titles, do not keep in memory
}
// titles are refreshed in menu.cpp as soon as this function returns
// titles are refreshed in menu.cpp as soon as this function returns
WindowPrompt(LANGUAGE.SuccessfullySaved, 0, LANGUAGE.ok, 0,0,0);
}
else

View File

@ -532,16 +532,18 @@ bool LoadGameInfoFromXML(char* gameid, char* langtxt)
char *splitresult;
splitresult = strtok(genretxt, delimgenre);
if (splitresult != NULL) {
trim_inplace(splitresult);
trimcopy(splitresult,splitresult,strlen(splitresult)+1);
strcpy(gameinfo.genresplit[1],splitresult);
gameinfo.genresplit[1][0] = toupper(gameinfo.genresplit[1][0]);
int incr = 1;
while (splitresult != NULL)
{
splitresult = strtok(NULL, delimgenre);
if (splitresult != NULL && strcmp(splitresult,"")!=0) {
++incr;
trim_inplace(splitresult);
trimcopy(splitresult,splitresult,strlen(splitresult)+1);
strcpy(gameinfo.genresplit[incr],splitresult);
gameinfo.genresplit[incr][0] = toupper(gameinfo.genresplit[incr][0]);
}
}
}
@ -675,44 +677,3 @@ void PrintGameInfo(bool showfullinfo)
/* trim leading and trailing whitespace functions, by calv */
void trim_copy(char *input, char *output)
{
char *end = output;
char c;
while(*input && isspace(*input))
++input;
while(*input)
{
c = *(output++) = *(input++);
if( !isspace(c) )
end = output;
}
*end = 0;
}
void trim_inplace(char *s)
{
trim_copy(s, s);
}
char *trim_nocopy(char *s)
{
char *start = s;
while(*start && isspace(*start))
++start;
char *i = start;
char *end = start;
while(*i)
{
if( !isspace(*(i++)) )
end = i;
}
*end = 0;
return start;
}

View File

@ -62,10 +62,7 @@ void PrintGameInfo(bool showfullinfo);
void FreeXMLMemory();
void title_set(char *id, char *title);
void trim_copy(char *input, char *output);
void trim_inplace(char *s);
char *trim_nocopy(char *s);
char* trimcopy(char *dest, char *src, int size);
#ifdef __cplusplus
}