mirror of
https://github.com/wiidev/usbloadergx.git
synced 2025-01-25 18:01:12 +01:00
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:
parent
71e9fe1169
commit
51afe469cc
@ -593,7 +593,11 @@ showGameInfo(char *ID, u8 *headerID)
|
|||||||
int wifiY=0;
|
int wifiY=0;
|
||||||
for (int i=1;i<=gameinfo.wifiCnt;i++)
|
for (int i=1;i<=gameinfo.wifiCnt;i++)
|
||||||
{
|
{
|
||||||
|
if (strcmp(gameinfo.wififeatures[i],"Nintendods") == 0) {
|
||||||
|
snprintf(linebuf, sizeof(linebuf), "Nintendo DS");
|
||||||
|
} else {
|
||||||
snprintf(linebuf, sizeof(linebuf), "%s",gameinfo.wififeatures[i]);
|
snprintf(linebuf, sizeof(linebuf), "%s",gameinfo.wififeatures[i]);
|
||||||
|
}
|
||||||
wifiTxt[i] = new GuiText(linebuf, 16, (GXColor){0,0,0, 255});
|
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);
|
wifiTxt[i]->SetAlignment(ALIGN_LEFT, ALIGN_TOP); wifiTxt[i]->SetPosition(215,200+wifiY); wifiY-=(20 * newline);
|
||||||
gameinfoWindow.Append(wifiTxt[i]);
|
gameinfoWindow.Append(wifiTxt[i]);
|
||||||
|
@ -1884,13 +1884,18 @@ int GameSettings(struct discHdr * header)
|
|||||||
}
|
}
|
||||||
parentalcontrolChoice = 0;
|
parentalcontrolChoice = 0;
|
||||||
CFG_forget_game_opt(header->id);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(saveBtn.GetState() == STATE_CLICKED)
|
if(saveBtn.GetState() == STATE_CLICKED)
|
||||||
{
|
{
|
||||||
|
|
||||||
// if(isSdInserted()) {
|
// if(isSdInserted()) {
|
||||||
if(isInserted(bootDevice)) {
|
if(isInserted(bootDevice)) {
|
||||||
if (CFG_save_game_opt(header->id))
|
if (CFG_save_game_opt(header->id))
|
||||||
@ -1899,9 +1904,8 @@ int GameSettings(struct discHdr * header)
|
|||||||
int opt_langnew = 0;
|
int opt_langnew = 0;
|
||||||
game_cfg = CFG_get_game_opt(header->id);
|
game_cfg = CFG_get_game_opt(header->id);
|
||||||
if (game_cfg) opt_langnew = game_cfg->language;
|
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
|
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);
|
WindowPrompt(LANGUAGE.SuccessfullySaved, 0, LANGUAGE.ok, 0,0,0);
|
||||||
}
|
}
|
||||||
|
@ -532,16 +532,18 @@ bool LoadGameInfoFromXML(char* gameid, char* langtxt)
|
|||||||
char *splitresult;
|
char *splitresult;
|
||||||
splitresult = strtok(genretxt, delimgenre);
|
splitresult = strtok(genretxt, delimgenre);
|
||||||
if (splitresult != NULL) {
|
if (splitresult != NULL) {
|
||||||
trim_inplace(splitresult);
|
trimcopy(splitresult,splitresult,strlen(splitresult)+1);
|
||||||
strcpy(gameinfo.genresplit[1],splitresult);
|
strcpy(gameinfo.genresplit[1],splitresult);
|
||||||
|
gameinfo.genresplit[1][0] = toupper(gameinfo.genresplit[1][0]);
|
||||||
int incr = 1;
|
int incr = 1;
|
||||||
while (splitresult != NULL)
|
while (splitresult != NULL)
|
||||||
{
|
{
|
||||||
splitresult = strtok(NULL, delimgenre);
|
splitresult = strtok(NULL, delimgenre);
|
||||||
if (splitresult != NULL && strcmp(splitresult,"")!=0) {
|
if (splitresult != NULL && strcmp(splitresult,"")!=0) {
|
||||||
++incr;
|
++incr;
|
||||||
trim_inplace(splitresult);
|
trimcopy(splitresult,splitresult,strlen(splitresult)+1);
|
||||||
strcpy(gameinfo.genresplit[incr],splitresult);
|
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -62,10 +62,7 @@ void PrintGameInfo(bool showfullinfo);
|
|||||||
void FreeXMLMemory();
|
void FreeXMLMemory();
|
||||||
|
|
||||||
void title_set(char *id, char *title);
|
void title_set(char *id, char *title);
|
||||||
|
char* trimcopy(char *dest, char *src, int size);
|
||||||
void trim_copy(char *input, char *output);
|
|
||||||
void trim_inplace(char *s);
|
|
||||||
char *trim_nocopy(char *s);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user