From a5822064f497dc5a4024525f212d5d5d93d2e7c5 Mon Sep 17 00:00:00 2001 From: dimok321 <15055714+dimok789@users.noreply.github.com> Date: Thu, 20 Jan 2011 15:56:01 +0000 Subject: [PATCH] *Forgot to add block of HBC and Title Launcher, added now *Resolve for Issue 1766 - You can now delete everything belonging to a game on deleting the game (covers/cheats/text codes...) *Added dotted limit to the window prompt title text --- HBC/META.XML | 4 +- source/homebrewboot/HomebrewBrowser.cpp | 3 +- source/menu/GameBrowseMenu.cpp | 4 +- source/prompts/PromptWindows.cpp | 1 + source/settings/menus/UninstallSM.cpp | 77 ++++++++++++++++--------- 5 files changed, 57 insertions(+), 32 deletions(-) diff --git a/HBC/META.XML b/HBC/META.XML index 014b360c..fe92fb20 100644 --- a/HBC/META.XML +++ b/HBC/META.XML @@ -2,8 +2,8 @@ USB Loader GX USB Loader GX Team - 2.0 r1047 - 201101201253 + 2.0 r1048 + 201101201504 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. diff --git a/source/homebrewboot/HomebrewBrowser.cpp b/source/homebrewboot/HomebrewBrowser.cpp index dd0a711b..43262cde 100644 --- a/source/homebrewboot/HomebrewBrowser.cpp +++ b/source/homebrewboot/HomebrewBrowser.cpp @@ -71,7 +71,8 @@ HomebrewBrowser::HomebrewBrowser() channelBtn->SetSoundClick(btnSoundClick2); channelBtn->SetEffectGrow(); channelBtn->SetTrigger(trigA); - Append(channelBtn); + if (Settings.godmode || !(Settings.ParentalBlocks & BLOCK_TITLE_LAUNCHER_MENU)) + Append(channelBtn); MainButtonDesc.resize(HomebrewList->GetFilecount()); MainButtonDescOver.resize(HomebrewList->GetFilecount()); diff --git a/source/menu/GameBrowseMenu.cpp b/source/menu/GameBrowseMenu.cpp index f29e0b6f..fa19b2f8 100644 --- a/source/menu/GameBrowseMenu.cpp +++ b/source/menu/GameBrowseMenu.cpp @@ -651,7 +651,9 @@ void GameBrowseMenu::ReloadBrowser() Append(gameInfo); Append(homeBtn); Append(settingsBtn); - Append(homebrewBtn); + + if (Settings.godmode || !(Settings.ParentalBlocks & BLOCK_HBC_MENU)) + Append(homebrewBtn); if (Settings.godmode || !(Settings.ParentalBlocks & BLOCK_GAME_INSTALL)) Append(installBtn); diff --git a/source/prompts/PromptWindows.cpp b/source/prompts/PromptWindows.cpp index ec4e9e06..e663c75a 100644 --- a/source/prompts/PromptWindows.cpp +++ b/source/prompts/PromptWindows.cpp @@ -549,6 +549,7 @@ int WindowPrompt(const char *title, const char *msg, const char *btn1Label, cons GuiText titleTxt(title, 26, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); titleTxt.SetPosition(0, 55); + titleTxt.SetMaxWidth(430, DOTTED); GuiText msgTxt(msg, 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); msgTxt.SetPosition(0, -40); diff --git a/source/settings/menus/UninstallSM.cpp b/source/settings/menus/UninstallSM.cpp index 73b7c809..519d9e6e 100644 --- a/source/settings/menus/UninstallSM.cpp +++ b/source/settings/menus/UninstallSM.cpp @@ -88,32 +88,50 @@ int UninstallSM::GetMenuInternal() //! Settings: Uninstall Game if (ret == ++Idx) { - int choice = WindowPrompt(tr( "Do you really want to delete:" ), GameTitles.GetTitle(DiscHeader), tr( "Yes" ), tr( "Cancel" )); - if (choice == 1) + int choice = WindowPrompt(GameTitles.GetTitle(DiscHeader), tr( "What should be deleted for this game title:" ), tr( "Game Only" ), tr("Uninstall all"), tr( "Cancel" )); + if (choice == 0) + return MENU_NONE; + + char GameID[7]; + snprintf(GameID, sizeof(GameID), "%s", (char *) DiscHeader->id); + + std::string Title = GameTitles.GetTitle(DiscHeader); + GameSettings.Remove(DiscHeader->id); + GameSettings.Save(); + GameStatistics.Remove(DiscHeader->id); + GameStatistics.Save(); + int ret = 0; + if(!mountMethod) + ret = WBFS_RemoveGame(DiscHeader->id); + + if(ret >= 0) { - std::string Title = GameTitles.GetTitle(DiscHeader); - GameSettings.Remove(DiscHeader->id); - GameSettings.Save(); - GameStatistics.Remove(DiscHeader->id); - GameStatistics.Save(); - int ret = 0; - if(!mountMethod) - ret = WBFS_RemoveGame(DiscHeader->id); - - if(ret >= 0) - { - wString oldFilter(gameList.GetCurrentFilter()); - gameList.ReadGameList(); - gameList.FilterList(oldFilter.c_str()); - } - - if (ret < 0) - WindowPrompt(tr( "Can't delete:" ), Title.c_str(), tr( "OK" )); - else - WindowPrompt(tr( "Successfully deleted:" ), Title.c_str(), tr( "OK" )); - - return MENU_DISCLIST; + wString oldFilter(gameList.GetCurrentFilter()); + gameList.ReadGameList(); + gameList.FilterList(oldFilter.c_str()); } + + if(choice == 2) + { + char filepath[200]; + snprintf(filepath, sizeof(filepath), "%s%s.png", Settings.covers_path, GameID); + if (CheckFile(filepath)) remove(filepath); + snprintf(filepath, sizeof(filepath), "%s%s.png", Settings.covers2d_path, GameID); + if (CheckFile(filepath)) remove(filepath); + snprintf(filepath, sizeof(filepath), "%s%s.png", Settings.disc_path, GameID); + if (CheckFile(filepath)) remove(filepath); + snprintf(filepath, sizeof(filepath), "%s%s.txt", Settings.TxtCheatcodespath, GameID); + if (CheckFile(filepath)) remove(filepath); + snprintf(filepath, sizeof(filepath), "%s%s.gct", Settings.Cheatcodespath, GameID); + if (CheckFile(filepath)) remove(filepath); + } + + if (ret < 0) + WindowPrompt(tr( "Can't delete:" ), Title.c_str(), tr( "OK" )); + else + WindowPrompt(tr( "Successfully deleted:" ), Title.c_str(), tr( "OK" )); + + return MENU_DISCLIST; } //! Settings: Reset Playcounter @@ -130,14 +148,17 @@ int UninstallSM::GetMenuInternal() //! Settings: Delete Cover Artwork else if (ret == ++Idx) { + int choice = WindowPrompt(tr( "Delete" ), tr("Are you sure?"), tr( "Yes" ), tr( "No" )); + if (choice != 1) + return MENU_NONE; + char GameID[7]; snprintf(GameID, sizeof(GameID), "%s", (char *) DiscHeader->id); char filepath[200]; snprintf(filepath, sizeof(filepath), "%s%s.png", Settings.covers_path, GameID); - - int choice = WindowPrompt(tr( "Delete" ), filepath, tr( "Yes" ), tr( "No" )); - if (choice == 1) - if (CheckFile(filepath)) remove(filepath); + if (CheckFile(filepath)) remove(filepath); + snprintf(filepath, sizeof(filepath), "%s%s.png", Settings.covers2d_path, GameID); + if (CheckFile(filepath)) remove(filepath); } //! Settings: Delete Disc Artwork