diff --git a/HBC/META.XML b/HBC/META.XML index a65d7048..097a25f5 100644 --- a/HBC/META.XML +++ b/HBC/META.XML @@ -2,8 +2,8 @@ USB Loader GX USB Loader GX Team - 1.0 r989 - 201010011950 + 1.0 r991 + 201010270652 Loads games from USB-devices USB Loader GX is a libwiigui based USB iso loader with a wii-like GUI. You can install games to your HDDs and boot them with shorter loading times. The interactive GUI is completely controllable with WiiMote, Classic Controller or GC Controller. diff --git a/gui.pnproj b/gui.pnproj index 523efa8f..8e25e270 100644 --- a/gui.pnproj +++ b/gui.pnproj @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/source/homebrewboot/HomebrewBrowse.cpp b/source/homebrewboot/HomebrewBrowse.cpp index 6bb6173c..4f210b95 100644 --- a/source/homebrewboot/HomebrewBrowse.cpp +++ b/source/homebrewboot/HomebrewBrowse.cpp @@ -142,7 +142,7 @@ int MenuHomebrewBrowse() GuiText backBtnTxt(tr( "Back" ), 22, Theme.prompttext); backBtnTxt.SetMaxWidth(btnOutline.GetWidth() - 30); GuiImage backBtnImg(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { backBtnTxt.SetWidescreen(Settings.widescreen); backBtnImg.SetWidescreen(Settings.widescreen); @@ -302,7 +302,7 @@ int MenuHomebrewBrowse() MainButton4.SetTrigger(&trigA); GuiImage wifiImg(&wifiImgData); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { wifiImg.SetWidescreen(Settings.widescreen); } diff --git a/source/input.cpp b/source/input.cpp index e657f034..67637131 100644 --- a/source/input.cpp +++ b/source/input.cpp @@ -48,7 +48,7 @@ void UpdatePads() userInput[i].pad.triggerL = PAD_TriggerL(i); userInput[i].pad.triggerR = PAD_TriggerR(i); - if (Settings.rumble == RumbleOn) DoRumble(i); + if (Settings.rumble == ON) DoRumble(i); } } diff --git a/source/libwiigui/gui_gamecarousel.cpp b/source/libwiigui/gui_gamecarousel.cpp index ee24639f..dfe10e2f 100644 --- a/source/libwiigui/gui_gamecarousel.cpp +++ b/source/libwiigui/gui_gamecarousel.cpp @@ -78,7 +78,7 @@ GuiGameCarousel::GuiGameCarousel(int w, int h, const char *themePath, const u8 * int btnHeight = (int) lround(sqrt(RADIUS * RADIUS - 90000) - RADIUS - 50); btnLeftImg = new GuiImage(imgLeft); - if (Settings.wsprompt == yes) btnLeftImg->SetWidescreen(Settings.widescreen); + if (Settings.wsprompt == ON) btnLeftImg->SetWidescreen(Settings.widescreen); btnLeft = new GuiButton(imgLeft->GetWidth(), imgLeft->GetHeight()); btnLeft->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); btnLeft->SetPosition(20, btnHeight); @@ -91,7 +91,7 @@ GuiGameCarousel::GuiGameCarousel(int w, int h, const char *themePath, const u8 * btnLeft->SetEffectGrow(); btnRightImg = new GuiImage(imgRight); - if (Settings.wsprompt == yes) btnRightImg->SetWidescreen(Settings.widescreen); + if (Settings.wsprompt == ON) btnRightImg->SetWidescreen(Settings.widescreen); btnRight = new GuiButton(imgRight->GetWidth(), imgRight->GetHeight()); btnRight->SetParent(this); btnRight->SetAlignment(ALIGN_RIGHT, ALIGN_MIDDLE); @@ -261,7 +261,7 @@ void GuiGameCarousel::Draw() } //!Draw tooltip after the Images to have it on top - if (focus && Settings.tooltips == TooltipsOn) for (int i = 0; i < pagesize; i++) + if (focus && Settings.tooltips == ON) for (int i = 0; i < pagesize; i++) game[i]->DrawTooltip(); this->UpdateEffects(); @@ -328,7 +328,7 @@ void GuiGameCarousel::Update(GuiTrigger * t) return; } - if (Settings.xflip == sysmenu || Settings.xflip == yes || Settings.xflip == disk3d) + if (Settings.xflip == XFLIP_SYSMENU || Settings.xflip == XFLIP_YES || Settings.xflip == XFLIP_DISK3D) newspeed = SHIFT_SPEED; else newspeed = -SHIFT_SPEED; } @@ -343,7 +343,7 @@ void GuiGameCarousel::Update(GuiTrigger * t) btnRight->ResetState(); return; } - if (Settings.xflip == sysmenu || Settings.xflip == yes || Settings.xflip == disk3d) + if (Settings.xflip == XFLIP_SYSMENU || Settings.xflip == XFLIP_YES || Settings.xflip == XFLIP_DISK3D) newspeed = -SHIFT_SPEED; else newspeed = SHIFT_SPEED; } diff --git a/source/libwiigui/gui_gamegrid.cpp b/source/libwiigui/gui_gamegrid.cpp index 519df1b9..4d0eb59d 100644 --- a/source/libwiigui/gui_gamegrid.cpp +++ b/source/libwiigui/gui_gamegrid.cpp @@ -440,7 +440,7 @@ void GuiGameGrid::Draw() btnRowUp->Draw(); btnRowDown->Draw(); - if (focus && Settings.tooltips == TooltipsOn) for (int i = 0; i < pagesize; i++) + if (focus && Settings.tooltips == ON) for (int i = 0; i < pagesize; i++) game[i]->DrawTooltip(); this->UpdateEffects(); @@ -503,7 +503,7 @@ void GuiGameGrid::Update(GuiTrigger * t) return; } - if (Settings.xflip == sysmenu || Settings.xflip == yes || Settings.xflip == disk3d) + if (Settings.xflip == XFLIP_SYSMENU || Settings.xflip == XFLIP_YES || Settings.xflip == XFLIP_DISK3D) goRight = goSteps; else goLeft = goSteps; } @@ -518,7 +518,7 @@ void GuiGameGrid::Update(GuiTrigger * t) btnRight->ResetState(); return; } - if (Settings.xflip == sysmenu || Settings.xflip == yes || Settings.xflip == disk3d) + if (Settings.xflip == XFLIP_SYSMENU || Settings.xflip == XFLIP_YES || Settings.xflip == XFLIP_DISK3D) goLeft = goSteps; else goRight = goSteps; } diff --git a/source/main.cpp b/source/main.cpp index 8f547779..74cd5970 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -71,36 +71,12 @@ int main(int argc, char *argv[]) printf("\tStarting up\n"); NandTitles.Get(); - bool bootDevice_found = false; - if (argc >= 1) - { - if (!strncasecmp(argv[0], "usb:/", 5)) - { - strcpy(bootDevice, "USB:"); - bootDevice_found = true; - } - else if (!strncasecmp(argv[0], "sd:/", 4)) bootDevice_found = true; - } - //Let's use libogc sd/usb for config loading printf("\tInitialize sd card\n"); SDCard_Init(); printf("\tInitialize usb device\n"); USBDevice_Init(); - if (!bootDevice_found) - { - printf("\tSearch for configuration file\n"); - //try USB - //left in all the dol and elf files in this check in case this is the first time running the app and they dont have the config - if (CheckFile((char*) "USB:/config/GXglobal.cfg") || (CheckFile((char*) "USB:/apps/usbloader_gx/boot.elf")) - || CheckFile((char*) "USB:/apps/usbloadergx/boot.dol") || (CheckFile( - (char*) "USB:/apps/usbloadergx/boot.elf")) || CheckFile((char*) "USB:/apps/usbloader_gx/boot.dol")) strcpy( - bootDevice, "USB:"); - - printf("\tConfiguration file is on %s\n", bootDevice); - } - gettextCleanUp(); printf("\tLoading configuration..."); Settings.Load(); diff --git a/source/menu.cpp b/source/menu.cpp index 6187bc54..dd91cfc5 100644 --- a/source/menu.cpp +++ b/source/menu.cpp @@ -119,7 +119,7 @@ static void * UpdateGUI(void *arg) } mainWindow->Draw(); - if (Settings.tooltips == TooltipsOn && Theme.show_tooltip != 0 && mainWindow->GetState() != STATE_DISABLED) mainWindow->DrawTooltip(); + if (Settings.tooltips == ON && Theme.show_tooltip != 0 && mainWindow->GetState() != STATE_DISABLED) mainWindow->DrawTooltip(); for (i = 3; i >= 0; i--) { @@ -313,7 +313,6 @@ int MainMenu(int menu) CloseXMLDatabase(); NewTitles::DestroyInstance(); - CFG_Cleanup(); if (strcmp(headlessID, "") != 0) //the GUIthread was never started, so it cant be ended and joined properly if headless mode was used. so we resume it and close it. ResumeGui(); @@ -410,9 +409,9 @@ int MainMenu(int menu) u8 iosChoice = Settings.cios; u8 fix002 = Settings.error002; u8 countrystrings = Settings.patchcountrystrings; - u8 alternatedol = off; + u8 alternatedol = OFF; u32 alternatedoloffset = 0; - u8 reloadblock = off; + u8 reloadblock = OFF; u8 returnToLoaderGV = 1; GameCFG * game_cfg = GameSettings.GetGameCFG(header->id); @@ -463,7 +462,7 @@ int MainMenu(int menu) ret = do_bca_code(header->id); gprintf("%d\n", ret); - if (reloadblock == on && Sys_IsHermes()) + if (reloadblock == ON && Sys_IsHermes()) { enable_ES_ioctlv_vector(); if (load_from_fs == PART_FS_WBFS) diff --git a/source/menu/menu_check.cpp b/source/menu/menu_check.cpp index 06852098..9d7bfdd6 100644 --- a/source/menu/menu_check.cpp +++ b/source/menu/menu_check.cpp @@ -130,7 +130,7 @@ int MenuCheck() } } - if ((ret2 >= 0 || load_from_fs != PART_FS_WBFS) && isInserted(bootDevice)) + if ((ret2 >= 0 || load_from_fs != PART_FS_WBFS) && isInserted(Settings.BootDevice)) { Settings.Save(); break; @@ -169,7 +169,7 @@ int MenuCheck() } // open database if needed, load titles if needed - if (isInserted(bootDevice)) OpenXMLDatabase(Settings.titlestxt_path, Settings.db_language, Settings.db_JPtoEN, + if (isInserted(Settings.BootDevice)) OpenXMLDatabase(Settings.titlestxt_path, Settings.db_language, Settings.db_JPtoEN, true, Settings.titlesOverride == 1 ? true : false, true); // titles.txt loaded after database to override database titles with custom titles diff --git a/source/menu/menu_disclist.cpp b/source/menu/menu_disclist.cpp index 837e83ce..774bbc6f 100644 --- a/source/menu/menu_disclist.cpp +++ b/source/menu/menu_disclist.cpp @@ -193,7 +193,7 @@ int MenuDiscList() gamecntBtn.SetTrigger(&trigA); GuiTooltip installBtnTT(tr( "Install a game" )); - if (Settings.wsprompt == yes) installBtnTT.SetWidescreen(Settings.widescreen); + if (Settings.wsprompt) installBtnTT.SetWidescreen(Settings.widescreen); installBtnTT.SetAlpha(Theme.tooltipAlpha); GuiImage installBtnImg(&btnInstall); GuiImage installBtnImgOver(&btnInstallOver); @@ -204,7 +204,7 @@ int MenuDiscList() &trigA, &btnSoundOver, btnClick2, 1, &installBtnTT, 24, -30, 0, 5); GuiTooltip settingsBtnTT(tr( "Settings" )); - if (Settings.wsprompt == yes) settingsBtnTT.SetWidescreen(Settings.widescreen); + if (Settings.wsprompt) settingsBtnTT.SetWidescreen(Settings.widescreen); settingsBtnTT.SetAlpha(Theme.tooltipAlpha); GuiImage settingsBtnImg(&btnSettings); settingsBtnImg.SetWidescreen(Settings.widescreen); @@ -214,7 +214,7 @@ int MenuDiscList() &btnSoundOver, btnClick2, 1, &settingsBtnTT, 65, -30, 0, 5); GuiTooltip homeBtnTT(tr( "Back to HBC or Wii Menu" )); - if (Settings.wsprompt == yes) homeBtnTT.SetWidescreen(Settings.widescreen); + if (Settings.wsprompt) homeBtnTT.SetWidescreen(Settings.widescreen); settingsBtnTT.SetAlpha(Theme.tooltipAlpha); GuiImage homeBtnImg(&btnhome); homeBtnImg.SetWidescreen(Settings.widescreen); @@ -226,7 +226,7 @@ int MenuDiscList() homeBtn.SetTrigger(&trigHome); GuiTooltip poweroffBtnTT(tr( "Power off the Wii" )); - if (Settings.wsprompt == yes) poweroffBtnTT.SetWidescreen(Settings.widescreen); + if (Settings.wsprompt) poweroffBtnTT.SetWidescreen(Settings.widescreen); poweroffBtnTT.SetAlpha(Theme.tooltipAlpha); GuiImage poweroffBtnImg(&btnpwroff); GuiImage poweroffBtnImgOver(&btnpwroffOver); @@ -236,7 +236,7 @@ int MenuDiscList() &btnSoundOver, btnClick2, 1, &poweroffBtnTT, -10, -30, 1, 5); GuiTooltip sdcardBtnTT(tr( "Reload SD" )); - if (Settings.wsprompt == yes) sdcardBtnTT.SetWidescreen(Settings.widescreen); + if (Settings.wsprompt) sdcardBtnTT.SetWidescreen(Settings.widescreen); sdcardBtnTT.SetAlpha(Theme.tooltipAlpha); GuiImage sdcardImg(&btnsdcard); GuiImage sdcardImgOver(&btnsdcardOver); @@ -250,7 +250,7 @@ int MenuDiscList() gameInfo.SetSoundClick(btnClick2); GuiTooltip favoriteBtnTT(tr( "Display favorites" )); - if (Settings.wsprompt == yes) favoriteBtnTT.SetWidescreen(Settings.widescreen); + if (Settings.wsprompt) favoriteBtnTT.SetWidescreen(Settings.widescreen); favoriteBtnTT.SetAlpha(Theme.tooltipAlpha); GuiImage favoriteBtnImg(&imgfavIcon); favoriteBtnImg.SetWidescreen(Settings.widescreen); @@ -261,7 +261,7 @@ int MenuDiscList() favoriteBtn.SetAlpha(180); GuiTooltip searchBtnTT(tr( "Set Search-Filter" )); - if (Settings.wsprompt == yes) searchBtnTT.SetWidescreen(Settings.widescreen); + if (Settings.wsprompt) searchBtnTT.SetWidescreen(Settings.widescreen); searchBtnTT.SetAlpha(Theme.tooltipAlpha); GuiImage searchBtnImg(&imgsearchIcon); searchBtnImg.SetWidescreen(Settings.widescreen); @@ -271,19 +271,19 @@ int MenuDiscList() Theme.gamelist_search_y, &trigA, &btnSoundOver, btnClick2, 1, &searchBtnTT, -15, 52, 0, 3); searchBtn.SetAlpha(180); - GuiTooltip abcBtnTT(Settings.fave ? tr( "Sort by rank" ) : tr( "Sort alphabetically" )); - if (Settings.wsprompt == yes) abcBtnTT.SetWidescreen(Settings.widescreen); + GuiTooltip abcBtnTT(Settings.GameSort == SORT_RANKING ? tr( "Sort by rank" ) : tr( "Sort alphabetically" )); + if (Settings.wsprompt) abcBtnTT.SetWidescreen(Settings.widescreen); abcBtnTT.SetAlpha(Theme.tooltipAlpha); - GuiImage abcBtnImg(Settings.fave ? &imgrankIcon : &imgabcIcon); + GuiImage abcBtnImg(Settings.GameSort == SORT_RANKING ? &imgrankIcon : &imgabcIcon); abcBtnImg.SetWidescreen(Settings.widescreen); - GuiImage abcBtnImg_g(Settings.fave ? &imgrankIcon_gray : &imgabcIcon_gray); + GuiImage abcBtnImg_g(Settings.GameSort == SORT_RANKING ? &imgrankIcon_gray : &imgabcIcon_gray); abcBtnImg_g.SetWidescreen(Settings.widescreen); GuiButton abcBtn(&abcBtnImg_g, &abcBtnImg_g, ALIGN_LEFT, ALIGN_TOP, Theme.gamelist_abc_x, Theme.gamelist_abc_y, &trigA, &btnSoundOver, btnClick2, 1, &abcBtnTT, -15, 52, 0, 3); abcBtn.SetAlpha(180); GuiTooltip countBtnTT(tr( "Sort order by most played" )); - if (Settings.wsprompt == yes) countBtnTT.SetWidescreen(Settings.widescreen); + if (Settings.wsprompt) countBtnTT.SetWidescreen(Settings.widescreen); countBtnTT.SetAlpha(Theme.tooltipAlpha); GuiImage countBtnImg(&imgplayCountIcon); countBtnImg.SetWidescreen(Settings.widescreen); @@ -294,7 +294,7 @@ int MenuDiscList() countBtn.SetAlpha(180); GuiTooltip listBtnTT(tr( "Display as a list" )); - if (Settings.wsprompt == yes) listBtnTT.SetWidescreen(Settings.widescreen); + if (Settings.wsprompt) listBtnTT.SetWidescreen(Settings.widescreen); listBtnTT.SetAlpha(Theme.tooltipAlpha); GuiImage listBtnImg(&imgarrangeList); listBtnImg.SetWidescreen(Settings.widescreen); @@ -305,7 +305,7 @@ int MenuDiscList() listBtn.SetAlpha(180); GuiTooltip gridBtnTT(tr( "Display as a grid" )); - if (Settings.wsprompt == yes) gridBtnTT.SetWidescreen(Settings.widescreen); + if (Settings.wsprompt) gridBtnTT.SetWidescreen(Settings.widescreen); gridBtnTT.SetAlpha(Theme.tooltipAlpha); GuiImage gridBtnImg(&imgarrangeGrid); gridBtnImg.SetWidescreen(Settings.widescreen); @@ -316,7 +316,7 @@ int MenuDiscList() gridBtn.SetAlpha(180); GuiTooltip carouselBtnTT(tr( "Display as a carousel" )); - if (Settings.wsprompt == yes) carouselBtnTT.SetWidescreen(Settings.widescreen); + if (Settings.wsprompt) carouselBtnTT.SetWidescreen(Settings.widescreen); carouselBtnTT.SetAlpha(Theme.tooltipAlpha); GuiImage carouselBtnImg(&imgarrangeCarousel); carouselBtnImg.SetWidescreen(Settings.widescreen); @@ -329,7 +329,7 @@ int MenuDiscList() bool canUnlock = (Settings.parentalcontrol == 0 && Settings.Parental.enabled == 1); GuiTooltip lockBtnTT(canUnlock ? tr( "Unlock Parental Control" ) : tr( "Parental Control disabled" )); - if (Settings.wsprompt == yes) lockBtnTT.SetWidescreen(Settings.widescreen); + if (Settings.wsprompt) lockBtnTT.SetWidescreen(Settings.widescreen); lockBtnTT.SetAlpha(Theme.tooltipAlpha); GuiImage lockBtnImg(&imgLock); lockBtnImg.SetWidescreen(Settings.widescreen); @@ -340,7 +340,7 @@ int MenuDiscList() lockBtn.SetAlpha(180); GuiTooltip unlockBtnTT(tr( "Enable Parental Control" )); - if (Settings.wsprompt == yes) unlockBtnTT.SetWidescreen(Settings.widescreen); + if (Settings.wsprompt) unlockBtnTT.SetWidescreen(Settings.widescreen); unlockBtnTT.SetAlpha(Theme.tooltipAlpha); GuiImage unlockBtnImg(&imgUnlock); unlockBtnImg.SetWidescreen(Settings.widescreen); @@ -360,7 +360,7 @@ int MenuDiscList() */ GuiTooltip dvdBtnTT(tr( "Mount DVD drive" )); - if (Settings.wsprompt == yes) dvdBtnTT.SetWidescreen(Settings.widescreen); + if (Settings.wsprompt) dvdBtnTT.SetWidescreen(Settings.widescreen); dvdBtnTT.SetAlpha(Theme.tooltipAlpha); GuiImage dvdBtnImg(&imgdvd); dvdBtnImg.SetWidescreen(Settings.widescreen); @@ -371,7 +371,7 @@ int MenuDiscList() dvdBtn.SetAlpha(180); GuiTooltip homebrewBtnTT(tr( "Homebrew Launcher" )); - if (Settings.wsprompt == yes) homebrewBtnTT.SetWidescreen(Settings.widescreen); + if (Settings.wsprompt) homebrewBtnTT.SetWidescreen(Settings.widescreen); homebrewBtnTT.SetAlpha(Theme.tooltipAlpha); GuiImage homebrewImg(&homebrewImgData); GuiImage homebrewImgOver(&homebrewImgDataOver); @@ -380,7 +380,7 @@ int MenuDiscList() GuiButton homebrewBtn(&homebrewImg, &homebrewImgOver, ALIGN_LEFT, ALIGN_TOP, Theme.homebrew_x, Theme.homebrew_y, &trigA, &btnSoundOver, btnClick2, 1, &homebrewBtnTT, 15, -30, 1, 5); - if (Settings.fave) + if (Settings.GameSort == SORT_RANKING) { favoriteBtn.SetImage(&favoriteBtnImg); favoriteBtn.SetImageOver(&favoriteBtnImg); @@ -395,38 +395,38 @@ int MenuDiscList() searchBtn.SetImageOver(&searchBtnImg); searchBtn.SetAlpha(255); } - if (Settings.sort == ALL) + if (Settings.GameSort == SORT_ABC) { abcBtn.SetImage(&abcBtnImg); abcBtn.SetImageOver(&abcBtnImg); abcBtn.SetAlpha(255); } - else if (Settings.sort == PLAYCOUNT) + else if (Settings.GameSort == SORT_PLAYCOUNT) { countBtn.SetImage(&countBtnImg); countBtn.SetImageOver(&countBtnImg); countBtn.SetAlpha(255); } - if (Settings.gameDisplay == list) + if (Settings.gameDisplay == LIST_MODE) { listBtn.SetImage(&listBtnImg); listBtn.SetImageOver(&listBtnImg); listBtn.SetAlpha(255); } - else if (Settings.gameDisplay == grid) + else if (Settings.gameDisplay == GRID_MODE) { gridBtn.SetImage(&gridBtnImg); gridBtn.SetImageOver(&gridBtnImg); gridBtn.SetAlpha(255); } - else if (Settings.gameDisplay == carousel) + else if (Settings.gameDisplay == CAROUSEL_MODE) { carouselBtn.SetImage(&carouselBtnImg); carouselBtn.SetImageOver(&carouselBtnImg); carouselBtn.SetAlpha(255); } - if (Settings.gameDisplay == list) + if (Settings.gameDisplay == LIST_MODE) { favoriteBtn.SetPosition(Theme.gamelist_favorite_x, Theme.gamelist_favorite_y); searchBtn.SetPosition(Theme.gamelist_search_x, Theme.gamelist_search_y); @@ -438,7 +438,7 @@ int MenuDiscList() lockBtn.SetPosition(Theme.gamelist_lock_x, Theme.gamelist_lock_y); dvdBtn.SetPosition(Theme.gamelist_dvd_x, Theme.gamelist_dvd_y); } - else if (Settings.gameDisplay == grid) + else if (Settings.gameDisplay == GRID_MODE) { favoriteBtn.SetPosition(Theme.gamegrid_favorite_x, Theme.gamegrid_favorite_y); searchBtn.SetPosition(Theme.gamegrid_search_x, Theme.gamegrid_search_y); @@ -450,7 +450,7 @@ int MenuDiscList() lockBtn.SetPosition(Theme.gamegrid_lock_x, Theme.gamegrid_lock_y); dvdBtn.SetPosition(Theme.gamegrid_dvd_x, Theme.gamegrid_dvd_y); } - else if (Settings.gameDisplay == carousel) + else if (Settings.gameDisplay == CAROUSEL_MODE) { favoriteBtn.SetPosition(Theme.gamecarousel_favorite_x, Theme.gamecarousel_favorite_y); searchBtn.SetPosition(Theme.gamecarousel_search_x, Theme.gamecarousel_favorite_y); @@ -465,14 +465,14 @@ int MenuDiscList() //Downloading Covers GuiTooltip DownloadBtnTT(tr( "Click to Download Covers" )); - if (Settings.wsprompt == yes) DownloadBtnTT.SetWidescreen(Settings.widescreen); + if (Settings.wsprompt) DownloadBtnTT.SetWidescreen(Settings.widescreen); DownloadBtnTT.SetAlpha(Theme.tooltipAlpha); GuiButton DownloadBtn(0, 0); DownloadBtn.SetAlignment(ALIGN_LEFT, ALIGN_TOP); DownloadBtn.SetPosition(Theme.covers_x, Theme.covers_y); GuiTooltip IDBtnTT(tr( "Click to change game ID" )); - if (Settings.wsprompt == yes) IDBtnTT.SetWidescreen(Settings.widescreen); + if (Settings.wsprompt) IDBtnTT.SetWidescreen(Settings.widescreen); IDBtnTT.SetAlpha(Theme.tooltipAlpha); GuiButton idBtn(0, 0); idBtn.SetAlignment(ALIGN_LEFT, ALIGN_TOP); @@ -499,19 +499,19 @@ int MenuDiscList() GuiGameBrowser * gameBrowser = NULL; GuiGameGrid * gameGrid = NULL; GuiGameCarousel * gameCarousel = NULL; - if (Settings.gameDisplay == list) + if (Settings.gameDisplay == LIST_MODE) { gameBrowser = new GuiGameBrowser(Theme.gamelist_w, Theme.gamelist_h, startat, offset); gameBrowser->SetPosition(Theme.gamelist_x, Theme.gamelist_y); gameBrowser->SetAlignment(ALIGN_LEFT, ALIGN_CENTRE); } - else if (Settings.gameDisplay == grid) + else if (Settings.gameDisplay == GRID_MODE) { gameGrid = new GuiGameGrid(Theme.gamegrid_w, Theme.gamegrid_h, Settings.theme_path, bg_options_png, 0, 0); gameGrid->SetPosition(Theme.gamegrid_x, Theme.gamegrid_y); gameGrid->SetAlignment(ALIGN_LEFT, ALIGN_CENTRE); } - else if (Settings.gameDisplay == carousel) + else if (Settings.gameDisplay == CAROUSEL_MODE) { //GuiGameCarousel gameCarousel(Theme.gamecarousel_w, Theme.gamecarousel_h, gameList, gameList.size(), Settings.theme_path, bg_options_png, startat, offset); gameCarousel = new GuiGameCarousel(640, 400, Settings.theme_path, bg_options_png, startat, offset); @@ -574,21 +574,21 @@ int MenuDiscList() if (Settings.godmode == 1) w.Append(&homebrewBtn); - if ((Settings.hddinfo == hr12) || (Settings.hddinfo == hr24)) + if ((Settings.hddinfo == CLOCK_HR12) || (Settings.hddinfo == CLOCK_HR24)) { w.Append(&clockTimeBack); w.Append(&clockTime); } - if (Settings.gameDisplay == list) + if (Settings.gameDisplay == LIST_MODE) { mainWindow->Append(gameBrowser); } - if (Settings.gameDisplay == grid) + if (Settings.gameDisplay == GRID_MODE) { mainWindow->Append(gameGrid); } - if (Settings.gameDisplay == carousel) + if (Settings.gameDisplay == CAROUSEL_MODE) { mainWindow->Append(gameCarousel); } @@ -630,36 +630,21 @@ int MenuDiscList() WDVD_GetCoverStatus(&covert);//for detecting if i disc has been inserted - // if the idiot is showing favorites and don't have any - if (Settings.fave && !gameList.size()) - { - WindowPrompt(tr( "No Favorites" ), - tr( "You are choosing to display favorites and you do not have any selected." ), tr( "Back" )); - Settings.fave = !Settings.fave; - if (isInserted(bootDevice)) - { - Settings.Save(); - } - gameList.FilterList(); - menu = MENU_DISCLIST; - break; - } - //CLOCK time_t rawtime = time(0); - if (((Settings.hddinfo == hr12) || (Settings.hddinfo == hr24)) && rawtime != lastrawtime) + if (((Settings.hddinfo == CLOCK_HR12) || (Settings.hddinfo == CLOCK_HR24)) && rawtime != lastrawtime) { lastrawtime = rawtime; timeinfo = localtime(&rawtime); if (dataed < 1) { - if (Settings.hddinfo == hr12) + if (Settings.hddinfo == CLOCK_HR12) { if (rawtime & 1) strftime(theTime, sizeof(theTime), "%I:%M", timeinfo); else strftime(theTime, sizeof(theTime), "%I %M", timeinfo); } - if (Settings.hddinfo == hr24) + if (Settings.hddinfo == CLOCK_HR24) { if (rawtime & 1) strftime(theTime, sizeof(theTime), "%H:%M", timeinfo); @@ -716,15 +701,15 @@ int MenuDiscList() else { poweroffBtn.ResetState(); - if (Settings.gameDisplay == list) + if (Settings.gameDisplay == LIST_MODE) { gameBrowser->SetFocus(1); } - else if (Settings.gameDisplay == grid) + else if (Settings.gameDisplay == GRID_MODE) { gameGrid->SetFocus(1); } - else if (Settings.gameDisplay == carousel) + else if (Settings.gameDisplay == CAROUSEL_MODE) { gameCarousel->SetFocus(1); } @@ -772,15 +757,15 @@ int MenuDiscList() else { homeBtn.ResetState(); - if (Settings.gameDisplay == list) + if (Settings.gameDisplay == LIST_MODE) { gameBrowser->SetFocus(1); } - else if (Settings.gameDisplay == grid) + else if (Settings.gameDisplay == GRID_MODE) { gameGrid->SetFocus(1); } - else if (Settings.gameDisplay == carousel) + else if (Settings.gameDisplay == CAROUSEL_MODE) { gameCarousel->SetFocus(1); } @@ -798,15 +783,15 @@ int MenuDiscList() else { installBtn.ResetState(); - if (Settings.gameDisplay == list) + if (Settings.gameDisplay == LIST_MODE) { gameBrowser->SetFocus(1); } - else if (Settings.gameDisplay == grid) + else if (Settings.gameDisplay == GRID_MODE) { gameGrid->SetFocus(1); } - else if (Settings.gameDisplay == carousel) + else if (Settings.gameDisplay == CAROUSEL_MODE) { gameCarousel->SetFocus(1); } @@ -829,15 +814,15 @@ int MenuDiscList() } else { - if (Settings.gameDisplay == list) + if (Settings.gameDisplay == LIST_MODE) { gameBrowser->SetFocus(1); } - else if (Settings.gameDisplay == grid) + else if (Settings.gameDisplay == GRID_MODE) { gameGrid->SetFocus(1); } - else if (Settings.gameDisplay == carousel) + else if (Settings.gameDisplay == CAROUSEL_MODE) { gameCarousel->SetFocus(1); } @@ -849,22 +834,22 @@ int MenuDiscList() gprintf("\tsdCardBtn Clicked\n"); SDCard_deInit(); SDCard_Init(); - if (Settings.gameDisplay == list) + if (Settings.gameDisplay == LIST_MODE) { startat = gameBrowser->GetSelectedOption(); offset = gameBrowser->GetOffset(); } - else if (Settings.gameDisplay == grid) + else if (Settings.gameDisplay == GRID_MODE) { startat = gameGrid->GetSelectedOption(); offset = gameGrid->GetOffset(); } - else if (Settings.gameDisplay == carousel) + else if (Settings.gameDisplay == CAROUSEL_MODE) { startat = gameCarousel->GetSelectedOption(); offset = gameCarousel->GetOffset(); } - if (isInserted(bootDevice)) + if (isInserted(Settings.BootDevice)) { HaltGui(); // to fix endless rumble when clicking on the SD icon when rumble is disabled because rumble is set to on in Global_Default() Settings.Load(); @@ -878,7 +863,7 @@ int MenuDiscList() else if (DownloadBtn.GetState() == STATE_CLICKED) { gprintf("\tDownloadBtn Clicked\n"); - if (isInserted(bootDevice)) + if (isInserted(Settings.BootDevice)) { choice = WindowPrompt(tr( "Cover Download" ), 0, tr( "Normal Covers" ), tr( "3D Covers" ), tr( "Disc Images" ), tr( "Back" )); // ask for download choice @@ -924,15 +909,15 @@ int MenuDiscList() } menu = MENU_DISCLIST; DownloadBtn.ResetState(); - if (Settings.gameDisplay == list) + if (Settings.gameDisplay == LIST_MODE) { gameBrowser->SetFocus(1); } - else if (Settings.gameDisplay == grid) + else if (Settings.gameDisplay == GRID_MODE) { gameGrid->SetFocus(1); } - else if (Settings.gameDisplay == carousel) + else if (Settings.gameDisplay == CAROUSEL_MODE) { gameCarousel->SetFocus(1); } @@ -941,17 +926,17 @@ int MenuDiscList() else if (settingsBtn.GetState() == STATE_CLICKED) { gprintf("\tsettingsBtn Clicked\n"); - if (Settings.gameDisplay == list) + if (Settings.gameDisplay == LIST_MODE) { startat = gameBrowser->GetSelectedOption(); offset = gameBrowser->GetOffset(); } - else if (Settings.gameDisplay == grid) + else if (Settings.gameDisplay == GRID_MODE) { startat = gameGrid->GetSelectedOption(); offset = gameGrid->GetOffset(); } - else if (Settings.gameDisplay == carousel) + else if (Settings.gameDisplay == CAROUSEL_MODE) { startat = gameCarousel->GetSelectedOption(); offset = gameCarousel->GetOffset(); @@ -963,16 +948,20 @@ int MenuDiscList() else if (favoriteBtn.GetState() == STATE_CLICKED) { - gprintf("\tfavoriteBtn Clicked\n"); - Settings.fave = !Settings.fave; - if (isInserted(bootDevice)) - { - Settings.Save(); - } - gameList.FilterList(); - menu = MENU_DISCLIST; - break; - + if(Settings.GameSort != SORT_RANKING) + { + gprintf("\tfavoriteBtn Clicked\n"); + Settings.GameSort = SORT_RANKING; + if (isInserted(Settings.BootDevice)) + { + Settings.Save(); + } + gameList.FilterList(); + menu = MENU_DISCLIST; + break; + } + else + favoriteBtn.ResetState(); } else if (searchBtn.GetState() == STATE_CLICKED && mountMethod != 3) @@ -1063,10 +1052,10 @@ int MenuDiscList() else if (abcBtn.GetState() == STATE_CLICKED) { gprintf("\tabcBtn clicked\n"); - if (Settings.sort != ALL) + if (Settings.GameSort != SORT_ABC) { - Settings.sort = ALL; - if (isInserted(bootDevice)) + Settings.GameSort = SORT_ABC; + if (isInserted(Settings.BootDevice)) { Settings.Save(); } @@ -1081,10 +1070,10 @@ int MenuDiscList() else if (countBtn.GetState() == STATE_CLICKED) { gprintf("\tcountBtn Clicked\n"); - if (Settings.sort != PLAYCOUNT) + if (Settings.GameSort != SORT_PLAYCOUNT) { - Settings.sort = PLAYCOUNT; - if (isInserted(bootDevice)) + Settings.GameSort = SORT_PLAYCOUNT; + if (isInserted(Settings.BootDevice)) { Settings.Save(); } @@ -1100,11 +1089,11 @@ int MenuDiscList() else if (listBtn.GetState() == STATE_CLICKED) { gprintf("\tlistBtn Clicked\n"); - if (Settings.gameDisplay != list) + if (Settings.gameDisplay != LIST_MODE) { - Settings.gameDisplay = list; + Settings.gameDisplay = LIST_MODE; menu = MENU_DISCLIST; - if (isInserted(bootDevice)) + if (isInserted(Settings.BootDevice)) { Settings.Save(); } @@ -1120,12 +1109,12 @@ int MenuDiscList() else if (gridBtn.GetState() == STATE_CLICKED) { gprintf("\tgridBtn Clicked\n"); - if (Settings.gameDisplay != grid) + if (Settings.gameDisplay != GRID_MODE) { - Settings.gameDisplay = grid; + Settings.gameDisplay = GRID_MODE; menu = MENU_DISCLIST; - if (isInserted(bootDevice)) + if (isInserted(Settings.BootDevice)) { Settings.Save(); } @@ -1141,11 +1130,11 @@ int MenuDiscList() else if (carouselBtn.GetState() == STATE_CLICKED) { gprintf("\tcarouselBtn Clicked\n"); - if (Settings.gameDisplay != carousel) + if (Settings.gameDisplay != CAROUSEL_MODE) { - Settings.gameDisplay = carousel; + Settings.gameDisplay = CAROUSEL_MODE; menu = MENU_DISCLIST; - if (isInserted(bootDevice)) + if (isInserted(Settings.BootDevice)) { Settings.Save(); } @@ -1253,7 +1242,7 @@ int MenuDiscList() rockout(); //break; } - if (Settings.gameDisplay == grid) + if (Settings.gameDisplay == GRID_MODE) { int selectimg; DownloadBtn.SetSize(0, 0); @@ -1262,7 +1251,7 @@ int MenuDiscList() selectImg1 = selectimg; } - if (Settings.gameDisplay == carousel) + if (Settings.gameDisplay == CAROUSEL_MODE) { int selectimg; DownloadBtn.SetSize(0, 0); @@ -1270,7 +1259,7 @@ int MenuDiscList() gameSelected = gameCarousel->GetClickedOption(); selectImg1 = selectimg; } - if (Settings.gameDisplay == list) + if (Settings.gameDisplay == LIST_MODE) { //Get selected game under cursor int selectimg; @@ -1357,7 +1346,7 @@ int MenuDiscList() DownloadBtn.SetImage(coverImg);// put the new image on the download button w.Append(&DownloadBtn); - if ((Settings.sinfo == GameID) || (Settings.sinfo == Both)) + if ((Settings.sinfo == GAMEINFO_ID) || (Settings.sinfo == GAMEINFO_BOTH)) { GameIDTxt = new GuiText(IDfull, 22, Theme.info); GameIDTxt->SetAlignment(ALIGN_LEFT, ALIGN_TOP); @@ -1367,7 +1356,7 @@ int MenuDiscList() w.Append(&idBtn); } //don't try to show region for channels because all the custom channels wont follow the rules - if (((Settings.sinfo == GameRegion) || (Settings.sinfo == Both)) && mountMethod != 3) + if (((Settings.sinfo == GAMEINFO_REGION) || (Settings.sinfo == GAMEINFO_BOTH)) && mountMethod != 3) { GameRegionTxt = new GuiText(gameregion, 22, Theme.info); GameRegionTxt->SetAlignment(ALIGN_LEFT, ALIGN_TOP); @@ -1442,13 +1431,13 @@ int MenuDiscList() } else { - alternatedol = off; + alternatedol = OFF; ocarinaChoice = Settings.ocarina; } - if (Settings.quickboot == yes) //quickboot game + if (Settings.quickboot == ON) //quickboot game { - if (alternatedol == on) + if (alternatedol == ON) { /* Open dol File and check exist */ sprintf(nipple, "%s%s.dol", Settings.dolpath, IDfull); @@ -1466,7 +1455,7 @@ int MenuDiscList() fclose(exeFile); } } - if (ocarinaChoice != off) + if (ocarinaChoice != OFF) { /* Open gct File and check exist */ sprintf(nipple, "%s%s.gct", Settings.Cheatcodespath, IDfull); @@ -1485,7 +1474,7 @@ int MenuDiscList() } wiilight(0); - if (isInserted(bootDevice)) + if (isInserted(Settings.BootDevice)) { //////////save game play count//////////////// GameStatistics.SetPlayCount(header->id, GameStatistics.GetPlayCount(header->id)+1); @@ -1503,13 +1492,13 @@ int MenuDiscList() while (returnHere) { returnHere = false; - if (Settings.wiilight != wiilight_forInstall) wiilight(1); + if (Settings.wiilight != WIILIGHT_INSTALL) wiilight(1); choice = GameWindowPrompt(); // header = gameList[gameSelected]; //reset header if (choice == 1) { - if (alternatedol == on) + if (alternatedol == ON) { /* Open dol File and check exist */ sprintf(nipple, "%s%s.dol", Settings.dolpath, IDfull); @@ -1528,7 +1517,7 @@ int MenuDiscList() fclose(exeFile); } } - if (ocarinaChoice != off) + if (ocarinaChoice != OFF) { /* Open gct File and check exist */ sprintf(nipple, "%s%s.gct", Settings.Cheatcodespath, IDfull); @@ -1554,11 +1543,11 @@ int MenuDiscList() { wiilight(0); HaltGui(); - if (Settings.gameDisplay == list) + if (Settings.gameDisplay == LIST_MODE) mainWindow->Remove(gameBrowser); - else if (Settings.gameDisplay == grid) + else if (Settings.gameDisplay == GRID_MODE) mainWindow->Remove(gameGrid); - else if (Settings.gameDisplay == carousel) mainWindow->Remove(gameCarousel); + else if (Settings.gameDisplay == CAROUSEL_MODE) mainWindow->Remove(gameCarousel); mainWindow->Remove(&w); ResumeGui(); @@ -1569,11 +1558,11 @@ int MenuDiscList() //menu = MENU_DISCLIST; // refresh titles (needed if the language setting has changed) */ HaltGui(); - if (Settings.gameDisplay == list) + if (Settings.gameDisplay == LIST_MODE) mainWindow->Append(gameBrowser); - else if (Settings.gameDisplay == grid) + else if (Settings.gameDisplay == GRID_MODE) mainWindow->Append(gameGrid); - else if (Settings.gameDisplay == carousel) mainWindow->Append(gameCarousel); + else if (Settings.gameDisplay == CAROUSEL_MODE) mainWindow->Append(gameCarousel); mainWindow->Append(&w); ResumeGui(); if (settret == 1) //if deleted @@ -1608,15 +1597,15 @@ int MenuDiscList() { rockout(2); if (mountMethod == 1 || mountMethod == 2) mountMethod = mountMethodOLD; - if (Settings.gameDisplay == list) + if (Settings.gameDisplay == LIST_MODE) { gameBrowser->SetFocus(1); } - else if (Settings.gameDisplay == grid) + else if (Settings.gameDisplay == GRID_MODE) { gameGrid->SetFocus(1); } - else if (Settings.gameDisplay == carousel) + else if (Settings.gameDisplay == CAROUSEL_MODE) { gameCarousel->SetFocus(1); } diff --git a/source/patches/gamepatches.c b/source/patches/gamepatches.c index fc3804ab..edbbd4e9 100644 --- a/source/patches/gamepatches.c +++ b/source/patches/gamepatches.c @@ -4,7 +4,7 @@ #include "dolpatcher.h" #include "wip.h" #include "gecko.h" -#include "../settings/cfg.h" +#include "../settings/SettingsEnums.h" /** Anti 002 fix for IOS 249 rev > 12 thanks to WiiPower **/ bool Anti_002_fix(u8 * Address, int Size) @@ -238,7 +238,7 @@ static bool Search_and_patch_Video_Modes(u8 * Address, u32 Size, GXRModeObj* Tab void VideoModePatcher(u8 * dst, int len, u8 videoSelected) { GXRModeObj** table = NULL; - if (videoSelected == patch) // patch enum'd in cfg.h + if (videoSelected == VIDEO_MODE_PATCH) // patch enum'd in cfg.h { switch (CONF_GetVideo()) diff --git a/source/patches/patchcode.c b/source/patches/patchcode.c index 9ad440f8..9b442a80 100644 --- a/source/patches/patchcode.c +++ b/source/patches/patchcode.c @@ -26,7 +26,7 @@ #include "usbloader/apploader.h" #include "patchcode.h" -#include "settings/cfg.h" +#include "settings/SettingsEnums.h" #include "FileOperations/fileops.h" #include "fst.h" @@ -324,37 +324,37 @@ void langpatcher(void *addr, u32 len, u8 languageChoice) u8 ocarinaLangPatchByte = 1; switch (languageChoice) { - case jap: + case JAPANESE: ocarinaLangPatchByte = 0x00; break; - case eng: + case ENGLISH: ocarinaLangPatchByte = 0x01; break; - case ger: + case GERMAN: ocarinaLangPatchByte = 0x02; break; - case fren: + case FRENCH: ocarinaLangPatchByte = 0x03; break; - case esp: + case SPANISH: ocarinaLangPatchByte = 0x04; break; - case it: + case ITALIAN: ocarinaLangPatchByte = 0x05; break; - case dut: + case DUTCH: ocarinaLangPatchByte = 0x06; break; - case schin: + case S_CHINESE: ocarinaLangPatchByte = 0x07; break; - case tchin: + case T_CHINESE: ocarinaLangPatchByte = 0x08; break; - case kor: + case KOREAN: ocarinaLangPatchByte = 0x09; break; - case ConsoleLangDefault: + case CONSOLE_DEFAULT: default: return; break; diff --git a/source/prompts/DiscBrowser.cpp b/source/prompts/DiscBrowser.cpp index 61606f19..399dd154 100644 --- a/source/prompts/DiscBrowser.cpp +++ b/source/prompts/DiscBrowser.cpp @@ -37,7 +37,7 @@ extern u8 mountMethod; /******************************************************************************** *Disk Browser *********************************************************************************/ -int DiscBrowse(struct discHdr * header) +int DiscBrowse(struct discHdr * header, char * alternatedname, int alternatedname_size) { gprintf("\nDiscBrowser() started"); bool exit = false; @@ -130,7 +130,7 @@ int DiscBrowse(struct discHdr * header) GuiText cancelBtnTxt(tr( "Back" ), 22, Theme.prompttext); cancelBtnTxt.SetMaxWidth(btnOutline.GetWidth() - 30); GuiImage cancelBtnImg(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt == ON) { cancelBtnTxt.SetWidescreen(Settings.widescreen); cancelBtnImg.SetWidescreen(Settings.widescreen); @@ -174,7 +174,7 @@ int DiscBrowse(struct discHdr * header) if (choice) { //ret = offsetselect[ret]; - strlcpy(alternatedname, temp, sizeof(alternatedname)); + strlcpy(alternatedname, temp, alternatedname_size); exit = true; } } diff --git a/source/prompts/DiscBrowser.h b/source/prompts/DiscBrowser.h index 4ea20536..06bc538c 100644 --- a/source/prompts/DiscBrowser.h +++ b/source/prompts/DiscBrowser.h @@ -8,7 +8,7 @@ #ifndef _DISCBROWSER_H_ #define _DISCBROWSER_H_ -int DiscBrowse(struct discHdr * header); +int DiscBrowse(struct discHdr * header, char * dolname, int dolname_size); int autoSelectDol(const char *id, bool force); int autoSelectDolMenu(const char *id, bool force); u8 DiscMount(struct discHdr * header); diff --git a/source/prompts/ProgressWindow.cpp b/source/prompts/ProgressWindow.cpp index 805c9bd7..ff8cc06d 100644 --- a/source/prompts/ProgressWindow.cpp +++ b/source/prompts/ProgressWindow.cpp @@ -135,7 +135,7 @@ static void ProgressWindow(const char *title, const char *msg1, const char *msg2 trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); GuiImage dialogBoxImg(&dialogBox); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { dialogBoxImg.SetWidescreen(Settings.widescreen); } @@ -143,7 +143,7 @@ static void ProgressWindow(const char *title, const char *msg1, const char *msg2 GuiImageData progressbarOutline(Resources::GetFile("progressbar_outline.png"), Resources::GetFileSize("progressbar_outline.png")); GuiImage progressbarOutlineImg(&progressbarOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { progressbarOutlineImg.SetWidescreen(Settings.widescreen); } @@ -197,7 +197,7 @@ static void ProgressWindow(const char *title, const char *msg1, const char *msg2 prTxt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); prTxt.SetPosition(200, 40); - if ((Settings.wsprompt == yes) && (Settings.widescreen)) /////////////adjust for widescreen + if ((Settings.wsprompt) && (Settings.widescreen)) /////////////adjust for widescreen { progressbarOutlineImg.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); progressbarOutlineImg.SetPosition(0, 40); @@ -258,7 +258,7 @@ static void ProgressWindow(const char *title, const char *msg1, const char *msg2 tmp = static_cast (progressbarImg.GetWidth() * progressDone); - if (Settings.widescreen && Settings.wsprompt == yes) + if (Settings.widescreen && Settings.wsprompt) progressbarImg.SetSkew(0, 0, static_cast (progressbarImg.GetWidth() * progressDone * 0.8) - progressbarImg.GetWidth(), 0, static_cast (progressbarImg.GetWidth() * progressDone * 0.8) - progressbarImg.GetWidth(), 0, 0, 0); diff --git a/source/prompts/PromptWindows.cpp b/source/prompts/PromptWindows.cpp index 085e028e..0d1ef1ca 100644 --- a/source/prompts/PromptWindows.cpp +++ b/source/prompts/PromptWindows.cpp @@ -87,7 +87,7 @@ int OnScreenNumpad(char * var, u32 maxlen) GuiText okBtnTxt(tr( "OK" ), 22, Theme.prompttext); GuiImage okBtnImg(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { okBtnTxt.SetWidescreen(Settings.widescreen); okBtnImg.SetWidescreen(Settings.widescreen); @@ -96,7 +96,7 @@ int OnScreenNumpad(char * var, u32 maxlen) okBtn.SetLabel(&okBtnTxt); GuiText cancelBtnTxt(tr( "Cancel" ), 22, Theme.prompttext); GuiImage cancelBtnImg(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { cancelBtnTxt.SetWidescreen(Settings.widescreen); cancelBtnImg.SetWidescreen(Settings.widescreen); @@ -146,20 +146,10 @@ int OnScreenKeyboard(char * var, u32 maxlen, int min) { int save = -1; - int keyset = 0; - if (Settings.keyset == us) - keyset = 0; - else if (Settings.keyset == dvorak) - keyset = 1; - else if (Settings.keyset == euro) - keyset = 2; - else if (Settings.keyset == azerty) - keyset = 3; - else if (Settings.keyset == qwerty) keyset = 4; - gprintf("\nOnScreenKeyboard(%s, %i, %i) \n\tkeyset = %i", var, maxlen, min, keyset); + gprintf("\nOnScreenKeyboard(%s, %i, %i) \n\tkeyset = %i", var, maxlen, min, Settings.keyset); - GuiKeyboard keyboard(var, maxlen, min, keyset); + GuiKeyboard keyboard(var, maxlen, min, Settings.keyset); GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, Settings.sfxvolume); // because destroy GuiSound must wait while sound playing is finished, we use a global sound @@ -175,7 +165,7 @@ int OnScreenKeyboard(char * var, u32 maxlen, int min) GuiText okBtnTxt(tr( "OK" ), 22, Theme.prompttext); GuiImage okBtnImg(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { okBtnTxt.SetWidescreen(Settings.widescreen); okBtnImg.SetWidescreen(Settings.widescreen); @@ -184,7 +174,7 @@ int OnScreenKeyboard(char * var, u32 maxlen, int min) okBtn.SetLabel(&okBtnTxt); GuiText cancelBtnTxt(tr( "Cancel" ), 22, Theme.prompttext); GuiImage cancelBtnImg(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { cancelBtnTxt.SetWidescreen(Settings.widescreen); cancelBtnImg.SetWidescreen(Settings.widescreen); @@ -549,7 +539,7 @@ int WindowPrompt(const char *title, const char *msg, const char *btn1Label, cons trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B); GuiImage dialogBoxImg(&dialogBox); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { dialogBoxImg.SetWidescreen(Settings.widescreen); } @@ -564,7 +554,7 @@ int WindowPrompt(const char *title, const char *msg, const char *btn1Label, cons GuiText btn1Txt(btn1Label, 22, Theme.prompttext); GuiImage btn1Img(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { btn1Txt.SetWidescreen(Settings.widescreen); btn1Img.SetWidescreen(Settings.widescreen); @@ -576,7 +566,7 @@ int WindowPrompt(const char *title, const char *msg, const char *btn1Label, cons GuiText btn2Txt(btn2Label, 22, Theme.prompttext); GuiImage btn2Img(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { btn2Txt.SetWidescreen(Settings.widescreen); btn2Img.SetWidescreen(Settings.widescreen); @@ -587,7 +577,7 @@ int WindowPrompt(const char *title, const char *msg, const char *btn1Label, cons GuiText btn3Txt(btn3Label, 22, Theme.prompttext); GuiImage btn3Img(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { btn3Txt.SetWidescreen(Settings.widescreen); btn3Img.SetWidescreen(Settings.widescreen); @@ -598,7 +588,7 @@ int WindowPrompt(const char *title, const char *msg, const char *btn1Label, cons GuiText btn4Txt(btn4Label, 22, Theme.prompttext); GuiImage btn4Img(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { btn4Txt.SetWidescreen(Settings.widescreen); btn4Img.SetWidescreen(Settings.widescreen); @@ -607,7 +597,7 @@ int WindowPrompt(const char *title, const char *msg, const char *btn1Label, cons btn4.SetLabel(&btn4Txt); if (btn4Label) btn4.SetTrigger(&trigB); - if ((Settings.wsprompt == yes) && (Settings.widescreen)) /////////////adjust buttons for widescreen + if ((Settings.wsprompt) && (Settings.widescreen)) /////////////adjust buttons for widescreen { msgTxt.SetMaxWidth(330); @@ -909,7 +899,7 @@ int WindowExitPrompt() { 0, 0, 0, 255}); closeTxt.SetPosition(10, 3); GuiImage closeImg(&close); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { closeTxt.SetWidescreen(Settings.widescreen); closeImg.SetWidescreen(Settings.widescreen); @@ -930,7 +920,7 @@ int WindowExitPrompt() GuiText btn2Txt(tr( "Back to Loader" ), 28, ( GXColor ) { 0, 0, 0, 255}); GuiImage btn2Img(&button); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { btn2Txt.SetWidescreen(Settings.widescreen); btn2Img.SetWidescreen(Settings.widescreen); @@ -944,7 +934,7 @@ int WindowExitPrompt() GuiText btn3Txt(tr( "Wii Menu" ), 28, ( GXColor ) { 0, 0, 0, 255}); GuiImage btn3Img(&button); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { btn3Txt.SetWidescreen(Settings.widescreen); btn3Img.SetWidescreen(Settings.widescreen); @@ -963,7 +953,7 @@ int WindowExitPrompt() btn4.SetEffect(EFFECT_SLIDE_BOTTOM | EFFECT_SLIDE_IN, 50); GuiImage wiimoteImg(&wiimote); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { wiimoteImg.SetWidescreen(Settings.widescreen); } @@ -1242,9 +1232,9 @@ int GameWindowPrompt() GuiImage dialogBoxImg(&dialogBox); GuiTooltip nameBtnTT(tr( "Rename Game on WBFS" )); - if (Settings.wsprompt == yes) nameBtnTT.SetWidescreen(Settings.widescreen); + if (Settings.wsprompt) nameBtnTT.SetWidescreen(Settings.widescreen); GuiText nameTxt("", 22, Theme.prompttext); - if (Settings.wsprompt == yes) nameTxt.SetWidescreen(Settings.widescreen); + if (Settings.wsprompt) nameTxt.SetWidescreen(Settings.widescreen); nameTxt.SetMaxWidth(350, SCROLL_HORIZONTAL); GuiButton nameBtn(120, 50); nameBtn.SetLabel(&nameTxt); @@ -1293,7 +1283,7 @@ int GameWindowPrompt() GuiText btn2Txt(tr( "Back" ), 22, Theme.prompttext); GuiImage btn2Img(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { btn2Txt.SetWidescreen(Settings.widescreen); btn2Img.SetWidescreen(Settings.widescreen); @@ -1315,7 +1305,7 @@ int GameWindowPrompt() GuiText btn3Txt(tr( "Settings" ), 22, Theme.prompttext); GuiImage btn3Img(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { btn3Txt.SetWidescreen(Settings.widescreen); btn3Img.SetWidescreen(Settings.widescreen); @@ -1353,7 +1343,7 @@ int GameWindowPrompt() SetupLockedButton(&btnLocked, &btnLockedImg, &btnSoundOver, btnClick2, &trigA); GuiImage btnLeftImg(&imgLeft); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { btnLeftImg.SetWidescreen(Settings.widescreen); } @@ -1362,7 +1352,7 @@ int GameWindowPrompt() btnLeft.SetTrigger(&trigMinus); GuiImage btnRightImg(&imgRight); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { btnRightImg.SetWidescreen(Settings.widescreen); } @@ -1606,7 +1596,7 @@ int GameWindowPrompt() } else if (btnFavorite1.GetState() == STATE_CLICKED) //switch favorite { - if (isInserted(bootDevice)) + if (isInserted(Settings.BootDevice)) { SetFavorite(&btnFavorite1, &btnFavorite2, &btnFavorite3, &btnFavorite4, &btnFavorite5, header->id, 1); @@ -1617,7 +1607,7 @@ int GameWindowPrompt() } else if (btnLocked.GetState() == STATE_CLICKED) //switch locked { - if (isInserted(bootDevice)) + if (isInserted(Settings.BootDevice)) { SetLocked(&btnLocked, header->id, 1); SetLockedImage(header->id, &btnLockedImg, &imgLocked, &imgNotLocked); @@ -1626,7 +1616,7 @@ int GameWindowPrompt() } else if (btnFavorite2.GetState() == STATE_CLICKED) //switch favorite { - if (isInserted(bootDevice)) + if (isInserted(Settings.BootDevice)) { SetFavorite(&btnFavorite1, &btnFavorite2, &btnFavorite3, &btnFavorite4, &btnFavorite5, header->id, 2); @@ -1637,7 +1627,7 @@ int GameWindowPrompt() } else if (btnFavorite3.GetState() == STATE_CLICKED) //switch favorite { - if (isInserted(bootDevice)) + if (isInserted(Settings.BootDevice)) { SetFavorite(&btnFavorite1, &btnFavorite2, &btnFavorite3, &btnFavorite4, &btnFavorite5, header->id, 3); @@ -1648,7 +1638,7 @@ int GameWindowPrompt() } else if (btnFavorite4.GetState() == STATE_CLICKED) //switch favorite { - if (isInserted(bootDevice)) + if (isInserted(Settings.BootDevice)) { SetFavorite(&btnFavorite1, &btnFavorite2, &btnFavorite3, &btnFavorite4, &btnFavorite5, header->id, 4); @@ -1659,7 +1649,7 @@ int GameWindowPrompt() } else if (btnFavorite5.GetState() == STATE_CLICKED) //switch favorite { - if (isInserted(bootDevice)) + if (isInserted(Settings.BootDevice)) { SetFavorite(&btnFavorite1, &btnFavorite2, &btnFavorite3, &btnFavorite4, &btnFavorite5, header->id, 5); @@ -1674,7 +1664,7 @@ int GameWindowPrompt() ScreenShot(); } // this next part is long because nobody could agree on what the left/right buttons should do - else if ((btnRight.GetState() == STATE_CLICKED) && (Settings.xflip == no)) //next game + else if ((btnRight.GetState() == STATE_CLICKED) && (Settings.xflip == XFLIP_NO)) //next game { promptWindow.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 50); changed = 1; @@ -1684,7 +1674,7 @@ int GameWindowPrompt() break; } - else if ((btnLeft.GetState() == STATE_CLICKED) && (Settings.xflip == no)) //previous game + else if ((btnLeft.GetState() == STATE_CLICKED) && (Settings.xflip == XFLIP_NO)) //previous game { promptWindow.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 50); changed = 2; @@ -1694,7 +1684,7 @@ int GameWindowPrompt() break; } - else if ((btnRight.GetState() == STATE_CLICKED) && (Settings.xflip == yes)) //previous game + else if ((btnRight.GetState() == STATE_CLICKED) && (Settings.xflip == XFLIP_YES)) //previous game { promptWindow.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 50); changed = 2; @@ -1704,7 +1694,7 @@ int GameWindowPrompt() break; } - else if ((btnLeft.GetState() == STATE_CLICKED) && (Settings.xflip == yes)) //next game + else if ((btnLeft.GetState() == STATE_CLICKED) && (Settings.xflip == XFLIP_YES)) //next game { promptWindow.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 50); changed = 1; @@ -1714,7 +1704,7 @@ int GameWindowPrompt() break; } - else if ((btnRight.GetState() == STATE_CLICKED) && (Settings.xflip == sysmenu)) //previous game + else if ((btnRight.GetState() == STATE_CLICKED) && (Settings.xflip == XFLIP_SYSMENU)) //previous game { promptWindow.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 50); changed = 2; @@ -1724,7 +1714,7 @@ int GameWindowPrompt() break; } - else if ((btnLeft.GetState() == STATE_CLICKED) && (Settings.xflip == sysmenu)) //next game + else if ((btnLeft.GetState() == STATE_CLICKED) && (Settings.xflip == XFLIP_SYSMENU)) //next game { promptWindow.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 50); changed = 1; @@ -1734,7 +1724,7 @@ int GameWindowPrompt() break; } - else if ((btnRight.GetState() == STATE_CLICKED) && (Settings.xflip == wtf)) //previous game + else if ((btnRight.GetState() == STATE_CLICKED) && (Settings.xflip == XFLIP_WTF)) //previous game { promptWindow.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 50); changed = 1; @@ -1744,7 +1734,7 @@ int GameWindowPrompt() break; } - else if ((btnLeft.GetState() == STATE_CLICKED) && (Settings.xflip == wtf)) //next game + else if ((btnLeft.GetState() == STATE_CLICKED) && (Settings.xflip == XFLIP_WTF)) //next game { promptWindow.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 50); changed = 2; @@ -1754,7 +1744,7 @@ int GameWindowPrompt() break; } - else if ((btnRight.GetState() == STATE_CLICKED) && (Settings.xflip == disk3d)) //next game + else if ((btnRight.GetState() == STATE_CLICKED) && (Settings.xflip == XFLIP_DISK3D)) //next game { // diskImg.SetBetaRotateEffect(45, 90); changed = 3; @@ -1764,7 +1754,7 @@ int GameWindowPrompt() break; } - else if ((btnLeft.GetState() == STATE_CLICKED) && (Settings.xflip == disk3d)) //previous game + else if ((btnLeft.GetState() == STATE_CLICKED) && (Settings.xflip == XFLIP_DISK3D)) //previous game { // diskImg.SetBetaRotateEffect(-45, 90); // promptWindow.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 1/*50*/); @@ -1824,7 +1814,7 @@ int DiscWait(const char *title, const char *msg, const char *btn1Label, const ch trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B); GuiImage dialogBoxImg(&dialogBox); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { dialogBoxImg.SetWidescreen(Settings.widescreen); } @@ -1839,7 +1829,7 @@ int DiscWait(const char *title, const char *msg, const char *btn1Label, const ch GuiText btn1Txt(btn1Label, 22, Theme.prompttext); GuiImage btn1Img(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { btn1Txt.SetWidescreen(Settings.widescreen); btn1Img.SetWidescreen(Settings.widescreen); @@ -1863,7 +1853,7 @@ int DiscWait(const char *title, const char *msg, const char *btn1Label, const ch GuiText btn2Txt(btn2Label, 22, Theme.prompttext); GuiImage btn2Img(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { btn2Txt.SetWidescreen(Settings.widescreen); btn2Img.SetWidescreen(Settings.widescreen); @@ -1871,7 +1861,7 @@ int DiscWait(const char *title, const char *msg, const char *btn1Label, const ch GuiButton btn2(&btn2Img, &btn2Img, 1, 4, -20, -25, &trigA, &btnSoundOver, btnClick2, 1); btn2.SetLabel(&btn2Txt); - if ((Settings.wsprompt == yes) && (Settings.widescreen)) /////////////adjust buttons for widescreen + if ((Settings.wsprompt) && (Settings.widescreen)) /////////////adjust buttons for widescreen { msgTxt.SetMaxWidth(380); if (btn2Label) @@ -1963,7 +1953,7 @@ int FormatingPartition(const char *title, partitionEntry *entry) trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); GuiImage dialogBoxImg(&dialogBox); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { dialogBoxImg.SetWidescreen(Settings.widescreen); } @@ -2018,7 +2008,7 @@ bool SearchMissingImages(int choice2) GuiImage dialogBoxImg(&dialogBox); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { dialogBoxImg.SetWidescreen(Settings.widescreen); } @@ -2150,7 +2140,7 @@ bool NetworkInitPrompt() GuiImage dialogBoxImg(&dialogBox); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { dialogBoxImg.SetWidescreen(Settings.widescreen); } @@ -2166,7 +2156,7 @@ bool NetworkInitPrompt() GuiText btn1Txt(tr( "Cancel" ), 22, Theme.prompttext); GuiImage btn1Img(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { btn1Txt.SetWidescreen(Settings.widescreen); btn1Img.SetWidescreen(Settings.widescreen); @@ -2175,7 +2165,7 @@ bool NetworkInitPrompt() btn1.SetLabel(&btn1Txt); btn1.SetState(STATE_SELECTED); - if ((Settings.wsprompt == yes) && (Settings.widescreen)) /////////////adjust buttons for widescreen + if ((Settings.wsprompt) && (Settings.widescreen)) /////////////adjust buttons for widescreen { btn1.SetAlignment(ALIGN_CENTRE, ALIGN_BOTTOM); btn1.SetPosition(0, -80); @@ -2255,14 +2245,14 @@ int ProgressDownloadWindow(int choice2) trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); GuiImage dialogBoxImg(&dialogBox); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { dialogBoxImg.SetWidescreen(Settings.widescreen); } GuiImageData progressbarOutline(Resources::GetFile("progressbar_outline.png"), Resources::GetFileSize("progressbar_outline.png")); GuiImage progressbarOutlineImg(&progressbarOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { progressbarOutlineImg.SetWidescreen(Settings.widescreen); } @@ -2298,7 +2288,7 @@ int ProgressDownloadWindow(int choice2) GuiText btn1Txt(tr( "Cancel" ), 22, Theme.prompttext); GuiImage btn1Img(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { btn1Txt.SetWidescreen(Settings.widescreen); btn1Img.SetWidescreen(Settings.widescreen); @@ -2307,7 +2297,7 @@ int ProgressDownloadWindow(int choice2) btn1.SetLabel(&btn1Txt); btn1.SetState(STATE_SELECTED); - if ((Settings.wsprompt == yes) && (Settings.widescreen)) /////////////adjust for widescreen + if ((Settings.wsprompt) && (Settings.widescreen)) /////////////adjust for widescreen { progressbarOutlineImg.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); progressbarOutlineImg.SetPosition(0, 40); @@ -2378,7 +2368,7 @@ int ProgressDownloadWindow(int choice2) tries = 0; prTxt.SetTextf("%i%%", 100 * i / cntMissFiles); - if ((Settings.wsprompt == yes) && (Settings.widescreen)) + if ((Settings.wsprompt) && (Settings.widescreen)) { //adjust for widescreen progressbarImg.SetPosition(80, 40); @@ -2861,7 +2851,7 @@ int ProgressUpdateWindow() trigA.SetSimpleTrigger( -1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A ); GuiImage dialogBoxImg( &dialogBox ); - if ( Settings.wsprompt == yes ) + if ( Settings.wsprompt ) { dialogBoxImg.SetWidescreen( Settings.widescreen ); } @@ -2869,7 +2859,7 @@ int ProgressUpdateWindow() snprintf( imgPath, sizeof( imgPath ), "%sprogressbar_outline.png", Settings.theme_path ); GuiImageData progressbarOutline( imgPath, progressbar_outline_png ); GuiImage progressbarOutlineImg( &progressbarOutline ); - if ( Settings.wsprompt == yes ) + if ( Settings.wsprompt ) { progressbarOutlineImg.SetWidescreen( Settings.widescreen ); } @@ -2910,7 +2900,7 @@ int ProgressUpdateWindow() GuiText btn1Txt( tr( "Cancel" ), 22, Theme.prompttext ); GuiImage btn1Img( &btnOutline ); - if ( Settings.wsprompt == yes ) + if ( Settings.wsprompt ) { btn1Txt.SetWidescreen( Settings.widescreen ); btn1Img.SetWidescreen( Settings.widescreen ); @@ -2919,7 +2909,7 @@ int ProgressUpdateWindow() btn1.SetLabel( &btn1Txt ); btn1.SetState( STATE_SELECTED ); - if ( ( Settings.wsprompt == yes ) && ( Settings.widescreen ) ) /////////////adjust for widescreen + if ( ( Settings.wsprompt ) && ( Settings.widescreen ) ) /////////////adjust for widescreen { progressbarOutlineImg.SetAlignment( ALIGN_CENTRE, ALIGN_MIDDLE ); @@ -3069,7 +3059,7 @@ int ProgressUpdateWindow() { usleep( 100 ); prTxt.SetTextf( "%i%%", ( 100*i / filesize ) + 1 ); - if ( ( Settings.wsprompt == yes ) && ( Settings.widescreen ) ) + if ( ( Settings.wsprompt ) && ( Settings.widescreen ) ) { progressbarImg.SetTile( 80*i / filesize ); } @@ -3224,14 +3214,14 @@ int ProgressUpdateWindow() trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); GuiImage dialogBoxImg(&dialogBox); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { dialogBoxImg.SetWidescreen(Settings.widescreen); } GuiImageData progressbarOutline(Resources::GetFile("progressbar_outline.png"), Resources::GetFileSize("progressbar_outline.png")); GuiImage progressbarOutlineImg(&progressbarOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { progressbarOutlineImg.SetWidescreen(Settings.widescreen); } @@ -3270,7 +3260,7 @@ int ProgressUpdateWindow() GuiText btn1Txt(tr( "Cancel" ), 22, Theme.prompttext); GuiImage btn1Img(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { btn1Txt.SetWidescreen(Settings.widescreen); btn1Img.SetWidescreen(Settings.widescreen); @@ -3279,7 +3269,7 @@ int ProgressUpdateWindow() btn1.SetLabel(&btn1Txt); btn1.SetState(STATE_SELECTED); - if ((Settings.wsprompt == yes) && (Settings.widescreen)) /////////////adjust for widescreen + if ((Settings.wsprompt) && (Settings.widescreen)) /////////////adjust for widescreen { progressbarOutlineImg.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); progressbarOutlineImg.SetPosition(0, 7); @@ -3400,7 +3390,7 @@ int ProgressUpdateWindow() { usleep(100); prTxt.SetTextf("%i%%", (100 * i / filesize) + 1); - if ((Settings.wsprompt == yes) && (Settings.widescreen)) + if ((Settings.wsprompt) && (Settings.widescreen)) { progressbarImg.SetTile(80 * i / filesize); } @@ -3617,7 +3607,7 @@ int CodeDownload(const char *id) trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); GuiImage dialogBoxImg(&dialogBox); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { dialogBoxImg.SetWidescreen(Settings.widescreen); } @@ -3639,7 +3629,7 @@ int CodeDownload(const char *id) GuiText btn1Txt(tr( "Cancel" ), 22, Theme.prompttext); GuiImage btn1Img(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { btn1Txt.SetWidescreen(Settings.widescreen); btn1Img.SetWidescreen(Settings.widescreen); @@ -3859,7 +3849,7 @@ int HBCWindowPrompt(const char *name, const char *coder, const char *version, co whiteBoxImg.SetPosition(0, 110); whiteBoxImg.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); whiteBoxImg.SetSkew(0, 0, 0, 0, 0, -120, 0, -120); - /*if (Settings.wsprompt == yes){ + /*if (Settings.wsprompt){ dialogBoxImg.SetWidescreen(Settings.widescreen); }*/ @@ -3928,7 +3918,7 @@ int HBCWindowPrompt(const char *name, const char *coder, const char *version, co GuiText btn1Txt(tr( "Load" ), 22, Theme.prompttext); GuiImage btn1Img(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { btn1Txt.SetWidescreen(Settings.widescreen); btn1Img.SetWidescreen(Settings.widescreen); @@ -3940,7 +3930,7 @@ int HBCWindowPrompt(const char *name, const char *coder, const char *version, co GuiText btn2Txt(tr( "Back" ), 22, Theme.prompttext); GuiImage btn2Img(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { btn2Txt.SetWidescreen(Settings.widescreen); btn2Img.SetWidescreen(Settings.widescreen); diff --git a/source/prompts/TitleBrowser.cpp b/source/prompts/TitleBrowser.cpp index 277eff34..8de6a750 100644 --- a/source/prompts/TitleBrowser.cpp +++ b/source/prompts/TitleBrowser.cpp @@ -147,7 +147,7 @@ bool TitleSelector(char output[]) GuiText cancelBtnTxt(tr( "Back" ), 22, Theme.prompttext); cancelBtnTxt.SetMaxWidth(btnOutline.GetWidth() - 30); GuiImage cancelBtnImg(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { cancelBtnTxt.SetWidescreen(Settings.widescreen); cancelBtnImg.SetWidescreen(Settings.widescreen); @@ -382,7 +382,7 @@ int TitleBrowser() GuiText cancelBtnTxt(tr( "Back" ), 22, Theme.prompttext); cancelBtnTxt.SetMaxWidth(btnOutline.GetWidth() - 30); GuiImage cancelBtnImg(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { cancelBtnTxt.SetWidescreen(Settings.widescreen); cancelBtnImg.SetWidescreen(Settings.widescreen); @@ -401,7 +401,7 @@ int TitleBrowser() GuiImageData wifiImgData(Resources::GetFile("Wifi_btn.png"), Resources::GetFileSize("Wifi_btn.png")); GuiImage wifiImg(&wifiImgData); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { wifiImg.SetWidescreen(Settings.widescreen); } diff --git a/source/prompts/filebrowser.cpp b/source/prompts/filebrowser.cpp index b57f03af..33ff1b64 100644 --- a/source/prompts/filebrowser.cpp +++ b/source/prompts/filebrowser.cpp @@ -323,7 +323,7 @@ int BrowseDevice(char * Path, int Path_size, int Flags, FILTERCASCADE *Filter/*= GuiText ExitBtnTxt(tr( "Cancel" ), 24, ( GXColor ) { 0, 0, 0, 255}); GuiImage ExitBtnImg(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { ExitBtnTxt.SetWidescreen(Settings.widescreen); ExitBtnImg.SetWidescreen(Settings.widescreen); @@ -340,7 +340,7 @@ int BrowseDevice(char * Path, int Path_size, int Flags, FILTERCASCADE *Filter/*= GuiText usbBtnTxt(browsers[(curDevice + 1) % browsers.size()].rootdir, 24, ( GXColor ) { 0, 0, 0, 255}); GuiImage usbBtnImg(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { usbBtnTxt.SetWidescreen(Settings.widescreen); usbBtnImg.SetWidescreen(Settings.widescreen); @@ -355,7 +355,7 @@ int BrowseDevice(char * Path, int Path_size, int Flags, FILTERCASCADE *Filter/*= GuiText okBtnTxt(tr( "OK" ), 22, Theme.prompttext); GuiImage okBtnImg(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { okBtnTxt.SetWidescreen(Settings.widescreen); okBtnImg.SetWidescreen(Settings.widescreen); diff --git a/source/settings/CSettings.cpp b/source/settings/CSettings.cpp index 63090939..0b48c5e0 100644 --- a/source/settings/CSettings.cpp +++ b/source/settings/CSettings.cpp @@ -67,23 +67,23 @@ void CSettings::SetDefault() strcpy(ogg_path, ""); strcpy(unlockCode, ""); - videomode = discdefault; - videopatch = off; - language = ConsoleLangDefault; - ocarina = off; - hddinfo = hr12; - sinfo = on; - rumble = RumbleOn; + videomode = VIDEO_MODE_DISCDEFAULT; + videopatch = OFF; + language = CONSOLE_DEFAULT; + ocarina = OFF; + hddinfo = CLOCK_HR12; + sinfo = ON; + rumble = ON; volume = 80; sfxvolume = 80; gamesoundvolume = 80; - tooltips = TooltipsOn; + tooltips = ON; gamesound = 1; parentalcontrol = 0; lockedgames = 0; cios = 249; - xflip = no; - quickboot = no; + xflip = XFLIP_NO; + quickboot = OFF; wiilight = 1; autonetwork = 0; discart = 0; @@ -97,7 +97,7 @@ void CSettings::SetDefault() partition = -1; marknewtitles = 1; FatInstallToDir = 0; - partitions_to_install = install_game_only; + InstallPartitions = ONLY_GAME_PARTITION; fullcopy = 0; beta_upgrades = 0; strcpy(db_url, ""); @@ -201,8 +201,7 @@ bool CSettings::Save() fprintf(file, "gamesoundvolume = %d\n ", gamesoundvolume); fprintf(file, "tooltips = %d\n ", tooltips); fprintf(file, "password = %s\n ", unlockCode); - fprintf(file, "sort = %d\n ", sort); - fprintf(file, "fave = %d\n ", fave); + fprintf(file, "sort = %d\n ", GameSort); fprintf(file, "cios = %d\n ", cios); fprintf(file, "keyset = %d\n ", keyset); fprintf(file, "xflip = %d\n ", xflip); @@ -240,7 +239,7 @@ bool CSettings::Save() fprintf(file, "partition = %d\n ", partition); fprintf(file, "marknewtitles = %d\n ", marknewtitles); fprintf(file, "FatInstallToDir = %d\n ", FatInstallToDir); - fprintf(file, "partitions_to_install = %d\n ", partitions_to_install); + fprintf(file, "InstallPartitions = %d\n ", InstallPartitions); fprintf(file, "fullcopy = %d\n ", fullcopy); fprintf(file, "beta_upgrades = %d\n ", beta_upgrades); fprintf(file, "returnTo = %s\n ", returnTo); @@ -346,14 +345,9 @@ bool CSettings::SetSetting(char *name, char *value) strcpy(unlockCode, value); return true; } - else if (strcmp(name, "sort") == 0) + else if (strcmp(name, "GameSort") == 0) { - if (sscanf(value, "%d", &i) == 1) sort = i; - return true; - } - else if (strcmp(name, "fave") == 0) - { - if (sscanf(value, "%d", &i) == 1) fave = i; + if (sscanf(value, "%d", &i) == 1) GameSort = i; return true; } else if (strcmp(name, "cios") == 0) @@ -471,9 +465,9 @@ bool CSettings::SetSetting(char *name, char *value) if (sscanf(value, "%d", &i) == 1) beta_upgrades = i; return true; } - else if (strcmp(name, "partitions_to_install") == 0) + else if (strcmp(name, "InstallPartitions") == 0) { - if (sscanf(value, "%d", &i) == 1) partitions_to_install = i; + if (sscanf(value, "%u", &i) == 1) InstallPartitions = i; return true; } else if (strcmp(name, "covers_path") == 0) diff --git a/source/settings/CSettings.h b/source/settings/CSettings.h index cefc0973..e566b90e 100644 --- a/source/settings/CSettings.h +++ b/source/settings/CSettings.h @@ -27,25 +27,9 @@ #include #include #include +#include "SettingsEnums.h" #include "cfg.h" -enum -{ - APP_DEFAULT = 0, - CONSOLE_DEFAULT, - JAPANESE, - ENGLISH, - GERMAN, - FRENCH, - SPANISH, - ITALIAN, - DUTCH, - S_CHINESE, - T_CHINESE, - KOREAN, - MAX_LANGUAGE -}; - class CSettings { public: @@ -87,8 +71,7 @@ class CSettings short quickboot; short wsprompt; short keyset; - short sort; - short fave; + short GameSort; short wiilight; short gameDisplay; short patchcountrystrings; @@ -125,7 +108,7 @@ class CSettings short gamesound; short marknewtitles; short FatInstallToDir; - short partitions_to_install; + u32 InstallPartitions; short fullcopy; short beta_upgrades; char returnTo[20]; diff --git a/source/settings/Settings.cpp b/source/settings/Settings.cpp index 049fb88b..c7ac9d01 100644 --- a/source/settings/Settings.cpp +++ b/source/settings/Settings.cpp @@ -47,21 +47,21 @@ extern PartList partitions; extern char game_partition[6]; extern u8 load_from_fs; -static const char *opts_no_yes[settings_off_on_max] = { trNOOP( "No" ), trNOOP( "Yes" ) }; -static const char *opts_off_on[settings_off_on_max] = { trNOOP( "OFF" ), trNOOP( "ON" ) }; -static const char *opts_videomode[settings_language_max][2] = { { "", trNOOP( "Disc Default" ) }, { +static const char *opts_no_yes[MAX_ON_OFF] = { trNOOP( "No" ), trNOOP( "Yes" ) }; +static const char *opts_off_on[MAX_ON_OFF] = { trNOOP( "OFF" ), trNOOP( "ON" ) }; +static const char *opts_videomode[VIDEO_MODE_MAX][2] = { { "", trNOOP( "Disc Default" ) }, { trNOOP( "System Default" ), "" }, { trNOOP( "AutoPatch" ), "" }, { trNOOP( "Force" ), " PAL50" }, { trNOOP( "Force" ), " PAL60" }, { trNOOP( "Force" ), " NTSC" } }; -static const char *opts_language[settings_language_max] = { trNOOP( "Console Default" ), trNOOP( "Japanese" ), +static const char *opts_language[MAX_LANGUAGE] = { trNOOP( "App Default" ), trNOOP( "Console Default" ), trNOOP( "Japanese" ), trNOOP( "English" ), trNOOP( "German" ), trNOOP( "French" ), trNOOP( "Spanish" ), trNOOP( "Italian" ), trNOOP( "Dutch" ), trNOOP( "SChinese" ), trNOOP( "TChinese" ), trNOOP( "Korean" ) }; static const char *opts_lockedgames[2] = { trNOOP( "0 (Locked and Unlocked Games)" ), trNOOP( "1 (Unlocked Games Only)" ) }; static const char *opts_parentalcontrol[5] = { trNOOP( "0 (Everyone)" ), trNOOP( "1 (Child 7+)" ), trNOOP( "2 (Teen 12+)" ), trNOOP( "3 (Mature 16+)" ), trNOOP( "4 (Adults Only 18+)" ) }; static const char *opts_error002[3] = { trNOOP( "No" ), trNOOP( "Yes" ), trNOOP( "Anti" ) }; -static const char *opts_partitions[settings_partitions_max] = { trNOOP( "Game partition" ), trNOOP( "All partitions" ), +static const char *opts_partitions[3] = { trNOOP( "Game partition" ), trNOOP( "All partitions" ), trNOOP( "Remove update" ) }; -static const char *opts_installdir[settings_installdir_max] = { trNOOP( "None" ), trNOOP( "GAMEID_Gamename" ), +static const char *opts_installdir[INSTALL_TO_MAX] = { trNOOP( "None" ), trNOOP( "GAMEID_Gamename" ), trNOOP( "Gamename [GAMEID]" ) }; bool IsValidPartition(int fs_type, int cios) @@ -152,7 +152,7 @@ int MenuSettings() GuiText backBtnTxt(tr( "Back" ), 22, Theme.prompttext); backBtnTxt.SetMaxWidth(btnOutline.GetWidth() - 30); GuiImage backBtnImg(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt == ON) { backBtnTxt.SetWidescreen(Settings.widescreen); backBtnImg.SetWidescreen(Settings.widescreen); @@ -724,7 +724,7 @@ int MenuSettings() if (firstRun) options2.SetName(Idx, "%s", tr( "App Language" )); if (ret == Idx) { - if (isInserted(bootDevice)) + if (isInserted(Settings.BootDevice)) { if (Settings.godmode == 1) { @@ -773,8 +773,8 @@ int MenuSettings() if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "%s", tr( "Display" )); - if (ret == Idx && ++Settings.sinfo >= settings_sinfo_max) Settings.sinfo = 0; - static const char *opts[settings_sinfo_max] = { trNOOP( "Game ID" ), + if (ret == Idx && ++Settings.sinfo >= GAMEINFO_MAX) Settings.sinfo = 0; + static const char *opts[GAMEINFO_MAX] = { trNOOP( "Game ID" ), trNOOP( "Game Region" ), trNOOP( "Both" ), trNOOP( "Neither" ) }; options2.SetValue(Idx, "%s", tr( opts[Settings.sinfo] )); } @@ -782,26 +782,26 @@ int MenuSettings() if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "%s", tr( "Clock" )); - if (ret == Idx && ++Settings.hddinfo >= settings_clock_max) Settings.hddinfo = 0; //CLOCK - if (Settings.hddinfo == hr12) + if (ret == Idx && ++Settings.hddinfo >= CLOCK_MAX) Settings.hddinfo = 0; //CLOCK + if (Settings.hddinfo == CLOCK_HR12) options2.SetValue(Idx, "12 %s", tr( "Hour" )); - else if (Settings.hddinfo == hr24) + else if (Settings.hddinfo == CLOCK_HR24) options2.SetValue(Idx, "24 %s", tr( "Hour" )); - else if (Settings.hddinfo == Off) options2.SetValue(Idx, "%s", tr( "OFF" )); + else if (Settings.hddinfo == OFF) options2.SetValue(Idx, "%s", tr( "OFF" )); } if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "%s", tr( "Tooltips" )); - if (ret == Idx && ++Settings.tooltips >= settings_tooltips_max) Settings.tooltips = 0; + if (ret == Idx && ++Settings.tooltips >= MAX_ON_OFF) Settings.tooltips = 0; options2.SetValue(Idx, "%s", tr( opts_off_on[Settings.tooltips] )); } if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "%s", tr( "Flip-X" )); - if (ret == Idx && ++Settings.xflip >= settings_xflip_max) Settings.xflip = 0; - static const char *opts[settings_xflip_max][3] = + if (ret == Idx && ++Settings.xflip >= XFLIP_MAX) Settings.xflip = 0; + static const char *opts[XFLIP_MAX][3] = { { trNOOP( "Right" ), "/", trNOOP( "Next" ) }, { trNOOP( "Left" ), "/", trNOOP( "Prev" ) }, { trNOOP( "Like SysMenu" ), "", "" }, { trNOOP( "Right" ), "/", trNOOP( "Prev" ) }, { trNOOP( "DiskFlip" ), @@ -813,8 +813,8 @@ int MenuSettings() if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "%s", tr( "Prompts Buttons" )); - if (ret == Idx && ++Settings.wsprompt >= settings_off_on_max) Settings.wsprompt = 0; - static const char *opts[settings_off_on_max] = { trNOOP( "Normal" ), + if (ret == Idx && ++Settings.wsprompt >= MAX_ON_OFF) Settings.wsprompt = 0; + static const char *opts[MAX_ON_OFF] = { trNOOP( "Normal" ), trNOOP( "Widescreen Fix" ) }; options2.SetValue(Idx, "%s", tr( opts[Settings.wsprompt] )); } @@ -822,9 +822,9 @@ int MenuSettings() if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "%s", tr( "Keyboard" )); - if (ret == Idx && ++Settings.keyset >= settings_keyset_max) Settings.keyset = 0; - static const char *opts[settings_keyset_max] = { "QWERTY", "QWERTY 2", "DVORAK", - "QWERTZ", "AZERTY" }; + if (ret == Idx && ++Settings.keyset >= KEYBOARD_MAX) Settings.keyset = 0; + static const char *opts[KEYBOARD_MAX] = { "QWERTY", "DVORAK", + "QWERTZ", "AZERTY", "QWERTY 2" }; options2.SetValue(Idx, "%s", opts[Settings.keyset]); } @@ -840,8 +840,8 @@ int MenuSettings() if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "%s", tr( "Wiilight" )); - if (ret == Idx && ++Settings.wiilight >= settings_wiilight_max) Settings.wiilight = 0; - static const char *opts[settings_wiilight_max] = { trNOOP( "OFF" ), trNOOP( "ON" ), + if (ret == Idx && ++Settings.wiilight >= WIILIGHT_MAX) Settings.wiilight = 0; + static const char *opts[WIILIGHT_MAX] = { trNOOP( "OFF" ), trNOOP( "ON" ), trNOOP( "Only for Install" ) }; options2.SetValue(Idx, "%s", tr( opts[Settings.wiilight] )); } @@ -849,14 +849,14 @@ int MenuSettings() if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "%s", tr( "Rumble" )); - if (ret == Idx && ++Settings.rumble >= settings_rumble_max) Settings.rumble = 0; //RUMBLE + if (ret == Idx && ++Settings.rumble >= MAX_ON_OFF) Settings.rumble = 0; //RUMBLE options2.SetValue(Idx, "%s", tr( opts_off_on[Settings.rumble] )); } if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "%s", tr( "AutoInit Network" )); - if (ret == Idx && ++Settings.autonetwork >= settings_off_on_max) Settings.autonetwork + if (ret == Idx && ++Settings.autonetwork >= MAX_ON_OFF) Settings.autonetwork = 0; options2.SetValue(Idx, "%s", tr( opts_off_on[Settings.autonetwork] )); } @@ -864,7 +864,7 @@ int MenuSettings() if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "%s", tr( "BETA revisions" )); - if (ret == Idx && ++Settings.beta_upgrades >= settings_off_on_max) Settings.beta_upgrades + if (ret == Idx && ++Settings.beta_upgrades >= MAX_ON_OFF) Settings.beta_upgrades = 0; options2.SetValue(Idx, "%s", tr( opts_off_on[Settings.beta_upgrades] )); } @@ -872,7 +872,7 @@ int MenuSettings() if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "%s", tr( "Titles from WiiTDB" )); - if (ret == Idx && ++Settings.titlesOverride >= settings_off_on_max) Settings.titlesOverride + if (ret == Idx && ++Settings.titlesOverride >= MAX_ON_OFF) Settings.titlesOverride = 0; options2.SetValue(Idx, "%s", tr( opts_off_on[Settings.titlesOverride] )); } @@ -880,9 +880,9 @@ int MenuSettings() if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "%s", tr( "Screensaver" )); - if (ret == Idx && ++Settings.screensaver >= settings_screensaver_max) Settings.screensaver + if (ret == Idx && ++Settings.screensaver >= SCREENSAVER_MAX) Settings.screensaver = 0; //RUMBLE - static const char *opts[settings_screensaver_max] = { trNOOP( "OFF" ), + static const char *opts[SCREENSAVER_MAX] = { trNOOP( "OFF" ), trNOOP( "3 min" ), trNOOP( "5 min" ), trNOOP( "10 min" ), trNOOP( "20 min" ), trNOOP( "30 min" ), trNOOP( "1 hour" ) }; options2.SetValue(Idx, "%s", tr( opts[Settings.screensaver] )); @@ -891,7 +891,7 @@ int MenuSettings() if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "%s", tr( "Mark new games" )); - if (ret == Idx && ++Settings.marknewtitles >= settings_off_on_max) Settings.marknewtitles + if (ret == Idx && ++Settings.marknewtitles >= MAX_ON_OFF) Settings.marknewtitles = 0; options2.SetValue(Idx, "%s", tr( opts_off_on[Settings.marknewtitles] )); } @@ -977,7 +977,7 @@ int MenuSettings() if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "%s", tr( "Video Mode" )); - if (ret == Idx && ++Settings.videomode >= settings_video_max) Settings.videomode = 0; + if (ret == Idx && ++Settings.videomode >= VIDEO_MODE_MAX) Settings.videomode = 0; options2.SetValue(Idx, "%s%s", opts_videomode[Settings.videomode][0], tr( opts_videomode[Settings.videomode][1] )); } @@ -985,21 +985,21 @@ int MenuSettings() if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "%s", tr( "VIDTV Patch" )); - if (ret == Idx && ++Settings.videopatch >= settings_off_on_max) Settings.videopatch = 0; + if (ret == Idx && ++Settings.videopatch >= MAX_ON_OFF) Settings.videopatch = 0; options2.SetValue(Idx, "%s", tr( opts_off_on[Settings.videopatch] )); } if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "%s", tr( "Game Language" )); - if (ret == Idx && ++Settings.language >= settings_language_max) Settings.language = 0; + if (ret == Idx && ++Settings.language >= MAX_LANGUAGE) Settings.language = 0; options2.SetValue(Idx, "%s", tr( opts_language[Settings.language] )); } if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "%s", tr( "Patch Country Strings" )); - if (ret == Idx && ++Settings.patchcountrystrings >= settings_off_on_max) Settings.patchcountrystrings + if (ret == Idx && ++Settings.patchcountrystrings >= MAX_ON_OFF) Settings.patchcountrystrings = 0; options2.SetValue(Idx, "%s", tr( opts_off_on[Settings.patchcountrystrings] )); } @@ -1007,7 +1007,7 @@ int MenuSettings() if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "Ocarina"); - if (ret == Idx && ++Settings.ocarina >= settings_off_on_max) Settings.ocarina = 0; + if (ret == Idx && ++Settings.ocarina >= MAX_ON_OFF) Settings.ocarina = 0; options2.SetValue(Idx, "%s", tr( opts_off_on[Settings.ocarina] )); } @@ -1069,7 +1069,7 @@ int MenuSettings() if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "%s", tr( "FAT: Use directories" )); - if (ret == Idx && ++Settings.FatInstallToDir >= settings_installdir_max) Settings.FatInstallToDir + if (ret == Idx && ++Settings.FatInstallToDir >= INSTALL_TO_MAX) Settings.FatInstallToDir = 0; options2.SetValue(Idx, "%s", tr( opts_installdir[Settings.FatInstallToDir] )); } @@ -1077,7 +1077,7 @@ int MenuSettings() if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "%s", tr( "Quick Boot" )); - if (ret == Idx && ++Settings.quickboot >= settings_off_on_max) Settings.quickboot = 0; + if (ret == Idx && ++Settings.quickboot >= MAX_ON_OFF) Settings.quickboot = 0; options2.SetValue(Idx, "%s", tr( opts_no_yes[Settings.quickboot] )); } @@ -1091,9 +1091,9 @@ int MenuSettings() if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "%s", tr( "Install partitions" )); - if (ret == Idx && ++Settings.partitions_to_install >= settings_partitions_max) Settings.partitions_to_install + if (ret == Idx && ++Settings.InstallPartitions >= 3) Settings.InstallPartitions = 0; - options2.SetValue(Idx, "%s", tr( opts_partitions[Settings.partitions_to_install] )); + options2.SetValue(Idx, "%s", tr( opts_partitions[Settings.InstallPartitions] )); } if (ret == ++Idx || firstRun) @@ -1403,7 +1403,7 @@ int MenuSettings() if (firstRun) options2.SetName(Idx, "%s", tr( "Backgroundmusic" )); if (ret == Idx) { - if (isInserted(bootDevice)) + if (isInserted(Settings.BootDevice)) { w.SetEffect(EFFECT_FADE, -20); while (w.GetEffect() > 0) @@ -1633,7 +1633,7 @@ int MenuSettings() if (entered[len] != '/') strncat(entered, "/", 1); strlcpy(Settings.covers_path, entered, sizeof(Settings.covers_path)); WindowPrompt(tr( "Cover Path Changed" ), 0, tr( "OK" )); - if (!isInserted(bootDevice)) WindowPrompt(tr( "No SD-Card inserted!" ), + if (!isInserted(Settings.BootDevice)) WindowPrompt(tr( "No SD-Card inserted!" ), tr( "Insert an SD-Card to save." ), tr( "OK" )); } } @@ -1660,7 +1660,7 @@ int MenuSettings() if (entered[len] != '/') strncat(entered, "/", 1); strlcpy(Settings.covers2d_path, entered, sizeof(Settings.covers2d_path)); WindowPrompt(tr( "Cover Path Changed" ), 0, tr( "OK" )); - if (!isInserted(bootDevice)) WindowPrompt(tr( "No SD-Card inserted!" ), + if (!isInserted(Settings.BootDevice)) WindowPrompt(tr( "No SD-Card inserted!" ), tr( "Insert an SD-Card to save." ), tr( "OK" )); } } @@ -1687,7 +1687,7 @@ int MenuSettings() if (entered[len] != '/') strncat(entered, "/", 1); strlcpy(Settings.disc_path, entered, sizeof(Settings.disc_path)); WindowPrompt(tr( "Disc Path Changed" ), 0, tr( "OK" )); - if (!isInserted(bootDevice)) WindowPrompt(tr( "No SD-Card inserted!" ), + if (!isInserted(Settings.BootDevice)) WindowPrompt(tr( "No SD-Card inserted!" ), tr( "Insert an SD-Card to save." ), tr( "OK" )); } } @@ -1713,7 +1713,7 @@ int MenuSettings() if (entered[len] != '/') strncat(entered, "/", 1); strlcpy(Settings.theme_path, entered, sizeof(Settings.theme_path)); WindowPrompt(tr( "Theme Path Changed" ), 0, tr( "OK" )); - if (!isInserted(bootDevice)) + if (!isInserted(Settings.BootDevice)) WindowPrompt(tr( "No SD-Card inserted!" ), tr( "Insert an SD-Card to save." ), tr( "OK" )); else Settings.Save(); @@ -1767,7 +1767,7 @@ int MenuSettings() if (entered[len] != '/') strncat(entered, "/", 1); strlcpy(Settings.titlestxt_path, entered, sizeof(Settings.titlestxt_path)); WindowPrompt(tr( "WiiTDB Path changed." ), 0, tr( "OK" )); - if (isInserted(bootDevice)) + if (isInserted(Settings.BootDevice)) { Settings.Save(); HaltGui(); @@ -1877,7 +1877,7 @@ int MenuSettings() if (entered[len] != '/') strncat(entered, "/", 1); strlcpy(Settings.dolpath, entered, sizeof(Settings.dolpath)); WindowPrompt(tr( "DOL path changed" ), 0, tr( "OK" )); - if (!isInserted(bootDevice)) + if (!isInserted(Settings.BootDevice)) { WindowPrompt(tr( "No SD-Card inserted!" ), tr( "Insert an SD-Card to save." ), tr( "OK" )); @@ -1908,7 +1908,7 @@ int MenuSettings() strlcpy(Settings.homebrewapps_path, entered, sizeof(Settings.homebrewapps_path)); WindowPrompt(tr( "Homebrew Appspath changed" ), 0, tr( "OK" )); - if (!isInserted(bootDevice)) + if (!isInserted(Settings.BootDevice)) { WindowPrompt(tr( "No SD-Card inserted!" ), tr( "Insert an SD-Card to save." ), tr( "OK" )); @@ -1939,7 +1939,7 @@ int MenuSettings() strlcpy(Settings.theme_downloadpath, entered, sizeof(Settings.theme_downloadpath)); WindowPrompt(tr( "Theme Download Path changed" ), 0, tr( "OK" )); - if (!isInserted(bootDevice)) WindowPrompt(tr( "No SD-Card inserted!" ), + if (!isInserted(Settings.BootDevice)) WindowPrompt(tr( "No SD-Card inserted!" ), tr( "Insert an SD-Card to save." ), tr( "OK" )); } } @@ -1966,7 +1966,7 @@ int MenuSettings() if (entered[len] != '/') strncat(entered, "/", 1); strlcpy(Settings.BcaCodepath, entered, sizeof(Settings.BcaCodepath)); WindowPrompt(tr( "BCA Codes Path changed" ), 0, tr( "OK" )); - if (!isInserted(bootDevice)) WindowPrompt(tr( "No SD-Card inserted!" ), + if (!isInserted(Settings.BootDevice)) WindowPrompt(tr( "No SD-Card inserted!" ), tr( "Insert an SD-Card to save." ), tr( "OK" )); } } @@ -1993,7 +1993,7 @@ int MenuSettings() if (entered[len] != '/') strncat(entered, "/", 1); strlcpy(Settings.WipCodepath, entered, sizeof(Settings.WipCodepath)); WindowPrompt(tr( "WIP Patches Path changed" ), 0, tr( "OK" )); - if (!isInserted(bootDevice)) WindowPrompt(tr( "No SD-Card inserted!" ), + if (!isInserted(Settings.BootDevice)) WindowPrompt(tr( "No SD-Card inserted!" ), tr( "Insert an SD-Card to save." ), tr( "OK" )); } } @@ -2033,7 +2033,7 @@ int MenuSettings() w.Remove(&MainButton2); w.Remove(&MainButton3); w.Remove(&MainButton4); - if (isInserted(bootDevice) && Settings.godmode) + if (isInserted(Settings.BootDevice) && Settings.godmode) { w.Remove(&optionBrowser2); w.Remove(&backBtn); @@ -2119,7 +2119,7 @@ int MenuSettings() { if (MainButton1.GetState() == STATE_CLICKED) { - if (isInserted(bootDevice)) Settings.Save(); + if (isInserted(Settings.BootDevice)) Settings.Save(); menu = MENU_THEMEDOWNLOADER; pageToDisplay = 0; break; @@ -2129,7 +2129,7 @@ int MenuSettings() if (backBtn.GetState() == STATE_CLICKED) { //Add the procedure call to save the global configuration - if (isInserted(bootDevice)) Settings.Save(); + if (isInserted(Settings.BootDevice)) Settings.Save(); menu = MENU_DISCLIST; pageToDisplay = 0; backBtn.ResetState(); @@ -2313,7 +2313,7 @@ int MenuGameSettings(struct discHdr * header) GuiText backBtnTxt(tr( "Back" ), 22, Theme.prompttext); backBtnTxt.SetMaxWidth(btnOutline.GetWidth() - 30); GuiImage backBtnImg(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt == ON) { backBtnTxt.SetWidescreen(Settings.widescreen); backBtnImg.SetWidescreen(Settings.widescreen); @@ -2328,7 +2328,7 @@ int MenuGameSettings(struct discHdr * header) GuiText saveBtnTxt(tr( "Save" ), 22, Theme.prompttext); saveBtnTxt.SetMaxWidth(btnOutline.GetWidth() - 30); GuiImage saveBtnImg(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt == ON) { saveBtnTxt.SetWidescreen(Settings.widescreen); saveBtnImg.SetWidescreen(Settings.widescreen); @@ -2429,9 +2429,9 @@ int MenuGameSettings(struct discHdr * header) game_cfg.parentalcontrol = 0; game_cfg.errorfix002 = Settings.error002; game_cfg.patchcountrystrings = Settings.patchcountrystrings; - game_cfg.loadalternatedol = off; + game_cfg.loadalternatedol = OFF; game_cfg.alternatedolstart = 0; - game_cfg.iosreloadblock = off; + game_cfg.iosreloadblock = OFF; strcpy(game_cfg.alternatedolname, ""); game_cfg.returnTo = 1; } @@ -2592,12 +2592,13 @@ int MenuGameSettings(struct discHdr * header) if (ret >= 0 || firstRun == true) { + char alternatedname[100]; int Idx = -1; if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "%s", tr( "Video Mode" )); - if (ret == Idx && ++game_cfg.video >= settings_video_max) game_cfg.video = 0; + if (ret == Idx && ++game_cfg.video >= VIDEO_MODE_MAX) game_cfg.video = 0; options2.SetValue(Idx, "%s%s", opts_videomode[game_cfg.video][0], tr( opts_videomode[game_cfg.video][1] )); } @@ -2605,7 +2606,7 @@ int MenuGameSettings(struct discHdr * header) if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "%s", tr( "VIDTV Patch" )); - if (ret == Idx && ++game_cfg.vipatch >= settings_off_on_max) game_cfg.vipatch = 0; + if (ret == Idx && ++game_cfg.vipatch >= MAX_ON_OFF) game_cfg.vipatch = 0; options2.SetValue(Idx, "%s", tr( opts_off_on[game_cfg.vipatch] )); } @@ -2613,14 +2614,14 @@ int MenuGameSettings(struct discHdr * header) if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "%s", tr( "Game Language" )); - if (ret == Idx && ++game_cfg.language >= settings_language_max) game_cfg.language = 0; + if (ret == Idx && ++game_cfg.language >= MAX_LANGUAGE) game_cfg.language = 0; options2.SetValue(Idx, "%s", tr( opts_language[game_cfg.language] )); } if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "Ocarina"); - if (ret == Idx && ++game_cfg.ocarina >= settings_off_on_max) game_cfg.ocarina = 0; + if (ret == Idx && ++game_cfg.ocarina >= MAX_ON_OFF) game_cfg.ocarina = 0; options2.SetValue(Idx, "%s", tr( opts_off_on[game_cfg.ocarina] )); } @@ -2671,7 +2672,7 @@ int MenuGameSettings(struct discHdr * header) if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "%s", tr( "Return To" )); - if (ret == Idx && ++game_cfg.returnTo >= settings_off_on_max) game_cfg.returnTo = 0; + if (ret == Idx && ++game_cfg.returnTo >= MAX_ON_OFF) game_cfg.returnTo = 0; char text[IMET_MAX_NAME_LEN]; int channel = NandTitles.FindU32(Settings.returnTo);//is the channel set in the global settings actually installed? @@ -2687,7 +2688,7 @@ int MenuGameSettings(struct discHdr * header) if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "%s", tr( "Patch Country Strings" )); - if (ret == Idx && ++game_cfg.patchcountrystrings >= settings_off_on_max) game_cfg.patchcountrystrings = 0; + if (ret == Idx && ++game_cfg.patchcountrystrings >= MAX_ON_OFF) game_cfg.patchcountrystrings = 0; options2.SetValue(Idx, "%s", tr( opts_off_on[game_cfg.patchcountrystrings] )); } @@ -2750,14 +2751,14 @@ int MenuGameSettings(struct discHdr * header) } else if (dolchoice == 2) //they want to search for the correct dol themselves { - int res = DiscBrowse(header); + int res = DiscBrowse(header, alternatedname, sizeof(alternatedname)); if ((res >= 0) && (res != 696969)) //if res==696969 they pressed the back button game_cfg.alternatedolstart = res; } } else { - int res = DiscBrowse(header); + int res = DiscBrowse(header, alternatedname, sizeof(alternatedname)); if ((res >= 0) && (res != 696969)) { game_cfg.alternatedolstart = res; @@ -2786,7 +2787,7 @@ int MenuGameSettings(struct discHdr * header) if (ret == ++Idx || firstRun) { if (firstRun) options2.SetName(Idx, "%s", tr( "Block IOS Reload" )); - if (ret == Idx && ++game_cfg.iosreloadblock >= settings_off_on_max) game_cfg.iosreloadblock = 0; + if (ret == Idx && ++game_cfg.iosreloadblock >= MAX_ON_OFF) game_cfg.iosreloadblock = 0; options2.SetValue(Idx, "%s", tr( opts_off_on[game_cfg.iosreloadblock] )); } @@ -2906,7 +2907,7 @@ int MenuGameSettings(struct discHdr * header) int result = WindowPrompt(tr( "Are you sure?" ), 0, tr( "Yes" ), tr( "Cancel" )); if (result == 1) { - if (isInserted(bootDevice)) + if (isInserted(Settings.BootDevice)) { GameStatistics.SetPlayCount(header->id, 0); GameStatistics.Save(); @@ -3007,9 +3008,9 @@ int MenuGameSettings(struct discHdr * header) game_cfg.ocarina = Settings.ocarina; game_cfg.errorfix002 = Settings.error002; game_cfg.patchcountrystrings = Settings.patchcountrystrings; - game_cfg.loadalternatedol = off; + game_cfg.loadalternatedol = OFF; game_cfg.alternatedolstart = 0; - game_cfg.iosreloadblock = off; + game_cfg.iosreloadblock = OFF; game_cfg.ios = Settings.cios; game_cfg.parentalcontrol = 0; strcpy(game_cfg.alternatedolname, ""); diff --git a/source/settings/SettingsEnums.h b/source/settings/SettingsEnums.h new file mode 100644 index 00000000..bae13a4a --- /dev/null +++ b/source/settings/SettingsEnums.h @@ -0,0 +1,119 @@ +#ifndef SETTINGS_ENUMS_H_ +#define SETTINGS_ENUMS_H_ + +#include "libs/libwbfs/wiidisc.h" + +enum +{ + APP_DEFAULT = 0, + CONSOLE_DEFAULT, + JAPANESE, + ENGLISH, + GERMAN, + FRENCH, + SPANISH, + ITALIAN, + DUTCH, + S_CHINESE, + T_CHINESE, + KOREAN, + MAX_LANGUAGE +}; + +enum +{ + VIDEO_MODE_SYSDEFAULT = 0, + VIDEO_MODE_DISCDEFAULT, + VIDEO_MODE_PATCH, + VIDEO_MODE_PAL50, + VIDEO_MODE_PAL60, + VIDEO_MODE_NTSC, + VIDEO_MODE_MAX +}; + +enum +{ + OFF = 0, + ON, + MAX_ON_OFF +}; + +enum +{ + CLOCK_HR12 = 1, // use OFF for clock off + CLOCK_HR24, + CLOCK_MAX +}; + + +enum +{ + WIILIGHT_OFF = 0, + WIILIGHT_ON, + WIILIGHT_INSTALL, + WIILIGHT_MAX + +}; + +enum +{ + GAMEINFO_ID, + GAMEINFO_REGION, + GAMEINFO_BOTH, + GAMEINFO_NONE, + GAMEINFO_MAX +}; + +enum +{ + SCREENSAVER_3_MIN = 1, + SCREENSAVER_5_MIN, + SCREENSAVER_10_MIN, + SCREENSAVER_20_MIN, + SCREENSAVER_30_MIN, + SCREENSAVER_60_MIN, + SCREENSAVER_MAX +}; + +enum +{ + XFLIP_NO = 0, + XFLIP_YES, + XFLIP_SYSMENU, + XFLIP_WTF, + XFLIP_DISK3D, + XFLIP_MAX +}; + +enum +{ + SORT_ABC = 0, + SORT_PLAYCOUNT, + SORT_RANKING, +}; +enum +{ + KEYBOARD_QWERTY = 0, + KEYBOARD_DVORAK, + KEYBOARD_QWERTZ, + KEYBOARD_AZERTY, + KEYBOARD_QWERTY2, + KEYBOARD_MAX +}; + +enum +{ + INSTALL_TO_NO_DIR, + INSTALL_TO_GAMEID_NAME, + INSTALL_TO_NAME_GAMEID, + INSTALL_TO_MAX +}; + +enum +{ + LIST_MODE, + GRID_MODE, + CAROUSEL_MODE +}; + +#endif diff --git a/source/settings/SettingsPrompts.cpp b/source/settings/SettingsPrompts.cpp index 6fb51bb8..5e782048 100644 --- a/source/settings/SettingsPrompts.cpp +++ b/source/settings/SettingsPrompts.cpp @@ -40,7 +40,7 @@ bool MenuBackgroundMusic() if ( strcmp( entered, "" ) == 0 ) { - sprintf( entered, "%s", bootDevice ); + sprintf( entered, "%s", Settings.BootDevice ); } else { @@ -65,7 +65,7 @@ bool MenuBackgroundMusic() return true; } else - sprintf( entered, "%s", bootDevice ); + sprintf( entered, "%s", Settings.BootDevice ); } result = BrowseDevice( entered, sizeof( entered ), FB_DEFAULT ); @@ -139,7 +139,7 @@ int MenuLanguageSelect() GuiText backBtnTxt( tr( "Back" ) , 22, Theme.prompttext ); backBtnTxt.SetMaxWidth( btnOutline.GetWidth() - 30 ); GuiImage backBtnImg( &btnOutline ); - if ( Settings.wsprompt == yes ) + if ( Settings.wsprompt == ON ) { backBtnTxt.SetWidescreen( Settings.widescreen ); backBtnImg.SetWidescreen( Settings.widescreen ); @@ -158,7 +158,7 @@ int MenuLanguageSelect() GuiText defaultBtnTxt( tr( "Default" ) , 22, Theme.prompttext ); defaultBtnTxt.SetMaxWidth( btnOutline.GetWidth() - 30 ); GuiImage defaultBtnImg( &btnOutline ); - if ( Settings.wsprompt == yes ) + if ( Settings.wsprompt == ON ) { defaultBtnTxt.SetWidescreen( Settings.widescreen ); defaultBtnImg.SetWidescreen( Settings.widescreen ); @@ -176,7 +176,7 @@ int MenuLanguageSelect() GuiText updateBtnTxt( tr( "Update Files" ) , 22, Theme.prompttext ); updateBtnTxt.SetMaxWidth( btnOutline.GetWidth() - 30 ); GuiImage updateBtnImg( &btnOutline ); - if ( Settings.wsprompt == yes ) + if ( Settings.wsprompt == ON ) { updateBtnTxt.SetWidescreen( Settings.widescreen ); updateBtnImg.SetWidescreen( Settings.widescreen ); @@ -342,7 +342,7 @@ int MenuLanguageSelect() strncat ( entered, "/", 1 ); strlcpy( Settings.languagefiles_path, entered, sizeof( Settings.languagefiles_path ) ); WindowPrompt( tr( "Languagepath changed." ), 0, tr( "OK" ) ); - if ( isInserted( bootDevice ) ) + if ( isInserted( Settings.BootDevice ) ) { Settings.Save(); returnhere = 1; @@ -367,7 +367,7 @@ int MenuLanguageSelect() choice = WindowPrompt( tr( "Do you want to change language?" ), 0, tr( "Yes" ), tr( "Cancel" ) ); if ( choice == 1 ) { - if ( isInserted( bootDevice ) ) + if ( isInserted( Settings.BootDevice ) ) { snprintf( Settings.language_path, sizeof( Settings.language_path ), "%s%s", Settings.languagefiles_path, Dir.GetFilename( ret ) ); Settings.Save(); diff --git a/source/settings/cfg.c b/source/settings/cfg.c index 2512fd2b..46028388 100644 --- a/source/settings/cfg.c +++ b/source/settings/cfg.c @@ -14,7 +14,7 @@ u8 ocarinaChoice = 0; u8 videoChoice = 0; -u8 faveChoice = no; +u8 faveChoice = 0; u8 languageChoice = 0; u8 viChoice = 0; u8 iosChoice = 0; diff --git a/source/settings/cfg.h b/source/settings/cfg.h index 72ee8467..7abd704d 100644 --- a/source/settings/cfg.h +++ b/source/settings/cfg.h @@ -10,146 +10,6 @@ extern "C" #include "usbloader/disc.h" -#define CFG_HOME_REBOOT 0 -#define CFG_HOME_EXIT 1 - -#define CFG_VIDEO_SYS 0 // system default -#define CFG_VIDEO_DEFAULT 1 -#define CFG_VIDEO_GAME 1 // game default -#define CFG_VIDEO_PATCH 2 // patch mode -#define CFG_VIDEO_PAL50 3 // force PAL -#define CFG_VIDEO_PAL60 4 // force PAL60 -#define CFG_VIDEO_NTSC 5 // force NTSC -#define CFG_VIDEO_COUNT 6 - -#define CFG_LANG_CONSOLE 0 -#define CFG_LANG_JAPANESE 1 -#define CFG_LANG_ENGLISH 2 -#define CFG_LANG_GERMAN 3 -#define CFG_LANG_FRENCH 4 -#define CFG_LANG_SPANISH 5 -#define CFG_LANG_ITALIAN 6 -#define CFG_LANG_DUTCH 7 -#define CFG_LANG_S_CHINESE 8 -#define CFG_LANG_T_CHINESE 9 -#define CFG_LANG_KOREAN 10 -#define CFG_LANG_COUNT 11 - - extern char bootDevice[10]; - -// extern u8 ocarinaChoice; -// extern u16 playcnt; -// -// extern u8 videoChoice; -// extern u8 languageChoice; -// extern u8 viChoice; -// extern u8 iosChoice; -// extern u8 parentalcontrolChoice; -// extern u8 fix002; -// extern u8 reloadblock; -// extern u8 countrystrings; -// extern u8 alternatedol; -// extern u32 alternatedoloffset; -// extern u8 xflip; -// extern u8 qboot; -// extern u8 sort; -// extern u8 fave; -// extern u8 wsprompt; -// extern u8 keyset; -// extern u8 gameDisplay; - extern char alternatedname[40]; -// extern u8 returnToLoaderGV; - - enum - { - ConsoleLangDefault = 0, jap, eng, ger, fren, esp, it, dut, schin, tchin, kor, settings_language_max - // always the last entry - }; - - void CFG_LoadGameNum(); // -1 = non forced mode - - enum - { - systemdefault = 0, discdefault, patch, pal50, pal60, ntsc, settings_video_max - // always the last entry - }; - - enum - { - off = 0, on, settings_off_on_max - // always the last entry - }; - - enum - { - wiilight_off = 0, wiilight_on, wiilight_forInstall, settings_wiilight_max - // always the last entry - }; - - enum - { - GameID, GameRegion, Both, Neither, settings_sinfo_max - // always the last entry - }; - - enum - { - hr12 = 0, hr24, Off, settings_clock_max - // always the last entry - }; - enum - { - ALL = 0, PLAYCOUNT, - }; - - enum - { - RumbleOff = 0, RumbleOn, settings_rumble_max - // always the last entry - }; - - enum - { - TooltipsOff = 0, TooltipsOn, settings_tooltips_max - // always the last entry - }; - - enum - { - min3 = 1, min5, min10, min20, min30, min60, settings_screensaver_max - // always the last entry - }; - - enum - { - no = 0, yes, sysmenu, wtf, disk3d, settings_xflip_max - // always the last entry - }; - enum - { - us = 0, qwerty, dvorak, euro, azerty, settings_keyset_max - // always the last entry - }; - enum - { - list, grid, carousel, settings_display_max - }; - enum - { - scrollDefault, scrollMarquee, settings_scrolleffect_max - // always the last entry - }; - enum - { - install_game_only, install_all, install_all_but_update, settings_partitions_max - // always the last entry - }; - enum - { - not_install_to_dir, install_to_gameid_name, install_to_name_gameid, settings_installdir_max - // always the last entry - }; - char *get_title(struct discHdr *header); char *cfg_get_title(u8 *id); void title_set(char *id, char *title); diff --git a/source/sys.cpp b/source/sys.cpp index d3615677..e6490971 100644 --- a/source/sys.cpp +++ b/source/sys.cpp @@ -153,7 +153,7 @@ void ScreenShot() timeinfo = localtime(&rawtime); //USBLoader_GX_ScreenShot-Month_Day_Hour_Minute_Second_Year.png strftime(buffer, 80, "USBLoader_GX_ScreenShot-%b%d%H%M%S%y.png", timeinfo); - sprintf(buffer2, "%s/config/%s", bootDevice, buffer); + sprintf(buffer2, "%s/config/%s", Settings.BootDevice, buffer); TakeScreenshot(buffer2); } diff --git a/source/system/IosLoader.cpp b/source/system/IosLoader.cpp index 6632d2b6..0e65f552 100644 --- a/source/system/IosLoader.cpp +++ b/source/system/IosLoader.cpp @@ -3,6 +3,7 @@ #include "IosLoader.h" #include "../fatmounter.h" #include "../usbloader/usbstorage2.h" +#include "../usbloader/disc.h" #include "../wad/nandtitle.h" #include "../mload/mload_modules.h" #include "../settings/CSettings.h" diff --git a/source/themes/Theme_Downloader.cpp b/source/themes/Theme_Downloader.cpp index 8382a299..1779650b 100644 --- a/source/themes/Theme_Downloader.cpp +++ b/source/themes/Theme_Downloader.cpp @@ -188,7 +188,7 @@ static int Theme_Prompt(const char *title, const char *author, GuiImageData *thu GuiText downloadBtnTxt(tr( "Download" ), 22, Theme.prompttext); downloadBtnTxt.SetMaxWidth(btnOutline.GetWidth() - 30); GuiImage downloadBtnImg(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { downloadBtnTxt.SetWidescreen(Settings.widescreen); downloadBtnImg.SetWidescreen(Settings.widescreen); @@ -201,7 +201,7 @@ static int Theme_Prompt(const char *title, const char *author, GuiImageData *thu GuiText backBtnTxt(tr( "Back" ), 22, Theme.prompttext); backBtnTxt.SetMaxWidth(btnOutline.GetWidth() - 30); GuiImage backBtnImg(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { backBtnTxt.SetWidescreen(Settings.widescreen); backBtnImg.SetWidescreen(Settings.widescreen); @@ -362,7 +362,7 @@ int Theme_Downloader() GuiText backBtnTxt(tr( "Back" ), 22, Theme.prompttext); backBtnTxt.SetMaxWidth(btnOutline.GetWidth() - 30); GuiImage backBtnImg(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { backBtnTxt.SetWidescreen(Settings.widescreen); backBtnImg.SetWidescreen(Settings.widescreen); @@ -412,7 +412,7 @@ int Theme_Downloader() PageIndicatorBtn.SetEffectGrow(); GuiImage wifiImg(&wifiImgData); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { wifiImg.SetWidescreen(Settings.widescreen); } diff --git a/source/usbloader/GameList.cpp b/source/usbloader/GameList.cpp index f1f0e506..80185ee4 100644 --- a/source/usbloader/GameList.cpp +++ b/source/usbloader/GameList.cpp @@ -117,7 +117,7 @@ int GameList::FilterList(const wchar_t * gameFilter) NewTitles::Instance()->CheckGame(header->id); /* Filters */ - if (Settings.fave) + if (Settings.GameSort == SORT_RANKING) { GameStatus * GameStats = GameStatistics.GetGameStatus(header->id); if (!GameStats || GameStats->FavoriteRank == 0) continue; @@ -218,11 +218,11 @@ void GameList::SortList() { if (FilteredList.size() < 2) return; - if (Settings.sort == PLAYCOUNT) + if (Settings.GameSort == SORT_PLAYCOUNT) { std::sort(FilteredList.begin(), FilteredList.end(), PlaycountSortCallback); } - else if (Settings.fave) + else if(Settings.GameSort == SORT_RANKING) { std::sort(FilteredList.begin(), FilteredList.end(), FavoriteSortCallback); } diff --git a/source/usbloader/disc.c b/source/usbloader/disc.c index aace22a7..1f84dfb2 100644 --- a/source/usbloader/disc.c +++ b/source/usbloader/disc.c @@ -15,7 +15,7 @@ #include "alternatedol.h" #include "memory.h" #include "wbfs.h" -#include "../settings/cfg.h" +#include "../settings/SettingsEnums.h" #include "../gecko.h" #include "../fatmounter.h" @@ -92,22 +92,22 @@ void __Disc_SetVMode(u8 videoselected) switch (videoselected) { - case pal50: + case VIDEO_MODE_PAL50: vmode = &TVPal528IntDf; vmode_reg = (vmode->viTVMode) >> 2; break; - case pal60: + case VIDEO_MODE_PAL60: vmode = (progressive) ? &TVNtsc480Prog : &TVEurgb60Hz480IntDf; vmode_reg = (vmode->viTVMode) >> 2; break; - case ntsc: + case VIDEO_MODE_NTSC: vmode = (progressive) ? &TVNtsc480Prog : &TVNtsc480IntDf; vmode_reg = (vmode->viTVMode) >> 2; break; - case systemdefault: + case VIDEO_MODE_SYSDEFAULT: // vmode = VIDEO_GetPreferredMode(NULL); break; - case discdefault: + case VIDEO_MODE_DISCDEFAULT: default: /* Select video mode */ switch (diskid[3]) diff --git a/source/usbloader/wbfs/wbfs_fat.cpp b/source/usbloader/wbfs/wbfs_fat.cpp index 6aa66156..3a23a611 100644 --- a/source/usbloader/wbfs/wbfs_fat.cpp +++ b/source/usbloader/wbfs/wbfs_fat.cpp @@ -168,18 +168,7 @@ s32 Wbfs_Fat::AddGame(void) /* Add game to device */ partition_selector_t part_sel = ALL_PARTITIONS; int copy_1_1 = Settings.fullcopy; - switch (Settings.partitions_to_install) - { - case install_game_only: - part_sel = ONLY_GAME_PARTITION; - break; - case install_all: - part_sel = ALL_PARTITIONS; - break; - case install_all_but_update: - part_sel = REMOVE_UPDATE_PARTITION; - break; - } + part_sel = (partition_selector_t) Settings.InstallPartitions; if (copy_1_1) { part_sel = ALL_PARTITIONS; @@ -322,7 +311,7 @@ f32 Wbfs_Fat::EstimateGameSize() } else { - part_sel = Settings.partitions_to_install == install_game_only ? ONLY_GAME_PARTITION : ALL_PARTITIONS; + part_sel = (partition_selector_t) Settings.InstallPartitions; } return wbfs_estimate_disc(part, __ReadDVD, NULL, part_sel); } diff --git a/source/usbloader/wbfs/wbfs_wbfs.cpp b/source/usbloader/wbfs/wbfs_wbfs.cpp index f0069a6c..9b53fa5b 100644 --- a/source/usbloader/wbfs/wbfs_wbfs.cpp +++ b/source/usbloader/wbfs/wbfs_wbfs.cpp @@ -104,7 +104,7 @@ s32 Wbfs_Wbfs::AddGame() } else { - part_sel = Settings.partitions_to_install == install_game_only ? ONLY_GAME_PARTITION : ALL_PARTITIONS; + part_sel = (partition_selector_t) Settings.InstallPartitions; } ret = wbfs_add_disc(hdd, __ReadDVD, NULL, ProgressCallback, part_sel, copy_1_1); @@ -181,18 +181,7 @@ f32 Wbfs_Wbfs::EstimateGameSize() } else { - switch (Settings.partitions_to_install) - { - case install_game_only: - part_sel = ONLY_GAME_PARTITION; - break; - case install_all: - part_sel = ALL_PARTITIONS; - break; - case install_all_but_update: - part_sel = REMOVE_UPDATE_PARTITION; - break; - } + part_sel = (partition_selector_t) Settings.InstallPartitions; } return wbfs_estimate_disc(hdd, __ReadDVD, NULL, part_sel); } diff --git a/source/wad/wad.cpp b/source/wad/wad.cpp index 91bd09fc..559c5185 100644 --- a/source/wad/wad.cpp +++ b/source/wad/wad.cpp @@ -131,14 +131,14 @@ s32 Wad_Install(FILE *fp) trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); GuiImage dialogBoxImg(&dialogBox); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { dialogBoxImg.SetWidescreen(Settings.widescreen); } GuiText btn1Txt(tr( "OK" ), 22, Theme.prompttext); GuiImage btn1Img(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { btn1Txt.SetWidescreen(Settings.widescreen); btn1Img.SetWidescreen(Settings.widescreen); @@ -149,7 +149,7 @@ s32 Wad_Install(FILE *fp) GuiImageData progressbarOutline(Resources::GetFile("progressbar_outline.png"), Resources::GetFileSize("progressbar_outline.png")); GuiImage progressbarOutlineImg(&progressbarOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { progressbarOutlineImg.SetWidescreen(Settings.widescreen); } @@ -199,7 +199,7 @@ s32 Wad_Install(FILE *fp) prTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); prTxt.SetPosition(0, 50); - if ((Settings.wsprompt == yes) && (Settings.widescreen)) /////////////adjust for widescreen + if ((Settings.wsprompt) && (Settings.widescreen)) /////////////adjust for widescreen { progressbarOutlineImg.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); progressbarOutlineImg.SetPosition(0, 50); @@ -368,7 +368,7 @@ s32 Wad_Install(FILE *fp) //msg4Txt.SetText(imgPath); prTxt.SetTextf("%i%%", 100 * (cnt * len + idx) / (tmd_data->num_contents * len)); - if ((Settings.wsprompt == yes) && (Settings.widescreen)) + if ((Settings.wsprompt) && (Settings.widescreen)) { progressbarImg.SetTile(78 * (cnt * len + idx) / (tmd_data->num_contents * len)); } @@ -450,14 +450,14 @@ s32 Wad_Uninstall(FILE *fp) trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); GuiImage dialogBoxImg(&dialogBox); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { dialogBoxImg.SetWidescreen(Settings.widescreen); } GuiText btn1Txt(tr( "OK" ), 22, Theme.prompttext); GuiImage btn1Img(&btnOutline); - if (Settings.wsprompt == yes) + if (Settings.wsprompt) { btn1Txt.SetWidescreen(Settings.widescreen); btn1Img.SetWidescreen(Settings.widescreen); @@ -492,7 +492,7 @@ s32 Wad_Uninstall(FILE *fp) msg5Txt.SetAlignment(ALIGN_LEFT, ALIGN_TOP); msg5Txt.SetPosition(50, 167); - if ((Settings.wsprompt == yes) && (Settings.widescreen)) /////////////adjust for widescreen + if ((Settings.wsprompt) && (Settings.widescreen)) /////////////adjust for widescreen { msg1Txt.SetPosition(70, 95);