2009-10-01 01:10:58 +02:00
|
|
|
#include <gccore.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <dirent.h>
|
|
|
|
|
|
|
|
#include "usbloader/wbfs.h"
|
|
|
|
#include "language/gettext.h"
|
|
|
|
#include "libwiigui/gui.h"
|
2010-09-17 17:15:21 +02:00
|
|
|
#include "libwiigui/Text.hpp"
|
2009-10-01 01:10:58 +02:00
|
|
|
#include "../xml/xml.h"
|
|
|
|
#include "menu.h"
|
2010-02-15 00:22:52 +01:00
|
|
|
#include "menu/menus.h"
|
2009-10-01 01:10:58 +02:00
|
|
|
#include "filelist.h"
|
|
|
|
#include "sys.h"
|
|
|
|
#include "wpad.h"
|
|
|
|
#include "fatmounter.h"
|
2010-09-25 08:54:27 +02:00
|
|
|
#include "FileOperations/fileops.h"
|
2009-10-01 01:10:58 +02:00
|
|
|
#include "prompts/PromptWindows.h"
|
2010-09-26 10:33:43 +02:00
|
|
|
#include "themes/CTheme.h"
|
2010-10-28 11:00:52 +02:00
|
|
|
#include "settings/GameTitles.h"
|
2009-10-01 01:10:58 +02:00
|
|
|
#include "gameinfo.h"
|
2010-09-18 13:46:25 +02:00
|
|
|
#include "usbloader/GameList.h"
|
2009-12-20 11:11:00 +01:00
|
|
|
#include "../gecko.h"
|
2009-10-01 01:10:58 +02:00
|
|
|
|
|
|
|
/*** Extern variables ***/
|
2010-01-19 11:48:50 +01:00
|
|
|
extern u8 shutdown;
|
|
|
|
extern u8 reset;
|
2009-10-01 01:10:58 +02:00
|
|
|
extern struct gameXMLinfo gameinfo;
|
|
|
|
extern struct gameXMLinfo gameinfo_reset;
|
|
|
|
|
2010-01-19 11:48:50 +01:00
|
|
|
/*** Extern functions ***/
|
|
|
|
extern void ResumeGui();
|
|
|
|
extern void HaltGui();
|
|
|
|
|
2009-10-01 01:10:58 +02:00
|
|
|
/****************************************************************************
|
2010-09-24 02:48:03 +02:00
|
|
|
* gameinfo
|
|
|
|
***************************************************************************/
|
|
|
|
int showGameInfo(char *ID)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2009-10-01 01:10:58 +02:00
|
|
|
HaltGui();//put this first to try to get rid of the code dump caused by loading this window at the same time as loading images from the SD card
|
2010-09-24 02:48:03 +02:00
|
|
|
mainWindow->SetState(STATE_DISABLED);
|
2009-10-01 01:10:58 +02:00
|
|
|
ResumeGui();
|
2009-11-22 17:42:53 +01:00
|
|
|
|
2009-10-01 01:10:58 +02:00
|
|
|
bool databaseopened = true;
|
2010-09-24 02:48:03 +02:00
|
|
|
if (databaseopened)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
LoadGameInfoFromXML(ID, Settings.db_language);
|
2009-10-01 01:10:58 +02:00
|
|
|
|
|
|
|
bool showmeminfo = false;
|
|
|
|
|
2010-09-19 01:16:05 +02:00
|
|
|
int choice = -1;
|
|
|
|
int titley = 10;
|
|
|
|
int marginY = titley + 40;
|
2009-10-01 01:10:58 +02:00
|
|
|
int indexy = marginY;
|
2010-09-19 01:16:05 +02:00
|
|
|
int wifiY = 0;
|
|
|
|
int intputX = 200, inputY = -30, txtXOffset = 90;
|
2010-09-24 02:48:03 +02:00
|
|
|
u8 nunchuk = 0, classiccontroller = 0, balanceboard = 0, dancepad = 0, guitar = 0, gamecube = 0, wheel = 0,
|
|
|
|
motionplus = 0, drums = 0, microphone = 0, zapper = 0, nintendods = 0,
|
|
|
|
//vitalitysensor=0,
|
|
|
|
wiispeak = 0;
|
2010-09-19 01:16:05 +02:00
|
|
|
int newline = 1;
|
|
|
|
u8 page = 1;
|
2009-10-01 01:10:58 +02:00
|
|
|
|
|
|
|
GuiImageData * playersImgData = NULL;
|
|
|
|
GuiImage * playersImg = NULL;
|
|
|
|
|
|
|
|
GuiImageData * wifiplayersImgData = NULL;
|
|
|
|
GuiImage * wifiplayersImg = NULL;
|
|
|
|
GuiImage * ratingImg = NULL;
|
|
|
|
|
|
|
|
GuiImage * classiccontrollerImg = NULL;
|
|
|
|
GuiImage * nunchukImg = NULL;
|
|
|
|
GuiImage * guitarImg = NULL;
|
|
|
|
GuiImage * drumsImg = NULL;
|
|
|
|
GuiImage * dancepadImg = NULL;
|
|
|
|
GuiImage * motionplusImg = NULL;
|
|
|
|
GuiImage * wheelImg = NULL;
|
|
|
|
GuiImage * balanceboardImg = NULL;
|
|
|
|
GuiImage * microphoneImg = NULL;
|
|
|
|
GuiImage * zapperImg = NULL;
|
|
|
|
GuiImage * nintendodsImg = NULL;
|
|
|
|
GuiImage * wiispeakImg = NULL;
|
|
|
|
//GuiImage * vitalitysensorImg = NULL;
|
|
|
|
GuiImage * gcImg = NULL;
|
|
|
|
GuiImage * dialogBoxImg1 = NULL;
|
|
|
|
GuiImage * dialogBoxImg2 = NULL;
|
|
|
|
GuiImage * dialogBoxImg3 = NULL;
|
|
|
|
GuiImage * dialogBoxImg4 = NULL;
|
|
|
|
GuiImage * dialogBoxImg11 = NULL;
|
|
|
|
GuiImage * dialogBoxImg22 = NULL;
|
|
|
|
GuiImage * dialogBoxImg33 = NULL;
|
|
|
|
GuiImage * dialogBoxImg44 = NULL;
|
|
|
|
GuiImage * coverImg = NULL;
|
|
|
|
GuiImage * coverImg2 = NULL;
|
|
|
|
|
|
|
|
GuiImageData * classiccontrollerImgData = NULL;
|
|
|
|
GuiImageData * nunchukImgData = NULL;
|
|
|
|
GuiImageData * guitarImgData = NULL;
|
|
|
|
GuiImageData * drumsImgData = NULL;
|
|
|
|
GuiImageData * motionplusImgData = NULL;
|
|
|
|
GuiImageData * wheelImgData = NULL;
|
|
|
|
GuiImageData * balanceboardImgData = NULL;
|
|
|
|
GuiImageData * dancepadImgData = NULL;
|
|
|
|
GuiImageData * microphoneImgData = NULL;
|
|
|
|
GuiImageData * zapperImgData = NULL;
|
|
|
|
GuiImageData * nintendodsImgData = NULL;
|
|
|
|
GuiImageData * wiispeakImgData = NULL;
|
|
|
|
//GuiImageData * vitalitysensorImgData = NULL;
|
|
|
|
GuiImageData * gamecubeImgData = NULL;
|
|
|
|
GuiImageData * ratingImgData = NULL;
|
|
|
|
GuiImageData * cover = NULL;
|
|
|
|
|
|
|
|
GuiText * releasedTxt = NULL;
|
|
|
|
GuiText * publisherTxt = NULL;
|
|
|
|
GuiText * developerTxt = NULL;
|
|
|
|
GuiText * titleTxt = NULL;
|
2010-09-17 17:15:21 +02:00
|
|
|
Text * synopsisTxt = NULL;
|
2009-10-01 01:10:58 +02:00
|
|
|
GuiText ** genreTxt = NULL;
|
|
|
|
GuiText ** wifiTxt = NULL;
|
|
|
|
GuiText * wiitdb1Txt = NULL;
|
|
|
|
GuiText * wiitdb2Txt = NULL;
|
|
|
|
GuiText * wiitdb3Txt = NULL;
|
|
|
|
GuiText * memTxt = NULL;
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiWindow gameinfoWindow(600, 308);
|
|
|
|
gameinfoWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
|
|
|
gameinfoWindow.SetPosition(0, -50);
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiWindow gameinfoWindow2(600, 308);
|
|
|
|
gameinfoWindow2.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
|
|
|
gameinfoWindow2.SetPosition(0, -50);
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiWindow txtWindow(350, 270);
|
|
|
|
txtWindow.SetAlignment(ALIGN_CENTRE, ALIGN_RIGHT);
|
|
|
|
txtWindow.SetPosition(95, 55);
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-26 10:33:43 +02:00
|
|
|
GuiImageData btnOutline(Resources::GetFile("button_dialogue_box.png"), Resources::GetFileSize("button_dialogue_box.png"));
|
|
|
|
GuiImageData dialogBox1(Resources::GetFile("gameinfo1.png"), Resources::GetFileSize("gameinfo1.png"));
|
|
|
|
GuiImageData dialogBox2(Resources::GetFile("gameinfo1a.png"), Resources::GetFileSize("gameinfo1a.png"));
|
|
|
|
GuiImageData dialogBox3(Resources::GetFile("gameinfo2.png"), Resources::GetFileSize("gameinfo2.png"));
|
|
|
|
GuiImageData dialogBox4(Resources::GetFile("gameinfo2a.png"), Resources::GetFileSize("gameinfo2a.png"));
|
2009-10-01 01:10:58 +02:00
|
|
|
|
|
|
|
GuiTrigger trig1;
|
2010-09-24 02:48:03 +02:00
|
|
|
trig1.SetButtonOnlyTrigger(-1, WPAD_BUTTON_1 | WPAD_CLASSIC_BUTTON_X, 0);
|
2009-10-01 01:10:58 +02:00
|
|
|
GuiTrigger trigA;
|
2010-09-24 02:48:03 +02:00
|
|
|
trigA.SetButtonOnlyTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
|
2009-10-01 01:10:58 +02:00
|
|
|
GuiTrigger trigB;
|
2010-09-24 02:48:03 +02:00
|
|
|
trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B);
|
2009-10-01 01:10:58 +02:00
|
|
|
GuiTrigger trigU;
|
2010-09-24 02:48:03 +02:00
|
|
|
trigU.SetButtonOnlyTrigger(-1, WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP, PAD_BUTTON_UP);
|
2009-10-01 01:10:58 +02:00
|
|
|
GuiTrigger trigD;
|
2010-09-24 02:48:03 +02:00
|
|
|
trigD.SetButtonOnlyTrigger(-1, WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN, PAD_BUTTON_DOWN);
|
2009-10-01 01:10:58 +02:00
|
|
|
GuiTrigger trigH;
|
2010-09-24 02:48:03 +02:00
|
|
|
trigH.SetButtonOnlyTrigger(-1, WPAD_BUTTON_HOME | WPAD_CLASSIC_BUTTON_HOME, 0);
|
2009-10-01 01:10:58 +02:00
|
|
|
|
|
|
|
//buttons for changing between synopsis and other info
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiButton backBtn(0, 0);
|
|
|
|
backBtn.SetPosition(-20, -20);
|
|
|
|
backBtn.SetTrigger(&trigB);
|
|
|
|
gameinfoWindow.Append(&backBtn);
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiButton nextBtn(0, 0);
|
|
|
|
nextBtn.SetPosition(20, 20);
|
|
|
|
nextBtn.SetTrigger(&trigA);
|
|
|
|
gameinfoWindow.Append(&nextBtn);
|
2009-10-01 01:10:58 +02:00
|
|
|
|
|
|
|
//buttons for scrolling the synopsis
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiButton upBtn(0, 0);
|
|
|
|
upBtn.SetPosition(0, 0);
|
|
|
|
upBtn.SetTrigger(&trigU);
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiButton dnBtn(0, 0);
|
|
|
|
dnBtn.SetPosition(0, 0);
|
|
|
|
dnBtn.SetTrigger(&trigD);
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiButton homeBtn(0, 0);
|
|
|
|
homeBtn.SetPosition(0, 0);
|
|
|
|
homeBtn.SetTrigger(&trigH);
|
2009-10-01 01:10:58 +02:00
|
|
|
|
|
|
|
// button to save the url for the zip file for poor people without wifi
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiButton urlBtn(0, 0);
|
|
|
|
urlBtn.SetPosition(0, 0);
|
|
|
|
urlBtn.SetTrigger(&trig1);
|
|
|
|
gameinfoWindow.Append(&urlBtn);
|
2009-10-01 01:10:58 +02:00
|
|
|
|
|
|
|
char linebuf[XML_SYNOPSISLEN] = "";
|
|
|
|
char linebuf2[100] = "";
|
|
|
|
|
|
|
|
// enable icons for required accessories
|
2010-09-24 02:48:03 +02:00
|
|
|
for (int i = 1; i <= XML_ELEMMAX; i++)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
if (strcmp(gameinfo.accessoriesReq[i], "classiccontroller") == 0) classiccontroller = 1;
|
|
|
|
if (strcmp(gameinfo.accessoriesReq[i], "nunchuk") == 0) nunchuk = 1;
|
|
|
|
if (strcmp(gameinfo.accessoriesReq[i], "guitar") == 0) guitar = 1;
|
|
|
|
if (strcmp(gameinfo.accessoriesReq[i], "drums") == 0) drums = 1;
|
|
|
|
if (strcmp(gameinfo.accessoriesReq[i], "dancepad") == 0) dancepad = 1;
|
|
|
|
if (strcmp(gameinfo.accessoriesReq[i], "motionplus") == 0) motionplus = 1;
|
|
|
|
if (strcmp(gameinfo.accessoriesReq[i], "wheel") == 0) wheel = 1;
|
|
|
|
if (strcmp(gameinfo.accessoriesReq[i], "balanceboard") == 0) balanceboard = 1;
|
|
|
|
if (strcmp(gameinfo.accessoriesReq[i], "microphone") == 0) microphone = 1;
|
|
|
|
if (strcmp(gameinfo.accessoriesReq[i], "zapper") == 0) zapper = 1;
|
|
|
|
if (strcmp(gameinfo.accessoriesReq[i], "nintendods") == 0) nintendods = 1;
|
|
|
|
if (strcmp(gameinfo.accessoriesReq[i], "wiispeak") == 0) wiispeak = 1;
|
2010-09-19 01:16:05 +02:00
|
|
|
//if (strcmp(gameinfo.accessoriesReq[i],"vitalitysensor")==0)
|
2009-10-01 01:10:58 +02:00
|
|
|
// vitalitysensor=1;
|
2010-09-24 02:48:03 +02:00
|
|
|
if (strcmp(gameinfo.accessoriesReq[i], "gamecube") == 0) gamecube = 1;
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// switch icons
|
2010-09-24 02:48:03 +02:00
|
|
|
if (nunchuk)
|
2010-09-26 10:33:43 +02:00
|
|
|
nunchukImgData = Resources::GetImageData("nunchukR.png");
|
|
|
|
else nunchukImgData = Resources::GetImageData("nunchuk.png");
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (classiccontroller)
|
2010-09-26 10:33:43 +02:00
|
|
|
classiccontrollerImgData = Resources::GetImageData("classiccontrollerR.png");
|
|
|
|
else classiccontrollerImgData = Resources::GetImageData("classiccontroller.png");
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (guitar)
|
2010-09-26 10:33:43 +02:00
|
|
|
guitarImgData = Resources::GetImageData("guitarR.png");
|
|
|
|
else guitarImgData = Resources::GetImageData("guitar.png");
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (gamecube)
|
2010-09-26 10:33:43 +02:00
|
|
|
gamecubeImgData = Resources::GetImageData("gcncontrollerR.png");
|
|
|
|
else gamecubeImgData = Resources::GetImageData("gcncontroller.png");
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (wheel)
|
2010-09-26 10:33:43 +02:00
|
|
|
wheelImgData = Resources::GetImageData("wheelR.png");
|
|
|
|
else wheelImgData = Resources::GetImageData("wheel.png");
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (motionplus)
|
2010-09-26 10:33:43 +02:00
|
|
|
motionplusImgData = Resources::GetImageData("motionplusR.png");
|
|
|
|
else motionplusImgData = Resources::GetImageData("motionplus.png");
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (drums)
|
2010-09-26 10:33:43 +02:00
|
|
|
drumsImgData = Resources::GetImageData("drumsR.png");
|
|
|
|
else drumsImgData = Resources::GetImageData("drums.png");
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (microphone)
|
2010-09-26 10:33:43 +02:00
|
|
|
microphoneImgData = Resources::GetImageData("microphoneR.png");
|
|
|
|
else microphoneImgData = Resources::GetImageData("microphone.png");
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (zapper)
|
2010-09-26 10:33:43 +02:00
|
|
|
zapperImgData = Resources::GetImageData("zapperR.png");
|
|
|
|
else zapperImgData = Resources::GetImageData("zapper.png");
|
2009-10-17 22:48:52 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (wiispeak)
|
2010-09-26 10:33:43 +02:00
|
|
|
wiispeakImgData = Resources::GetImageData("wiispeakR.png");
|
|
|
|
else wiispeakImgData = Resources::GetImageData("wiispeak.png");
|
2009-10-17 22:48:52 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (nintendods)
|
2010-09-26 10:33:43 +02:00
|
|
|
nintendodsImgData = Resources::GetImageData("nintendodsR.png");
|
|
|
|
else nintendodsImgData = Resources::GetImageData("nintendods.png");
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (balanceboard)
|
2010-09-26 10:33:43 +02:00
|
|
|
balanceboardImgData = Resources::GetImageData("balanceboardR.png");
|
|
|
|
else balanceboardImgData = Resources::GetImageData("balanceboard.png");
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (dancepad)
|
2010-09-26 10:33:43 +02:00
|
|
|
dancepadImgData = Resources::GetImageData("dancepadR.png");
|
|
|
|
else dancepadImgData = Resources::GetImageData("dancepad.png");
|
2009-10-01 01:10:58 +02:00
|
|
|
|
|
|
|
// look for optional accessories
|
2010-09-24 02:48:03 +02:00
|
|
|
for (int i = 1; i <= XML_ELEMMAX; i++)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
if (strcmp(gameinfo.accessories[i], "classiccontroller") == 0) classiccontroller = 1;
|
|
|
|
if (strcmp(gameinfo.accessories[i], "nunchuk") == 0) nunchuk = 1;
|
|
|
|
if (strcmp(gameinfo.accessories[i], "guitar") == 0) guitar = 1;
|
|
|
|
if (strcmp(gameinfo.accessories[i], "drums") == 0) drums = 1;
|
|
|
|
if (strcmp(gameinfo.accessories[i], "dancepad") == 0) dancepad = 1;
|
|
|
|
if (strcmp(gameinfo.accessories[i], "motionplus") == 0) motionplus = 1;
|
|
|
|
if (strcmp(gameinfo.accessories[i], "wheel") == 0) wheel = 1;
|
|
|
|
if (strcmp(gameinfo.accessories[i], "balanceboard") == 0) balanceboard = 1;
|
|
|
|
if (strcmp(gameinfo.accessories[i], "microphone") == 0) microphone = 1;
|
|
|
|
if (strcmp(gameinfo.accessories[i], "zapper") == 0) zapper = 1;
|
|
|
|
if (strcmp(gameinfo.accessories[i], "nintendods") == 0) nintendods = 1;
|
|
|
|
if (strcmp(gameinfo.accessories[i], "wiispeak") == 0) wiispeak = 1;
|
2010-09-19 01:16:05 +02:00
|
|
|
//if (strcmp(gameinfo.accessories[i],"vitalitysensor")==0)
|
2009-10-01 01:10:58 +02:00
|
|
|
// vitalitysensor=1;
|
2010-09-24 02:48:03 +02:00
|
|
|
if (strcmp(gameinfo.accessories[i], "gamecube") == 0) gamecube = 1;
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
dialogBoxImg1 = new GuiImage(&dialogBox1);
|
|
|
|
dialogBoxImg1->SetAlignment(0, 3);
|
|
|
|
dialogBoxImg1->SetPosition(-9, 0);
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
dialogBoxImg2 = new GuiImage(&dialogBox2);
|
|
|
|
dialogBoxImg2->SetAlignment(0, 3);
|
|
|
|
dialogBoxImg2->SetPosition(145, 0);
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
dialogBoxImg3 = new GuiImage(&dialogBox3);
|
|
|
|
dialogBoxImg3->SetAlignment(0, 3);
|
|
|
|
dialogBoxImg3->SetPosition(301, 0);
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
dialogBoxImg4 = new GuiImage(&dialogBox4);
|
|
|
|
dialogBoxImg4->SetAlignment(0, 3);
|
|
|
|
dialogBoxImg4->SetPosition(457, 0);
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
gameinfoWindow.Append(dialogBoxImg1);
|
|
|
|
gameinfoWindow.Append(dialogBoxImg2);
|
|
|
|
gameinfoWindow.Append(dialogBoxImg3);
|
|
|
|
gameinfoWindow.Append(dialogBoxImg4);
|
2010-11-13 23:34:53 +01:00
|
|
|
|
2010-09-26 10:33:43 +02:00
|
|
|
char imgPath[150];
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(imgPath, sizeof(imgPath), "%s%s.png", Settings.covers_path, ID);
|
2010-09-26 10:33:43 +02:00
|
|
|
cover = new GuiImageData(imgPath); //load full id image
|
2010-09-24 02:48:03 +02:00
|
|
|
if (!cover->GetImage())
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2009-10-01 01:10:58 +02:00
|
|
|
delete cover;
|
2010-09-26 10:33:43 +02:00
|
|
|
cover = Resources::GetImageData("nocover.png");
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
|
|
|
delete coverImg;
|
|
|
|
coverImg = NULL;
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
coverImg = new GuiImage(cover);
|
|
|
|
coverImg->SetWidescreen(Settings.widescreen);
|
|
|
|
coverImg->SetPosition(15, 30);
|
|
|
|
gameinfoWindow.Append(coverImg);
|
2009-10-01 01:10:58 +02:00
|
|
|
|
|
|
|
// # of players
|
2010-09-24 02:48:03 +02:00
|
|
|
if (strcmp(gameinfo.players, "") != 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-26 10:33:43 +02:00
|
|
|
playersImgData = Resources::GetImageData("wiimote1.png");
|
2010-09-24 02:48:03 +02:00
|
|
|
if (atoi(gameinfo.players) > 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-26 10:33:43 +02:00
|
|
|
playersImgData = Resources::GetImageData("wiimote2.png");
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (atoi(gameinfo.players) > 2)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-26 10:33:43 +02:00
|
|
|
playersImgData = Resources::GetImageData("wiimote4.png");
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
playersImg = new GuiImage(playersImgData);
|
|
|
|
playersImg->SetWidescreen(Settings.widescreen);
|
|
|
|
playersImg->SetPosition(intputX, inputY);
|
|
|
|
playersImg->SetAlignment(0, 4);
|
|
|
|
gameinfoWindow.Append(playersImg);
|
|
|
|
intputX += (Settings.widescreen ? playersImg->GetWidth() * .8 : playersImg->GetWidth()) + 5;
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//draw the input types for this game
|
2010-09-24 02:48:03 +02:00
|
|
|
if (motionplus == 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
motionplusImg = new GuiImage(motionplusImgData);
|
|
|
|
motionplusImg->SetWidescreen(Settings.widescreen);
|
|
|
|
motionplusImg->SetPosition(intputX, inputY);
|
|
|
|
motionplusImg->SetAlignment(0, 4);
|
|
|
|
gameinfoWindow.Append(motionplusImg);
|
|
|
|
intputX += (Settings.widescreen ? motionplusImg->GetWidth() * .8 : motionplusImg->GetWidth()) + 5;
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (nunchuk == 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
nunchukImg = new GuiImage(nunchukImgData);
|
|
|
|
nunchukImg->SetWidescreen(Settings.widescreen);
|
|
|
|
nunchukImg->SetPosition(intputX, inputY);
|
|
|
|
nunchukImg->SetAlignment(0, 4);
|
|
|
|
gameinfoWindow.Append(nunchukImg);
|
|
|
|
intputX += (Settings.widescreen ? nunchukImg->GetWidth() * .8 : nunchukImg->GetWidth()) + 5;
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (classiccontroller == 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
classiccontrollerImg = new GuiImage(classiccontrollerImgData);
|
|
|
|
classiccontrollerImg->SetWidescreen(Settings.widescreen);
|
|
|
|
classiccontrollerImg->SetPosition(intputX, inputY);
|
|
|
|
classiccontrollerImg->SetAlignment(0, 4);
|
|
|
|
gameinfoWindow.Append(classiccontrollerImg);
|
|
|
|
intputX += (Settings.widescreen ? classiccontrollerImg->GetWidth() * .8 : classiccontrollerImg->GetWidth())
|
|
|
|
+ 5;
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (gamecube == 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gcImg = new GuiImage(gamecubeImgData);
|
|
|
|
gcImg->SetWidescreen(Settings.widescreen);
|
|
|
|
gcImg->SetPosition(intputX, inputY);
|
|
|
|
gcImg->SetAlignment(0, 4);
|
|
|
|
gameinfoWindow.Append(gcImg);
|
|
|
|
intputX += (Settings.widescreen ? gcImg->GetWidth() * .8 : gcImg->GetWidth()) + 5;
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (wheel == 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
wheelImg = new GuiImage(wheelImgData);
|
|
|
|
wheelImg->SetWidescreen(Settings.widescreen);
|
|
|
|
wheelImg->SetPosition(intputX, inputY);
|
|
|
|
wheelImg->SetAlignment(0, 4);
|
|
|
|
gameinfoWindow.Append(wheelImg);
|
|
|
|
intputX += (Settings.widescreen ? wheelImg->GetWidth() * .8 : wheelImg->GetWidth()) + 5;
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (guitar == 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
guitarImg = new GuiImage(guitarImgData);
|
|
|
|
guitarImg->SetWidescreen(Settings.widescreen);
|
|
|
|
guitarImg->SetPosition(intputX, inputY);
|
|
|
|
guitarImg->SetAlignment(0, 4);
|
|
|
|
gameinfoWindow.Append(guitarImg);
|
|
|
|
intputX += (Settings.widescreen ? guitarImg->GetWidth() * .8 : guitarImg->GetWidth()) + 5;
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (drums == 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
drumsImg = new GuiImage(drumsImgData);
|
|
|
|
drumsImg->SetWidescreen(Settings.widescreen);
|
|
|
|
drumsImg->SetPosition(intputX, inputY);
|
|
|
|
drumsImg->SetAlignment(0, 4);
|
|
|
|
gameinfoWindow.Append(drumsImg);
|
|
|
|
intputX += (Settings.widescreen ? drumsImg->GetWidth() * .8 : drumsImg->GetWidth()) + 5;
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (microphone == 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
microphoneImg = new GuiImage(microphoneImgData);
|
|
|
|
microphoneImg->SetWidescreen(Settings.widescreen);
|
|
|
|
microphoneImg->SetPosition(intputX, inputY);
|
|
|
|
microphoneImg->SetAlignment(0, 4);
|
|
|
|
gameinfoWindow.Append(microphoneImg);
|
|
|
|
intputX += (Settings.widescreen ? microphoneImg->GetWidth() * .8 : microphoneImg->GetWidth()) + 5;
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (zapper == 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
zapperImg = new GuiImage(zapperImgData);
|
|
|
|
zapperImg->SetWidescreen(Settings.widescreen);
|
|
|
|
zapperImg->SetPosition(intputX, inputY);
|
|
|
|
zapperImg->SetAlignment(0, 4);
|
|
|
|
gameinfoWindow.Append(zapperImg);
|
|
|
|
intputX += (Settings.widescreen ? zapperImg->GetWidth() * .8 : zapperImg->GetWidth()) + 5;
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (wiispeak == 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
wiispeakImg = new GuiImage(wiispeakImgData);
|
|
|
|
wiispeakImg->SetWidescreen(Settings.widescreen);
|
|
|
|
wiispeakImg->SetPosition(intputX, inputY);
|
|
|
|
wiispeakImg->SetAlignment(0, 4);
|
|
|
|
gameinfoWindow.Append(wiispeakImg);
|
|
|
|
intputX += (Settings.widescreen ? wiispeakImg->GetWidth() * .8 : wiispeakImg->GetWidth()) + 5;
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (nintendods == 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
nintendodsImg = new GuiImage(nintendodsImgData);
|
|
|
|
nintendodsImg->SetWidescreen(Settings.widescreen);
|
|
|
|
nintendodsImg->SetPosition(intputX, inputY);
|
|
|
|
nintendodsImg->SetAlignment(0, 4);
|
|
|
|
gameinfoWindow.Append(nintendodsImg);
|
|
|
|
intputX += (Settings.widescreen ? nintendodsImg->GetWidth() * .8 : nintendodsImg->GetWidth()) + 5;
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (dancepad == 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
dancepadImg = new GuiImage(dancepadImgData);
|
|
|
|
dancepadImg->SetWidescreen(Settings.widescreen);
|
|
|
|
dancepadImg->SetPosition(intputX, inputY);
|
|
|
|
dancepadImg->SetAlignment(0, 4);
|
|
|
|
gameinfoWindow.Append(dancepadImg);
|
|
|
|
intputX += (Settings.widescreen ? dancepadImg->GetWidth() * .8 : dancepadImg->GetWidth()) + 5;
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (balanceboard == 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
balanceboardImg = new GuiImage(balanceboardImgData);
|
|
|
|
balanceboardImg->SetWidescreen(Settings.widescreen);
|
|
|
|
balanceboardImg->SetPosition(intputX, inputY);
|
|
|
|
balanceboardImg->SetAlignment(0, 4);
|
|
|
|
gameinfoWindow.Append(balanceboardImg);
|
|
|
|
intputX += (Settings.widescreen ? balanceboardImg->GetWidth() * .8 : balanceboardImg->GetWidth()) + 5;
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// # online players
|
2010-09-24 02:48:03 +02:00
|
|
|
if ((strcmp(gameinfo.wifiplayers, "") != 0) && (strcmp(gameinfo.wifiplayers, "0") != 0))
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-26 10:33:43 +02:00
|
|
|
wifiplayersImgData = Resources::GetImageData("wifi1.png");
|
2010-09-24 02:48:03 +02:00
|
|
|
if (atoi(gameinfo.wifiplayers) > 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-26 10:33:43 +02:00
|
|
|
wifiplayersImgData = Resources::GetImageData("wifi2.png");
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (atoi(gameinfo.wifiplayers) > 2)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-26 10:33:43 +02:00
|
|
|
wifiplayersImgData = Resources::GetImageData("wifi4.png");
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (atoi(gameinfo.wifiplayers) > 4)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-26 10:33:43 +02:00
|
|
|
wifiplayersImgData =Resources::GetImageData("wifi8.png");
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (atoi(gameinfo.wifiplayers) > 8)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-26 10:33:43 +02:00
|
|
|
wifiplayersImgData = Resources::GetImageData("wifi12.png");
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (atoi(gameinfo.wifiplayers) > 12)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-26 10:33:43 +02:00
|
|
|
wifiplayersImgData = Resources::GetImageData("wifi16.png");
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (atoi(gameinfo.wifiplayers) > 16)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-26 10:33:43 +02:00
|
|
|
wifiplayersImgData = Resources::GetImageData("wifi32.png");
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
wifiplayersImg = new GuiImage(wifiplayersImgData);
|
|
|
|
wifiplayersImg->SetWidescreen(Settings.widescreen);
|
|
|
|
wifiplayersImg->SetPosition(intputX, inputY);
|
|
|
|
wifiplayersImg->SetAlignment(0, 4);
|
|
|
|
gameinfoWindow.Append(wifiplayersImg);
|
|
|
|
intputX += (Settings.widescreen ? wifiplayersImg->GetWidth() * .8 : wifiplayersImg->GetWidth()) + 5;
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ratings
|
2010-09-24 02:48:03 +02:00
|
|
|
if (strcmp(gameinfo.ratingtype, "") != 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
if (strcmp(gameinfo.ratingtype, "ESRB") == 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
if (strcmp(gameinfo.ratingvalueESRB, "EC") == 0)
|
2010-09-26 10:33:43 +02:00
|
|
|
ratingImgData = Resources::GetImageData("esrb_ec.png");
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (strcmp(gameinfo.ratingvalueESRB, "E") == 0)
|
2010-09-26 10:33:43 +02:00
|
|
|
ratingImgData = Resources::GetImageData("esrb_e.png");
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (strcmp(gameinfo.ratingvalueESRB, "E10+") == 0)
|
2010-09-26 10:33:43 +02:00
|
|
|
ratingImgData = Resources::GetImageData("esrb_eten.png");
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (strcmp(gameinfo.ratingvalueESRB, "T") == 0)
|
2010-09-26 10:33:43 +02:00
|
|
|
ratingImgData = Resources::GetImageData("esrb_t.png");
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (strcmp(gameinfo.ratingvalueESRB, "M") == 0)
|
2010-09-26 10:33:43 +02:00
|
|
|
ratingImgData = Resources::GetImageData("esrb_m.png");
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (strcmp(gameinfo.ratingvalueESRB, "AO") == 0)
|
2010-09-26 10:33:43 +02:00
|
|
|
ratingImgData = Resources::GetImageData("esrb_ao.png");
|
2010-09-19 01:16:05 +02:00
|
|
|
else
|
|
|
|
{
|
2010-09-26 10:33:43 +02:00
|
|
|
ratingImgData = Resources::GetImageData("norating.png");
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
} //there are 2 values here cause some countries are stupid and
|
|
|
|
else if (strcmp(gameinfo.ratingtype, "PEGI") == 0) //can't use the same as everybody else
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
if ((strcmp(gameinfo.ratingvaluePEGI, "3") == 0) || (strcmp(gameinfo.ratingvaluePEGI, "4") == 0))
|
2010-09-26 10:33:43 +02:00
|
|
|
ratingImgData = Resources::GetImageData("pegi_3.png");
|
2010-09-24 02:48:03 +02:00
|
|
|
else if ((strcmp(gameinfo.ratingvaluePEGI, "7") == 0) || (strcmp(gameinfo.ratingvaluePEGI, "7") == 0))
|
2010-09-26 10:33:43 +02:00
|
|
|
ratingImgData = Resources::GetImageData("pegi_7.png");
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (strcmp(gameinfo.ratingvaluePEGI, "12") == 0)
|
2010-09-26 10:33:43 +02:00
|
|
|
ratingImgData = Resources::GetImageData("pegi_12.png");
|
2010-09-24 02:48:03 +02:00
|
|
|
else if ((strcmp(gameinfo.ratingvaluePEGI, "16") == 0) || (strcmp(gameinfo.ratingvaluePEGI, "15") == 0))
|
2010-09-26 10:33:43 +02:00
|
|
|
ratingImgData = Resources::GetImageData("pegi_16.png");
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (strcmp(gameinfo.ratingvaluePEGI, "18") == 0)
|
2010-09-26 10:33:43 +02:00
|
|
|
ratingImgData = Resources::GetImageData("pegi_18.png");
|
2010-09-19 01:16:05 +02:00
|
|
|
else
|
|
|
|
{
|
2010-09-26 10:33:43 +02:00
|
|
|
ratingImgData = Resources::GetImageData("norating.png");
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (strcmp(gameinfo.ratingtype, "CERO") == 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
if (strcmp(gameinfo.ratingvalueCERO, "A") == 0)
|
2010-09-26 10:33:43 +02:00
|
|
|
ratingImgData = Resources::GetImageData("cero_a.png");
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (strcmp(gameinfo.ratingvalueCERO, "B") == 0)
|
2010-09-26 10:33:43 +02:00
|
|
|
ratingImgData = Resources::GetImageData("cero_b.png");
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (strcmp(gameinfo.ratingvalueCERO, "C") == 0)
|
2010-09-26 10:33:43 +02:00
|
|
|
ratingImgData = Resources::GetImageData("cero_c.png");
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (strcmp(gameinfo.ratingvalueCERO, "D") == 0)
|
2010-09-26 10:33:43 +02:00
|
|
|
ratingImgData = Resources::GetImageData("cero_d.png");
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (strcmp(gameinfo.ratingvalueCERO, "Z") == 0)
|
2010-09-26 10:33:43 +02:00
|
|
|
ratingImgData = Resources::GetImageData("cero_z.png");
|
2010-09-19 01:16:05 +02:00
|
|
|
else
|
|
|
|
{
|
2010-09-26 10:33:43 +02:00
|
|
|
ratingImgData = Resources::GetImageData("norating.png");
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-09-19 01:16:05 +02:00
|
|
|
else
|
|
|
|
{
|
2010-09-26 10:33:43 +02:00
|
|
|
ratingImgData = Resources::GetImageData("norating.png");
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
ratingImg = new GuiImage(ratingImgData);
|
|
|
|
ratingImg->SetWidescreen(Settings.widescreen);
|
|
|
|
ratingImg->SetPosition(-25, inputY);
|
|
|
|
ratingImg->SetAlignment(1, 4);
|
|
|
|
gameinfoWindow.Append(ratingImg);
|
|
|
|
intputX += (Settings.widescreen ? ratingImg->GetWidth() * .8 : ratingImg->GetWidth()) + 5;
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// memory info
|
2010-09-24 02:48:03 +02:00
|
|
|
if (showmeminfo)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2009-10-01 01:10:58 +02:00
|
|
|
char meminfotxt[200];
|
2010-09-24 02:48:03 +02:00
|
|
|
strlcpy(meminfotxt, MemInfo(), sizeof(meminfotxt));
|
|
|
|
snprintf(linebuf, sizeof(linebuf), "%s", meminfotxt);
|
|
|
|
memTxt = new GuiText(linebuf, 18, ( GXColor )
|
|
|
|
{ 0, 0, 0, 255});
|
|
|
|
memTxt->SetAlignment(ALIGN_LEFT, ALIGN_TOP);
|
|
|
|
memTxt->SetPosition(0, 0);
|
|
|
|
gameinfoWindow.Append(memTxt);
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// title
|
2010-09-19 01:16:05 +02:00
|
|
|
int titlefontsize = 25;
|
2010-09-24 02:48:03 +02:00
|
|
|
if (strcmp(gameinfo.title, "") != 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf, sizeof(linebuf), "%s", gameinfo.title);
|
|
|
|
titleTxt = new GuiText(linebuf, titlefontsize, ( GXColor )
|
|
|
|
{ 0, 0, 0, 255});
|
|
|
|
titleTxt->SetMaxWidth(350, SCROLL_HORIZONTAL);
|
2009-10-01 01:10:58 +02:00
|
|
|
//while (titleTxt->GetWidth()>250) { titleTxt->SetFontSize(titlefontsize-=2); }
|
2010-09-24 02:48:03 +02:00
|
|
|
titleTxt->SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
|
|
|
titleTxt->SetPosition(txtXOffset, 12 + titley);
|
|
|
|
gameinfoWindow.Append(titleTxt);
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//date
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf2, sizeof(linebuf2), " ");
|
|
|
|
if (strcmp(gameinfo.day, "") != 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf2, sizeof(linebuf2), "%s ", gameinfo.day);
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (strcmp(gameinfo.month, "") != 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
switch (atoi(gameinfo.month))
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
case 1:
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf2, sizeof(linebuf2), "%s%s ", linebuf2, tr( "Jan" ));
|
2010-09-19 01:16:05 +02:00
|
|
|
break;
|
|
|
|
case 2:
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf2, sizeof(linebuf2), "%s%s ", linebuf2, tr( "Feb" ));
|
2010-09-19 01:16:05 +02:00
|
|
|
break;
|
|
|
|
case 3:
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf2, sizeof(linebuf2), "%s%s ", linebuf2, tr( "Mar" ));
|
2010-09-19 01:16:05 +02:00
|
|
|
break;
|
|
|
|
case 4:
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf2, sizeof(linebuf2), "%s%s ", linebuf2, tr( "Apr" ));
|
2010-09-19 01:16:05 +02:00
|
|
|
break;
|
|
|
|
case 5:
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf2, sizeof(linebuf2), "%s%s ", linebuf2, tr( "May" ));
|
2010-09-19 01:16:05 +02:00
|
|
|
break;
|
|
|
|
case 6:
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf2, sizeof(linebuf2), "%s%s ", linebuf2, tr( "June" ));
|
2010-09-19 01:16:05 +02:00
|
|
|
break;
|
|
|
|
case 7:
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf2, sizeof(linebuf2), "%s%s ", linebuf2, tr( "July" ));
|
2010-09-19 01:16:05 +02:00
|
|
|
break;
|
|
|
|
case 8:
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf2, sizeof(linebuf2), "%s%s ", linebuf2, tr( "Aug" ));
|
2010-09-19 01:16:05 +02:00
|
|
|
break;
|
|
|
|
case 9:
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf2, sizeof(linebuf2), "%s%s ", linebuf2, tr( "Sept" ));
|
2010-09-19 01:16:05 +02:00
|
|
|
break;
|
|
|
|
case 10:
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf2, sizeof(linebuf2), "%s%s ", linebuf2, tr( "Oct" ));
|
2010-09-19 01:16:05 +02:00
|
|
|
break;
|
|
|
|
case 11:
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf2, sizeof(linebuf2), "%s%s ", linebuf2, tr( "Nov" ));
|
2010-09-19 01:16:05 +02:00
|
|
|
break;
|
|
|
|
case 12:
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf2, sizeof(linebuf2), "%s%s ", linebuf2, tr( "Dec" ));
|
2010-09-19 01:16:05 +02:00
|
|
|
break;
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (strcmp(gameinfo.year, "") != 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf, sizeof(linebuf), "%s : %s%s", tr( "Released" ), linebuf2, gameinfo.year);
|
|
|
|
releasedTxt = new GuiText(linebuf, 16, ( GXColor )
|
|
|
|
{ 0, 0, 0, 255});
|
|
|
|
if (releasedTxt->GetWidth() > 300) newline = 2;
|
|
|
|
releasedTxt->SetAlignment(ALIGN_RIGHT, ALIGN_TOP);
|
|
|
|
releasedTxt->SetPosition(-17, 12 + indexy);
|
|
|
|
indexy += (20 * newline);
|
2010-09-19 01:16:05 +02:00
|
|
|
newline = 1;
|
2010-09-24 02:48:03 +02:00
|
|
|
gameinfoWindow.Append(releasedTxt);
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//publisher
|
2010-09-24 02:48:03 +02:00
|
|
|
if (strcmp(gameinfo.publisher, "") != 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf, sizeof(linebuf), "%s %s", tr( "Published by" ), gameinfo.publisher);
|
|
|
|
publisherTxt = new GuiText(linebuf, 16, ( GXColor )
|
|
|
|
{ 0, 0, 0, 255});
|
|
|
|
if (publisherTxt->GetWidth() > 250) newline = 2;
|
|
|
|
publisherTxt->SetMaxWidth(250, WRAP);
|
|
|
|
publisherTxt->SetAlignment(ALIGN_RIGHT, ALIGN_TOP);
|
|
|
|
publisherTxt->SetPosition(-17, 12 + indexy);
|
|
|
|
indexy += (20 * newline);
|
2010-09-19 01:16:05 +02:00
|
|
|
newline = 1;
|
2010-09-24 02:48:03 +02:00
|
|
|
gameinfoWindow.Append(publisherTxt);
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//developer
|
2010-09-24 02:48:03 +02:00
|
|
|
if (strcmp(gameinfo.developer, "") != 0 && strcasecmp(gameinfo.developer, gameinfo.publisher) != 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf, sizeof(linebuf), "%s %s", tr( "Developed by" ), gameinfo.developer);
|
|
|
|
developerTxt = new GuiText(linebuf, 16, ( GXColor )
|
|
|
|
{ 0, 0, 0, 255});
|
|
|
|
if (developerTxt->GetWidth() > 250) newline = 2;
|
|
|
|
developerTxt->SetMaxWidth(250, WRAP);
|
|
|
|
developerTxt->SetAlignment(ALIGN_RIGHT, ALIGN_TOP);
|
|
|
|
developerTxt->SetPosition(-17, 12 + indexy);
|
|
|
|
indexy += (20 * newline);
|
2010-09-19 01:16:05 +02:00
|
|
|
newline = 1;
|
2010-09-24 02:48:03 +02:00
|
|
|
gameinfoWindow.Append(developerTxt);
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//genre
|
|
|
|
int genreY = marginY;
|
2010-09-24 02:48:03 +02:00
|
|
|
genreTxt = new GuiText *[gameinfo.genreCnt + 1];
|
|
|
|
for (int i = 1; i <= gameinfo.genreCnt; i++)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf, sizeof(linebuf), "%s", gameinfo.genresplit[i]);
|
|
|
|
genreTxt[i] = new GuiText(linebuf, 16, ( GXColor )
|
|
|
|
{ 0, 0, 0, 255});
|
|
|
|
genreTxt[i]->SetAlignment(ALIGN_LEFT, ALIGN_TOP);
|
|
|
|
genreTxt[i]->SetPosition(205, 12 + genreY);
|
2010-09-19 01:16:05 +02:00
|
|
|
genreY += 20;
|
2010-09-24 02:48:03 +02:00
|
|
|
gameinfoWindow.Append(genreTxt[i]);
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//online
|
2010-09-24 02:48:03 +02:00
|
|
|
wifiTxt = new GuiText *[gameinfo.wifiCnt + 1];
|
|
|
|
for (int i = gameinfo.wifiCnt; i >= 1; i--)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
if (strcmp(gameinfo.wififeatures[i], "Nintendods") == 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf, sizeof(linebuf), "Nintendo DS");
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
2010-09-19 01:16:05 +02:00
|
|
|
else
|
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf, sizeof(linebuf), "%s", gameinfo.wififeatures[i]);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
wifiTxt[i] = new GuiText(linebuf, 16, ( GXColor )
|
|
|
|
{ 0, 0, 0, 255});
|
|
|
|
wifiTxt[i]->SetAlignment(ALIGN_LEFT, ALIGN_TOP);
|
|
|
|
wifiTxt[i]->SetPosition(215, 200 + wifiY);
|
2010-09-19 01:16:05 +02:00
|
|
|
wifiY -= 20;
|
2010-09-24 02:48:03 +02:00
|
|
|
gameinfoWindow.Append(wifiTxt[i]);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (strcmp(gameinfo.wififeatures[1], "") != 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf, sizeof(linebuf), "%s:", tr( "WiFi Features" ));
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
2010-09-19 01:16:05 +02:00
|
|
|
else
|
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
strcpy(linebuf, "");
|
2010-09-17 18:15:18 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
wifiTxt[0] = new GuiText(linebuf, 16, ( GXColor )
|
|
|
|
{ 0, 0, 0, 255});
|
|
|
|
wifiTxt[0]->SetAlignment(ALIGN_LEFT, ALIGN_TOP);
|
|
|
|
wifiTxt[0]->SetPosition(205, 200 + wifiY);
|
|
|
|
gameinfoWindow.Append(wifiTxt[0]);
|
2009-10-01 01:10:58 +02:00
|
|
|
|
|
|
|
//synopsis
|
2010-09-19 01:16:05 +02:00
|
|
|
int pagesize = 12;
|
2010-09-24 02:48:03 +02:00
|
|
|
if (strcmp(gameinfo.synopsis, "") != 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf, sizeof(linebuf), "%s", gameinfo.synopsis);
|
|
|
|
synopsisTxt = new Text(linebuf, 16, ( GXColor )
|
|
|
|
{ 0, 0, 0, 255});
|
|
|
|
synopsisTxt->SetMaxWidth(350);
|
|
|
|
synopsisTxt->SetAlignment(ALIGN_LEFT, ALIGN_TOP);
|
|
|
|
synopsisTxt->SetPosition(0, 0);
|
|
|
|
synopsisTxt->SetLinesToDraw(pagesize);
|
2010-09-17 18:15:18 +02:00
|
|
|
synopsisTxt->Refresh();
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
dialogBoxImg11 = new GuiImage(&dialogBox1);
|
|
|
|
dialogBoxImg11->SetAlignment(0, 3);
|
|
|
|
dialogBoxImg11->SetPosition(-9, 0);
|
|
|
|
|
|
|
|
dialogBoxImg22 = new GuiImage(&dialogBox2);
|
|
|
|
dialogBoxImg22->SetAlignment(0, 3);
|
|
|
|
dialogBoxImg22->SetPosition(145, 0);
|
|
|
|
|
|
|
|
dialogBoxImg33 = new GuiImage(&dialogBox3);
|
|
|
|
dialogBoxImg33->SetAlignment(0, 3);
|
|
|
|
dialogBoxImg33->SetPosition(301, 0);
|
|
|
|
|
|
|
|
dialogBoxImg44 = new GuiImage(&dialogBox4);
|
|
|
|
dialogBoxImg44->SetAlignment(0, 3);
|
|
|
|
dialogBoxImg44->SetPosition(457, 0);
|
|
|
|
|
|
|
|
gameinfoWindow2.Append(dialogBoxImg11);
|
|
|
|
gameinfoWindow2.Append(dialogBoxImg22);
|
|
|
|
gameinfoWindow2.Append(dialogBoxImg33);
|
|
|
|
gameinfoWindow2.Append(dialogBoxImg44);
|
|
|
|
|
|
|
|
txtWindow.Append(synopsisTxt);
|
|
|
|
txtWindow.Append(&upBtn);
|
|
|
|
txtWindow.Append(&dnBtn);
|
|
|
|
coverImg2 = new GuiImage(cover);
|
|
|
|
coverImg2->SetWidescreen(Settings.widescreen);
|
|
|
|
coverImg2->SetPosition(15, 30);
|
|
|
|
gameinfoWindow2.Append(coverImg2);
|
|
|
|
gameinfoWindow2.Append(&txtWindow);
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf, sizeof(linebuf), "http://wiitdb.com");
|
2009-10-01 01:10:58 +02:00
|
|
|
//snprintf(linebuf, sizeof(linebuf), tr("Don't bother the USB Loader GX Team about errors in this file."));
|
2010-09-24 02:48:03 +02:00
|
|
|
wiitdb1Txt = new GuiText(linebuf, 16, ( GXColor )
|
|
|
|
{ 0, 0, 0, 255});
|
|
|
|
wiitdb1Txt->SetAlignment(ALIGN_LEFT, ALIGN_BOTTOM);
|
|
|
|
wiitdb1Txt->SetPosition(40, -15);
|
|
|
|
gameinfoWindow.Append(wiitdb1Txt);
|
|
|
|
snprintf(linebuf, sizeof(linebuf), tr( "If you don't have WiFi, press 1 to get an URL to get your WiiTDB.zip" ));
|
|
|
|
wiitdb2Txt = new GuiText(linebuf, 14, ( GXColor )
|
|
|
|
{ 0, 0, 0, 255});
|
|
|
|
wiitdb2Txt->SetAlignment(ALIGN_LEFT, ALIGN_BOTTOM);
|
|
|
|
wiitdb2Txt->SetPosition(202, -15);
|
|
|
|
gameinfoWindow.Append(wiitdb2Txt);
|
|
|
|
snprintf(linebuf, sizeof(linebuf), " ");
|
|
|
|
wiitdb3Txt = new GuiText(linebuf, 14, ( GXColor )
|
|
|
|
{ 0, 0, 0, 255});
|
|
|
|
wiitdb3Txt->SetAlignment(ALIGN_LEFT, ALIGN_BOTTOM);
|
|
|
|
wiitdb3Txt->SetPosition(202, -4);
|
|
|
|
gameinfoWindow.Append(wiitdb3Txt);
|
|
|
|
|
|
|
|
gameinfoWindow.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_IN, 100);
|
2010-09-19 01:16:05 +02: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-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
GuiButton screenShotBtn(0, 0);
|
|
|
|
screenShotBtn.SetPosition(0, 0);
|
|
|
|
screenShotBtn.SetTrigger(&trigZ);
|
|
|
|
gameinfoWindow.Append(&screenShotBtn);
|
2009-10-01 01:10:58 +02:00
|
|
|
HaltGui();
|
|
|
|
//mainWindow->SetState(STATE_DISABLED);
|
2010-09-24 02:48:03 +02:00
|
|
|
mainWindow->Append(&gameinfoWindow);
|
|
|
|
mainWindow->ChangeFocus(&gameinfoWindow);
|
2009-10-01 01:10:58 +02:00
|
|
|
ResumeGui();
|
2009-10-17 22:48:52 +02:00
|
|
|
|
2010-09-19 01:16:05 +02:00
|
|
|
bool savedURL = false;
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
while (choice == -1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2009-10-01 01:10:58 +02:00
|
|
|
|
|
|
|
VIDEO_WaitVSync();
|
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
|
|
|
wiilight(0);
|
2010-01-19 11:48:50 +01:00
|
|
|
Sys_Shutdown();
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (reset == 1)
|
2010-01-19 11:48:50 +01:00
|
|
|
Sys_Reboot();
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
else if ((backBtn.GetState() == STATE_CLICKED) || (backBtn.GetState() == STATE_HELD))
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
backBtn.ResetState();
|
2010-09-24 02:48:03 +02:00
|
|
|
if (page == 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
choice = 1;
|
2010-09-24 02:48:03 +02:00
|
|
|
if (synopsisTxt) delete synopsisTxt;
|
2009-10-01 01:10:58 +02:00
|
|
|
synopsisTxt = NULL;
|
|
|
|
break;
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (page == 2)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2009-10-01 01:10:58 +02:00
|
|
|
HaltGui();
|
2010-09-24 02:48:03 +02:00
|
|
|
gameinfoWindow2.Remove(&nextBtn);
|
|
|
|
gameinfoWindow2.Remove(&backBtn);
|
|
|
|
gameinfoWindow2.Remove(&homeBtn);
|
|
|
|
gameinfoWindow2.Remove(&screenShotBtn);
|
|
|
|
gameinfoWindow2.SetVisible(false);
|
|
|
|
gameinfoWindow.SetVisible(true);
|
|
|
|
gameinfoWindow.Append(&backBtn);
|
|
|
|
gameinfoWindow.Append(&nextBtn);
|
|
|
|
gameinfoWindow.Append(&homeBtn);
|
|
|
|
gameinfoWindow.Append(&screenShotBtn);
|
|
|
|
mainWindow->Remove(&gameinfoWindow2);
|
2009-10-01 01:10:58 +02:00
|
|
|
ResumeGui();
|
2010-09-19 01:16:05 +02:00
|
|
|
page = 1;
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
2010-09-17 18:15:18 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (((nextBtn.GetState() == STATE_CLICKED) || (nextBtn.GetState() == STATE_HELD)) && (strcmp(
|
|
|
|
gameinfo.synopsis, "") != 0))
|
2010-09-17 18:15:18 +02:00
|
|
|
{
|
2009-10-01 07:13:01 +02:00
|
|
|
nextBtn.ResetState();
|
2010-09-17 18:15:18 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (page == 1)
|
2010-09-17 18:15:18 +02:00
|
|
|
{
|
2009-10-01 01:10:58 +02:00
|
|
|
HaltGui();
|
2010-09-24 02:48:03 +02:00
|
|
|
gameinfoWindow.Remove(&nextBtn);
|
|
|
|
gameinfoWindow.Remove(&backBtn);
|
|
|
|
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);
|
|
|
|
gameinfoWindow2.Append(&screenShotBtn);
|
|
|
|
mainWindow->Append(&gameinfoWindow2);
|
2009-10-01 01:10:58 +02:00
|
|
|
ResumeGui();
|
2010-09-19 01:16:05 +02:00
|
|
|
page = 2;
|
2010-09-17 18:15:18 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-10-01 01:10:58 +02:00
|
|
|
HaltGui();
|
2010-09-24 02:48:03 +02:00
|
|
|
gameinfoWindow2.Remove(&nextBtn);
|
|
|
|
gameinfoWindow2.Remove(&backBtn);
|
|
|
|
gameinfoWindow2.Remove(&homeBtn);
|
|
|
|
gameinfoWindow2.Remove(&screenShotBtn);
|
|
|
|
gameinfoWindow2.SetVisible(false);
|
|
|
|
gameinfoWindow.SetVisible(true);
|
|
|
|
gameinfoWindow.Append(&backBtn);
|
|
|
|
gameinfoWindow.Append(&nextBtn);
|
|
|
|
gameinfoWindow.Append(&homeBtn);
|
|
|
|
gameinfoWindow.Append(&screenShotBtn);
|
|
|
|
mainWindow->Remove(&gameinfoWindow2);
|
2009-10-01 01:10:58 +02:00
|
|
|
ResumeGui();
|
2010-09-19 01:16:05 +02:00
|
|
|
page = 1;
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
|
|
|
|
2010-09-17 18:15:18 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
else if ((upBtn.GetState() == STATE_CLICKED || upBtn.GetState() == STATE_HELD) && page == 2)
|
2010-09-17 18:15:18 +02:00
|
|
|
{
|
|
|
|
synopsisTxt->PreviousLine();
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
usleep(60000);
|
|
|
|
if (!((ButtonsHold() & WPAD_BUTTON_UP) || (ButtonsHold() & PAD_BUTTON_UP))) upBtn.ResetState();
|
2009-10-19 22:34:54 +02:00
|
|
|
|
2010-09-17 18:15:18 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
else if ((dnBtn.GetState() == STATE_CLICKED || dnBtn.GetState() == STATE_HELD) && page == 2)
|
2010-09-17 18:15:18 +02:00
|
|
|
{
|
|
|
|
synopsisTxt->NextLine();
|
2009-10-19 22:34:54 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
usleep(60000);
|
|
|
|
if (!((ButtonsHold() & WPAD_BUTTON_DOWN) || (ButtonsHold() & PAD_BUTTON_DOWN))) dnBtn.ResetState();
|
2010-09-17 18:15:18 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (homeBtn.GetState() == STATE_CLICKED)
|
2010-09-17 18:15:18 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
if (page == 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
choice = 2;
|
2010-09-24 02:48:03 +02:00
|
|
|
if (synopsisTxt) delete synopsisTxt;
|
2009-10-01 01:10:58 +02:00
|
|
|
synopsisTxt = NULL;
|
|
|
|
break;
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (page == 2)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2009-10-01 01:10:58 +02:00
|
|
|
HaltGui();
|
2010-09-24 02:48:03 +02:00
|
|
|
gameinfoWindow2.SetVisible(false);
|
|
|
|
gameinfoWindow.SetVisible(true);
|
|
|
|
mainWindow->Remove(&gameinfoWindow2);
|
2009-10-01 01:10:58 +02:00
|
|
|
ResumeGui();
|
2010-09-19 01:16:05 +02:00
|
|
|
page = 1;
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (urlBtn.GetState() == STATE_CLICKED && !savedURL)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf, sizeof(linebuf), tr( "Please wait..." ));
|
|
|
|
wiitdb2Txt->SetText(linebuf);
|
|
|
|
gameinfoWindow.Append(wiitdb2Txt);
|
|
|
|
if (save_XML_URL())
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf, sizeof(linebuf), tr( "Your URL has been saved in %sWiiTDB_URL.txt." ),
|
|
|
|
Settings.update_path);
|
|
|
|
wiitdb2Txt->SetText(linebuf);
|
|
|
|
gameinfoWindow.Append(wiitdb2Txt);
|
|
|
|
snprintf(linebuf, sizeof(linebuf), tr( "Paste it into your browser to get your WiiTDB.zip." ));
|
|
|
|
wiitdb3Txt->SetText(linebuf);
|
|
|
|
gameinfoWindow.Append(wiitdb3Txt);
|
2010-09-19 01:16:05 +02:00
|
|
|
savedURL = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(linebuf, sizeof(linebuf), tr( "Could not save." ));
|
|
|
|
wiitdb2Txt->SetText(linebuf);
|
|
|
|
gameinfoWindow.Append(wiitdb2Txt);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
urlBtn.ResetState();
|
|
|
|
}
|
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("\n\tscreenShotBtn clicked");
|
2010-09-19 01:16:05 +02:00
|
|
|
screenShotBtn.ResetState();
|
|
|
|
ScreenShot();
|
2010-09-24 02:48:03 +02:00
|
|
|
gprintf("...It's easy, mmmmmmKay");
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (page == 1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gameinfoWindow.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 100);
|
|
|
|
while (gameinfoWindow.GetEffect() > 0)
|
|
|
|
usleep(50);
|
2009-10-01 01:10:58 +02:00
|
|
|
HaltGui();
|
2010-09-24 02:48:03 +02:00
|
|
|
mainWindow->Remove(&gameinfoWindow);
|
|
|
|
mainWindow->SetState(STATE_DEFAULT);
|
2009-10-01 01:10:58 +02:00
|
|
|
|
|
|
|
delete playersImgData;
|
|
|
|
delete playersImg;
|
|
|
|
|
|
|
|
delete wifiplayersImgData;
|
|
|
|
delete wifiplayersImg;
|
|
|
|
delete ratingImg;
|
|
|
|
|
|
|
|
delete classiccontrollerImg;
|
|
|
|
delete nunchukImg;
|
|
|
|
delete guitarImg;
|
|
|
|
delete drumsImg;
|
|
|
|
delete dancepadImg;
|
|
|
|
delete motionplusImg;
|
|
|
|
delete wheelImg;
|
|
|
|
delete balanceboardImg;
|
|
|
|
delete microphoneImg;
|
|
|
|
delete zapperImg;
|
|
|
|
delete wiispeakImg;
|
|
|
|
delete nintendodsImg;
|
|
|
|
//delete vitalitysensorImg;
|
|
|
|
delete gcImg;
|
|
|
|
delete dialogBoxImg1;
|
|
|
|
delete dialogBoxImg2;
|
|
|
|
delete dialogBoxImg3;
|
|
|
|
delete dialogBoxImg4;
|
|
|
|
delete dialogBoxImg11;
|
|
|
|
delete dialogBoxImg22;
|
|
|
|
delete dialogBoxImg33;
|
|
|
|
delete dialogBoxImg44;
|
|
|
|
delete coverImg;
|
|
|
|
delete coverImg2;
|
|
|
|
|
|
|
|
delete classiccontrollerImgData;
|
|
|
|
delete nunchukImgData;
|
|
|
|
delete guitarImgData;
|
|
|
|
delete drumsImgData;
|
|
|
|
delete motionplusImgData;
|
|
|
|
delete wheelImgData;
|
|
|
|
delete balanceboardImgData;
|
|
|
|
delete dancepadImgData;
|
|
|
|
delete microphoneImgData;
|
|
|
|
delete zapperImgData;
|
|
|
|
delete wiispeakImgData;
|
|
|
|
delete nintendodsImgData;
|
|
|
|
//delete vitalitysensorImgData;
|
|
|
|
delete gamecubeImgData;
|
|
|
|
delete ratingImgData;
|
|
|
|
delete cover;
|
|
|
|
delete releasedTxt;
|
|
|
|
delete publisherTxt;
|
|
|
|
delete developerTxt;
|
|
|
|
delete titleTxt;
|
|
|
|
delete synopsisTxt;
|
|
|
|
delete wiitdb1Txt;
|
|
|
|
delete wiitdb2Txt;
|
|
|
|
delete wiitdb3Txt;
|
|
|
|
delete memTxt;
|
2010-09-24 02:48:03 +02:00
|
|
|
if (gameinfo.genreCnt > 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
for (int i = 1; i <= gameinfo.genreCnt; i++)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2009-10-01 01:10:58 +02:00
|
|
|
delete genreTxt[i];
|
|
|
|
}
|
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (gameinfo.wifiCnt > 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
for (int i = 0; i <= gameinfo.wifiCnt; i++)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2009-10-01 01:10:58 +02:00
|
|
|
delete wifiTxt[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ResumeGui();
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gameinfoWindow2.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 100);
|
|
|
|
while (gameinfoWindow2.GetEffect() > 0)
|
|
|
|
usleep(50);
|
2009-10-01 01:10:58 +02:00
|
|
|
HaltGui();
|
2010-09-24 02:48:03 +02:00
|
|
|
mainWindow->Remove(&gameinfoWindow2);
|
|
|
|
mainWindow->SetState(STATE_DEFAULT);
|
2009-10-01 01:10:58 +02:00
|
|
|
ResumeGui();
|
|
|
|
}
|
2009-10-17 22:48:52 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (savedURL) return 3;
|
2009-10-01 01:10:58 +02:00
|
|
|
return choice;
|
|
|
|
|
2010-09-19 01:16:05 +02:00
|
|
|
/* File not found */
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-10-01 01:10:58 +02:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
bool save_gamelist(int txt) // save gamelist
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
mainWindow->SetState(STATE_DISABLED);
|
2009-10-01 01:10:58 +02:00
|
|
|
char tmp[200];
|
2010-09-24 02:48:03 +02:00
|
|
|
sprintf(tmp, "%s", Settings.update_path);
|
2009-10-01 01:10:58 +02:00
|
|
|
struct stat st;
|
2010-09-24 02:48:03 +02:00
|
|
|
if (stat(tmp, &st) != 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
mkdir(tmp, 0777);
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
|
|
|
FILE *f;
|
2010-09-24 02:48:03 +02:00
|
|
|
sprintf(tmp, "%sGameList.txt", Settings.update_path);
|
|
|
|
if (txt == 1) sprintf(tmp, "%sGameList.csv", Settings.update_path);
|
|
|
|
f = fopen(tmp, "w");
|
|
|
|
if (!f)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
sleep(1);
|
|
|
|
mainWindow->SetState(STATE_DEFAULT);
|
2009-10-01 01:10:58 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
//make sure that all games are added to the gamelist
|
2010-09-18 13:46:25 +02:00
|
|
|
gameList.LoadUnfiltered();
|
2009-10-01 01:10:58 +02:00
|
|
|
|
|
|
|
f32 size = 0.0;
|
2010-09-19 01:16:05 +02:00
|
|
|
f32 freespace, used;
|
|
|
|
int i;
|
2009-10-17 22:48:52 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
WBFS_DiskSpace(&used, &freespace);
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
fprintf(f, "# USB Loader Has Saved this file\n");
|
|
|
|
fprintf(f, "# This file was created based on your list of games and language settings.\n");
|
|
|
|
fclose(f);
|
2009-10-01 01:10:58 +02:00
|
|
|
/* Closing and reopening because of a write issue we are having right now */
|
2010-09-24 02:48:03 +02:00
|
|
|
f = fopen(tmp, "w");
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (txt == 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
fprintf(f, "# USB Loader Has Saved this file\n");
|
|
|
|
fprintf(f, "# This file was created based on your list of games and language settings.\n\n");
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
fprintf(f, "%.2fGB %s %.2fGB %s\n\n", freespace, tr( "of" ), (freespace + used), tr( "free" ));
|
|
|
|
fprintf(f, "ID Size(GB) Name\n");
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
for (i = 0; i < gameList.size(); i++)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
struct discHdr* header = gameList[i];
|
2010-09-24 02:48:03 +02:00
|
|
|
WBFS_GameSize(header->id, &size);
|
|
|
|
if (i < 500)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
fprintf(f, "%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2], header->id[3], header->id[4],
|
|
|
|
header->id[5]);
|
|
|
|
fprintf(f, " [%.2f] ", size);
|
2010-10-28 11:00:52 +02:00
|
|
|
fprintf(f, " %s", GameTitles.GetTitle(header));
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
fprintf(f, "\n");
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
fprintf(f, "\"ID\",\"Size(GB)\",\"Name\"\n");
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
for (i = 0; i < gameList.size(); i++)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
struct discHdr* header = gameList[i];
|
2010-09-24 02:48:03 +02:00
|
|
|
WBFS_GameSize(header->id, &size);
|
|
|
|
if (i < 500)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
fprintf(f, "\"%c%c%c%c%c%c\",\"%.2f\",\"%s\"\n", header->id[0], header->id[1], header->id[2],
|
2010-10-28 11:00:52 +02:00
|
|
|
header->id[3], header->id[4], header->id[5], size, GameTitles.GetTitle(header));
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
fclose(f);
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-18 13:46:25 +02:00
|
|
|
gameList.FilterList();
|
2010-09-24 02:48:03 +02:00
|
|
|
mainWindow->SetState(STATE_DEFAULT);
|
2009-10-01 01:10:58 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
bool save_XML_URL() // save xml url as as txt file for people without wifi
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2009-10-01 01:10:58 +02:00
|
|
|
char tmp[200];
|
2010-09-24 02:48:03 +02:00
|
|
|
sprintf(tmp, "%s", Settings.update_path);
|
2009-10-01 01:10:58 +02:00
|
|
|
struct stat st;
|
2010-09-24 02:48:03 +02:00
|
|
|
if (stat(tmp, &st) != 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
mkdir(tmp, 0777);
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
|
|
|
FILE *f;
|
2010-09-24 02:48:03 +02:00
|
|
|
sprintf(tmp, "%sWiiTDB_URL.txt", Settings.update_path);
|
|
|
|
f = fopen(tmp, "w");
|
|
|
|
if (!f)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
sleep(1);
|
2009-10-01 01:10:58 +02:00
|
|
|
return false;
|
|
|
|
}
|
2010-09-17 18:15:18 +02:00
|
|
|
|
2010-09-19 01:16:05 +02:00
|
|
|
char XMLurl[3540];
|
2010-09-24 02:48:03 +02:00
|
|
|
build_XML_URL(XMLurl, sizeof(XMLurl));
|
2010-09-17 18:15:18 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
fprintf(f, "# USB Loader Has Saved this file\n");
|
|
|
|
fprintf(f, "# This URL was created based on your list of games and language settings.\n");
|
|
|
|
fclose(f);
|
2009-10-17 22:48:52 +02:00
|
|
|
// Closing and reopening because of a write issue we are having right now
|
2010-09-24 02:48:03 +02:00
|
|
|
f = fopen(tmp, "w");
|
|
|
|
fprintf(f, "# USB Loader Has Saved this file\n");
|
|
|
|
fprintf(f, "# This URL was created based on your list of games and language settings.\n");
|
|
|
|
fprintf(f,
|
|
|
|
"# Copy and paste this URL into your web browser and you should get a zip file that will work for you.\n");
|
|
|
|
fprintf(f, "%s\n\n\n ", XMLurl);
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
fclose(f);
|
2009-10-01 01:10:58 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2010-02-09 11:59:55 +01:00
|
|
|
void MemInfoPrompt()
|
|
|
|
{
|
2010-09-19 01:16:05 +02:00
|
|
|
char meminfotxt[200];
|
2010-09-24 02:48:03 +02:00
|
|
|
strlcpy(meminfotxt, MemInfo(), sizeof(meminfotxt));
|
|
|
|
WindowPrompt(0, meminfotxt, tr( "OK" ));
|
2009-10-01 01:10:58 +02:00
|
|
|
}
|
2009-10-18 23:23:54 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
void build_XML_URL(char *XMLurl, int XMLurlsize)
|
2010-09-18 13:46:25 +02:00
|
|
|
{
|
|
|
|
gameList.LoadUnfiltered();
|
2010-09-19 01:16:05 +02:00
|
|
|
// NET_BUFFER_SIZE in http.c needs to be set to size of XMLurl + headerformat
|
2009-10-18 23:23:54 +02:00
|
|
|
char url[3540];
|
|
|
|
char filename[10];
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(url, sizeof(url), "http://wiitdb.com/wiitdb.zip?LANG=%s&ID=", Settings.db_language);
|
2010-09-18 13:46:25 +02:00
|
|
|
int i;
|
2010-09-24 02:48:03 +02:00
|
|
|
for (i = 0; i < gameList.size(); i++)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-18 13:46:25 +02:00
|
|
|
struct discHdr* header = gameList[i];
|
2010-09-24 02:48:03 +02:00
|
|
|
if (i < 500)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
snprintf(filename, sizeof(filename), "%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2],
|
|
|
|
header->id[3], header->id[4], header->id[5]);
|
|
|
|
strncat(url, filename, 6);
|
|
|
|
if ((i != gameList.size() - 1) && (i < 500)) strncat(url, ",", 1);
|
2009-10-18 23:23:54 +02:00
|
|
|
}
|
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
strlcpy(XMLurl, url, XMLurlsize);
|
2010-09-19 01:16:05 +02:00
|
|
|
gameList.FilterList();
|
2009-10-18 23:23:54 +02:00
|
|
|
}
|