From b758bef4e1d49ec2e12520e769cbaa6d4f87b9df Mon Sep 17 00:00:00 2001 From: dimok321 <15055714+dimok789@users.noreply.github.com> Date: Sun, 7 Jun 2009 11:03:39 +0000 Subject: [PATCH] *Fixed GameSize not showing on install *Fixed missplacing WiiMotePointer *Added some missing languagevariables --- source/Settings.cpp | 16 ++++++++-------- source/language.c | 22 ++++++++++++++++------ source/language.h | 6 ++++-- source/libwiigui/gui_button.cpp | 18 ++++-------------- source/menu.cpp | 18 +++++++++++++++--- source/wpad.c | 8 ++++++++ 6 files changed, 55 insertions(+), 33 deletions(-) diff --git a/source/Settings.cpp b/source/Settings.cpp index 473220f9..22e52be6 100644 --- a/source/Settings.cpp +++ b/source/Settings.cpp @@ -1,3 +1,4 @@ +#include #include #include "menu.h" @@ -837,8 +838,8 @@ int MenuSettings() if (Settings.parentalcontrol > 3 ) Settings.parentalcontrol = 0; - if( Settings.godmode == 1 ) options2.SetValue(0, "Unlocked"); - else if( Settings.godmode == 0 ) options2.SetValue(0, "Locked"); + if( Settings.godmode == 1 ) options2.SetValue(0, LANGUAGE.Unlocked); + else if( Settings.godmode == 0 ) options2.SetValue(0, LANGUAGE.Locked); if ( Settings.godmode != 1) options2.SetValue(1, "********"); else if (!strcmp("", Settings.unlockCode)) options2.SetValue(1, "%s",LANGUAGE.notset); @@ -1642,8 +1643,7 @@ int GameSettings(struct discHdr * header) while(!exit) { - - VIDEO_WaitVSync (); + VIDEO_WaitVSync(); if (videoChoice == discdefault) options3.SetValue(0,"%s",LANGUAGE.DiscDefault); else if (videoChoice == systemdefault) options3.SetValue(0,"%s",LANGUAGE.SystemDefault); @@ -1673,21 +1673,21 @@ int GameSettings(struct discHdr * header) if (iosChoice == i249) options3.SetValue(4,"249"); else if (iosChoice == i222) options3.SetValue(4,"222"); - if (parentalcontrolChoice == 0) options3.SetValue(5,"0 (Always)"); + if (parentalcontrolChoice == 0) options3.SetValue(5, LANGUAGE.Always); else if (parentalcontrolChoice == 1) options3.SetValue(5,"1"); else if (parentalcontrolChoice == 2) options3.SetValue(5,"2"); - else if (parentalcontrolChoice == 3) options3.SetValue(5,"3 (Mature)"); + else if (parentalcontrolChoice == 3) options3.SetValue(5, LANGUAGE.Mature); if (fix002 == on) options3.SetValue(6,LANGUAGE.ON); else if (fix002 == off) options3.SetValue(6,LANGUAGE.OFF); + options3.SetValue(7, NULL); + if(shutdown == 1) Sys_Shutdown(); if(reset == 1) Sys_Reboot(); - options3.SetValue(7, NULL); - ret = optionBrowser3.GetClickedOption(); switch (ret) diff --git a/source/language.c b/source/language.c index d92a53eb..2d93c3d7 100644 --- a/source/language.c +++ b/source/language.c @@ -37,6 +37,7 @@ snprintf(LANGUAGE.t3Covers, sizeof(LANGUAGE.t3Covers), "3D Covers"); snprintf(LANGUAGE.Areyousure, sizeof(LANGUAGE.Areyousure), "Are you sure?"); snprintf(LANGUAGE.available, sizeof(LANGUAGE.available), "available"); snprintf(LANGUAGE.AutoPatch, sizeof(LANGUAGE.AutoPatch), "AutoPatch"); +snprintf(LANGUAGE.Always, sizeof(LANGUAGE.Always), "0 (Always)"); snprintf(LANGUAGE.Back, sizeof(LANGUAGE.Back), "Back"); snprintf(LANGUAGE.Backgroundmusic, sizeof(LANGUAGE.Backgroundmusic), "Backgroundmusic"); snprintf(LANGUAGE.Backgroundmusicpath, sizeof(LANGUAGE.Backgroundmusicpath), "Backgroundmusic Path changed."); @@ -137,10 +138,11 @@ snprintf(LANGUAGE.LoadingincIOS, sizeof(LANGUAGE.LoadingincIOS), "Loading in cIO snprintf(LANGUAGE.ListSort, sizeof(LANGUAGE.ListSort), "Sort Game List"); snprintf(LANGUAGE.Loadingstandardlanguage, sizeof(LANGUAGE.Loadingstandardlanguage), "Loading standard language."); snprintf(LANGUAGE.Loadingstandardmusic, sizeof(LANGUAGE.Loadingstandardmusic), "Loading standard music."); -snprintf(LANGUAGE.Lock, sizeof(LANGUAGE.Lock), "Lock"); +snprintf(LANGUAGE.Locked, sizeof(LANGUAGE.Locked), "Locked"); snprintf(LANGUAGE.LockConsole, sizeof(LANGUAGE.LockConsole), "Lock Console"); snprintf(LANGUAGE.Patchcountrystrings, sizeof(LANGUAGE.Patchcountrystrings), "Patch Country Strings"); snprintf(LANGUAGE.Missingfiles, sizeof(LANGUAGE.Missingfiles), "Missing files"); +snprintf(LANGUAGE.Mature, sizeof(LANGUAGE.Mature), "3 (Mature)"); snprintf(LANGUAGE.Networkiniterror, sizeof(LANGUAGE.Networkiniterror), "Network init error"); snprintf(LANGUAGE.Neither, sizeof(LANGUAGE.Neither), "Neither"); snprintf(LANGUAGE.Next, sizeof(LANGUAGE.Next), "Next"); @@ -214,7 +216,7 @@ snprintf(LANGUAGE.Try, sizeof(LANGUAGE.Try), "Try"); snprintf(LANGUAGE.Tooltips, sizeof(LANGUAGE.Tooltips), "Tooltips"); snprintf(LANGUAGE.Timeleft, sizeof(LANGUAGE.Timeleft), "Time left:"); snprintf(LANGUAGE.updating, sizeof(LANGUAGE.updating), "Updating"); -snprintf(LANGUAGE.Unlock, sizeof(LANGUAGE.Unlock), "Unlock"); +snprintf(LANGUAGE.Unlocked, sizeof(LANGUAGE.Unlocked), "Unlocked"); snprintf(LANGUAGE.UnlockConsoletousethisOption, sizeof(LANGUAGE.UnlockConsoletousethisOption), "Unlock console to use this option."); snprintf(LANGUAGE.Unicodefix, sizeof(LANGUAGE.Unicodefix), "Unicode Fix"); snprintf(LANGUAGE.Uninstall, sizeof(LANGUAGE.Uninstall), "Uninstall"); @@ -291,6 +293,10 @@ void language_set(char *name, char *val) strcopy(LANGUAGE.AutoPatch, val, sizeof(LANGUAGE.AutoPatch)); return; } + if (strcmp(name, "Always") == 0) { + strcopy(LANGUAGE.Always, val, sizeof(LANGUAGE.Always)); + return; + } if (strcmp(name, "Back") == 0) { strcopy(LANGUAGE.Back, val, sizeof(LANGUAGE.Back)); return; @@ -695,8 +701,8 @@ void language_set(char *name, char *val) strcopy(LANGUAGE.Loadingstandardmusic, val, sizeof(LANGUAGE.Loadingstandardmusic)); return; } - if (strcmp(name, "Lock") == 0) { - strcopy(LANGUAGE.Lock, val, sizeof(LANGUAGE.Lock)); + if (strcmp(name, "Locked") == 0) { + strcopy(LANGUAGE.Locked, val, sizeof(LANGUAGE.Locked)); return; } if (strcmp(name, "LockConsole") == 0) { @@ -711,6 +717,10 @@ void language_set(char *name, char *val) strcopy(LANGUAGE.Missingfiles, val, sizeof(LANGUAGE.Missingfiles)); return; } + if (strcmp(name, "Mature") == 0) { + strcopy(LANGUAGE.Mature, val, sizeof(LANGUAGE.Mature)); + return; + } if (strcmp(name, "Networkiniterror") == 0) { strcopy(LANGUAGE.Networkiniterror, val, sizeof(LANGUAGE.Networkiniterror)); return; @@ -979,8 +989,8 @@ void language_set(char *name, char *val) strcopy(LANGUAGE.Timeleft, val, sizeof(LANGUAGE.Timeleft)); return; } - if (strcmp(name, "Unlock") == 0) { - strcopy(LANGUAGE.Unlock, val, sizeof(LANGUAGE.Unlock)); + if (strcmp(name, "Unlocked") == 0) { + strcopy(LANGUAGE.Unlocked, val, sizeof(LANGUAGE.Unlocked)); return; } if (strcmp(name, "UnlockConsoletousethisOption") == 0) { diff --git a/source/language.h b/source/language.h index cf30051c..26cfd9f7 100644 --- a/source/language.h +++ b/source/language.h @@ -18,6 +18,7 @@ struct LANGUAGE char available[20]; char Areyousure[50]; char AutoPatch[30]; + char Always[50]; char Back[20]; char Backgroundmusic[80]; char Backgroundmusicpath[100]; @@ -120,10 +121,11 @@ struct LANGUAGE char LoadingincIOS[50]; char Loadingstandardlanguage[80]; char Loadingstandardmusic[80]; - char Lock[30]; + char Locked[30]; char LockConsole[50]; char Patchcountrystrings[80]; char Missingfiles[50]; + char Mature[50]; char Networkiniterror[50]; char Neither[40]; char Next[40]; @@ -196,7 +198,7 @@ struct LANGUAGE char Try[30]; char Tooltips[50]; char Timeleft[50]; - char Unlock[50]; + char Unlocked[50]; char UnlockConsoletousethisOption[100]; char Unicodefix[50]; char Uninstall[50]; diff --git a/source/libwiigui/gui_button.cpp b/source/libwiigui/gui_button.cpp index 2d9c3c6c..cd015d04 100644 --- a/source/libwiigui/gui_button.cpp +++ b/source/libwiigui/gui_button.cpp @@ -66,11 +66,6 @@ GuiButton::GuiButton(GuiImage* img, GuiImage* imgOver, int hor, int vert, int x, xoffset = x; yoffset = y; trigger[0] = trig; - - //SetAlignment(h_align, v_align); - //SetPosition(x,y); - - for(int i=0; i < 3; i++) { @@ -86,7 +81,7 @@ GuiButton::GuiButton(GuiImage* img, GuiImage* imgOver, int hor, int vert, int x, selectable = true; holdable = false; clickable = true; - + if (grow==1){ effectsOver |= EFFECT_SCALE; effectAmountOver = 4; @@ -114,11 +109,6 @@ GuiButton::GuiButton(GuiImage* img, GuiImage* imgOver, int hor, int vert, int x, xoffset = x; yoffset = y; trigger[0] = trig; - - //SetAlignment(h_align, v_align); - //SetPosition(x,y); - - for(int i=0; i < 3; i++) { @@ -134,13 +124,13 @@ GuiButton::GuiButton(GuiImage* img, GuiImage* imgOver, int hor, int vert, int x, selectable = true; holdable = false; clickable = true; - - if (grow==1){ + + if (grow==1) { effectsOver |= EFFECT_SCALE; effectAmountOver = 4; effectTargetOver = 110; } - + toolTip = tt; toolTip->SetParent(this); toolTip->SetAlignment(h_align, v_align); diff --git a/source/menu.cpp b/source/menu.cpp index f5465cf6..5200198c 100644 --- a/source/menu.cpp +++ b/source/menu.cpp @@ -15,7 +15,6 @@ #include "libwiigui/gui.h" #include "libwiigui/gui_gamegrid.h" #include "libwiigui/gui_gamecarousel.h" -#include "libwiigui/gui_customoptionbrowser.h" #include "libwiigui/gui_gamebrowser.h" #include "menu.h" #include "audio.h" @@ -1328,7 +1327,20 @@ static int MenuDiscList() else if (choice == 2) { wiilight(0); - if (GameSettings(header) == 1) //if deleted + HaltGui(); + if (Settings.gameDisplay==list) mainWindow->Remove(&gameBrowser); + else if (Settings.gameDisplay==grid) mainWindow->Remove(&gameGrid); + else if (Settings.gameDisplay==carousel) mainWindow->Remove(&gameCarousel); + mainWindow->Remove(&w); + ResumeGui(); + int settret = GameSettings(header); + HaltGui(); + if (Settings.gameDisplay==list) mainWindow->Append(&gameBrowser); + else if (Settings.gameDisplay==grid) mainWindow->Append(&gameGrid); + else if (Settings.gameDisplay==carousel) mainWindow->Append(&gameCarousel); + mainWindow->Append(&w); + ResumeGui(); + if (settret == 1) //if deleted { menu = MENU_DISCLIST; break; @@ -1457,7 +1469,7 @@ static int MenuInstall() f32 freespace, used; WBFS_DiskSpace(&used, &freespace); - float gamesize = WBFS_EstimeGameSize()/GB_SIZE; + gamesize = WBFS_EstimeGameSize()/GB_SIZE; char gametxt[50]; sprintf(gametxt, "%s : %.2fGB", name, gamesize); diff --git a/source/wpad.c b/source/wpad.c index 0f07415d..573ad52e 100644 --- a/source/wpad.c +++ b/source/wpad.c @@ -49,13 +49,17 @@ u32 ButtonsHold(void) { int i; u32 buttons = 0; + #ifdef HW_RVL WPAD_ScanPads(); + #endif PAD_ScanPads(); for(i=3; i >= 0; i--) { buttons |= PAD_ButtonsHeld(i); + #ifdef HW_RVL buttons |= WPAD_ButtonsHeld(i); + #endif } return buttons; } @@ -65,13 +69,17 @@ u32 ButtonsPressed(void) { int i; u32 buttons = 0; + #ifdef HW_RVL WPAD_ScanPads(); + #endif PAD_ScanPads(); for(i=3; i >= 0; i--) { buttons |= PAD_ButtonsDown(i); + #ifdef HW_RVL buttons |= WPAD_ButtonsDown(i); + #endif } return buttons;