2010-02-27 19:18:01 +01:00
|
|
|
#include "menus.h"
|
|
|
|
#include "fatmounter.h"
|
|
|
|
#include "usbloader/wdvd.h"
|
2010-09-18 13:46:25 +02:00
|
|
|
#include "usbloader/GameList.h"
|
2010-02-27 19:18:01 +01:00
|
|
|
#include "usbloader/wbfs.h"
|
|
|
|
#include "patches/fst.h"
|
|
|
|
#include "network/networkops.h"
|
|
|
|
#include "prompts/gameinfo.h"
|
|
|
|
#include "prompts/DiscBrowser.h"
|
2010-09-19 12:53:24 +02:00
|
|
|
#include "prompts/TitleBrowser.h"
|
2010-02-27 19:18:01 +01:00
|
|
|
#include "settings/Settings.h"
|
2010-09-24 23:22:01 +02:00
|
|
|
#include "settings/CGameSettings.h"
|
2010-09-25 10:51:44 +02:00
|
|
|
#include "settings/CGameStatistics.h"
|
2010-10-28 11:00:52 +02:00
|
|
|
#include "settings/GameTitles.h"
|
2010-09-24 19:58:56 +02:00
|
|
|
#include "themes/CTheme.h"
|
2010-11-06 16:30:14 +01:00
|
|
|
#include "GameBootProcess.h"
|
2010-02-27 19:18:01 +01:00
|
|
|
#include "wpad.h"
|
|
|
|
#include "sys.h"
|
|
|
|
|
|
|
|
#include "libwiigui/gui_gamebrowser.h"
|
|
|
|
#include "libwiigui/gui_gamegrid.h"
|
|
|
|
#include "libwiigui/gui_gamecarousel.h"
|
|
|
|
#include "libwiigui/gui_searchbar.h"
|
|
|
|
|
|
|
|
extern u8 * gameScreenTex;
|
|
|
|
extern struct discHdr *dvdheader;
|
|
|
|
extern u8 mountMethod;
|
|
|
|
extern int load_from_fs;
|
|
|
|
extern s32 gameSelected;
|
|
|
|
extern GuiText * GameIDTxt;
|
|
|
|
extern GuiText * GameRegionTxt;
|
|
|
|
extern const u8 data1;
|
|
|
|
extern FreeTypeGX *fontClock;
|
|
|
|
extern bool updateavailable;
|
|
|
|
extern int cntMissFiles;
|
|
|
|
extern GuiImageData * cover;
|
|
|
|
extern GuiImage * coverImg;
|
|
|
|
extern GuiImageData * pointer[4];
|
|
|
|
extern bool altdoldefault;
|
|
|
|
extern GuiImage * bgImg;
|
|
|
|
|
|
|
|
GuiButton *Toolbar[9];
|
2010-09-19 01:16:05 +02:00
|
|
|
int idiotFlag = -1;
|
2010-02-27 19:18:01 +01:00
|
|
|
char idiotChar[50];
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
void DiscListWinUpdateCallback(void * e);
|
|
|
|
void rockout(int f = 0);
|
2010-02-27 19:18:01 +01:00
|
|
|
|
|
|
|
static u32 startat = 0;
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* MenuDiscList
|
|
|
|
***************************************************************************/
|
2010-09-19 01:16:05 +02:00
|
|
|
int MenuDiscList()
|
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gprintf("MenuDiscList()\n");
|
2010-09-18 13:46:25 +02:00
|
|
|
gameList.FilterList();
|
2010-09-19 01:16:05 +02:00
|
|
|
int offset = MIN( ( int )startat, gameList.size() - 1 );
|
2010-02-27 19:18:01 +01:00
|
|
|
startat = offset;
|
2010-09-19 01:16:05 +02:00
|
|
|
int datagB = 0;
|
2010-02-27 19:18:01 +01:00
|
|
|
int dataed = -1;
|
|
|
|
int selectImg1 = 0;
|
|
|
|
char ID[4];
|
|
|
|
char IDfull[7];
|
|
|
|
u32 covert = 0;
|
2010-09-24 02:48:03 +02:00
|
|
|
if (!dvdheader) dvdheader = new struct discHdr;
|
2010-09-19 01:16:05 +02:00
|
|
|
u8 mountMethodOLD = 0;
|
2010-02-27 19:18:01 +01:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
WDVD_GetCoverStatus(&covert);
|
2010-09-19 01:16:05 +02:00
|
|
|
u32 covertOld = covert;
|
2010-02-27 19:18:01 +01:00
|
|
|
|
2010-09-19 01:16:05 +02:00
|
|
|
f32 freespace, used, size = 0.0;
|
|
|
|
wchar_t searchChar;
|
2010-02-27 19:18:01 +01:00
|
|
|
//SCREENSAVER
|
|
|
|
int check = 0; //to skip the first cycle when wiimote isn't completely connected
|
|
|
|
|
2010-09-19 01:16:05 +02:00
|
|
|
datagB = 0;
|
2010-09-25 08:54:27 +02:00
|
|
|
int menu = MENU_NONE;
|
2010-02-27 19:18:01 +01:00
|
|
|
|
|
|
|
u32 nolist;
|
|
|
|
int choice = 0, selectedold = 100;
|
|
|
|
s32 ret;
|
|
|
|
|
|
|
|
//CLOCK
|
|
|
|
struct tm * timeinfo;
|
2010-09-19 01:16:05 +02:00
|
|
|
char theTime[80] = "";
|
|
|
|
time_t lastrawtime = 0;
|
2010-02-27 19:18:01 +01:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (mountMethod != 3 && WBFS_ShowFreeSpace())
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
WBFS_DiskSpace(&used, &freespace);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-02-27 19:18:01 +01:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (!gameList.size()) //if there is no list of games to display
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
nolist = 1;
|
|
|
|
}
|
|
|
|
|
2010-09-26 10:33:43 +02:00
|
|
|
GuiImageData btnInstall(Resources::GetFile("button_install.png"), Resources::GetFileSize("button_install.png"));
|
|
|
|
GuiImageData btnInstallOver(Resources::GetFile("button_install_over.png"), Resources::GetFileSize("button_install_over.png"));
|
|
|
|
|
|
|
|
GuiImageData btnSettings(Resources::GetFile("settings_button.png"), Resources::GetFileSize("settings_button.png"));
|
|
|
|
GuiImageData btnSettingsOver(Resources::GetFile("settings_button_over.png"), Resources::GetFileSize("settings_button_over.png"));
|
|
|
|
|
|
|
|
GuiImageData btnpwroff(Resources::GetFile("wiimote_poweroff.png"), Resources::GetFileSize("wiimote_poweroff.png"));
|
|
|
|
GuiImageData btnpwroffOver(Resources::GetFile("wiimote_poweroff_over.png"), Resources::GetFileSize("wiimote_poweroff_over.png"));
|
|
|
|
GuiImageData btnhome(Resources::GetFile("menu_button.png"), Resources::GetFileSize("menu_button.png"));
|
|
|
|
GuiImageData btnhomeOver(Resources::GetFile("menu_button_over.png"), Resources::GetFileSize("menu_button_over.png"));
|
|
|
|
GuiImageData btnsdcardOver(Resources::GetFile("sdcard_over.png"), Resources::GetFileSize("sdcard_over.png"));
|
|
|
|
GuiImageData btnsdcard(Resources::GetFile("sdcard.png"), Resources::GetFileSize("sdcard.png"));
|
|
|
|
|
|
|
|
GuiImageData imgfavIcon(Resources::GetFile("favIcon.png"), Resources::GetFileSize("favIcon.png"));
|
|
|
|
GuiImageData imgfavIcon_gray(Resources::GetFile("favIcon_gray.png"), Resources::GetFileSize("favIcon_gray.png"));
|
|
|
|
GuiImageData imgsearchIcon(Resources::GetFile("searchIcon.png"), Resources::GetFileSize("searchIcon.png"));
|
|
|
|
GuiImageData imgsearchIcon_gray(Resources::GetFile("searchIcon_gray.png"), Resources::GetFileSize("searchIcon_gray.png"));
|
|
|
|
GuiImageData imgabcIcon(Resources::GetFile("abcIcon.png"), Resources::GetFileSize("abcIcon.png"));
|
|
|
|
GuiImageData imgrankIcon(Resources::GetFile("rankIcon.png"), Resources::GetFileSize("rankIcon.png"));
|
|
|
|
GuiImageData imgplayCountIcon(Resources::GetFile("playCountIcon.png"), Resources::GetFileSize("playCountIcon.png"));
|
|
|
|
GuiImageData imgarrangeGrid(Resources::GetFile("arrangeGrid.png"), Resources::GetFileSize("arrangeGrid.png"));
|
|
|
|
GuiImageData imgarrangeGrid_gray(Resources::GetFile("arrangeGrid_gray.png"), Resources::GetFileSize("arrangeGrid_gray.png"));
|
|
|
|
GuiImageData imgarrangeList(Resources::GetFile("arrangeList.png"), Resources::GetFileSize("arrangeList.png"));
|
|
|
|
GuiImageData imgarrangeList_gray(Resources::GetFile("arrangeList_gray.png"), Resources::GetFileSize("arrangeList_gray.png"));
|
|
|
|
GuiImageData imgarrangeCarousel(Resources::GetFile("arrangeCarousel.png"), Resources::GetFileSize("arrangeCarousel.png"));
|
|
|
|
GuiImageData imgarrangeCarousel_gray(Resources::GetFile("arrangeCarousel_gray.png"), Resources::GetFileSize("arrangeCarousel_gray.png"));
|
|
|
|
|
|
|
|
GuiImageData imgLock(Resources::GetFile("lock.png"), Resources::GetFileSize("lock.png"));
|
|
|
|
GuiImageData imgLock_gray(Resources::GetFile("lock_gray.png"), Resources::GetFileSize("lock_gray.png"));
|
|
|
|
GuiImageData imgUnlock(Resources::GetFile("lock_gray.png"), Resources::GetFileSize("lock_gray.png"));
|
|
|
|
GuiImageData imgUnlock_gray(Resources::GetFile("unlock_gray.png"), Resources::GetFileSize("unlock_gray.png"));
|
|
|
|
|
|
|
|
GuiImageData imgdvd(Resources::GetFile("dvd.png"), Resources::GetFileSize("dvd.png"));
|
|
|
|
GuiImageData imgdvd_gray(Resources::GetFile("dvd_gray.png"), Resources::GetFileSize("dvd_gray.png"));
|
|
|
|
|
|
|
|
GuiImageData homebrewImgData(Resources::GetFile("browser.png"), Resources::GetFileSize("browser.png"));
|
|
|
|
GuiImageData homebrewImgDataOver(Resources::GetFile("browser_over.png"), Resources::GetFileSize("browser_over.png"));
|
2010-02-27 19:18:01 +01:00
|
|
|
|
|
|
|
GuiTrigger trigA;
|
2010-09-24 02:48:03 +02:00
|
|
|
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
|
2010-02-27 19:18:01 +01:00
|
|
|
GuiTrigger trigHome;
|
2010-09-24 02:48:03 +02:00
|
|
|
trigHome.SetButtonOnlyTrigger(-1, WPAD_BUTTON_HOME | WPAD_CLASSIC_BUTTON_HOME, PAD_BUTTON_START);
|
2010-02-27 19:18:01 +01:00
|
|
|
GuiTrigger trig2;
|
2010-09-24 02:48:03 +02:00
|
|
|
trig2.SetButtonOnlyTrigger(-1, WPAD_BUTTON_2 | WPAD_CLASSIC_BUTTON_X, 0);
|
2010-02-27 19:18:01 +01:00
|
|
|
GuiTrigger trig1;
|
2010-09-24 02:48:03 +02:00
|
|
|
trig1.SetButtonOnlyTrigger(-1, WPAD_BUTTON_1 | WPAD_CLASSIC_BUTTON_Y, 0);
|
2010-02-27 19:18:01 +01:00
|
|
|
GuiTrigger trigZ;
|
2010-09-24 02:48:03 +02:00
|
|
|
trigZ.SetButtonOnlyTrigger(-1, WPAD_NUNCHUK_BUTTON_Z | WPAD_CLASSIC_BUTTON_ZL, PAD_TRIGGER_Z);
|
2010-02-27 19:18:01 +01:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiButton screenShotBtn(0, 0);
|
|
|
|
screenShotBtn.SetPosition(0, 0);
|
|
|
|
screenShotBtn.SetTrigger(&trigZ);
|
2010-02-27 19:18:01 +01:00
|
|
|
|
|
|
|
char spaceinfo[30];
|
2010-09-24 02:48:03 +02:00
|
|
|
if (load_from_fs == PART_FS_FAT)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
memset(spaceinfo, 0, 30);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
if (!strcmp(Settings.db_language, "JA"))
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
// needs to be "total...used" for Japanese
|
2010-09-24 02:48:03 +02:00
|
|
|
sprintf(spaceinfo, (mountMethod != 3 ? "%.2fGB %s %.2fGB %s" : " "), (freespace + used), tr( "of" ),
|
|
|
|
freespace, tr( "free" ));
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
sprintf(spaceinfo, (mountMethod != 3 ? "%.2fGB %s %.2fGB %s" : " "), freespace, tr( "of" ), (freespace
|
|
|
|
+ used), tr( "free" ));
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
}
|
2010-09-24 19:58:56 +02:00
|
|
|
GuiText usedSpaceTxt(spaceinfo, 18, Theme.info);
|
|
|
|
usedSpaceTxt.SetAlignment(Theme.hddinfo_align, ALIGN_TOP);
|
|
|
|
usedSpaceTxt.SetPosition(Theme.hddinfo_x, Theme.hddinfo_y);
|
2010-09-19 01:16:05 +02:00
|
|
|
|
|
|
|
char GamesCnt[15];
|
2010-09-24 02:48:03 +02:00
|
|
|
sprintf(GamesCnt, "%s: %i", (mountMethod != 3 ? tr( "Games" ) : tr( "Channels" )), gameList.size());
|
2010-09-24 19:58:56 +02:00
|
|
|
GuiText gamecntTxt(GamesCnt, 18, Theme.info);
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiButton gamecntBtn(100, 18);
|
2010-09-24 19:58:56 +02:00
|
|
|
gamecntBtn.SetAlignment(Theme.gamecount_align, ALIGN_TOP);
|
|
|
|
gamecntBtn.SetPosition(Theme.gamecount_x, Theme.gamecount_y);
|
2010-09-24 02:48:03 +02:00
|
|
|
gamecntBtn.SetLabel(&gamecntTxt);
|
2010-09-19 01:16:05 +02:00
|
|
|
gamecntBtn.SetEffectGrow();
|
2010-09-24 02:48:03 +02:00
|
|
|
gamecntBtn.SetTrigger(&trigA);
|
|
|
|
|
|
|
|
GuiTooltip installBtnTT(tr( "Install a game" ));
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.wsprompt) installBtnTT.SetWidescreen(Settings.widescreen);
|
2010-09-24 19:58:56 +02:00
|
|
|
installBtnTT.SetAlpha(Theme.tooltipAlpha);
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiImage installBtnImg(&btnInstall);
|
|
|
|
GuiImage installBtnImgOver(&btnInstallOver);
|
|
|
|
installBtnImg.SetWidescreen(Settings.widescreen);
|
|
|
|
installBtnImgOver.SetWidescreen(Settings.widescreen);
|
|
|
|
|
2010-09-24 19:58:56 +02:00
|
|
|
GuiButton installBtn(&installBtnImg, &installBtnImgOver, ALIGN_LEFT, ALIGN_TOP, Theme.install_x, Theme.install_y,
|
2010-11-13 23:34:53 +01:00
|
|
|
&trigA, btnSoundOver, btnSoundClick2, 1, &installBtnTT, 24, -30, 0, 5);
|
2010-09-24 02:48:03 +02:00
|
|
|
|
|
|
|
GuiTooltip settingsBtnTT(tr( "Settings" ));
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.wsprompt) settingsBtnTT.SetWidescreen(Settings.widescreen);
|
2010-09-24 19:58:56 +02:00
|
|
|
settingsBtnTT.SetAlpha(Theme.tooltipAlpha);
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiImage settingsBtnImg(&btnSettings);
|
|
|
|
settingsBtnImg.SetWidescreen(Settings.widescreen);
|
|
|
|
GuiImage settingsBtnImgOver(&btnSettingsOver);
|
|
|
|
settingsBtnImgOver.SetWidescreen(Settings.widescreen);
|
2010-09-24 19:58:56 +02:00
|
|
|
GuiButton settingsBtn(&settingsBtnImg, &settingsBtnImgOver, 0, 3, Theme.setting_x, Theme.setting_y, &trigA,
|
2010-11-13 23:34:53 +01:00
|
|
|
btnSoundOver, btnSoundClick2, 1, &settingsBtnTT, 65, -30, 0, 5);
|
2010-09-24 02:48:03 +02:00
|
|
|
|
|
|
|
GuiTooltip homeBtnTT(tr( "Back to HBC or Wii Menu" ));
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.wsprompt) homeBtnTT.SetWidescreen(Settings.widescreen);
|
2010-09-24 19:58:56 +02:00
|
|
|
settingsBtnTT.SetAlpha(Theme.tooltipAlpha);
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiImage homeBtnImg(&btnhome);
|
|
|
|
homeBtnImg.SetWidescreen(Settings.widescreen);
|
|
|
|
GuiImage homeBtnImgOver(&btnhomeOver);
|
|
|
|
homeBtnImgOver.SetWidescreen(Settings.widescreen);
|
2010-11-13 23:34:53 +01:00
|
|
|
GuiButton homeBtn(&homeBtnImg, &homeBtnImgOver, 0, 3, Theme.home_x, Theme.home_y, &trigA, btnSoundOver, btnSoundClick2,
|
2010-09-24 02:48:03 +02:00
|
|
|
1, &homeBtnTT, 15, -30, 1, 5);
|
2010-02-27 19:18:01 +01:00
|
|
|
homeBtn.RemoveSoundClick();
|
2010-09-24 02:48:03 +02:00
|
|
|
homeBtn.SetTrigger(&trigHome);
|
|
|
|
|
|
|
|
GuiTooltip poweroffBtnTT(tr( "Power off the Wii" ));
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.wsprompt) poweroffBtnTT.SetWidescreen(Settings.widescreen);
|
2010-09-24 19:58:56 +02:00
|
|
|
poweroffBtnTT.SetAlpha(Theme.tooltipAlpha);
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiImage poweroffBtnImg(&btnpwroff);
|
|
|
|
GuiImage poweroffBtnImgOver(&btnpwroffOver);
|
|
|
|
poweroffBtnImg.SetWidescreen(Settings.widescreen);
|
|
|
|
poweroffBtnImgOver.SetWidescreen(Settings.widescreen);
|
2010-09-24 19:58:56 +02:00
|
|
|
GuiButton poweroffBtn(&poweroffBtnImg, &poweroffBtnImgOver, 0, 3, Theme.power_x, Theme.power_y, &trigA,
|
2010-11-13 23:34:53 +01:00
|
|
|
btnSoundOver, btnSoundClick2, 1, &poweroffBtnTT, -10, -30, 1, 5);
|
2010-09-24 02:48:03 +02:00
|
|
|
|
|
|
|
GuiTooltip sdcardBtnTT(tr( "Reload SD" ));
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.wsprompt) sdcardBtnTT.SetWidescreen(Settings.widescreen);
|
2010-09-24 19:58:56 +02:00
|
|
|
sdcardBtnTT.SetAlpha(Theme.tooltipAlpha);
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiImage sdcardImg(&btnsdcard);
|
|
|
|
GuiImage sdcardImgOver(&btnsdcardOver);
|
|
|
|
sdcardImg.SetWidescreen(Settings.widescreen);
|
|
|
|
sdcardImgOver.SetWidescreen(Settings.widescreen);
|
2010-11-13 23:34:53 +01:00
|
|
|
GuiButton sdcardBtn(&sdcardImg, &sdcardImgOver, 0, 3, Theme.sdcard_x, Theme.sdcard_y, &trigA, btnSoundOver,
|
|
|
|
btnSoundClick2, 1, &sdcardBtnTT, 15, -30, 0, 5);
|
2010-09-24 02:48:03 +02:00
|
|
|
|
|
|
|
GuiButton gameInfo(0, 0);
|
|
|
|
gameInfo.SetTrigger(&trig2);
|
2010-11-13 23:34:53 +01:00
|
|
|
gameInfo.SetSoundClick(btnSoundClick2);
|
2010-09-24 02:48:03 +02:00
|
|
|
|
2010-11-07 21:31:45 +01:00
|
|
|
GuiTooltip favoriteBtnTT(tr( "Display favorites only" ));
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.wsprompt) favoriteBtnTT.SetWidescreen(Settings.widescreen);
|
2010-09-24 19:58:56 +02:00
|
|
|
favoriteBtnTT.SetAlpha(Theme.tooltipAlpha);
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiImage favoriteBtnImg(&imgfavIcon);
|
|
|
|
favoriteBtnImg.SetWidescreen(Settings.widescreen);
|
|
|
|
GuiImage favoriteBtnImg_g(&imgfavIcon_gray);
|
|
|
|
favoriteBtnImg_g.SetWidescreen(Settings.widescreen);
|
2010-09-24 19:58:56 +02:00
|
|
|
GuiButton favoriteBtn(&favoriteBtnImg_g, &favoriteBtnImg_g, ALIGN_LEFT, ALIGN_TOP, Theme.gamelist_favorite_x,
|
2010-11-13 23:34:53 +01:00
|
|
|
Theme.gamelist_favorite_y, &trigA, btnSoundOver, btnSoundClick2, 1, &favoriteBtnTT, -15, 52, 0, 3);
|
2010-09-24 02:48:03 +02:00
|
|
|
favoriteBtn.SetAlpha(180);
|
|
|
|
|
|
|
|
GuiTooltip searchBtnTT(tr( "Set Search-Filter" ));
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.wsprompt) searchBtnTT.SetWidescreen(Settings.widescreen);
|
2010-09-24 19:58:56 +02:00
|
|
|
searchBtnTT.SetAlpha(Theme.tooltipAlpha);
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiImage searchBtnImg(&imgsearchIcon);
|
|
|
|
searchBtnImg.SetWidescreen(Settings.widescreen);
|
|
|
|
GuiImage searchBtnImg_g(&imgsearchIcon_gray);
|
|
|
|
searchBtnImg_g.SetWidescreen(Settings.widescreen);
|
2010-09-24 19:58:56 +02:00
|
|
|
GuiButton searchBtn(&searchBtnImg_g, &searchBtnImg_g, ALIGN_LEFT, ALIGN_TOP, Theme.gamelist_search_x,
|
2010-11-13 23:34:53 +01:00
|
|
|
Theme.gamelist_search_y, &trigA, btnSoundOver, btnSoundClick2, 1, &searchBtnTT, -15, 52, 0, 3);
|
2010-09-24 02:48:03 +02:00
|
|
|
searchBtn.SetAlpha(180);
|
|
|
|
|
2010-11-07 21:31:45 +01:00
|
|
|
const char * sortTTText = NULL;
|
|
|
|
GuiImageData * sortImgData = NULL;
|
|
|
|
|
|
|
|
if(Settings.GameSort & SORT_RANKING)
|
|
|
|
{
|
|
|
|
sortTTText = tr( "Sort by rank" );
|
|
|
|
sortImgData = &imgrankIcon;
|
|
|
|
}
|
|
|
|
else if(Settings.GameSort & SORT_PLAYCOUNT)
|
|
|
|
{
|
|
|
|
sortTTText = tr( "Sort order by most played");
|
|
|
|
sortImgData = &imgplayCountIcon;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sortTTText = tr("Sort alphabetically");
|
|
|
|
sortImgData = &imgabcIcon;
|
|
|
|
}
|
|
|
|
|
|
|
|
GuiTooltip sortBtnTT(sortTTText);
|
|
|
|
if (Settings.wsprompt) sortBtnTT.SetWidescreen(Settings.widescreen);
|
|
|
|
sortBtnTT.SetAlpha(Theme.tooltipAlpha);
|
|
|
|
|
|
|
|
GuiImage sortBtnImg(sortImgData);
|
|
|
|
sortBtnImg.SetWidescreen(Settings.widescreen);
|
2010-11-13 23:34:53 +01:00
|
|
|
GuiButton sortBtn(&sortBtnImg, &sortBtnImg, ALIGN_LEFT, ALIGN_TOP, Theme.gamelist_abc_x, Theme.gamelist_abc_y, &trigA, btnSoundOver, btnSoundClick2, 1, &sortBtnTT, -15, 52, 0, 3);
|
2010-09-24 02:48:03 +02:00
|
|
|
|
|
|
|
GuiTooltip listBtnTT(tr( "Display as a list" ));
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.wsprompt) listBtnTT.SetWidescreen(Settings.widescreen);
|
2010-09-24 19:58:56 +02:00
|
|
|
listBtnTT.SetAlpha(Theme.tooltipAlpha);
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiImage listBtnImg(&imgarrangeList);
|
|
|
|
listBtnImg.SetWidescreen(Settings.widescreen);
|
|
|
|
GuiImage listBtnImg_g(&imgarrangeList_gray);
|
|
|
|
listBtnImg_g.SetWidescreen(Settings.widescreen);
|
2010-09-24 19:58:56 +02:00
|
|
|
GuiButton listBtn(&listBtnImg_g, &listBtnImg_g, ALIGN_LEFT, ALIGN_TOP, Theme.gamelist_list_x,
|
2010-11-13 23:34:53 +01:00
|
|
|
Theme.gamelist_list_y, &trigA, btnSoundOver, btnSoundClick2, 1, &listBtnTT, 15, 52, 1, 3);
|
2010-09-24 02:48:03 +02:00
|
|
|
listBtn.SetAlpha(180);
|
|
|
|
|
|
|
|
GuiTooltip gridBtnTT(tr( "Display as a grid" ));
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.wsprompt) gridBtnTT.SetWidescreen(Settings.widescreen);
|
2010-09-24 19:58:56 +02:00
|
|
|
gridBtnTT.SetAlpha(Theme.tooltipAlpha);
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiImage gridBtnImg(&imgarrangeGrid);
|
|
|
|
gridBtnImg.SetWidescreen(Settings.widescreen);
|
|
|
|
GuiImage gridBtnImg_g(&imgarrangeGrid_gray);
|
|
|
|
gridBtnImg_g.SetWidescreen(Settings.widescreen);
|
2010-09-24 19:58:56 +02:00
|
|
|
GuiButton gridBtn(&gridBtnImg_g, &gridBtnImg_g, ALIGN_LEFT, ALIGN_TOP, Theme.gamelist_grid_x,
|
2010-11-13 23:34:53 +01:00
|
|
|
Theme.gamelist_grid_y, &trigA, btnSoundOver, btnSoundClick2, 1, &gridBtnTT, 15, 52, 1, 3);
|
2010-09-24 02:48:03 +02:00
|
|
|
gridBtn.SetAlpha(180);
|
|
|
|
|
|
|
|
GuiTooltip carouselBtnTT(tr( "Display as a carousel" ));
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.wsprompt) carouselBtnTT.SetWidescreen(Settings.widescreen);
|
2010-09-24 19:58:56 +02:00
|
|
|
carouselBtnTT.SetAlpha(Theme.tooltipAlpha);
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiImage carouselBtnImg(&imgarrangeCarousel);
|
|
|
|
carouselBtnImg.SetWidescreen(Settings.widescreen);
|
|
|
|
GuiImage carouselBtnImg_g(&imgarrangeCarousel_gray);
|
|
|
|
carouselBtnImg_g.SetWidescreen(Settings.widescreen);
|
2010-09-24 19:58:56 +02:00
|
|
|
GuiButton carouselBtn(&carouselBtnImg_g, &carouselBtnImg_g, ALIGN_LEFT, ALIGN_TOP, Theme.gamelist_carousel_x,
|
2010-11-13 23:34:53 +01:00
|
|
|
Theme.gamelist_carousel_y, &trigA, btnSoundOver, btnSoundClick2, 1, &carouselBtnTT, 15, 52, 1, 3);
|
2010-09-24 02:48:03 +02:00
|
|
|
carouselBtn.SetAlpha(180);
|
|
|
|
|
|
|
|
bool canUnlock = (Settings.parentalcontrol == 0 && Settings.Parental.enabled == 1);
|
|
|
|
|
|
|
|
GuiTooltip lockBtnTT(canUnlock ? tr( "Unlock Parental Control" ) : tr( "Parental Control disabled" ));
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.wsprompt) lockBtnTT.SetWidescreen(Settings.widescreen);
|
2010-09-24 19:58:56 +02:00
|
|
|
lockBtnTT.SetAlpha(Theme.tooltipAlpha);
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiImage lockBtnImg(&imgLock);
|
|
|
|
lockBtnImg.SetWidescreen(Settings.widescreen);
|
|
|
|
GuiImage lockBtnImg_g(&imgLock_gray);
|
|
|
|
lockBtnImg_g.SetWidescreen(Settings.widescreen);
|
2010-09-24 19:58:56 +02:00
|
|
|
GuiButton lockBtn(&lockBtnImg_g, &lockBtnImg_g, ALIGN_LEFT, ALIGN_TOP, Theme.gamelist_lock_x,
|
2010-11-13 23:34:53 +01:00
|
|
|
Theme.gamelist_lock_y, &trigA, btnSoundOver, btnSoundClick2, 1, &lockBtnTT, 15, 52, 1, 3);
|
2010-09-24 02:48:03 +02:00
|
|
|
lockBtn.SetAlpha(180);
|
|
|
|
|
|
|
|
GuiTooltip unlockBtnTT(tr( "Enable Parental Control" ));
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.wsprompt) unlockBtnTT.SetWidescreen(Settings.widescreen);
|
2010-09-24 19:58:56 +02:00
|
|
|
unlockBtnTT.SetAlpha(Theme.tooltipAlpha);
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiImage unlockBtnImg(&imgUnlock);
|
|
|
|
unlockBtnImg.SetWidescreen(Settings.widescreen);
|
|
|
|
GuiImage unlockBtnImg_g(&imgUnlock_gray);
|
|
|
|
unlockBtnImg_g.SetWidescreen(Settings.widescreen);
|
|
|
|
|
|
|
|
if (canUnlock && Settings.godmode)
|
|
|
|
{
|
|
|
|
lockBtn.SetImage(&unlockBtnImg_g);
|
|
|
|
lockBtn.SetImageOver(&unlockBtnImg_g);
|
|
|
|
lockBtn.SetToolTip(&unlockBtnTT, 15, 52, 1, 3);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiTooltip dvdBtnTT(tr( "Mount DVD drive" ));
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.wsprompt) dvdBtnTT.SetWidescreen(Settings.widescreen);
|
2010-09-24 19:58:56 +02:00
|
|
|
dvdBtnTT.SetAlpha(Theme.tooltipAlpha);
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiImage dvdBtnImg(&imgdvd);
|
|
|
|
dvdBtnImg.SetWidescreen(Settings.widescreen);
|
|
|
|
GuiImage dvdBtnImg_g(dvdBtnImg);
|
|
|
|
dvdBtnImg_g.SetWidescreen(Settings.widescreen);
|
2010-09-24 19:58:56 +02:00
|
|
|
GuiButton dvdBtn(&dvdBtnImg_g, &dvdBtnImg_g, ALIGN_LEFT, ALIGN_TOP, Theme.gamelist_dvd_x, Theme.gamelist_dvd_y,
|
2010-11-13 23:34:53 +01:00
|
|
|
&trigA, btnSoundOver, btnSoundClick2, 1, &dvdBtnTT, 15, 52, 1, 3);
|
2010-09-24 02:48:03 +02:00
|
|
|
dvdBtn.SetAlpha(180);
|
|
|
|
|
|
|
|
GuiTooltip homebrewBtnTT(tr( "Homebrew Launcher" ));
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.wsprompt) homebrewBtnTT.SetWidescreen(Settings.widescreen);
|
2010-09-24 19:58:56 +02:00
|
|
|
homebrewBtnTT.SetAlpha(Theme.tooltipAlpha);
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiImage homebrewImg(&homebrewImgData);
|
|
|
|
GuiImage homebrewImgOver(&homebrewImgDataOver);
|
|
|
|
homebrewImg.SetWidescreen(Settings.widescreen);
|
|
|
|
homebrewImgOver.SetWidescreen(Settings.widescreen);
|
2010-09-24 19:58:56 +02:00
|
|
|
GuiButton homebrewBtn(&homebrewImg, &homebrewImgOver, ALIGN_LEFT, ALIGN_TOP, Theme.homebrew_x, Theme.homebrew_y,
|
2010-11-13 23:34:53 +01:00
|
|
|
&trigA, btnSoundOver, btnSoundClick2, 1, &homebrewBtnTT, 15, -30, 1, 5);
|
2010-09-24 02:48:03 +02:00
|
|
|
|
2010-11-07 21:31:45 +01:00
|
|
|
if (Settings.GameSort & SORT_FAVORITE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
favoriteBtn.SetImage(&favoriteBtnImg);
|
|
|
|
favoriteBtn.SetImageOver(&favoriteBtnImg);
|
|
|
|
favoriteBtn.SetAlpha(255);
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
2010-09-19 01:16:05 +02:00
|
|
|
static bool show_searchwindow = false;
|
2010-09-24 02:48:03 +02:00
|
|
|
if (*gameList.GetCurrentFilter())
|
2010-02-27 19:18:01 +01:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
if (show_searchwindow && gameList.size() == 1) show_searchwindow = false;
|
|
|
|
if (!show_searchwindow) searchBtn.SetEffect(EFFECT_PULSE, 10, 105);
|
|
|
|
searchBtn.SetImage(&searchBtnImg);
|
|
|
|
searchBtn.SetImageOver(&searchBtnImg);
|
|
|
|
searchBtn.SetAlpha(255);
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.gameDisplay == LIST_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
listBtn.SetImage(&listBtnImg);
|
|
|
|
listBtn.SetImageOver(&listBtnImg);
|
|
|
|
listBtn.SetAlpha(255);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
else if (Settings.gameDisplay == GRID_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gridBtn.SetImage(&gridBtnImg);
|
|
|
|
gridBtn.SetImageOver(&gridBtnImg);
|
|
|
|
gridBtn.SetAlpha(255);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
else if (Settings.gameDisplay == CAROUSEL_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
carouselBtn.SetImage(&carouselBtnImg);
|
|
|
|
carouselBtn.SetImageOver(&carouselBtnImg);
|
|
|
|
carouselBtn.SetAlpha(255);
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.gameDisplay == LIST_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 19:58:56 +02:00
|
|
|
favoriteBtn.SetPosition(Theme.gamelist_favorite_x, Theme.gamelist_favorite_y);
|
|
|
|
searchBtn.SetPosition(Theme.gamelist_search_x, Theme.gamelist_search_y);
|
2010-11-07 21:31:45 +01:00
|
|
|
sortBtn.SetPosition(Theme.gamelist_abc_x, Theme.gamelist_abc_y);
|
2010-09-24 19:58:56 +02:00
|
|
|
listBtn.SetPosition(Theme.gamelist_list_x, Theme.gamelist_list_y);
|
|
|
|
gridBtn.SetPosition(Theme.gamelist_grid_x, Theme.gamelist_grid_y);
|
|
|
|
carouselBtn.SetPosition(Theme.gamelist_carousel_x, Theme.gamelist_carousel_y);
|
|
|
|
lockBtn.SetPosition(Theme.gamelist_lock_x, Theme.gamelist_lock_y);
|
|
|
|
dvdBtn.SetPosition(Theme.gamelist_dvd_x, Theme.gamelist_dvd_y);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
else if (Settings.gameDisplay == GRID_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 19:58:56 +02:00
|
|
|
favoriteBtn.SetPosition(Theme.gamegrid_favorite_x, Theme.gamegrid_favorite_y);
|
|
|
|
searchBtn.SetPosition(Theme.gamegrid_search_x, Theme.gamegrid_search_y);
|
2010-11-07 21:31:45 +01:00
|
|
|
sortBtn.SetPosition(Theme.gamegrid_abc_x, Theme.gamegrid_abc_y);
|
2010-09-24 19:58:56 +02:00
|
|
|
listBtn.SetPosition(Theme.gamegrid_list_x, Theme.gamegrid_list_y);
|
|
|
|
gridBtn.SetPosition(Theme.gamegrid_grid_x, Theme.gamegrid_grid_y);
|
|
|
|
carouselBtn.SetPosition(Theme.gamegrid_carousel_x, Theme.gamegrid_carousel_y);
|
|
|
|
lockBtn.SetPosition(Theme.gamegrid_lock_x, Theme.gamegrid_lock_y);
|
|
|
|
dvdBtn.SetPosition(Theme.gamegrid_dvd_x, Theme.gamegrid_dvd_y);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
else if (Settings.gameDisplay == CAROUSEL_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 19:58:56 +02:00
|
|
|
favoriteBtn.SetPosition(Theme.gamecarousel_favorite_x, Theme.gamecarousel_favorite_y);
|
|
|
|
searchBtn.SetPosition(Theme.gamecarousel_search_x, Theme.gamecarousel_favorite_y);
|
2010-11-07 21:31:45 +01:00
|
|
|
sortBtn.SetPosition(Theme.gamecarousel_abc_x, Theme.gamecarousel_abc_y);
|
2010-09-24 19:58:56 +02:00
|
|
|
listBtn.SetPosition(Theme.gamecarousel_list_x, Theme.gamecarousel_list_y);
|
|
|
|
gridBtn.SetPosition(Theme.gamecarousel_grid_x, Theme.gamecarousel_grid_y);
|
|
|
|
carouselBtn.SetPosition(Theme.gamecarousel_carousel_x, Theme.gamecarousel_carousel_y);
|
|
|
|
lockBtn.SetPosition(Theme.gamecarousel_lock_x, Theme.gamecarousel_lock_y);
|
|
|
|
dvdBtn.SetPosition(Theme.gamecarousel_dvd_x, Theme.gamecarousel_dvd_y);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-02-27 19:18:01 +01:00
|
|
|
|
|
|
|
//Downloading Covers
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiTooltip DownloadBtnTT(tr( "Click to Download Covers" ));
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.wsprompt) DownloadBtnTT.SetWidescreen(Settings.widescreen);
|
2010-09-24 19:58:56 +02:00
|
|
|
DownloadBtnTT.SetAlpha(Theme.tooltipAlpha);
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiButton DownloadBtn(0, 0);
|
|
|
|
DownloadBtn.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
|
2010-09-24 19:58:56 +02:00
|
|
|
DownloadBtn.SetPosition(Theme.covers_x, Theme.covers_y);
|
2010-09-24 02:48:03 +02:00
|
|
|
|
|
|
|
GuiTooltip IDBtnTT(tr( "Click to change game ID" ));
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.wsprompt) IDBtnTT.SetWidescreen(Settings.widescreen);
|
2010-09-24 19:58:56 +02:00
|
|
|
IDBtnTT.SetAlpha(Theme.tooltipAlpha);
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiButton idBtn(0, 0);
|
|
|
|
idBtn.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
|
2010-09-24 19:58:56 +02:00
|
|
|
idBtn.SetPosition(Theme.id_x, Theme.id_y);
|
2010-09-24 02:48:03 +02:00
|
|
|
|
|
|
|
if (Settings.godmode == 1 && mountMethod != 3) //only make the button have trigger & tooltip if in godmode
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-11-13 23:34:53 +01:00
|
|
|
DownloadBtn.SetSoundOver(btnSoundOver);
|
2010-09-24 02:48:03 +02:00
|
|
|
DownloadBtn.SetTrigger(&trigA);
|
|
|
|
DownloadBtn.SetTrigger(&trig1);
|
|
|
|
DownloadBtn.SetToolTip(&DownloadBtnTT, 205, -30);
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-11-13 23:34:53 +01:00
|
|
|
idBtn.SetSoundOver(btnSoundOver);
|
2010-09-24 02:48:03 +02:00
|
|
|
idBtn.SetTrigger(&trigA);
|
|
|
|
idBtn.SetToolTip(&IDBtnTT, 205, -30);
|
2010-09-19 01:16:05 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
DownloadBtn.SetRumble(false);
|
|
|
|
idBtn.SetRumble(false);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-02-27 19:18:01 +01:00
|
|
|
|
|
|
|
GuiGameBrowser * gameBrowser = NULL;
|
|
|
|
GuiGameGrid * gameGrid = NULL;
|
|
|
|
GuiGameCarousel * gameCarousel = NULL;
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.gameDisplay == LIST_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-26 10:33:43 +02:00
|
|
|
gameBrowser = new GuiGameBrowser(Theme.gamelist_w, Theme.gamelist_h, startat, offset);
|
2010-09-24 19:58:56 +02:00
|
|
|
gameBrowser->SetPosition(Theme.gamelist_x, Theme.gamelist_y);
|
2010-09-24 02:48:03 +02:00
|
|
|
gameBrowser->SetAlignment(ALIGN_LEFT, ALIGN_CENTRE);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
else if (Settings.gameDisplay == GRID_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 19:58:56 +02:00
|
|
|
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);
|
2010-09-24 02:48:03 +02:00
|
|
|
gameGrid->SetAlignment(ALIGN_LEFT, ALIGN_CENTRE);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
else if (Settings.gameDisplay == CAROUSEL_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 19:58:56 +02:00
|
|
|
//GuiGameCarousel gameCarousel(Theme.gamecarousel_w, Theme.gamecarousel_h, gameList, gameList.size(), Settings.theme_path, bg_options_png, startat, offset);
|
2010-09-24 02:48:03 +02:00
|
|
|
gameCarousel = new GuiGameCarousel(640, 400, Settings.theme_path, bg_options_png, startat, offset);
|
2010-09-24 19:58:56 +02:00
|
|
|
gameCarousel->SetPosition(Theme.gamecarousel_x, Theme.gamecarousel_y);
|
2010-09-24 02:48:03 +02:00
|
|
|
gameCarousel->SetAlignment(ALIGN_LEFT, ALIGN_CENTRE);
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
|
2010-10-01 22:03:14 +02:00
|
|
|
GuiText clockTimeBack("88:88", 40, (GXColor) {Theme.clock.r, Theme.clock.g, Theme.clock.b, Theme.clock.a / 6});
|
2010-09-24 19:58:56 +02:00
|
|
|
clockTimeBack.SetAlignment(Theme.clock_align, ALIGN_TOP);
|
|
|
|
clockTimeBack.SetPosition(Theme.clock_x, Theme.clock_y);
|
2010-09-24 02:48:03 +02:00
|
|
|
clockTimeBack.SetFont(clock_ttf, clock_ttf_size);
|
2010-09-24 19:58:56 +02:00
|
|
|
GuiText clockTime(theTime, 40, Theme.clock);
|
|
|
|
clockTime.SetAlignment(Theme.clock_align, ALIGN_TOP);
|
|
|
|
clockTime.SetPosition(Theme.clock_x, Theme.clock_y);
|
2010-09-24 02:48:03 +02:00
|
|
|
clockTime.SetFont(clock_ttf, clock_ttf_size);
|
2010-02-27 19:18:01 +01:00
|
|
|
|
|
|
|
HaltGui();
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiWindow w(screenwidth, screenheight);
|
2010-02-27 19:18:01 +01:00
|
|
|
|
2010-09-24 19:58:56 +02:00
|
|
|
if (Theme.show_hddinfo == -1 || Theme.show_hddinfo == 1) //force show hdd info
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
w.Append(&usedSpaceTxt);
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
2010-09-24 19:58:56 +02:00
|
|
|
if (Theme.show_gamecount == -1 || Theme.show_gamecount == 1) //force show game cnt info
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
w.Append(&gamecntBtn);
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
w.Append(&sdcardBtn);
|
|
|
|
w.Append(&poweroffBtn);
|
|
|
|
w.Append(&gameInfo);
|
|
|
|
if (Settings.godmode) w.Append(&installBtn);
|
|
|
|
w.Append(&homeBtn);
|
|
|
|
w.Append(&settingsBtn);
|
|
|
|
w.Append(&DownloadBtn);
|
|
|
|
w.Append(&idBtn);
|
|
|
|
w.Append(&screenShotBtn);
|
2010-09-19 01:16:05 +02:00
|
|
|
|
|
|
|
// Begin Toolbar
|
2010-09-24 02:48:03 +02:00
|
|
|
w.Append(&favoriteBtn);
|
2010-09-19 01:16:05 +02:00
|
|
|
Toolbar[0] = &favoriteBtn;
|
2010-09-24 02:48:03 +02:00
|
|
|
w.Append(&searchBtn);
|
2010-09-19 01:16:05 +02:00
|
|
|
Toolbar[1] = &searchBtn;
|
2010-11-07 21:31:45 +01:00
|
|
|
w.Append(&sortBtn);
|
|
|
|
Toolbar[2] = &sortBtn;
|
2010-09-24 02:48:03 +02:00
|
|
|
w.Append(&listBtn);
|
2010-11-07 21:31:45 +01:00
|
|
|
Toolbar[3] = &listBtn;
|
2010-09-24 02:48:03 +02:00
|
|
|
w.Append(&gridBtn);
|
2010-11-07 21:31:45 +01:00
|
|
|
Toolbar[4] = &gridBtn;
|
2010-09-24 02:48:03 +02:00
|
|
|
w.Append(&carouselBtn);
|
2010-11-07 21:31:45 +01:00
|
|
|
Toolbar[5] = &carouselBtn;
|
2010-09-24 02:48:03 +02:00
|
|
|
w.Append(&lockBtn);
|
2010-11-07 21:31:45 +01:00
|
|
|
Toolbar[6] = &lockBtn;
|
2010-09-24 02:48:03 +02:00
|
|
|
w.Append(&dvdBtn);
|
2010-11-07 21:31:45 +01:00
|
|
|
Toolbar[7] = &dvdBtn;
|
2010-09-24 02:48:03 +02:00
|
|
|
w.SetUpdateCallback(DiscListWinUpdateCallback);
|
2010-09-19 01:16:05 +02:00
|
|
|
// End Toolbar
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (Settings.godmode == 1) w.Append(&homebrewBtn);
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-10-27 16:45:27 +02:00
|
|
|
if ((Settings.hddinfo == CLOCK_HR12) || (Settings.hddinfo == CLOCK_HR24))
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
w.Append(&clockTimeBack);
|
|
|
|
w.Append(&clockTime);
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.gameDisplay == LIST_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
mainWindow->Append(gameBrowser);
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.gameDisplay == GRID_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
mainWindow->Append(gameGrid);
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.gameDisplay == CAROUSEL_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
mainWindow->Append(gameCarousel);
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
mainWindow->Append(&w);
|
2010-02-27 19:18:01 +01:00
|
|
|
|
2010-09-19 01:16:05 +02:00
|
|
|
GuiSearchBar *searchBar = NULL;
|
2010-09-24 02:48:03 +02:00
|
|
|
if (show_searchwindow)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
searchBar = new GuiSearchBar(gameList.GetAvailableSearchChars());
|
|
|
|
if (searchBar) mainWindow->Append(searchBar);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-02-27 19:18:01 +01:00
|
|
|
|
2010-09-19 01:16:05 +02:00
|
|
|
ResumeGui();
|
2010-02-27 19:18:01 +01:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
// ShowMemInfo();
|
2010-02-27 19:18:01 +01:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
while (menu == MENU_NONE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (idiotFlag == 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gprintf("\tIdiot flag\n");
|
2010-02-27 19:18:01 +01:00
|
|
|
char idiotBuffer[200];
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(idiotBuffer, sizeof(idiotBuffer), "%s (%s). %s", tr( "You have attempted to load a bad image" ),
|
|
|
|
idiotChar, tr( "Most likely it has dimensions that are not evenly divisible by 4." ));
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
int deleteImg = WindowPrompt(0, idiotBuffer, tr( "OK" ), tr( "Delete" ));
|
|
|
|
if (deleteImg == 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(idiotBuffer, sizeof(idiotBuffer), "%s %s.", tr( "You are about to delete " ), idiotChar);
|
|
|
|
deleteImg = WindowPrompt(tr( "Confirm" ), idiotBuffer, tr( "Delete" ), tr( "Cancel" ));
|
|
|
|
if (deleteImg == 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
remove(idiotChar);
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
}
|
2010-09-19 01:16:05 +02:00
|
|
|
idiotFlag = -1;
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
WDVD_GetCoverStatus(&covert);//for detecting if i disc has been inserted
|
2010-02-27 19:18:01 +01:00
|
|
|
|
|
|
|
//CLOCK
|
2010-09-24 02:48:03 +02:00
|
|
|
time_t rawtime = time(0);
|
2010-10-27 16:45:27 +02:00
|
|
|
if (((Settings.hddinfo == CLOCK_HR12) || (Settings.hddinfo == CLOCK_HR24)) && rawtime != lastrawtime)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
lastrawtime = rawtime;
|
2010-09-24 02:48:03 +02:00
|
|
|
timeinfo = localtime(&rawtime);
|
|
|
|
if (dataed < 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.hddinfo == CLOCK_HR12)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
if (rawtime & 1)
|
|
|
|
strftime(theTime, sizeof(theTime), "%I:%M", timeinfo);
|
|
|
|
else strftime(theTime, sizeof(theTime), "%I %M", timeinfo);
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.hddinfo == CLOCK_HR24)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
if (rawtime & 1)
|
|
|
|
strftime(theTime, sizeof(theTime), "%H:%M", timeinfo);
|
|
|
|
else strftime(theTime, sizeof(theTime), "%H %M", timeinfo);
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
clockTime.SetText(theTime);
|
2010-02-27 19:18:01 +01:00
|
|
|
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (dataed > 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
clockTime.SetTextf("%i", (dataed - 1));
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// respond to button presses
|
2010-09-24 02:48:03 +02:00
|
|
|
if (shutdown == 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gprintf("\n\tshutdown");
|
2010-02-27 19:18:01 +01:00
|
|
|
Sys_Shutdown();
|
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (reset == 1) Sys_Reboot();
|
2010-02-27 19:18:01 +01:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (updateavailable == true)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gprintf("\tUpdate Available\n");
|
2010-02-27 19:18:01 +01:00
|
|
|
HaltGui();
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiWindow ww(640, 480);
|
|
|
|
w.SetState(STATE_DISABLED);
|
|
|
|
mainWindow->Append(&ww);
|
2010-02-27 19:18:01 +01:00
|
|
|
ResumeGui();
|
|
|
|
ProgressUpdateWindow();
|
|
|
|
updateavailable = false;
|
2010-09-24 02:48:03 +02:00
|
|
|
mainWindow->Remove(&ww);
|
|
|
|
w.SetState(STATE_DEFAULT);
|
2010-02-27 19:18:01 +01:00
|
|
|
menu = MENU_DISCLIST;
|
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (poweroffBtn.GetState() == STATE_CLICKED)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
gprintf("\tpoweroffBtn clicked\n");
|
|
|
|
choice = WindowPrompt(tr( "How to Shutdown?" ), 0, tr( "Full Shutdown" ), tr( "Shutdown to Idle" ),
|
|
|
|
tr( "Cancel" ));
|
|
|
|
if (choice == 2)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
Sys_ShutdownToIdel();
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (choice == 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
Sys_ShutdownToStandby();
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
poweroffBtn.ResetState();
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.gameDisplay == LIST_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gameBrowser->SetFocus(1);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
else if (Settings.gameDisplay == GRID_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gameGrid->SetFocus(1);
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
else if (Settings.gameDisplay == CAROUSEL_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gameCarousel->SetFocus(1);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (gamecntBtn.GetState() == STATE_CLICKED && mountMethod != 3)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gprintf("\tgameCntBtn clicked\n");
|
2010-09-19 01:16:05 +02:00
|
|
|
gamecntBtn.ResetState();
|
|
|
|
char linebuf[150];
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf, sizeof(linebuf), "%s %sGameList ?", tr( "Save Game List to" ), Settings.update_path);
|
|
|
|
choice = WindowPrompt(0, linebuf, "TXT", "CSV", tr( "Back" ));
|
|
|
|
if (choice)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
if (save_gamelist(choice - 1))
|
|
|
|
WindowPrompt(0, tr( "Saved" ), tr( "OK" ));
|
|
|
|
else WindowPrompt(tr( "Error" ), tr( "Could not save." ), tr( "OK" ));
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
2010-09-19 01:16:05 +02:00
|
|
|
menu = MENU_DISCLIST;
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (screenShotBtn.GetState() == STATE_CLICKED)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gprintf("\tscreenShotBtn clicked\n");
|
2010-09-19 01:16:05 +02:00
|
|
|
screenShotBtn.ResetState();
|
2010-09-24 02:48:03 +02:00
|
|
|
ScreenShot();
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (homeBtn.GetState() == STATE_CLICKED)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gprintf("\thomeBtn clicked\n");
|
2010-02-27 19:18:01 +01:00
|
|
|
bgMusic->Pause();
|
|
|
|
choice = WindowExitPrompt();
|
|
|
|
bgMusic->Resume();
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (choice == 3)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
Sys_LoadMenu(); // Back to System Menu
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (choice == 2)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
Sys_BackToLoader();
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
homeBtn.ResetState();
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.gameDisplay == LIST_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gameBrowser->SetFocus(1);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
else if (Settings.gameDisplay == GRID_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gameGrid->SetFocus(1);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
else if (Settings.gameDisplay == CAROUSEL_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gameCarousel->SetFocus(1);
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (installBtn.GetState() == STATE_CLICKED)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
choice = WindowPrompt(tr( "Install a game" ), 0, tr( "Yes" ), tr( "No" ));
|
|
|
|
if (choice == 1)
|
2010-05-30 08:49:23 +02:00
|
|
|
{
|
2010-09-16 21:59:41 +02:00
|
|
|
menu = MENU_INSTALL;
|
2010-02-27 19:18:01 +01:00
|
|
|
break;
|
2010-05-30 08:49:23 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
installBtn.ResetState();
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.gameDisplay == LIST_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gameBrowser->SetFocus(1);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
else if (Settings.gameDisplay == GRID_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gameGrid->SetFocus(1);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
else if (Settings.gameDisplay == CAROUSEL_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gameCarousel->SetFocus(1);
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
}
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
else if ((covert & 0x2) && (covert != covertOld))
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gprintf("\tNew Disc Detected\n");
|
|
|
|
choice
|
|
|
|
= WindowPrompt(tr( "New Disc Detected" ), 0, tr( "Install" ), tr( "Mount DVD drive" ),
|
|
|
|
tr( "Cancel" ));
|
|
|
|
if (choice == 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
menu = MENU_INSTALL;
|
|
|
|
break;
|
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (choice == 2)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
dvdBtn.SetState(STATE_CLICKED);
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
2010-09-19 01:16:05 +02:00
|
|
|
else
|
|
|
|
{
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.gameDisplay == LIST_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gameBrowser->SetFocus(1);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
else if (Settings.gameDisplay == GRID_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gameGrid->SetFocus(1);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
else if (Settings.gameDisplay == CAROUSEL_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gameCarousel->SetFocus(1);
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (sdcardBtn.GetState() == STATE_CLICKED)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gprintf("\tsdCardBtn Clicked\n");
|
2010-02-27 19:18:01 +01:00
|
|
|
SDCard_deInit();
|
|
|
|
SDCard_Init();
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.gameDisplay == LIST_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
startat = gameBrowser->GetSelectedOption();
|
|
|
|
offset = gameBrowser->GetOffset();
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
else if (Settings.gameDisplay == GRID_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
startat = gameGrid->GetSelectedOption();
|
|
|
|
offset = gameGrid->GetOffset();
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
else if (Settings.gameDisplay == CAROUSEL_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
startat = gameCarousel->GetSelectedOption();
|
|
|
|
offset = gameCarousel->GetOffset();
|
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
if (isInserted(Settings.BootDevice))
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
HaltGui(); // to fix endless rumble when clicking on the SD icon when rumble is disabled because rumble is set to on in Global_Default()
|
2010-09-19 22:25:12 +02:00
|
|
|
Settings.Load();
|
2010-09-19 01:16:05 +02:00
|
|
|
ResumeGui();
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
sdcardBtn.ResetState();
|
|
|
|
menu = MENU_DISCLIST;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (DownloadBtn.GetState() == STATE_CLICKED)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gprintf("\tDownloadBtn Clicked\n");
|
2010-10-27 16:45:27 +02:00
|
|
|
if (isInserted(Settings.BootDevice))
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
choice = WindowPrompt(tr( "Cover Download" ), 0, tr( "Normal Covers" ), tr( "3D Covers" ),
|
|
|
|
tr( "Disc Images" ), tr( "Back" )); // ask for download choice
|
|
|
|
if (choice != 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
int choice2 = choice;
|
2010-09-19 01:16:05 +02:00
|
|
|
bool missing;
|
2010-09-24 02:48:03 +02:00
|
|
|
missing = SearchMissingImages(choice2);
|
|
|
|
if (IsNetworkInit() == false && missing == true)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
WindowPrompt(tr( "Network init error" ), 0, tr( "OK" ));
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
if (GetMissingFiles() != NULL && cntMissFiles > 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
char tempCnt[40];
|
2010-09-24 02:48:03 +02:00
|
|
|
sprintf(tempCnt, "%i %s", cntMissFiles, tr( "Missing files" ));
|
|
|
|
if (choice != 3)
|
|
|
|
choice = WindowPrompt(tr( "Download Boxart image?" ), tempCnt, tr( "Yes" ), tr( "No" ));
|
|
|
|
else if (choice == 3) choice = WindowPrompt(tr( "Download Discart image?" ), tempCnt,
|
|
|
|
tr( "Yes" ), tr( "No" ));
|
|
|
|
if (choice == 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
ret = ProgressDownloadWindow(choice2);
|
|
|
|
if (ret == 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
WindowPrompt(tr( "Download finished" ), 0, tr( "OK" ));
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
sprintf(tempCnt, "%i %s", ret, tr( "files not found on the server!" ));
|
|
|
|
WindowPrompt(tr( "Download finished" ), tempCnt, tr( "OK" ));
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
WindowPrompt(tr( "No SD-Card inserted!" ), tr( "Insert an SD-Card to download images." ), tr( "OK" ));
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
menu = MENU_DISCLIST;
|
|
|
|
DownloadBtn.ResetState();
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.gameDisplay == LIST_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gameBrowser->SetFocus(1);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
else if (Settings.gameDisplay == GRID_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gameGrid->SetFocus(1);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
else if (Settings.gameDisplay == CAROUSEL_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gameCarousel->SetFocus(1);
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
}//end download
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (settingsBtn.GetState() == STATE_CLICKED)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gprintf("\tsettingsBtn Clicked\n");
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.gameDisplay == LIST_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
startat = gameBrowser->GetSelectedOption();
|
|
|
|
offset = gameBrowser->GetOffset();
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
else if (Settings.gameDisplay == GRID_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
startat = gameGrid->GetSelectedOption();
|
|
|
|
offset = gameGrid->GetOffset();
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
else if (Settings.gameDisplay == CAROUSEL_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
startat = gameCarousel->GetSelectedOption();
|
|
|
|
offset = gameCarousel->GetOffset();
|
|
|
|
}
|
|
|
|
menu = MENU_SETTINGS;
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (favoriteBtn.GetState() == STATE_CLICKED)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-11-07 21:31:45 +01:00
|
|
|
favoriteBtn.ResetState();
|
|
|
|
gprintf("\tfavoriteBtn Clicked\n");
|
|
|
|
|
|
|
|
if(Settings.GameSort & SORT_FAVORITE)
|
|
|
|
Settings.GameSort &= ~SORT_FAVORITE;
|
|
|
|
else
|
|
|
|
Settings.GameSort |= SORT_FAVORITE;
|
|
|
|
Settings.Save();
|
|
|
|
menu = MENU_DISCLIST;
|
|
|
|
break;
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (searchBtn.GetState() == STATE_CLICKED && mountMethod != 3)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
gprintf("\tsearchBtn Clicked\n");
|
2010-09-19 01:16:05 +02:00
|
|
|
show_searchwindow = !show_searchwindow;
|
|
|
|
HaltGui();
|
2010-09-24 02:48:03 +02:00
|
|
|
if (searchBar)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
mainWindow->Remove(searchBar);
|
2010-09-19 01:16:05 +02:00
|
|
|
delete searchBar;
|
|
|
|
searchBar = NULL;
|
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (show_searchwindow)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
if (*gameList.GetCurrentFilter())
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
searchBtn.StopEffect();
|
|
|
|
searchBtn.SetEffectGrow();
|
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
searchBar = new GuiSearchBar(gameList.GetAvailableSearchChars());
|
|
|
|
if (searchBar) mainWindow->Append(searchBar);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
if (*gameList.GetCurrentFilter()) searchBtn.SetEffect(EFFECT_PULSE, 10, 105);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
searchBtn.ResetState();
|
|
|
|
ResumeGui();
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (searchBar && (searchChar = searchBar->GetClicked()))
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
if (searchChar > 27)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
int len = gameList.GetCurrentFilter() ? wcslen(gameList.GetCurrentFilter()) : 0;
|
|
|
|
wchar_t newFilter[len + 2];
|
|
|
|
if (gameList.GetCurrentFilter()) wcscpy(newFilter, gameList.GetCurrentFilter());
|
2010-09-19 01:16:05 +02:00
|
|
|
newFilter[len] = searchChar;
|
2010-09-24 02:48:03 +02:00
|
|
|
newFilter[len + 1] = 0;
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
gameList.FilterList(newFilter);
|
2010-09-19 01:16:05 +02:00
|
|
|
menu = MENU_DISCLIST;
|
|
|
|
break;
|
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (searchChar == 7) // Close
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
show_searchwindow = false;
|
|
|
|
HaltGui();
|
2010-09-24 02:48:03 +02:00
|
|
|
if (searchBar)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
mainWindow->Remove(searchBar);
|
2010-09-19 01:16:05 +02:00
|
|
|
delete searchBar;
|
|
|
|
searchBar = NULL;
|
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (*gameList.GetCurrentFilter())
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
searchBtn.SetEffect(EFFECT_PULSE, 10, 105);
|
|
|
|
searchBtn.SetImage(&searchBtnImg);
|
|
|
|
searchBtn.SetImageOver(&searchBtnImg);
|
|
|
|
searchBtn.SetAlpha(255);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
searchBtn.StopEffect();
|
|
|
|
searchBtn.SetEffectGrow();
|
2010-09-24 02:48:03 +02:00
|
|
|
searchBtn.SetImage(&searchBtnImg_g);
|
|
|
|
searchBtn.SetImageOver(&searchBtnImg_g);
|
|
|
|
searchBtn.SetAlpha(180);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
ResumeGui();
|
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (searchChar == 8) // Backspace
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
int len = wcslen(gameList.GetCurrentFilter());
|
|
|
|
wchar_t newFilter[len + 1];
|
|
|
|
if (gameList.GetCurrentFilter()) wcscpy(newFilter, gameList.GetCurrentFilter());
|
|
|
|
newFilter[len > 0 ? len - 1 : 0] = 0;
|
|
|
|
gameList.FilterList(newFilter);
|
2010-09-19 01:16:05 +02:00
|
|
|
menu = MENU_DISCLIST;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2010-11-07 21:31:45 +01:00
|
|
|
else if (sortBtn.GetState() == STATE_CLICKED)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-11-07 21:31:45 +01:00
|
|
|
sortBtn.ResetState();
|
|
|
|
gprintf("\tsortBtn clicked\n");
|
|
|
|
if(Settings.GameSort & SORT_ABC)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-11-07 21:31:45 +01:00
|
|
|
Settings.GameSort &= ~SORT_ABC;
|
|
|
|
Settings.GameSort |= SORT_RANKING;
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
2010-11-07 21:31:45 +01:00
|
|
|
else if(Settings.GameSort & SORT_RANKING)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-11-07 21:31:45 +01:00
|
|
|
Settings.GameSort &= ~SORT_RANKING;
|
|
|
|
Settings.GameSort |= SORT_PLAYCOUNT;
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
2010-11-07 21:31:45 +01:00
|
|
|
else if(Settings.GameSort & SORT_PLAYCOUNT)
|
|
|
|
{
|
|
|
|
Settings.GameSort &= ~SORT_PLAYCOUNT;
|
|
|
|
Settings.GameSort |= SORT_ABC;
|
|
|
|
}
|
|
|
|
Settings.Save();
|
|
|
|
menu = MENU_DISCLIST;
|
|
|
|
break;
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (listBtn.GetState() == STATE_CLICKED)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gprintf("\tlistBtn Clicked\n");
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.gameDisplay != LIST_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-10-27 16:45:27 +02:00
|
|
|
Settings.gameDisplay = LIST_MODE;
|
2010-02-27 19:18:01 +01:00
|
|
|
menu = MENU_DISCLIST;
|
2010-10-27 16:45:27 +02:00
|
|
|
if (isInserted(Settings.BootDevice))
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-19 22:25:12 +02:00
|
|
|
Settings.Save();
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
listBtn.ResetState();
|
|
|
|
break;
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
listBtn.ResetState();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (gridBtn.GetState() == STATE_CLICKED)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gprintf("\tgridBtn Clicked\n");
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.gameDisplay != GRID_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
|
2010-10-27 16:45:27 +02:00
|
|
|
Settings.gameDisplay = GRID_MODE;
|
2010-02-27 19:18:01 +01:00
|
|
|
menu = MENU_DISCLIST;
|
2010-10-27 16:45:27 +02:00
|
|
|
if (isInserted(Settings.BootDevice))
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-19 22:25:12 +02:00
|
|
|
Settings.Save();
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
gridBtn.ResetState();
|
|
|
|
break;
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
gridBtn.ResetState();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (carouselBtn.GetState() == STATE_CLICKED)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gprintf("\tcarouselBtn Clicked\n");
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.gameDisplay != CAROUSEL_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-10-27 16:45:27 +02:00
|
|
|
Settings.gameDisplay = CAROUSEL_MODE;
|
2010-02-27 19:18:01 +01:00
|
|
|
menu = MENU_DISCLIST;
|
2010-10-27 16:45:27 +02:00
|
|
|
if (isInserted(Settings.BootDevice))
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-19 22:25:12 +02:00
|
|
|
Settings.Save();
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
carouselBtn.ResetState();
|
|
|
|
break;
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
carouselBtn.ResetState();
|
|
|
|
}
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-09-19 03:16:04 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (homebrewBtn.GetState() == STATE_CLICKED)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gprintf("\thomebrewBtn Clicked\n");
|
2010-02-27 19:18:01 +01:00
|
|
|
menu = MENU_HOMEBREWBROWSE;
|
|
|
|
break;
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-09-19 03:16:04 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (gameInfo.GetState() == STATE_CLICKED && mountMethod != 3)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gprintf("\tgameinfo Clicked\n");
|
2010-02-27 19:18:01 +01:00
|
|
|
gameInfo.ResetState();
|
2010-09-24 02:48:03 +02:00
|
|
|
if (selectImg1 >= 0 && selectImg1 < (s32) gameList.size())
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
gameSelected = selectImg1;
|
|
|
|
rockout();
|
2010-09-18 13:46:25 +02:00
|
|
|
struct discHdr *header = gameList[selectImg1];
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(IDfull, sizeof(IDfull), "%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2],
|
|
|
|
header->id[3], header->id[4], header->id[5]);
|
|
|
|
choice = showGameInfo(IDfull);
|
|
|
|
rockout(2);
|
|
|
|
if (choice == 2) homeBtn.SetState(STATE_CLICKED);
|
|
|
|
if (choice == 3)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
menu = MENU_DISCLIST;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (lockBtn.GetState() == STATE_CLICKED)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gprintf("\tlockBtn clicked\n");
|
2010-09-19 01:16:05 +02:00
|
|
|
lockBtn.ResetState();
|
2010-09-24 02:48:03 +02:00
|
|
|
if (!canUnlock)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
WindowPrompt(
|
|
|
|
tr( "Parental Control" ),
|
|
|
|
tr( "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." ),
|
|
|
|
tr( "OK" ));
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
if (Settings.godmode)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
if (WindowPrompt(tr( "Parental Control" ), tr( "Are you sure you want to enable Parent Control?" ),
|
|
|
|
tr( "Yes" ), tr( "No" )) == 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
Settings.godmode = 0;
|
2010-09-24 02:48:03 +02:00
|
|
|
lockBtn.SetImage(&lockBtnImg_g);
|
|
|
|
lockBtn.SetImageOver(&lockBtnImg_g);
|
|
|
|
lockBtn.SetToolTip(&lockBtnTT, 15, 52, 1, 3);
|
2010-09-19 01:16:05 +02:00
|
|
|
|
|
|
|
// Retrieve the gamelist again
|
|
|
|
menu = MENU_DISCLIST;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Require the user to enter the PIN code
|
|
|
|
char pin[5];
|
2010-09-24 02:48:03 +02:00
|
|
|
memset(&pin, 0, 5);
|
|
|
|
int ret = OnScreenNumpad((char *) &pin, 5);
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (ret == 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
if (memcmp(pin, Settings.Parental.pin, 4) == 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
Settings.godmode = 1;
|
2010-09-24 02:48:03 +02:00
|
|
|
lockBtn.SetImage(&unlockBtnImg_g);
|
|
|
|
lockBtn.SetImageOver(&unlockBtnImg_g);
|
|
|
|
lockBtn.SetToolTip(&unlockBtnTT, 15, 52, 1, 3);
|
2010-09-19 01:16:05 +02:00
|
|
|
|
|
|
|
// Retrieve the gamelist again
|
|
|
|
menu = MENU_DISCLIST;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
WindowPrompt(tr( "Parental Control" ), tr( "Invalid PIN code" ), tr( "OK" ));
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (dvdBtn.GetState() == STATE_CLICKED)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gprintf("\tdvdBtn Clicked\n");
|
|
|
|
mountMethodOLD = (mountMethod == 3 ? mountMethod : 0);
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
mountMethod = DiscMount(dvdheader);
|
2010-09-19 01:16:05 +02:00
|
|
|
dvdBtn.ResetState();
|
|
|
|
|
|
|
|
rockout();
|
|
|
|
//break;
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.gameDisplay == GRID_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
int selectimg;
|
2010-09-24 02:48:03 +02:00
|
|
|
DownloadBtn.SetSize(0, 0);
|
2010-02-27 19:18:01 +01:00
|
|
|
selectimg = gameGrid->GetSelectedOption();
|
|
|
|
gameSelected = gameGrid->GetClickedOption();
|
2010-09-19 01:16:05 +02:00
|
|
|
selectImg1 = selectimg;
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.gameDisplay == CAROUSEL_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
int selectimg;
|
2010-09-24 02:48:03 +02:00
|
|
|
DownloadBtn.SetSize(0, 0);
|
2010-02-27 19:18:01 +01:00
|
|
|
selectimg = gameCarousel->GetSelectedOption();
|
|
|
|
gameSelected = gameCarousel->GetClickedOption();
|
2010-09-19 01:16:05 +02:00
|
|
|
selectImg1 = selectimg;
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.gameDisplay == LIST_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
//Get selected game under cursor
|
|
|
|
int selectimg;
|
2010-09-24 02:48:03 +02:00
|
|
|
DownloadBtn.SetSize(160, 224);
|
|
|
|
idBtn.SetSize(100, 40);
|
2010-02-27 19:18:01 +01:00
|
|
|
|
|
|
|
selectimg = gameBrowser->GetSelectedOption();
|
|
|
|
gameSelected = gameBrowser->GetClickedOption();
|
2010-09-19 01:16:05 +02:00
|
|
|
selectImg1 = selectimg;
|
2010-02-27 19:18:01 +01:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (gameSelected > 0) //if click occured
|
|
|
|
selectimg = gameSelected;
|
2010-02-27 19:18:01 +01:00
|
|
|
|
2010-09-19 01:16:05 +02:00
|
|
|
char gameregion[7];
|
2010-09-24 02:48:03 +02:00
|
|
|
if ((selectimg >= 0) && (selectimg < (s32) gameList.size()))
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
if (selectimg != selectedold)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
selectedold = selectimg;//update displayed cover, game ID, and region if the selected game changes
|
2010-09-18 13:46:25 +02:00
|
|
|
struct discHdr *header = gameList[selectimg];
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(ID, sizeof(ID), "%c%c%c", header->id[0], header->id[1], header->id[2]);
|
|
|
|
snprintf(IDfull, sizeof(IDfull), "%s%c%c%c", ID, header->id[3], header->id[4], header->id[5]);
|
|
|
|
w.Remove(&DownloadBtn);
|
2010-02-27 19:18:01 +01:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (GameIDTxt)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
w.Remove(&idBtn);
|
2010-02-27 19:18:01 +01:00
|
|
|
delete GameIDTxt;
|
|
|
|
GameIDTxt = NULL;
|
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (GameRegionTxt)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
w.Remove(GameRegionTxt);
|
2010-02-27 19:18:01 +01:00
|
|
|
delete GameRegionTxt;
|
|
|
|
GameRegionTxt = NULL;
|
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
switch (header->id[3])
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
case 'E':
|
2010-09-24 02:48:03 +02:00
|
|
|
sprintf(gameregion, "NTSC U");
|
2010-09-19 01:16:05 +02:00
|
|
|
break;
|
|
|
|
case 'J':
|
2010-09-24 02:48:03 +02:00
|
|
|
sprintf(gameregion, "NTSC J");
|
2010-09-19 01:16:05 +02:00
|
|
|
break;
|
|
|
|
case 'W':
|
2010-09-24 02:48:03 +02:00
|
|
|
sprintf(gameregion, "NTSC T");
|
2010-09-19 01:16:05 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
case 'K':
|
2010-09-24 02:48:03 +02:00
|
|
|
sprintf(gameregion, "NTSC K");
|
2010-09-19 01:16:05 +02:00
|
|
|
break;
|
|
|
|
case 'P':
|
|
|
|
case 'D':
|
|
|
|
case 'F':
|
|
|
|
case 'I':
|
|
|
|
case 'S':
|
|
|
|
case 'H':
|
|
|
|
case 'U':
|
|
|
|
case 'X':
|
|
|
|
case 'Y':
|
|
|
|
case 'Z':
|
2010-09-24 02:48:03 +02:00
|
|
|
sprintf(gameregion, " PAL ");
|
2010-09-19 01:16:05 +02:00
|
|
|
break;
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//load game cover
|
2010-09-24 02:48:03 +02:00
|
|
|
if (cover)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
delete cover;
|
|
|
|
cover = NULL;
|
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
cover = LoadCoverImage(header);
|
2010-02-27 19:18:01 +01:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (coverImg)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
delete coverImg;
|
|
|
|
coverImg = NULL;
|
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
coverImg = new GuiImage(cover);
|
|
|
|
coverImg->SetWidescreen(Settings.widescreen);
|
2010-02-27 19:18:01 +01:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
DownloadBtn.SetImage(coverImg);// put the new image on the download button
|
|
|
|
w.Append(&DownloadBtn);
|
2010-02-27 19:18:01 +01:00
|
|
|
|
2010-10-27 16:45:27 +02:00
|
|
|
if ((Settings.sinfo == GAMEINFO_ID) || (Settings.sinfo == GAMEINFO_BOTH))
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 19:58:56 +02:00
|
|
|
GameIDTxt = new GuiText(IDfull, 22, Theme.info);
|
2010-09-24 02:48:03 +02:00
|
|
|
GameIDTxt->SetAlignment(ALIGN_LEFT, ALIGN_TOP);
|
2010-09-24 19:58:56 +02:00
|
|
|
//GameIDTxt->SetPosition(Theme.id_x,Theme.id_y);
|
2010-09-24 02:48:03 +02:00
|
|
|
idBtn.SetEffect(EFFECT_FADE, 20);
|
|
|
|
idBtn.SetLabel(GameIDTxt);
|
|
|
|
w.Append(&idBtn);
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
2010-09-19 01:16:05 +02:00
|
|
|
//don't try to show region for channels because all the custom channels wont follow the rules
|
2010-10-27 16:45:27 +02:00
|
|
|
if (((Settings.sinfo == GAMEINFO_REGION) || (Settings.sinfo == GAMEINFO_BOTH)) && mountMethod != 3)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 19:58:56 +02:00
|
|
|
GameRegionTxt = new GuiText(gameregion, 22, Theme.info);
|
2010-09-24 02:48:03 +02:00
|
|
|
GameRegionTxt->SetAlignment(ALIGN_LEFT, ALIGN_TOP);
|
2010-09-24 19:58:56 +02:00
|
|
|
GameRegionTxt->SetPosition(Theme.region_x, Theme.region_y);
|
2010-09-24 02:48:03 +02:00
|
|
|
GameRegionTxt->SetEffect(EFFECT_FADE, 20);
|
|
|
|
w.Append(GameRegionTxt);
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (idBtn.GetState() == STATE_CLICKED && mountMethod != 3)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-10-01 02:26:16 +02:00
|
|
|
gprintf("\tidBtn Clicked\n");
|
2010-09-19 01:16:05 +02:00
|
|
|
struct discHdr * header = gameList[gameBrowser->GetSelectedOption()];
|
|
|
|
//enter new game ID
|
|
|
|
char entered[10];
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(entered, sizeof(entered), "%s", IDfull);
|
2010-09-19 01:16:05 +02:00
|
|
|
//entered[9] = '\0';
|
2010-09-24 02:48:03 +02:00
|
|
|
int result = OnScreenKeyboard(entered, 7, 0);
|
|
|
|
if (result == 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
WBFS_ReIDGame(header->id, entered);
|
2010-09-19 01:16:05 +02:00
|
|
|
//__Menu_GetEntries();
|
|
|
|
menu = MENU_DISCLIST;
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
2010-09-19 01:16:05 +02:00
|
|
|
|
|
|
|
idBtn.ResetState();
|
|
|
|
}
|
|
|
|
startat = gameBrowser->GetOffset(), offset = startat;
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (((gameSelected >= 0) && (gameSelected < (s32) gameList.size())) || mountMethod == 1 || mountMethod == 2)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
if (searchBar)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
HaltGui();
|
2010-09-24 02:48:03 +02:00
|
|
|
mainWindow->Remove(searchBar);
|
2010-09-19 01:16:05 +02:00
|
|
|
ResumeGui();
|
|
|
|
}
|
|
|
|
rockout();
|
2010-09-24 02:48:03 +02:00
|
|
|
struct discHdr *header = (mountMethod == 1 || mountMethod == 2 ? dvdheader : gameList[gameSelected]);
|
2010-09-19 01:16:05 +02:00
|
|
|
// struct discHdr *header = dvdheader:gameList[gameSelected]);
|
2010-09-24 02:48:03 +02:00
|
|
|
if (!mountMethod)//only get this stuff it we are booting a game from USB
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
WBFS_GameSize(header->id, &size);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-02-27 19:18:01 +01:00
|
|
|
|
|
|
|
//check if alt Dol and gct file is present
|
|
|
|
FILE *exeFile = NULL;
|
|
|
|
char nipple[100];
|
2010-09-24 02:48:03 +02:00
|
|
|
header = (mountMethod == 1 || mountMethod == 2 ? dvdheader : gameList[gameSelected]); //reset header
|
|
|
|
snprintf(IDfull, sizeof(IDfull), "%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2],
|
|
|
|
header->id[3], header->id[4], header->id[5]);
|
2010-09-24 23:22:01 +02:00
|
|
|
GameCFG* game_cfg = GameSettings.GetGameCFG(header->id);
|
|
|
|
u8 alternatedol;
|
|
|
|
u8 ocarinaChoice;
|
2010-09-25 10:51:44 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (game_cfg)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
alternatedol = game_cfg->loadalternatedol;
|
|
|
|
ocarinaChoice = game_cfg->ocarina;
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-10-27 16:45:27 +02:00
|
|
|
alternatedol = OFF;
|
2010-02-27 19:18:01 +01:00
|
|
|
ocarinaChoice = Settings.ocarina;
|
|
|
|
}
|
|
|
|
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.quickboot == ON) //quickboot game
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-12-04 08:36:23 +01:00
|
|
|
if (alternatedol == 2)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
/* Open dol File and check exist */
|
2010-09-24 02:48:03 +02:00
|
|
|
sprintf(nipple, "%s%s.dol", Settings.dolpath, IDfull);
|
|
|
|
exeFile = fopen(nipple, "rb");
|
|
|
|
if (exeFile == NULL)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
sprintf(nipple, "%s %s", nipple, tr( "does not exist!" ));
|
|
|
|
WindowPrompt(tr( "Error" ), nipple, tr( "OK" ));
|
2010-10-27 21:50:48 +02:00
|
|
|
menu = MENU_DISCLIST;
|
2010-09-24 02:48:03 +02:00
|
|
|
wiilight(0);
|
2010-02-27 19:18:01 +01:00
|
|
|
break;
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
fclose(exeFile);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
if (ocarinaChoice != OFF)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
/* Open gct File and check exist */
|
2010-09-24 02:48:03 +02:00
|
|
|
sprintf(nipple, "%s%s.gct", Settings.Cheatcodespath, IDfull);
|
|
|
|
exeFile = fopen(nipple, "rb");
|
|
|
|
if (exeFile == NULL)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gprintf("\ttried to load missing gct.\n");
|
|
|
|
sprintf(nipple, "%s %s", nipple, tr( "does not exist! Loading game without cheats." ));
|
|
|
|
WindowPrompt(tr( "Error" ), nipple, NULL, NULL, NULL, NULL, 170);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
fclose(exeFile);
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
wiilight(0);
|
2010-10-27 16:45:27 +02:00
|
|
|
if (isInserted(Settings.BootDevice))
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
//////////save game play count////////////////
|
2010-09-25 10:51:44 +02:00
|
|
|
GameStatistics.SetPlayCount(header->id, GameStatistics.GetPlayCount(header->id)+1);
|
|
|
|
GameStatistics.Save();
|
2010-02-27 19:18:01 +01:00
|
|
|
|
2010-10-01 02:26:16 +02:00
|
|
|
gprintf("\tplaycount for %c%c%c%c%c%c raised to %i\n", header->id[0], header->id[1], header->id[2],
|
2010-09-25 10:51:44 +02:00
|
|
|
header->id[3], header->id[4], header->id[5], GameStatistics.GetPlayCount(header->id));
|
2010-02-27 19:18:01 +01:00
|
|
|
|
|
|
|
}
|
2010-11-06 16:30:14 +01:00
|
|
|
//Just calling that shuts down everything and starts game
|
|
|
|
BootGame((const char *) header->id);
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
bool returnHere = true;// prompt to start game
|
2010-09-24 02:48:03 +02:00
|
|
|
while (returnHere)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
returnHere = false;
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.wiilight != WIILIGHT_INSTALL) wiilight(1);
|
2010-09-19 01:16:05 +02:00
|
|
|
choice = GameWindowPrompt();
|
2010-09-18 13:46:25 +02:00
|
|
|
// header = gameList[gameSelected]; //reset header
|
2010-02-27 19:18:01 +01:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (choice == 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-12-04 08:36:23 +01:00
|
|
|
if (alternatedol == 2)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
/* Open dol File and check exist */
|
2010-09-24 02:48:03 +02:00
|
|
|
sprintf(nipple, "%s%s.dol", Settings.dolpath, IDfull);
|
|
|
|
exeFile = fopen(nipple, "rb");
|
|
|
|
if (exeFile == NULL)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gprintf("\n\tTried to load alt dol that isn't there");
|
2010-11-06 16:30:14 +01:00
|
|
|
sprintf(nipple, "%s %s", nipple, tr( "does not exist! You messed something up." ));
|
2010-09-24 02:48:03 +02:00
|
|
|
WindowPrompt(tr( "Error" ), nipple, tr( "OK" ));
|
2010-10-27 21:50:48 +02:00
|
|
|
menu = MENU_DISCLIST;
|
2010-09-24 02:48:03 +02:00
|
|
|
wiilight(0);
|
2010-02-27 19:18:01 +01:00
|
|
|
break;
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
fclose(exeFile);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
if (ocarinaChoice != OFF)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
/* Open gct File and check exist */
|
2010-09-24 02:48:03 +02:00
|
|
|
sprintf(nipple, "%s%s.gct", Settings.Cheatcodespath, IDfull);
|
|
|
|
exeFile = fopen(nipple, "rb");
|
|
|
|
if (exeFile == NULL)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gprintf("\ttried to load gct file that isn't there\n");
|
|
|
|
sprintf(nipple, "%s %s", nipple, tr( "does not exist! Loading game without cheats." ));
|
|
|
|
WindowPrompt(tr( "Error" ), nipple, NULL, NULL, NULL, NULL, 170);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
fclose(exeFile);
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
wiilight(0);
|
2010-02-27 19:18:01 +01:00
|
|
|
returnHere = false;
|
2010-11-06 16:30:14 +01:00
|
|
|
//Just calling that shuts down everything and starts game
|
|
|
|
BootGame((const char *) gameList[gameSelected]->id);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (choice == 2)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
wiilight(0);
|
2010-02-27 19:18:01 +01:00
|
|
|
HaltGui();
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.gameDisplay == LIST_MODE)
|
2010-09-24 02:48:03 +02:00
|
|
|
mainWindow->Remove(gameBrowser);
|
2010-10-27 16:45:27 +02:00
|
|
|
else if (Settings.gameDisplay == GRID_MODE)
|
2010-09-24 02:48:03 +02:00
|
|
|
mainWindow->Remove(gameGrid);
|
2010-10-27 16:45:27 +02:00
|
|
|
else if (Settings.gameDisplay == CAROUSEL_MODE) mainWindow->Remove(gameCarousel);
|
2010-09-24 02:48:03 +02:00
|
|
|
mainWindow->Remove(&w);
|
2010-02-27 19:18:01 +01:00
|
|
|
ResumeGui();
|
|
|
|
|
|
|
|
//re-evaluate header now in case they changed games while on the game prompt
|
2010-09-24 02:48:03 +02:00
|
|
|
header = (mountMethod == 1 || mountMethod == 2 ? dvdheader : gameList[gameSelected]);
|
2010-09-24 23:22:01 +02:00
|
|
|
int settret = MenuGameSettings(header);
|
2010-09-19 01:16:05 +02:00
|
|
|
/* unneeded for now, kept in case database gets a separate language setting
|
2010-09-24 02:48:03 +02:00
|
|
|
//menu = MENU_DISCLIST; // refresh titles (needed if the language setting has changed)
|
|
|
|
*/
|
2010-02-27 19:18:01 +01:00
|
|
|
HaltGui();
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.gameDisplay == LIST_MODE)
|
2010-09-24 02:48:03 +02:00
|
|
|
mainWindow->Append(gameBrowser);
|
2010-10-27 16:45:27 +02:00
|
|
|
else if (Settings.gameDisplay == GRID_MODE)
|
2010-09-24 02:48:03 +02:00
|
|
|
mainWindow->Append(gameGrid);
|
2010-10-27 16:45:27 +02:00
|
|
|
else if (Settings.gameDisplay == CAROUSEL_MODE) mainWindow->Append(gameCarousel);
|
2010-09-24 02:48:03 +02:00
|
|
|
mainWindow->Append(&w);
|
2010-02-27 19:18:01 +01:00
|
|
|
ResumeGui();
|
2010-12-05 20:09:32 +01:00
|
|
|
if (settret == MENU_DISCLIST) //if deleted
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
menu = MENU_DISCLIST;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
returnHere = true;
|
2010-09-24 02:48:03 +02:00
|
|
|
rockout(2);
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (choice == 3 && !mountMethod) //WBFS renaming
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
wiilight(0);
|
2010-09-19 01:16:05 +02:00
|
|
|
//re-evaluate header now in case they changed games while on the game prompt
|
2010-09-18 13:46:25 +02:00
|
|
|
header = gameList[gameSelected];
|
2010-02-27 19:18:01 +01:00
|
|
|
|
|
|
|
//enter new game title
|
|
|
|
char entered[60];
|
2010-10-28 11:00:52 +02:00
|
|
|
snprintf(entered, sizeof(entered), "%s", GameTitles.GetTitle(header));
|
2010-02-27 19:18:01 +01:00
|
|
|
entered[59] = '\0';
|
2010-09-24 02:48:03 +02:00
|
|
|
int result = OnScreenKeyboard(entered, 60, 0);
|
|
|
|
if (result == 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
WBFS_RenameGame(header->id, entered);
|
2010-09-18 13:46:25 +02:00
|
|
|
gameList.ReadGameList();
|
|
|
|
gameList.FilterList();
|
2010-02-27 19:18:01 +01:00
|
|
|
menu = MENU_DISCLIST;
|
|
|
|
}
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (choice == 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
rockout(2);
|
|
|
|
if (mountMethod == 1 || mountMethod == 2) mountMethod = mountMethodOLD;
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.gameDisplay == LIST_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gameBrowser->SetFocus(1);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
else if (Settings.gameDisplay == GRID_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gameGrid->SetFocus(1);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
else if (Settings.gameDisplay == CAROUSEL_MODE)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gameCarousel->SetFocus(1);
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (searchBar)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
HaltGui();
|
2010-09-24 02:48:03 +02:00
|
|
|
mainWindow->Append(searchBar);
|
2010-09-19 01:16:05 +02:00
|
|
|
ResumeGui();
|
|
|
|
}
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
// to skip the first call of windowScreensaver at startup when wiimote is not connected
|
2010-09-24 02:48:03 +02:00
|
|
|
if (IsWpadConnected())
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
check = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// screensaver is called when wiimote shuts down, depending on the wiimotet idletime
|
2010-09-24 02:48:03 +02:00
|
|
|
if (!IsWpadConnected() && check != 0 && Settings.screensaver != 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
check++;
|
2010-09-19 01:16:05 +02:00
|
|
|
int screensaverIsOn = 0;
|
2010-09-24 02:48:03 +02:00
|
|
|
if (check == 11500) //to allow time for the wii to turn off and not show the screensaver
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
screensaverIsOn = WindowScreensaver();
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (screensaverIsOn == 1) check = 0;
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
2010-09-19 01:16:05 +02:00
|
|
|
covertOld = covert;
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
2010-09-25 10:51:44 +02:00
|
|
|
|
2010-09-19 01:16:05 +02:00
|
|
|
HaltGui();
|
|
|
|
mainWindow->RemoveAll();
|
2010-09-24 02:48:03 +02:00
|
|
|
mainWindow->Append(bgImg);
|
2010-09-19 01:16:05 +02:00
|
|
|
delete searchBar;
|
|
|
|
searchBar = NULL;
|
|
|
|
delete gameBrowser;
|
|
|
|
gameBrowser = NULL;
|
|
|
|
delete gameGrid;
|
|
|
|
gameGrid = NULL;
|
|
|
|
delete gameCarousel;
|
|
|
|
gameCarousel = NULL;
|
|
|
|
ResumeGui();
|
2010-02-27 19:18:01 +01:00
|
|
|
return menu;
|
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
void DiscListWinUpdateCallback(void * e)
|
2010-02-27 19:18:01 +01:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiWindow *w = (GuiWindow *) e;
|
|
|
|
for (int i = 0; i < 8; ++i)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
if (Toolbar[i]->GetState() == STATE_SELECTED)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
w->Remove(Toolbar[i]);
|
|
|
|
w->Append(Toolbar[i]); // draw the selected Icon allways on top
|
2010-09-19 01:16:05 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
void rockout(int f)
|
2010-09-18 13:46:25 +02:00
|
|
|
{
|
2010-02-27 19:18:01 +01:00
|
|
|
HaltGui();
|
|
|
|
|
2010-10-28 11:00:52 +02:00
|
|
|
if (gameSelected >= 0 && gameSelected < gameList.size() && (strcasestr(GameTitles.GetTitle(gameList[gameSelected]), "guitar")
|
|
|
|
|| strcasestr(GameTitles.GetTitle(gameList[gameSelected]), "band") || strcasestr(GameTitles.GetTitle(gameList[gameSelected]),
|
2010-09-24 02:48:03 +02:00
|
|
|
"rock")))
|
2010-09-18 13:46:25 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
for (int i = 0; i < 4; i++)
|
2010-02-27 19:18:01 +01:00
|
|
|
delete pointer[i];
|
2010-09-26 10:33:43 +02:00
|
|
|
pointer[0] = Resources::GetImageData("rplayer1_point.png");
|
|
|
|
pointer[1] = Resources::GetImageData("rplayer2_point.png");
|
|
|
|
pointer[2] = Resources::GetImageData("rplayer3_point.png");
|
|
|
|
pointer[3] = Resources::GetImageData("rplayer4_point.png");
|
2010-02-27 19:18:01 +01:00
|
|
|
}
|
2010-09-18 13:46:25 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
for (int i = 0; i < 4; i++)
|
2010-09-18 13:46:25 +02:00
|
|
|
delete pointer[i];
|
2010-09-26 10:33:43 +02:00
|
|
|
pointer[0] = Resources::GetImageData("player1_point.png");
|
|
|
|
pointer[1] = Resources::GetImageData("player2_point.png");
|
|
|
|
pointer[2] = Resources::GetImageData("player3_point.png");
|
|
|
|
pointer[3] = Resources::GetImageData("player4_point.png");
|
2010-09-18 13:46:25 +02:00
|
|
|
}
|
2010-02-27 19:18:01 +01:00
|
|
|
ResumeGui();
|
|
|
|
}
|