mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-12-19 00:11:55 +01:00
auto add / if missing from path ends. add stuff to create stat/favorite file. add option to use 12rh clock.(not tested but i'll know in 12 hours if it works)
This commit is contained in:
parent
d7350ff386
commit
2dc38a8354
118
source/cfg.c
118
source/cfg.c
@ -44,6 +44,7 @@ struct CFG CFG;
|
||||
struct THEME THEME;
|
||||
u8 ocarinaChoice = 0;
|
||||
u8 videoChoice = 0;
|
||||
u8 faveChoice = no;
|
||||
u8 languageChoice = 0;
|
||||
u8 viChoice = 0;
|
||||
u8 iosChoice = 0;
|
||||
@ -52,6 +53,8 @@ u8 xflip = 0;
|
||||
u8 qboot = 0;
|
||||
u8 wsprompt = 0;
|
||||
u8 keyset = 0;
|
||||
u8 favorite = 0;
|
||||
u8 count = 0;
|
||||
|
||||
#define TITLE_MAX 65
|
||||
|
||||
@ -67,8 +70,11 @@ int num_title = 0; //number of titles
|
||||
struct ID_Title *cfg_title = NULL;
|
||||
|
||||
#define MAX_SAVED_GAMES 1000
|
||||
#define MAX_SAVED_GAME_NUM 1000
|
||||
int num_saved_games = 0;
|
||||
int num_saved_game_num = 0;
|
||||
struct Game_CFG cfg_game[MAX_SAVED_GAMES];
|
||||
struct Game_NUM cfg_game_num[MAX_SAVED_GAME_NUM];
|
||||
|
||||
|
||||
/* For Mapping */
|
||||
@ -987,6 +993,26 @@ void cfg_set_game_opt(struct Game_CFG *game, u8 *id)
|
||||
game->parentalcontrol = parentalcontrolChoice;
|
||||
}
|
||||
|
||||
struct Game_NUM* cfg_get_game_num(u8 *id)
|
||||
{
|
||||
struct Game_NUM *game = CFG_get_game_num(id);
|
||||
if (game) return game;
|
||||
if (num_saved_game_num >= MAX_SAVED_GAME_NUM) return NULL;
|
||||
game = &cfg_game_num[num_saved_game_num];
|
||||
num_saved_game_num++;
|
||||
return game;
|
||||
}
|
||||
|
||||
// current options to game
|
||||
void cfg_set_game_num(struct Game_NUM *game, u8 *id)
|
||||
{
|
||||
strncpy((char*)game->id, (char*)id, 6);
|
||||
game->id[6] = 0;
|
||||
game->favorite = favorite;
|
||||
game->count = count;
|
||||
}
|
||||
|
||||
|
||||
bool cfg_save_global()// save global settings
|
||||
{
|
||||
struct stat st;
|
||||
@ -1103,12 +1129,57 @@ void game_set(char *name, char *val)
|
||||
if (np) p = np + 1; else p = NULL;
|
||||
}
|
||||
}
|
||||
void game_set_num(char *name, char *val)
|
||||
{
|
||||
u8 id[8];
|
||||
struct Game_NUM *game;
|
||||
if (strncmp(name, "game:", 5) != 0) return;
|
||||
trimcopy((char*)id, name+5, sizeof(id));
|
||||
game = cfg_get_game_num(id);
|
||||
|
||||
cfg_set_game_num(game, id);
|
||||
|
||||
|
||||
// parse val
|
||||
// first split options by ;
|
||||
char opt[100], *p, *np;
|
||||
p = val;
|
||||
|
||||
while(p) {
|
||||
np = strchr(p, ';');
|
||||
if (np) trim_n_copy(opt, p, np-p, sizeof(opt));
|
||||
else trimcopy(opt, p, sizeof(opt));
|
||||
|
||||
char opt_name[100], opt_val[100];
|
||||
if (trimsplit(opt, opt_name, opt_val, ':', sizeof(opt_name))){
|
||||
|
||||
short opt_c;
|
||||
if (strcmp("favorite", opt_name) == 0) {
|
||||
if (sscanf(opt_val, "%hd", &opt_c) == 1) {
|
||||
game->favorite = opt_c;
|
||||
}
|
||||
}
|
||||
if (strcmp("count", opt_name) == 0) {
|
||||
if (sscanf(opt_val, "%hd", &opt_c) == 1) {
|
||||
game->count = opt_c;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (np) p = np + 1; else p = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
bool cfg_load_games()
|
||||
{
|
||||
return cfg_parsefile("SD:/config/GXGameSettings.cfg", &game_set);
|
||||
}
|
||||
|
||||
bool cfg_load_game_num()
|
||||
{
|
||||
return cfg_parsefile("SD:/config/GXGameCount.cfg", &game_set_num);
|
||||
}
|
||||
|
||||
bool cfg_save_games()// save per game setings
|
||||
{
|
||||
FILE *f;
|
||||
@ -1140,6 +1211,30 @@ bool cfg_save_games()// save per game setings
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cfg_save_game_num()
|
||||
{
|
||||
FILE *f;
|
||||
int i;
|
||||
mkdir("SD:/config/", 0777);
|
||||
f = fopen("SD:/config/GXGameCount.cfg", "wb");
|
||||
if (!f) {
|
||||
printf("Error saving %s\n", "GXGameCount.cfg");
|
||||
sleep(1);
|
||||
return false;
|
||||
}
|
||||
fprintf(f, "# USB Loader settings file\n");
|
||||
fprintf(f, "# note: this file is automatically generated\n");
|
||||
fprintf(f, "# Num Games: %d\n", num_saved_game_num);
|
||||
for (i=0; i<num_saved_game_num; i++) {
|
||||
fprintf(f, "game:%s = ", cfg_game_num[i].id);
|
||||
fprintf(f, "favorite:%d; ", cfg_game_num[i].favorite);
|
||||
fprintf(f, "count:%d;\n", cfg_game_num[i].count);
|
||||
}
|
||||
fprintf(f, "# END\n");
|
||||
fclose(f);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cfg_load_global()
|
||||
{
|
||||
//Default values defined by dev team
|
||||
@ -1151,7 +1246,7 @@ bool cfg_load_global()
|
||||
Settings.qboot = off;
|
||||
Settings.wsprompt = off;
|
||||
Settings.keyset = us;
|
||||
Settings.hddinfo = HDDInfo;
|
||||
Settings.hddinfo = hr12;
|
||||
Settings.sinfo = ((THEME.showID) ? GameID : Neither);
|
||||
Settings.rumble = RumbleOn;
|
||||
if (THEME.showRegion)
|
||||
@ -1176,6 +1271,18 @@ struct Game_CFG* CFG_get_game_opt(u8 *id)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
struct Game_NUM* CFG_get_game_num(u8 *id)
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<num_saved_game_num; i++) {
|
||||
if (memcmp(id, cfg_game_num[i].id, 2) == 0) {
|
||||
return &cfg_game_num[i];
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool CFG_save_game_opt(u8 *id)
|
||||
{
|
||||
struct Game_CFG *game = cfg_get_game(id);
|
||||
@ -1184,6 +1291,14 @@ bool CFG_save_game_opt(u8 *id)
|
||||
return cfg_save_games();
|
||||
}
|
||||
|
||||
bool CFG_save_game_num(u8 *id)
|
||||
{
|
||||
struct Game_NUM *game = cfg_get_game_num(id);
|
||||
if (!game) return false;
|
||||
cfg_set_game_num(game, id);
|
||||
return cfg_save_game_num();
|
||||
}
|
||||
|
||||
bool CFG_forget_game_opt(u8 *id)
|
||||
{
|
||||
struct Game_CFG *game = CFG_get_game_opt(id);
|
||||
@ -1231,6 +1346,7 @@ void CFG_Load()
|
||||
|
||||
// load per-game settings
|
||||
cfg_load_games();
|
||||
cfg_load_game_num();
|
||||
|
||||
// cfg_parsearg(argc, argv);
|
||||
}
|
||||
|
16
source/cfg.h
16
source/cfg.h
@ -144,10 +144,13 @@ struct THEME
|
||||
extern struct CFG CFG;
|
||||
extern struct THEME THEME;
|
||||
extern u8 ocarinaChoice;
|
||||
extern u8 fave;
|
||||
extern u8 playcnt;
|
||||
extern u8 videoChoice;
|
||||
extern u8 languageChoice;
|
||||
extern u8 viChoice;
|
||||
extern u8 iosChoice;
|
||||
extern u8 faveChoice;
|
||||
extern u8 parentalcontrolChoice;
|
||||
extern u8 xflip;
|
||||
extern u8 qboot;
|
||||
@ -164,13 +167,21 @@ struct Game_CFG
|
||||
u8 ios;
|
||||
u8 parentalcontrol;
|
||||
};
|
||||
struct Game_NUM
|
||||
{
|
||||
u8 id[8];
|
||||
u8 favorite;
|
||||
u8 count;
|
||||
};
|
||||
|
||||
|
||||
void CFG_Default(int widescreen); // -1 = non forced mode
|
||||
void CFG_Load();
|
||||
void lang_defualt();
|
||||
struct Game_CFG* CFG_get_game_opt(u8 *id);
|
||||
struct Game_NUM* CFG_get_game_num(u8 *id);
|
||||
bool CFG_save_game_opt(u8 *id);
|
||||
bool CFG_save_game_num(u8 *id);
|
||||
bool CFG_forget_game_opt(u8 *id);
|
||||
int subfoldercheck(char * directory);
|
||||
|
||||
@ -221,8 +232,9 @@ enum {
|
||||
};
|
||||
|
||||
enum {
|
||||
HDDInfo,
|
||||
Clock,
|
||||
hr12,
|
||||
hr24,
|
||||
Off,
|
||||
};
|
||||
|
||||
enum {
|
||||
|
@ -30,6 +30,7 @@ return false;
|
||||
void lang_default()
|
||||
{
|
||||
snprintf(LANGUAGE.ok, sizeof(LANGUAGE.ok), "OK");
|
||||
snprintf(LANGUAGE.addToFavorite, sizeof(LANGUAGE.addToFavorite), "Favorite");
|
||||
snprintf(LANGUAGE.AppLanguage, sizeof(LANGUAGE.AppLanguage), "App Language");
|
||||
snprintf(LANGUAGE.t3Covers, sizeof(LANGUAGE.t3Covers), "3D Covers");
|
||||
snprintf(LANGUAGE.Areyousure, sizeof(LANGUAGE.Areyousure), "Are you sure?");
|
||||
@ -74,6 +75,7 @@ snprintf(LANGUAGE.Downloadingfile, sizeof(LANGUAGE.Downloadingfile), "Downloadin
|
||||
snprintf(LANGUAGE.DownloadBoxartimage, sizeof(LANGUAGE.DownloadBoxartimage), "Download Boxart image?");
|
||||
snprintf(LANGUAGE.Downloadfinished, sizeof(LANGUAGE.Downloadfinished), "Download finished");
|
||||
snprintf(LANGUAGE.Error, sizeof(LANGUAGE.Error), "Error !");
|
||||
snprintf(LANGUAGE.hour, sizeof(LANGUAGE.hour), "Hour");
|
||||
snprintf(LANGUAGE.BOOTERROR, sizeof(LANGUAGE.BOOTERROR), "BOOT ERROR");
|
||||
snprintf(LANGUAGE.ErrorreadingDisc, sizeof(LANGUAGE.ErrorreadingDisc), "Error reading Disc");
|
||||
snprintf(LANGUAGE.ExitUSBISOLoader, sizeof(LANGUAGE.ExitUSBISOLoader), "Exit USB Loader GX?");
|
||||
@ -225,6 +227,10 @@ void language_set(char *name, char *val)
|
||||
strcopy(LANGUAGE.t3Covers, val, sizeof(LANGUAGE.t3Covers));
|
||||
return;
|
||||
}
|
||||
if (strcmp(name, "addToFavorite") == 0) {
|
||||
strcopy(LANGUAGE.addToFavorite, val, sizeof(LANGUAGE.addToFavorite));
|
||||
return;
|
||||
}
|
||||
if (strcmp(name, "Specialthanksto") == 0) {
|
||||
strcopy(LANGUAGE.Specialthanksto, val, sizeof(LANGUAGE.Specialthanksto));
|
||||
return;
|
||||
@ -493,6 +499,10 @@ void language_set(char *name, char *val)
|
||||
strcopy(LANGUAGE.Force, val, sizeof(LANGUAGE.Force));
|
||||
return;
|
||||
}
|
||||
if (strcmp(name, "hour") == 0) {
|
||||
strcopy(LANGUAGE.hour, val, sizeof(LANGUAGE.hour));
|
||||
return;
|
||||
}
|
||||
if (strcmp(name, "Youneedtoformatapartition") == 0) {
|
||||
strcopy(LANGUAGE.Youneedtoformatapartition, val, sizeof(LANGUAGE.Youneedtoformatapartition));
|
||||
return;
|
||||
|
@ -13,6 +13,7 @@ struct LANGUAGE
|
||||
{
|
||||
|
||||
char t3Covers[50];
|
||||
char addToFavorite[20];
|
||||
char AppLanguage[50];
|
||||
char Areyousure[50];
|
||||
char AutoPatch[20];
|
||||
@ -92,6 +93,7 @@ struct LANGUAGE
|
||||
char GoBack[50];
|
||||
char GotoPage[50];///////
|
||||
char HowtoShutdown[50];
|
||||
char hour[10];
|
||||
char keyboard[50];
|
||||
char Language[50];
|
||||
char Langchange[50];
|
||||
|
@ -84,7 +84,7 @@ DefaultSettings()
|
||||
Settings.vpatch = off;
|
||||
Settings.language = ConsoleLangDefault;
|
||||
Settings.ocarina = off;
|
||||
Settings.hddinfo = HDDInfo;
|
||||
Settings.hddinfo = hr12;
|
||||
Settings.sinfo = ((THEME.showID) ? GameID : Neither);
|
||||
Settings.rumble = RumbleOn;
|
||||
if (THEME.showRegion)
|
||||
|
147
source/menu.cpp
147
source/menu.cpp
@ -2883,7 +2883,7 @@ static int MenuDiscList()
|
||||
w.Append(&settingsBtn);
|
||||
w.Append(&DownloadBtn);
|
||||
|
||||
if(Settings.hddinfo == Clock)
|
||||
if((Settings.hddinfo == hr12)||(Settings.hddinfo == hr24))
|
||||
{
|
||||
w.Append(&clockTimeBack);
|
||||
w.Append(&clockTime);
|
||||
@ -2911,11 +2911,13 @@ static int MenuDiscList()
|
||||
|
||||
//CLOCK
|
||||
time_t rawtime = time(0); //this fixes code dump caused by the clock
|
||||
if (Settings.hddinfo == Clock && rawtime != lastrawtime) {
|
||||
if (((Settings.hddinfo == hr12)||(Settings.hddinfo == hr24)) && rawtime != lastrawtime) {
|
||||
lastrawtime = rawtime;
|
||||
timeinfo = localtime (&rawtime);
|
||||
if (dataed < 1){
|
||||
if(rawtime & 1)
|
||||
if((rawtime & 1)&&(Settings.hddinfo == hr12))
|
||||
strftime(theTime, sizeof(theTime), "%I:%M", timeinfo);
|
||||
if((rawtime & 1)&&(Settings.hddinfo == hr24))
|
||||
strftime(theTime, sizeof(theTime), "%H:%M", timeinfo);
|
||||
else
|
||||
strftime(theTime, sizeof(theTime), "%H %M", timeinfo);
|
||||
@ -2934,7 +2936,7 @@ static int MenuDiscList()
|
||||
|
||||
|
||||
//////////////////////end clock code//////////////////////////////
|
||||
if ((datagB<1)&&(Settings.cios==1)&&(Settings.video == ntsc)&&(Settings.hddinfo == Clock)&&(Settings.qboot==1)&&(Settings.wsprompt==0)&&(Settings.language==ger)&&(Settings.tooltips==0)){dataed=1;dataef=1;}if (dataef==1){if (cosa>7){cosa=1;}datag++;if (sina==3){wiiBtn.SetAlignment(ALIGN_LEFT,ALIGN_BOTTOM);wiiBtnImg.SetAngle(0);if(datag>163){datag=1;}else if (datag<62){wiiBtn.SetPosition(((cosa)*70),(-2*(datag)+120));}else if(62<=datag){wiiBtn.SetPosition(((cosa)*70),((datag*2)-130));}if (datag>162){wiiBtn.SetPosition(700,700);w.Remove(&wiiBtn);datagB=2;cosa++;sina=lastrawtime%4;}w.Append(&wiiBtn);}if (sina==2){wiiBtn.SetAlignment(ALIGN_RIGHT,ALIGN_TOP);wiiBtnImg.SetAngle(270);if(datag>163){datag=1;}else if (datag<62){wiiBtn.SetPosition(((-2*(datag)+130)),((cosa)*50));}else if(62<=datag){wiiBtn.SetPosition((2*(datag)-120),((cosa)*50));}if (datag>162){wiiBtn.SetPosition(700,700);w.Remove(&wiiBtn);datagB=2;cosa++;sina=lastrawtime%4;}w.Append(&wiiBtn);}if (sina==1){wiiBtn.SetAlignment(ALIGN_TOP,ALIGN_LEFT);wiiBtnImg.SetAngle(180);if(datag>163){datag=1;}else if (datag<62){wiiBtn.SetPosition(((cosa)*70),(2*(datag)-120));}else if(62<=datag){wiiBtn.SetPosition(((cosa)*70),(-2*(datag)+130));}if (datag>162){wiiBtn.SetPosition(700,700);w.Remove(&wiiBtn);datagB=2;cosa++;sina=lastrawtime%4;}w.Append(&wiiBtn);}if (sina==0){wiiBtn.SetAlignment(ALIGN_TOP,ALIGN_LEFT);wiiBtnImg.SetAngle(90);if(datag>163){datag=1;}else if (datag<62){wiiBtn.SetPosition(((2*(datag)-130)),((cosa)*50));}else if(62<=datag){wiiBtn.SetPosition((-2*(datag)+120),((cosa)*50));}if (datag>162){wiiBtn.SetPosition(700,700);w.Remove(&wiiBtn);datagB=2;cosa++;sina=lastrawtime%4;}w.Append(&wiiBtn);}}
|
||||
if ((datagB<1)&&(Settings.cios==1)&&(Settings.video == ntsc)&&(Settings.hddinfo == hr12)&&(Settings.qboot==1)&&(Settings.wsprompt==0)&&(Settings.language==ger)&&(Settings.tooltips==0)){dataed=1;dataef=1;}if (dataef==1){if (cosa>7){cosa=1;}datag++;if (sina==3){wiiBtn.SetAlignment(ALIGN_LEFT,ALIGN_BOTTOM);wiiBtnImg.SetAngle(0);if(datag>163){datag=1;}else if (datag<62){wiiBtn.SetPosition(((cosa)*70),(-2*(datag)+120));}else if(62<=datag){wiiBtn.SetPosition(((cosa)*70),((datag*2)-130));}if (datag>162){wiiBtn.SetPosition(700,700);w.Remove(&wiiBtn);datagB=2;cosa++;sina=lastrawtime%4;}w.Append(&wiiBtn);}if (sina==2){wiiBtn.SetAlignment(ALIGN_RIGHT,ALIGN_TOP);wiiBtnImg.SetAngle(270);if(datag>163){datag=1;}else if (datag<62){wiiBtn.SetPosition(((-2*(datag)+130)),((cosa)*50));}else if(62<=datag){wiiBtn.SetPosition((2*(datag)-120),((cosa)*50));}if (datag>162){wiiBtn.SetPosition(700,700);w.Remove(&wiiBtn);datagB=2;cosa++;sina=lastrawtime%4;}w.Append(&wiiBtn);}if (sina==1){wiiBtn.SetAlignment(ALIGN_TOP,ALIGN_LEFT);wiiBtnImg.SetAngle(180);if(datag>163){datag=1;}else if (datag<62){wiiBtn.SetPosition(((cosa)*70),(2*(datag)-120));}else if(62<=datag){wiiBtn.SetPosition(((cosa)*70),(-2*(datag)+130));}if (datag>162){wiiBtn.SetPosition(700,700);w.Remove(&wiiBtn);datagB=2;cosa++;sina=lastrawtime%4;}w.Append(&wiiBtn);}if (sina==0){wiiBtn.SetAlignment(ALIGN_TOP,ALIGN_LEFT);wiiBtnImg.SetAngle(90);if(datag>163){datag=1;}else if (datag<62){wiiBtn.SetPosition(((2*(datag)-130)),((cosa)*50));}else if(62<=datag){wiiBtn.SetPosition((-2*(datag)+120),((cosa)*50));}if (datag>162){wiiBtn.SetPosition(700,700);w.Remove(&wiiBtn);datagB=2;cosa++;sina=lastrawtime%4;}w.Append(&wiiBtn);}}
|
||||
|
||||
/*
|
||||
#ifdef HW_RVL
|
||||
@ -3252,6 +3254,31 @@ static int MenuDiscList()
|
||||
{
|
||||
|
||||
wiilight(0);
|
||||
//////////save game play count////////////////
|
||||
extern u8 favorite;
|
||||
extern u8 count;
|
||||
struct Game_NUM* game_num = CFG_get_game_num(header->id);
|
||||
|
||||
if (game_num)
|
||||
{
|
||||
favorite = game_num->favorite;
|
||||
count = game_num->count;//count+=1;
|
||||
|
||||
}count+=1;
|
||||
|
||||
if(isSdInserted() == 1) {
|
||||
if (CFG_save_game_num(header->id))
|
||||
{
|
||||
//WindowPrompt(LANGUAGE.SuccessfullySaved, 0, LANGUAGE.ok, 0,0,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
WindowPrompt(LANGUAGE.SaveFailed, 0, LANGUAGE.ok, 0,0,0);
|
||||
}
|
||||
} else {
|
||||
WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0);
|
||||
}
|
||||
////////////end save play count//////////////
|
||||
|
||||
struct Game_CFG* game_cfg = CFG_get_game_opt(header->id);
|
||||
|
||||
@ -3338,6 +3365,7 @@ static int MenuDiscList()
|
||||
bool returnHere = true;// prompt to start game
|
||||
while (returnHere)
|
||||
{
|
||||
|
||||
returnHere = false;
|
||||
wiilight(1);
|
||||
choice = GameWindowPrompt();
|
||||
@ -3347,6 +3375,32 @@ static int MenuDiscList()
|
||||
{
|
||||
|
||||
wiilight(0);
|
||||
//////////save game play count////////////////
|
||||
extern u8 favorite;
|
||||
extern u8 count;
|
||||
struct Game_NUM* game_num = CFG_get_game_num(header->id);
|
||||
|
||||
if (game_num)
|
||||
{
|
||||
favorite = game_num->favorite;
|
||||
count = game_num->count;//count+=1;
|
||||
|
||||
}count+=1;
|
||||
|
||||
|
||||
if(isSdInserted() == 1) {
|
||||
if (CFG_save_game_num(header->id))
|
||||
{
|
||||
//WindowPrompt(LANGUAGE.SuccessfullySaved, 0, LANGUAGE.ok, 0,0,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
WindowPrompt(LANGUAGE.SaveFailed, 0, LANGUAGE.ok, 0,0,0);
|
||||
}
|
||||
} else {
|
||||
WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0);
|
||||
}
|
||||
////////////end save play count//////////////
|
||||
|
||||
struct Game_CFG* game_cfg = CFG_get_game_opt(header->id);
|
||||
|
||||
@ -4024,7 +4078,7 @@ static int MenuSettings()
|
||||
Settings.vpatch = 0;
|
||||
if(Settings.sinfo > 3)
|
||||
Settings.sinfo = 0;
|
||||
if(Settings.hddinfo > 1)
|
||||
if(Settings.hddinfo > 2)
|
||||
Settings.hddinfo = 0; //CLOCK
|
||||
if(Settings.rumble > 1)
|
||||
Settings.rumble = 0; //RUMBLE
|
||||
@ -4068,8 +4122,9 @@ static int MenuSettings()
|
||||
else if (Settings.sinfo == Both) sprintf (options2.value[4],"%s",LANGUAGE.Both);
|
||||
else if (Settings.sinfo == Neither) sprintf (options2.value[4],"%s",LANGUAGE.Neither);
|
||||
|
||||
if (Settings.hddinfo == HDDInfo) sprintf (options2.value[5],"%s",LANGUAGE.OFF);
|
||||
else if (Settings.hddinfo == Clock) sprintf (options2.value[5],"%s",LANGUAGE.ON);
|
||||
if (Settings.hddinfo == hr12) sprintf (options2.value[5],"12 %s",LANGUAGE.hour);
|
||||
else if (Settings.hddinfo == hr24) sprintf (options2.value[5],"24 %s",LANGUAGE.hour);
|
||||
else if (Settings.hddinfo == Off) sprintf (options2.value[5],"%s",LANGUAGE.OFF);
|
||||
|
||||
if (Settings.rumble == RumbleOn) sprintf (options2.value[6],"%s",LANGUAGE.ON);
|
||||
else if (Settings.rumble == RumbleOff) sprintf (options2.value[6],"%s",LANGUAGE.OFF);
|
||||
@ -4266,7 +4321,11 @@ static int MenuSettings()
|
||||
w.Append(&backBtn);
|
||||
w.Append(&lockBtn);
|
||||
if ( result == 1 )
|
||||
{ strncpy(CFG.covers_path, entered, sizeof(CFG.covers_path));
|
||||
{
|
||||
int len = (strlen(entered)-1);
|
||||
if(entered[len] !='/')
|
||||
strncat (entered, "/", 1);
|
||||
strncpy(CFG.covers_path, entered, sizeof(CFG.covers_path));
|
||||
WindowPrompt(LANGUAGE.CoverpathChanged,0,LANGUAGE.ok,0,0,0);
|
||||
if(isSdInserted() == 1) {
|
||||
cfg_save_global();
|
||||
@ -4302,6 +4361,9 @@ static int MenuSettings()
|
||||
w.Append(&lockBtn);
|
||||
if ( result == 1 )
|
||||
{
|
||||
int len = (strlen(entered)-1);
|
||||
if(entered[len] !='/')
|
||||
strncat (entered, "/", 1);
|
||||
strncpy(CFG.disc_path, entered, sizeof(CFG.disc_path));
|
||||
WindowPrompt(LANGUAGE.DiscpathChanged,0,LANGUAGE.ok,0,0,0);
|
||||
if(isSdInserted() == 1) {
|
||||
@ -4338,6 +4400,9 @@ static int MenuSettings()
|
||||
w.Append(&lockBtn);
|
||||
if ( result == 1 )
|
||||
{
|
||||
int len = (strlen(entered)-1);
|
||||
if(entered[len] !='/')
|
||||
strncat (entered, "/", 1);
|
||||
strncpy(CFG.theme_path, entered, sizeof(CFG.theme_path));
|
||||
WindowPrompt(LANGUAGE.ThemepathChanged,0,LANGUAGE.ok,0,0,0);
|
||||
if(isSdInserted() == 1) {
|
||||
@ -4472,7 +4537,11 @@ static int MenuSettings()
|
||||
w.Append(&backBtn);
|
||||
w.Append(&lockBtn);
|
||||
if ( result == 1 )
|
||||
{ strncpy(CFG.titlestxt_path, entered, sizeof(CFG.titlestxt_path));
|
||||
{
|
||||
int len = (strlen(entered)-1);
|
||||
if(entered[len] !='/')
|
||||
strncat (entered, "/", 1);
|
||||
strncpy(CFG.titlestxt_path, entered, sizeof(CFG.titlestxt_path));
|
||||
WindowPrompt(LANGUAGE.TitlestxtpathChanged,0,LANGUAGE.ok,0,0,0);
|
||||
if(isSdInserted() == 1) {
|
||||
cfg_save_global();
|
||||
@ -4699,12 +4768,13 @@ int GameSettings(struct discHdr * header)
|
||||
strncat(gameName, "...", 3);
|
||||
}
|
||||
|
||||
customOptionList options3(5);
|
||||
customOptionList options3(6);
|
||||
sprintf(options3.name[0],"%s", LANGUAGE.VideoMode);
|
||||
sprintf(options3.name[1],"%s", LANGUAGE.VIDTVPatch);
|
||||
sprintf(options3.name[2],"%s", LANGUAGE.Language);
|
||||
sprintf(options3.name[3], "Ocarina");
|
||||
sprintf(options3.name[4], "IOS");
|
||||
sprintf(options3.name[5],"%s", LANGUAGE.addToFavorite);
|
||||
|
||||
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol);
|
||||
|
||||
@ -4762,7 +4832,7 @@ int GameSettings(struct discHdr * header)
|
||||
cancelBtn.SetTrigger(&trigA);
|
||||
cancelBtn.SetTrigger(&trigB);
|
||||
cancelBtn.SetEffectGrow();
|
||||
|
||||
|
||||
GuiText deleteBtnTxt(LANGUAGE.Uninstall, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
|
||||
deleteBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
|
||||
GuiImage deleteBtnImg(&btnOutline);
|
||||
@ -4795,6 +4865,19 @@ int GameSettings(struct discHdr * header)
|
||||
mainWindow->Append(&optionBrowser3);
|
||||
|
||||
ResumeGui();
|
||||
//extern u8 favorite;
|
||||
extern u8 count;
|
||||
struct Game_NUM* game_num = CFG_get_game_num(header->id);
|
||||
|
||||
if (game_num)
|
||||
{
|
||||
faveChoice = game_num->favorite;
|
||||
count = game_num->count;//count+=1;
|
||||
|
||||
}
|
||||
else {
|
||||
faveChoice = no;}
|
||||
|
||||
|
||||
struct Game_CFG* game_cfg = CFG_get_game_opt(header->id);
|
||||
|
||||
@ -4851,6 +4934,10 @@ int GameSettings(struct discHdr * header)
|
||||
|
||||
if (iosChoice == i249) sprintf (options3.value[4],"249");
|
||||
else if (iosChoice == i222) sprintf (options3.value[4],"222");
|
||||
|
||||
if (faveChoice == yes) sprintf (options3.value[5],"%s",LANGUAGE.Yes);
|
||||
else if (faveChoice == no) sprintf (options3.value[5],"%s",LANGUAGE.No);
|
||||
|
||||
|
||||
if(shutdown == 1)
|
||||
Sys_Shutdown();
|
||||
@ -4876,12 +4963,41 @@ int GameSettings(struct discHdr * header)
|
||||
case 4:
|
||||
iosChoice = (iosChoice + 1) % 2;
|
||||
break;
|
||||
case 5:
|
||||
faveChoice = (faveChoice + 1) % 2;
|
||||
break;
|
||||
}
|
||||
|
||||
if(saveBtn.GetState() == STATE_CLICKED)
|
||||
{
|
||||
if(isSdInserted() == 1) {
|
||||
if (CFG_save_game_opt(header->id))
|
||||
{
|
||||
|
||||
if(isSdInserted() == 1) {
|
||||
//////////save game play count////////////////
|
||||
extern u8 favorite;
|
||||
extern u8 count;
|
||||
struct Game_NUM* game_num = CFG_get_game_num(header->id);
|
||||
|
||||
if (game_num)
|
||||
{
|
||||
favorite = game_num->favorite;
|
||||
count = game_num->count;//count+=1;
|
||||
|
||||
}favorite = faveChoice;
|
||||
|
||||
if(isSdInserted() == 1) {
|
||||
if (CFG_save_game_num(header->id))
|
||||
{
|
||||
//WindowPrompt(LANGUAGE.SuccessfullySaved, 0, LANGUAGE.ok, 0,0,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
WindowPrompt(LANGUAGE.SaveFailed, 0, LANGUAGE.ok, 0,0,0);
|
||||
}
|
||||
} else {
|
||||
WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0);
|
||||
}
|
||||
////////////end save play count//////////////
|
||||
if (CFG_save_game_opt(header->id))
|
||||
{
|
||||
WindowPrompt(LANGUAGE.SuccessfullySaved, 0, LANGUAGE.ok, 0,0,0);
|
||||
}
|
||||
@ -5141,10 +5257,9 @@ int MenuOGG()
|
||||
scrollon = 1;
|
||||
}
|
||||
|
||||
GuiCustomOptionBrowser optionBrowser4(396, 280, &options2, CFG.theme_path, "bg_options_settings.png", bg_options_settings_png, scrollon, 85);
|
||||
GuiCustomOptionBrowser optionBrowser4(396, 280, &options2, CFG.theme_path, "bg_options_settings.png", bg_options_settings_png, scrollon, 55);
|
||||
optionBrowser4.SetPosition(0, 90);
|
||||
optionBrowser4.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||
optionBrowser4.SetCol2Position(30);
|
||||
|
||||
int songPlaying=0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user