From 5d19915af82099b021225be12ffb50a49a6f00ae Mon Sep 17 00:00:00 2001 From: giantpune Date: Sun, 20 Dec 2009 10:11:00 +0000 Subject: [PATCH] fix code dumps when loading without a SD card add screenshot shit to gameinfo window --- HBC/META.XML | 4 ++-- source/menu/menu_check.cpp | 4 ++-- source/menu/menu_disclist.cpp | 1 + source/menu/menu_format.cpp | 2 +- source/prompts/gameinfo.cpp | 45 +++++++++++++++++++++++++---------- 5 files changed, 39 insertions(+), 17 deletions(-) diff --git a/HBC/META.XML b/HBC/META.XML index a34e55c9..de5fbc11 100644 --- a/HBC/META.XML +++ b/HBC/META.XML @@ -2,8 +2,8 @@ USB Loader GX USB Loader GX Team - 1.0 r871 - 200912192124 + 1.0 r872 + 200912200514 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/source/menu/menu_check.cpp b/source/menu/menu_check.cpp index c2a512f4..b1ee8f62 100644 --- a/source/menu/menu_check.cpp +++ b/source/menu/menu_check.cpp @@ -105,7 +105,7 @@ int MenuCheck() { } } - if (ret2 >= 0 || load_from_fs != PART_FS_WBFS) { + if ((ret2 >= 0 || load_from_fs != PART_FS_WBFS) && isInserted(bootDevice)) { cfg_save_global(); break; } @@ -138,7 +138,7 @@ int MenuCheck() { } // open database if needed, load titles if needed - OpenXMLDatabase(Settings.titlestxt_path,Settings.db_language, Settings.db_JPtoEN, true, Settings.titlesOverride==1?true:false, true); + if(isInserted(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 //snprintf(pathname, sizeof(pathname), "%stitles.txt", Settings.titlestxt_path); diff --git a/source/menu/menu_disclist.cpp b/source/menu/menu_disclist.cpp index 74a89f96..dbd37bce 100644 --- a/source/menu/menu_disclist.cpp +++ b/source/menu/menu_disclist.cpp @@ -1227,6 +1227,7 @@ int MenuDiscList() { case 'W': sprintf(gameregion,"NTSC T"); break; + default: case 'K': sprintf(gameregion,"NTSC K"); break; diff --git a/source/menu/menu_format.cpp b/source/menu/menu_format.cpp index ef73aeaf..ff97fd76 100644 --- a/source/menu/menu_format.cpp +++ b/source/menu/menu_format.cpp @@ -113,7 +113,7 @@ int MenuFormat() { menu = MENU_DISCLIST; Settings.partition = ret; - cfg_save_global(); + if(isInserted(bootDevice))cfg_save_global(); } else { sprintf(text, "%s %d : %.2fGB",tr("Partition"), ret+1, entry->size * (partitions.sector_size / GB_SIZE)); choice = WindowPrompt( tr("Do you want to format:"), text,tr("Yes"),tr("No")); diff --git a/source/prompts/gameinfo.cpp b/source/prompts/gameinfo.cpp index 6a354565..7e8325c2 100644 --- a/source/prompts/gameinfo.cpp +++ b/source/prompts/gameinfo.cpp @@ -18,6 +18,7 @@ #include "prompts/PromptWindows.h" #include "gameinfo.h" #include "usbloader/getentries.h" +#include "../gecko.h" /*** Extern variables ***/ @@ -779,6 +780,14 @@ int showGameInfo(char *ID) { gameinfoWindow.Append(wiitdb3Txt); gameinfoWindow.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_IN, 100); + + GuiTrigger trigZ; + trigZ.SetButtonOnlyTrigger(-1, WPAD_NUNCHUK_BUTTON_Z | WPAD_CLASSIC_BUTTON_ZL, PAD_TRIGGER_Z); + + GuiButton screenShotBtn(0,0); + screenShotBtn.SetPosition(0,0); + screenShotBtn.SetTrigger(&trigZ); + gameinfoWindow.Append(&screenShotBtn); HaltGui(); //mainWindow->SetState(STATE_DISABLED); mainWindow->Append(&gameinfoWindow); @@ -806,13 +815,15 @@ int showGameInfo(char *ID) { HaltGui(); gameinfoWindow2.Remove(&nextBtn); gameinfoWindow2.Remove(&backBtn); - gameinfoWindow2.Remove(&homeBtn); - gameinfoWindow2.SetVisible(false); + gameinfoWindow2.Remove(&homeBtn); + gameinfoWindow2.Remove(&screenShotBtn); + gameinfoWindow2.SetVisible(false); gameinfoWindow.SetVisible(true); gameinfoWindow.Append(&backBtn); gameinfoWindow.Append(&nextBtn); - gameinfoWindow.Append(&homeBtn); - mainWindow->Remove(&gameinfoWindow2); + gameinfoWindow.Append(&homeBtn); + gameinfoWindow.Append(&screenShotBtn); + mainWindow->Remove(&gameinfoWindow2); ResumeGui(); page=1; } @@ -823,27 +834,31 @@ int showGameInfo(char *ID) { HaltGui(); gameinfoWindow.Remove(&nextBtn); gameinfoWindow.Remove(&backBtn); - gameinfoWindow.Remove(&homeBtn); - gameinfoWindow.SetVisible(false); + gameinfoWindow.Remove(&homeBtn); + gameinfoWindow.Remove(&screenShotBtn); + gameinfoWindow.SetVisible(false); gameinfoWindow2.SetVisible(true); coverImg->SetPosition(15,30); gameinfoWindow2.Append(&nextBtn); gameinfoWindow2.Append(&backBtn); - gameinfoWindow2.Append(&homeBtn); - mainWindow->Append(&gameinfoWindow2); + gameinfoWindow2.Append(&homeBtn); + gameinfoWindow2.Append(&screenShotBtn); + mainWindow->Append(&gameinfoWindow2); ResumeGui(); page=2; } else { HaltGui(); gameinfoWindow2.Remove(&nextBtn); gameinfoWindow2.Remove(&backBtn); - gameinfoWindow2.Remove(&homeBtn); - gameinfoWindow2.SetVisible(false); + gameinfoWindow2.Remove(&homeBtn); + gameinfoWindow2.Remove(&screenShotBtn); + gameinfoWindow2.SetVisible(false); gameinfoWindow.SetVisible(true); gameinfoWindow.Append(&backBtn); gameinfoWindow.Append(&nextBtn); - gameinfoWindow.Append(&homeBtn); - mainWindow->Remove(&gameinfoWindow2); + gameinfoWindow.Append(&homeBtn); + gameinfoWindow.Append(&screenShotBtn); + mainWindow->Remove(&gameinfoWindow2); ResumeGui(); page=1; } @@ -901,6 +916,12 @@ int showGameInfo(char *ID) { } urlBtn.ResetState(); } + else if (screenShotBtn.GetState() == STATE_CLICKED) { + gprintf("\n\tscreenShotBtn clicked"); + screenShotBtn.ResetState(); + ScreenShot(); + gprintf("...It's easy, mmmmmmKay"); + } } if (page==1) { gameinfoWindow.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 100);