*Temporary fix for corrupted first downloaded cover (redownloading first cover at the end of download)

*Some issues solved (dont remember the numbers)
This commit is contained in:
dimok321 2009-05-24 14:40:51 +00:00
parent 1e24620c2b
commit edb501683f
2 changed files with 111 additions and 82 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 664 B

View File

@ -413,10 +413,10 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label,
GuiTrigger trigB; GuiTrigger trigB;
trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B); trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B);
//GuiImageData dialogBox(dialogue_box_png);
GuiImage dialogBoxImg(&dialogBox); GuiImage dialogBoxImg(&dialogBox);
if (Settings.wsprompt == yes){ if (Settings.wsprompt == yes){
dialogBoxImg.SetWidescreen(CFG.widescreen);}/////////// dialogBoxImg.SetWidescreen(CFG.widescreen);
}
GuiText titleTxt(title, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255}); GuiText titleTxt(title, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
@ -430,7 +430,8 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label,
GuiImage btn1Img(&btnOutline); GuiImage btn1Img(&btnOutline);
if (Settings.wsprompt == yes){ if (Settings.wsprompt == yes){
btn1Txt.SetWidescreen(CFG.widescreen); btn1Txt.SetWidescreen(CFG.widescreen);
btn1Img.SetWidescreen(CFG.widescreen);}/////////// btn1Img.SetWidescreen(CFG.widescreen);
}
GuiButton btn1(btnOutline.GetWidth(), btnOutline.GetHeight()); GuiButton btn1(btnOutline.GetWidth(), btnOutline.GetHeight());
btn1.SetLabel(&btn1Txt); btn1.SetLabel(&btn1Txt);
btn1.SetImage(&btn1Img); btn1.SetImage(&btn1Img);
@ -444,7 +445,8 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label,
GuiImage btn2Img(&btnOutline); GuiImage btn2Img(&btnOutline);
if (Settings.wsprompt == yes){ if (Settings.wsprompt == yes){
btn2Txt.SetWidescreen(CFG.widescreen); btn2Txt.SetWidescreen(CFG.widescreen);
btn2Img.SetWidescreen(CFG.widescreen);}/////////// btn2Img.SetWidescreen(CFG.widescreen);
}
GuiButton btn2(btnOutline.GetWidth(), btnOutline.GetHeight()); GuiButton btn2(btnOutline.GetWidth(), btnOutline.GetHeight());
btn2.SetLabel(&btn2Txt); btn2.SetLabel(&btn2Txt);
btn2.SetImage(&btn2Img); btn2.SetImage(&btn2Img);
@ -459,7 +461,8 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label,
GuiImage btn3Img(&btnOutline); GuiImage btn3Img(&btnOutline);
if (Settings.wsprompt == yes){ if (Settings.wsprompt == yes){
btn3Txt.SetWidescreen(CFG.widescreen); btn3Txt.SetWidescreen(CFG.widescreen);
btn3Img.SetWidescreen(CFG.widescreen);}/////////// btn3Img.SetWidescreen(CFG.widescreen);
}
GuiButton btn3(btnOutline.GetWidth(), btnOutline.GetHeight()); GuiButton btn3(btnOutline.GetWidth(), btnOutline.GetHeight());
btn3.SetLabel(&btn3Txt); btn3.SetLabel(&btn3Txt);
btn3.SetImage(&btn3Img); btn3.SetImage(&btn3Img);
@ -474,7 +477,8 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label,
GuiImage btn4Img(&btnOutline); GuiImage btn4Img(&btnOutline);
if (Settings.wsprompt == yes){ if (Settings.wsprompt == yes){
btn4Txt.SetWidescreen(CFG.widescreen); btn4Txt.SetWidescreen(CFG.widescreen);
btn4Img.SetWidescreen(CFG.widescreen);}/////////// btn4Img.SetWidescreen(CFG.widescreen);
}
GuiButton btn4(btnOutline.GetWidth(), btnOutline.GetHeight()); GuiButton btn4(btnOutline.GetWidth(), btnOutline.GetHeight());
btn4.SetLabel(&btn4Txt); btn4.SetLabel(&btn4Txt);
btn4.SetImage(&btn4Img); btn4.SetImage(&btn4Img);
@ -757,7 +761,8 @@ WindowExitPrompt(const char *title, const char *msg, const char *btn1Label,
GuiImage closeImg(&close); GuiImage closeImg(&close);
if (Settings.wsprompt == yes){ if (Settings.wsprompt == yes){
closeTxt.SetWidescreen(CFG.widescreen); closeTxt.SetWidescreen(CFG.widescreen);
closeImg.SetWidescreen(CFG.widescreen);}/////////// closeImg.SetWidescreen(CFG.widescreen);
}
GuiButton closeBtn(close.GetWidth(), close.GetHeight()); GuiButton closeBtn(close.GetWidth(), close.GetHeight());
closeBtn.SetImage(&closeImg); closeBtn.SetImage(&closeImg);
closeBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); closeBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
@ -777,11 +782,12 @@ WindowExitPrompt(const char *title, const char *msg, const char *btn1Label,
btn1.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_IN, 50); btn1.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_IN, 50);
btn1.SetPosition(0, 0); btn1.SetPosition(0, 0);
GuiText btn2Txt(btn1Label, 34, (GXColor){0, 0, 0, 255}); GuiText btn2Txt(btn1Label, 28, (GXColor){0, 0, 0, 255});
GuiImage btn2Img(&button); GuiImage btn2Img(&button);
if (Settings.wsprompt == yes){ if (Settings.wsprompt == yes){
btn2Txt.SetWidescreen(CFG.widescreen); btn2Txt.SetWidescreen(CFG.widescreen);
btn2Img.SetWidescreen(CFG.widescreen);}/////////// btn2Img.SetWidescreen(CFG.widescreen);
}
GuiButton btn2(button.GetWidth(), button.GetHeight()); GuiButton btn2(button.GetWidth(), button.GetHeight());
btn2.SetLabel(&btn2Txt); btn2.SetLabel(&btn2Txt);
btn2.SetImage(&btn2Img); btn2.SetImage(&btn2Img);
@ -794,11 +800,12 @@ WindowExitPrompt(const char *title, const char *msg, const char *btn1Label,
btn2.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_IN, 50); btn2.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_IN, 50);
btn2.SetRumble(false); btn2.SetRumble(false);
GuiText btn3Txt(btn2Label, 34, (GXColor){0, 0, 0, 255}); GuiText btn3Txt(btn2Label, 28, (GXColor){0, 0, 0, 255});
GuiImage btn3Img(&button); GuiImage btn3Img(&button);
if (Settings.wsprompt == yes){ if (Settings.wsprompt == yes){
btn3Txt.SetWidescreen(CFG.widescreen); btn3Txt.SetWidescreen(CFG.widescreen);
btn3Img.SetWidescreen(CFG.widescreen);}/////////// btn3Img.SetWidescreen(CFG.widescreen);
}
GuiButton btn3(button.GetWidth(), button.GetHeight()); GuiButton btn3(button.GetWidth(), button.GetHeight());
btn3.SetLabel(&btn3Txt); btn3.SetLabel(&btn3Txt);
btn3.SetImage(&btn3Img); btn3.SetImage(&btn3Img);
@ -824,9 +831,6 @@ WindowExitPrompt(const char *title, const char *msg, const char *btn1Label,
btn4.SetPosition(0,0); btn4.SetPosition(0,0);
btn4.SetEffect(EFFECT_SLIDE_BOTTOM | EFFECT_SLIDE_IN, 50); btn4.SetEffect(EFFECT_SLIDE_BOTTOM | EFFECT_SLIDE_IN, 50);
// btn2Txt.SetFontSize(22);
// btn3Txt.SetFontSize(22);
GuiImage wiimoteImg(&wiimote); GuiImage wiimoteImg(&wiimote);
if (Settings.wsprompt == yes){wiimoteImg.SetWidescreen(CFG.widescreen);} if (Settings.wsprompt == yes){wiimoteImg.SetWidescreen(CFG.widescreen);}
wiimoteImg.SetAlignment(ALIGN_LEFT, ALIGN_BOTTOM); wiimoteImg.SetAlignment(ALIGN_LEFT, ALIGN_BOTTOM);
@ -1081,7 +1085,8 @@ int GameWindowPrompt()
GuiImage btn2Img(&btnOutline); GuiImage btn2Img(&btnOutline);
if (Settings.wsprompt == yes){ if (Settings.wsprompt == yes){
btn2Txt.SetWidescreen(CFG.widescreen); btn2Txt.SetWidescreen(CFG.widescreen);
btn2Img.SetWidescreen(CFG.widescreen);}/////////// btn2Img.SetWidescreen(CFG.widescreen);
}
GuiButton btn2(btnOutline.GetWidth(), btnOutline.GetHeight()); GuiButton btn2(btnOutline.GetWidth(), btnOutline.GetHeight());
//check if unlocked //check if unlocked
if (CFG.godmode == 1) if (CFG.godmode == 1)
@ -1327,7 +1332,7 @@ int GameWindowPrompt()
favorite = game_num->favorite; favorite = game_num->favorite;
count = game_num->count;//count+=1; count = game_num->count;//count+=1;
}count+=1; }count+=1;
if(isSdInserted() == 1) { if(isSdInserted()) {
if (CFG_save_game_num(header->id)) if (CFG_save_game_num(header->id))
{ {
//WindowPrompt(LANGUAGE.SuccessfullySaved, 0, LANGUAGE.ok, 0,0,0); //WindowPrompt(LANGUAGE.SuccessfullySaved, 0, LANGUAGE.ok, 0,0,0);
@ -1361,7 +1366,7 @@ int GameWindowPrompt()
} }
else if(btnFavorite.GetState() == STATE_CLICKED){//switch favorite else if(btnFavorite.GetState() == STATE_CLICKED){//switch favorite
if(isSdInserted() == 1) { if(isSdInserted()) {
faveChoice = !faveChoice; faveChoice = !faveChoice;
btnFavoriteImg.SetImage(faveChoice ? &imgFavorite : &imgNotFavorite); btnFavoriteImg.SetImage(faveChoice ? &imgFavorite : &imgNotFavorite);
extern u8 favorite; extern u8 favorite;
@ -1512,7 +1517,8 @@ DiscWait(const char *title, const char *msg, const char *btn1Label, const char *
GuiImage dialogBoxImg(&dialogBox); GuiImage dialogBoxImg(&dialogBox);
if (Settings.wsprompt == yes){ if (Settings.wsprompt == yes){
dialogBoxImg.SetWidescreen(CFG.widescreen);}/////////// dialogBoxImg.SetWidescreen(CFG.widescreen);
}
GuiText titleTxt(title, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255}); GuiText titleTxt(title, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
@ -1526,7 +1532,8 @@ DiscWait(const char *title, const char *msg, const char *btn1Label, const char *
GuiImage btn1Img(&btnOutline); GuiImage btn1Img(&btnOutline);
if (Settings.wsprompt == yes){ if (Settings.wsprompt == yes){
btn1Txt.SetWidescreen(CFG.widescreen); btn1Txt.SetWidescreen(CFG.widescreen);
btn1Img.SetWidescreen(CFG.widescreen);}/////////// btn1Img.SetWidescreen(CFG.widescreen);
}
GuiButton btn1(btnOutline.GetWidth(), btnOutline.GetHeight()); GuiButton btn1(btnOutline.GetWidth(), btnOutline.GetHeight());
if(btn2Label) if(btn2Label)
@ -1553,7 +1560,8 @@ DiscWait(const char *title, const char *msg, const char *btn1Label, const char *
GuiImage btn2Img(&btnOutline); GuiImage btn2Img(&btnOutline);
if (Settings.wsprompt == yes){ if (Settings.wsprompt == yes){
btn2Txt.SetWidescreen(CFG.widescreen); btn2Txt.SetWidescreen(CFG.widescreen);
btn2Img.SetWidescreen(CFG.widescreen);}/////////// btn2Img.SetWidescreen(CFG.widescreen);
}
GuiButton btn2(btnOutline.GetWidth(), btnOutline.GetHeight()); GuiButton btn2(btnOutline.GetWidth(), btnOutline.GetHeight());
btn2.SetAlignment(ALIGN_RIGHT, ALIGN_BOTTOM); btn2.SetAlignment(ALIGN_RIGHT, ALIGN_BOTTOM);
btn2.SetPosition(-20, -25); btn2.SetPosition(-20, -25);
@ -1666,7 +1674,8 @@ FormatingPartition(const char *title, partitionEntry *entry)
GuiImage dialogBoxImg(&dialogBox); GuiImage dialogBoxImg(&dialogBox);
if (Settings.wsprompt == yes){ if (Settings.wsprompt == yes){
dialogBoxImg.SetWidescreen(CFG.widescreen);}/////////// dialogBoxImg.SetWidescreen(CFG.widescreen);
}
GuiText titleTxt(title, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255}); GuiText titleTxt(title, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
@ -1723,7 +1732,8 @@ int NetworkInitPromp(int choice2)
GuiImage dialogBoxImg(&dialogBox); GuiImage dialogBoxImg(&dialogBox);
if (Settings.wsprompt == yes){ if (Settings.wsprompt == yes){
dialogBoxImg.SetWidescreen(CFG.widescreen);}/////////// dialogBoxImg.SetWidescreen(CFG.widescreen);
}
GuiText titleTxt(LANGUAGE.InitializingNetwork, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255}); GuiText titleTxt(LANGUAGE.InitializingNetwork, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
@ -1738,7 +1748,8 @@ int NetworkInitPromp(int choice2)
GuiImage btn1Img(&btnOutline); GuiImage btn1Img(&btnOutline);
if (Settings.wsprompt == yes){ if (Settings.wsprompt == yes){
btn1Txt.SetWidescreen(CFG.widescreen); btn1Txt.SetWidescreen(CFG.widescreen);
btn1Img.SetWidescreen(CFG.widescreen);}/////////// btn1Img.SetWidescreen(CFG.widescreen);
}
GuiButton btn1(btnOutline.GetWidth(), btnOutline.GetHeight()); GuiButton btn1(btnOutline.GetWidth(), btnOutline.GetHeight());
btn1.SetAlignment(ALIGN_CENTRE, ALIGN_BOTTOM); btn1.SetAlignment(ALIGN_CENTRE, ALIGN_BOTTOM);
btn1.SetPosition(0, -45); btn1.SetPosition(0, -45);
@ -2207,6 +2218,37 @@ ProgressDownloadWindow(int choice2)
} }
/**Temporary redownloading 1st image because of a fucking corruption bug **/
char URLFile[100];
if (choice2 == 2) {
sprintf(URLFile,"http://www.theotherzone.com/wii/3d/176/248/%s",missingFiles[0]); // For 3D Covers
sprintf(imgPath,"%s%s", CFG.covers_path, missingFiles[0]);
}
if(choice2 == 3) {
sprintf(URLFile,"http://www.theotherzone.com/wii/diskart/160/160/%s",missingFiles[0]);
sprintf(imgPath,"%s%s", CFG.disc_path, missingFiles[0]);
}
if(choice2 == 1) {
sprintf(URLFile,"http://www.theotherzone.com/wii/resize/160/224/%s",missingFiles[0]);
sprintf(imgPath,"%s%s", CFG.covers_path, missingFiles[0]);
}
struct block file = downloadfile(URLFile);
if (file.size == 36864 || file.size <= 1024 || file.size == 7386 || file.data == NULL) {
} else {
if(file.data != NULL)
{
// save png to sd card
FILE *pfile;
pfile = fopen(imgPath, "wb");
fwrite(file.data,1,file.size,pfile);
fclose (pfile);
free(file.data);
}
}
HaltGui(); HaltGui();
mainWindow->Remove(&promptWindow); mainWindow->Remove(&promptWindow);
@ -2484,13 +2526,14 @@ static int OnScreenKeyboard(char * var, u32 maxlen, int min)
GuiImage okBtnImg(&btnOutline); GuiImage okBtnImg(&btnOutline);
if (Settings.wsprompt == yes){ if (Settings.wsprompt == yes){
okBtnTxt.SetWidescreen(CFG.widescreen); okBtnTxt.SetWidescreen(CFG.widescreen);
okBtnImg.SetWidescreen(CFG.widescreen);}/////////// okBtnImg.SetWidescreen(CFG.widescreen);
}
GuiButton okBtn(btnOutline.GetWidth(), btnOutline.GetHeight()); GuiButton okBtn(btnOutline.GetWidth(), btnOutline.GetHeight());
okBtn.SetAlignment(ALIGN_LEFT, ALIGN_BOTTOM); okBtn.SetAlignment(ALIGN_LEFT, ALIGN_BOTTOM);
okBtn.SetPosition(5, 15);//(25, -25); okBtn.SetPosition(5, 15);
okBtn.SetLabel(&okBtnTxt);// okBtn.SetLabel(&okBtnTxt);
okBtn.SetImage(&okBtnImg); okBtn.SetImage(&okBtnImg);
okBtn.SetSoundOver(&btnSoundOver); okBtn.SetSoundOver(&btnSoundOver);
okBtn.SetSoundClick(&btnClick); okBtn.SetSoundClick(&btnClick);
@ -2501,7 +2544,8 @@ static int OnScreenKeyboard(char * var, u32 maxlen, int min)
GuiImage cancelBtnImg(&btnOutline); GuiImage cancelBtnImg(&btnOutline);
if (Settings.wsprompt == yes){ if (Settings.wsprompt == yes){
cancelBtnTxt.SetWidescreen(CFG.widescreen); cancelBtnTxt.SetWidescreen(CFG.widescreen);
cancelBtnImg.SetWidescreen(CFG.widescreen);}/////////// cancelBtnImg.SetWidescreen(CFG.widescreen);
}
GuiButton cancelBtn(btnOutline.GetWidth(), btnOutline.GetHeight()); GuiButton cancelBtn(btnOutline.GetWidth(), btnOutline.GetHeight());
cancelBtn.SetAlignment(ALIGN_RIGHT, ALIGN_BOTTOM); cancelBtn.SetAlignment(ALIGN_RIGHT, ALIGN_BOTTOM);
cancelBtn.SetPosition(-5, 15);//(-25, -25); cancelBtn.SetPosition(-5, 15);//(-25, -25);
@ -2776,7 +2820,7 @@ static int MenuDiscList()
GuiImageData batteryRed(imgPath, battery_red_png); GuiImageData batteryRed(imgPath, battery_red_png);
snprintf(imgPath, sizeof(imgPath), "%sbattery_bar.png", CFG.theme_path); snprintf(imgPath, sizeof(imgPath), "%sbattery_bar.png", CFG.theme_path);
GuiImageData batteryBar(imgPath, battery_bar_png); GuiImageData batteryBar(imgPath, battery_bar_png);
//NEW
snprintf(imgPath, sizeof(imgPath), "%sfavIcon.png", CFG.theme_path); snprintf(imgPath, sizeof(imgPath), "%sfavIcon.png", CFG.theme_path);
GuiImageData imgfavIcon(imgPath, favIcon_png); GuiImageData imgfavIcon(imgPath, favIcon_png);
snprintf(imgPath, sizeof(imgPath), "%sfavIcon_gray.png", CFG.theme_path); snprintf(imgPath, sizeof(imgPath), "%sfavIcon_gray.png", CFG.theme_path);
@ -2961,7 +3005,6 @@ static int MenuDiscList()
countBtn.SetEffectGrow(); countBtn.SetEffectGrow();
countBtn.SetAlpha(180); countBtn.SetAlpha(180);
//NEW
GuiImage gridBtnImg(&imgarrangeGrid); GuiImage gridBtnImg(&imgarrangeGrid);
gridBtnImg.SetWidescreen(CFG.widescreen); gridBtnImg.SetWidescreen(CFG.widescreen);
GuiImage gridBtnImg_g(&imgarrangeGrid_gray); GuiImage gridBtnImg_g(&imgarrangeGrid_gray);
@ -3060,7 +3103,6 @@ static int MenuDiscList()
w.Append(&favoriteBtn); w.Append(&favoriteBtn);
w.Append(&abcBtn); w.Append(&abcBtn);
w.Append(&countBtn); w.Append(&countBtn);
//NEW
w.Append(&gridBtn); w.Append(&gridBtn);
w.Append(&carosselleBtn); w.Append(&carosselleBtn);
@ -3145,7 +3187,6 @@ static int MenuDiscList()
} }
} }
//BLA
else if(homeBtn.GetState() == STATE_CLICKED) else if(homeBtn.GetState() == STATE_CLICKED)
{ {
s32 thetimeofbg = bgMusic->GetPlayTime(); s32 thetimeofbg = bgMusic->GetPlayTime();
@ -3200,6 +3241,9 @@ static int MenuDiscList()
SDCard_Init(); SDCard_Init();
startat = gameBrowser.GetSelectedOption(); startat = gameBrowser.GetSelectedOption();
offset = gameBrowser.GetOffset(); offset = gameBrowser.GetOffset();
if(isSdInserted()) {
CFG_Load();
}
sdcardBtn.ResetState(); sdcardBtn.ResetState();
menu = MENU_DISCLIST; menu = MENU_DISCLIST;
break; break;
@ -3207,7 +3251,7 @@ static int MenuDiscList()
else if(DownloadBtn.GetState() == STATE_CLICKED) else if(DownloadBtn.GetState() == STATE_CLICKED)
{ {
if(isSdInserted() == 1) { if(isSdInserted()) {
choice = WindowPrompt(LANGUAGE.CoverDownload, 0, LANGUAGE.NormalCovers, LANGUAGE.t3Covers, LANGUAGE.DiscImages, LANGUAGE.Back); // ask for download choice choice = WindowPrompt(LANGUAGE.CoverDownload, 0, LANGUAGE.NormalCovers, LANGUAGE.t3Covers, LANGUAGE.DiscImages, LANGUAGE.Back); // ask for download choice
if (choice != 0) if (choice != 0)
@ -3272,7 +3316,7 @@ static int MenuDiscList()
else if(favoriteBtn.GetState() == STATE_CLICKED) else if(favoriteBtn.GetState() == STATE_CLICKED)
{ {
Settings.fave=!Settings.fave; Settings.fave=!Settings.fave;
if(isSdInserted() == 1) { if(isSdInserted()) {
cfg_save_global(); cfg_save_global();
} }
__Menu_GetEntries(); __Menu_GetEntries();
@ -3288,7 +3332,7 @@ static int MenuDiscList()
{ {
if(Settings.sort != all) { if(Settings.sort != all) {
Settings.sort=all; Settings.sort=all;
if(isSdInserted() == 1) { if(isSdInserted()) {
cfg_save_global(); cfg_save_global();
} }
__Menu_GetEntries(); __Menu_GetEntries();
@ -3306,7 +3350,7 @@ static int MenuDiscList()
{ {
if(Settings.sort != pcount) { if(Settings.sort != pcount) {
Settings.sort=pcount; Settings.sort=pcount;
if(isSdInserted() == 1) { if(isSdInserted()) {
cfg_save_global(); cfg_save_global();
} }
__Menu_GetEntries(); __Menu_GetEntries();
@ -3455,11 +3499,11 @@ static int MenuDiscList()
if (game_num) if (game_num)
{ {
favorite = game_num->favorite; favorite = game_num->favorite;
count = game_num->count;//count+=1; count = game_num->count;
}count+=1; }count+=1;
if(isSdInserted() == 1) { if(isSdInserted()) {
if (CFG_save_game_num(header->id)) if (CFG_save_game_num(header->id))
{ {
//WindowPrompt(LANGUAGE.SuccessfullySaved, 0, LANGUAGE.ok, 0,0,0); //WindowPrompt(LANGUAGE.SuccessfullySaved, 0, LANGUAGE.ok, 0,0,0);
@ -3949,7 +3993,7 @@ static int MenuSettings()
int menu = MENU_NONE; int menu = MENU_NONE;
int ret; int ret;
char cfgtext[20]; char cfgtext[20];
int choice = 0; //BLA int choice = 0;
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol); GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol);
GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, vol); GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, vol);
@ -4010,7 +4054,6 @@ static int MenuSettings()
backBtn.SetTrigger(&trigB); backBtn.SetTrigger(&trigB);
backBtn.SetEffectGrow(); backBtn.SetEffectGrow();
//BLA
GuiButton homo(1,1); GuiButton homo(1,1);
homo.SetTrigger(&trigHome); homo.SetTrigger(&trigHome);
homo.SetAlignment(ALIGN_LEFT, ALIGN_TOP); homo.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
@ -4403,7 +4446,6 @@ static int MenuSettings()
{ {
strncpy(Settings.unlockCode, entered, sizeof(Settings.unlockCode)); strncpy(Settings.unlockCode, entered, sizeof(Settings.unlockCode));
WindowPrompt(LANGUAGE.PasswordChanged,LANGUAGE.Passwordhasbeenchanged,LANGUAGE.ok,0,0,0); WindowPrompt(LANGUAGE.PasswordChanged,LANGUAGE.Passwordhasbeenchanged,LANGUAGE.ok,0,0,0);
cfg_save_global();
} }
} }
else else
@ -4455,9 +4497,7 @@ static int MenuSettings()
strncat (entered, "/", 1); strncat (entered, "/", 1);
strncpy(CFG.covers_path, entered, sizeof(CFG.covers_path)); strncpy(CFG.covers_path, entered, sizeof(CFG.covers_path));
WindowPrompt(LANGUAGE.CoverpathChanged,0,LANGUAGE.ok,0,0,0); WindowPrompt(LANGUAGE.CoverpathChanged,0,LANGUAGE.ok,0,0,0);
if(isSdInserted() == 1) { if(!isSdInserted()) {
cfg_save_global();
} else {
WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0); WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0);
} }
} }
@ -4494,9 +4534,7 @@ static int MenuSettings()
strncat (entered, "/", 1); strncat (entered, "/", 1);
strncpy(CFG.disc_path, entered, sizeof(CFG.disc_path)); strncpy(CFG.disc_path, entered, sizeof(CFG.disc_path));
WindowPrompt(LANGUAGE.DiscpathChanged,0,LANGUAGE.ok,0,0,0); WindowPrompt(LANGUAGE.DiscpathChanged,0,LANGUAGE.ok,0,0,0);
if(isSdInserted() == 1) { if(!isSdInserted()) {
cfg_save_global();
} else {
WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0); WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0);
} }
} }
@ -4533,10 +4571,10 @@ static int MenuSettings()
strncat (entered, "/", 1); strncat (entered, "/", 1);
strncpy(CFG.theme_path, entered, sizeof(CFG.theme_path)); strncpy(CFG.theme_path, entered, sizeof(CFG.theme_path));
WindowPrompt(LANGUAGE.ThemepathChanged,0,LANGUAGE.ok,0,0,0); WindowPrompt(LANGUAGE.ThemepathChanged,0,LANGUAGE.ok,0,0,0);
if(isSdInserted() == 1) { if(!isSdInserted()) {
cfg_save_global();
} else {
WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0); WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0);
} else {
cfg_save_global();
} }
mainWindow->Remove(bgImg); mainWindow->Remove(bgImg);
CFG_Load(); CFG_Load();
@ -4576,7 +4614,6 @@ static int MenuSettings()
mainWindow->Append(&page3Btn); mainWindow->Append(&page3Btn);
w.Append(&backBtn); w.Append(&backBtn);
w.Append(&lockBtn); w.Append(&lockBtn);
//////end load new theme////////////
} }
} }
else else
@ -4675,7 +4712,7 @@ static int MenuSettings()
strncat (entered, "/", 1); strncat (entered, "/", 1);
strncpy(CFG.titlestxt_path, entered, sizeof(CFG.titlestxt_path)); strncpy(CFG.titlestxt_path, entered, sizeof(CFG.titlestxt_path));
WindowPrompt(LANGUAGE.TitlestxtpathChanged,0,LANGUAGE.ok,0,0,0); WindowPrompt(LANGUAGE.TitlestxtpathChanged,0,LANGUAGE.ok,0,0,0);
if(isSdInserted() == 1) { if(isSdInserted()) {
cfg_save_global(); cfg_save_global();
CFG_Load(); CFG_Load();
} else { } else {
@ -4710,7 +4747,7 @@ static int MenuSettings()
w.Append(&lockBtn); w.Append(&lockBtn);
if ( result == 1 ) if ( result == 1 )
{ strncpy(CFG.language_path, entered, sizeof(CFG.language_path)); { strncpy(CFG.language_path, entered, sizeof(CFG.language_path));
if(isSdInserted() == 1) { if(isSdInserted()) {
cfg_save_global(); cfg_save_global();
if(!checkfile(CFG.language_path)) { if(!checkfile(CFG.language_path)) {
WindowPrompt(LANGUAGE.Filenotfound,LANGUAGE.Loadingstandardlanguage,LANGUAGE.ok,0,0,0); WindowPrompt(LANGUAGE.Filenotfound,LANGUAGE.Loadingstandardlanguage,LANGUAGE.ok,0,0,0);
@ -4719,11 +4756,9 @@ static int MenuSettings()
CFG_Load(); CFG_Load();
menu = MENU_SETTINGS; menu = MENU_SETTINGS;
pageToDisplay = 0; pageToDisplay = 0;
} else { } else {
WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0); WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0);
} }
} }
} }
else else
@ -4738,7 +4773,7 @@ static int MenuSettings()
Settings.unicodefix++; Settings.unicodefix++;
break; break;
case 4: case 4:
if(isSdInserted() == 1) { if(isSdInserted()) {
menu = MENU_OGG; menu = MENU_OGG;
pageToDisplay = 0; pageToDisplay = 0;
} else { } else {
@ -4808,7 +4843,7 @@ static int MenuSettings()
if(backBtn.GetState() == STATE_CLICKED) if(backBtn.GetState() == STATE_CLICKED)
{ {
//Add the procedure call to save the global configuration //Add the procedure call to save the global configuration
if(isSdInserted() == 1) { if(isSdInserted()) {
cfg_save_global(); cfg_save_global();
} }
menu = MENU_DISCLIST; menu = MENU_DISCLIST;
@ -4842,12 +4877,10 @@ static int MenuSettings()
w.Append(&backBtn); w.Append(&backBtn);
w.Append(&lockBtn); w.Append(&lockBtn);
mainWindow->Append(&tabBtn); mainWindow->Append(&tabBtn);
if ( result == 1 ) if ( result == 1 ) {
{
if (!strcmp(entered, Settings.unlockCode)) //if password correct if (!strcmp(entered, Settings.unlockCode)) //if password correct
{ {
if (CFG.godmode == 0) if (CFG.godmode == 0) {
{
WindowPrompt(LANGUAGE.CorrectPassword,LANGUAGE.InstallRenameandDeleteareunlocked,LANGUAGE.ok,0,0,0); WindowPrompt(LANGUAGE.CorrectPassword,LANGUAGE.InstallRenameandDeleteareunlocked,LANGUAGE.ok,0,0,0);
CFG.godmode = 1; CFG.godmode = 1;
__Menu_GetEntries(); __Menu_GetEntries();
@ -4863,8 +4896,7 @@ static int MenuSettings()
else else
{ {
int choice = WindowPrompt (LANGUAGE.LockConsole,LANGUAGE.Areyousure,LANGUAGE.Yes,LANGUAGE.No,0,0); int choice = WindowPrompt (LANGUAGE.LockConsole,LANGUAGE.Areyousure,LANGUAGE.Yes,LANGUAGE.No,0,0);
if(choice == 1) if(choice == 1) {
{
WindowPrompt(LANGUAGE.ConsoleLocked,LANGUAGE.USBLoaderisprotected,LANGUAGE.ok,0,0,0); WindowPrompt(LANGUAGE.ConsoleLocked,LANGUAGE.USBLoaderisprotected,LANGUAGE.ok,0,0,0);
CFG.godmode = 0; CFG.godmode = 0;
__Menu_GetEntries(); __Menu_GetEntries();
@ -4881,9 +4913,9 @@ static int MenuSettings()
} }
lockBtn.ResetState(); lockBtn.ResetState();
} }
//BLA
else if(homo.GetState() == STATE_CLICKED) else if(homo.GetState() == STATE_CLICKED)
{ {
cfg_save_global();
optionBrowser2.SetState(STATE_DISABLED); optionBrowser2.SetState(STATE_DISABLED);
s32 thetimeofbg = bgMusic->GetPlayTime(); s32 thetimeofbg = bgMusic->GetPlayTime();
bgMusic->Stop(); bgMusic->Stop();
@ -4912,10 +4944,7 @@ static int MenuSettings()
else else
{ {
homo.ResetState(); homo.ResetState();
//optionBrowser2.SetState(STATE_DEFAULT);
//optionBrowser2.SetFocus(1);
} }
} }
if(settingsbackgroundbtn.GetState() == STATE_CLICKED) if(settingsbackgroundbtn.GetState() == STATE_CLICKED)
{ {
@ -5171,7 +5200,7 @@ int GameSettings(struct discHdr * header)
if(saveBtn.GetState() == STATE_CLICKED) if(saveBtn.GetState() == STATE_CLICKED)
{ {
if(isSdInserted() == 1) { if(isSdInserted()) {
if (CFG_save_game_opt(header->id)) if (CFG_save_game_opt(header->id))
{ {
WindowPrompt(LANGUAGE.SuccessfullySaved, 0, LANGUAGE.ok, 0,0,0); WindowPrompt(LANGUAGE.SuccessfullySaved, 0, LANGUAGE.ok, 0,0,0);
@ -5553,7 +5582,7 @@ int MenuOGG()
sprintf(CFG.ogg_path, "notset"); sprintf(CFG.ogg_path, "notset");
bgMusic->Play(); bgMusic->Play();
} }
//cfg_save_global(); cfg_save_global();
menu = MENU_OGG; menu = MENU_OGG;
break; break;
} else { } else {