2009-09-27 20:19:53 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* libwiigui
|
|
|
|
*
|
|
|
|
* gui_gameGrid.cpp
|
|
|
|
*
|
|
|
|
* GUI class definitions
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#include "gui.h"
|
*Completely rewrote the asynchron GuiImageData class (problems from switch Carousel<->Grid layour should be fixed now)
*Fixed bug mounting a wbfs partition which was formatted from an ext partition
*Rewrote the parental control feature. Removed loading pin or settings from the Wii Settings. Parental control is now completely managed in the loader from the settings selected and the password set.
*Saving password in config file is now encrypted
*Added loop to wait for usb when reloading the cIOS before game start
The parental control feature is filtering games like following when usb loader is locked:
level 0 (everyone 0+) > shows only games with lvl 0
level 1 (childs 7+) > shows games with lvl 0, 1
level 2 (teens 12+) > shows games with lvl 0, 1, 2
level 3 (mature 16+) > shows games with lvl 0, 1, 2, 3
level 4 (adults only 18+) > shows all games (lvl 0, 1, 2, 3, 4)
level 4 is default when creating new configs
2010-12-19 19:20:33 +01:00
|
|
|
#include "wpad.h"
|
2009-09-27 20:19:53 +02:00
|
|
|
|
|
|
|
#include <unistd.h>
|
|
|
|
#include "gui_gamegrid.h"
|
|
|
|
#include "gui_image_async.h"
|
*Completely rewrote the asynchron GuiImageData class (problems from switch Carousel<->Grid layour should be fixed now)
*Fixed bug mounting a wbfs partition which was formatted from an ext partition
*Rewrote the parental control feature. Removed loading pin or settings from the Wii Settings. Parental control is now completely managed in the loader from the settings selected and the password set.
*Saving password in config file is now encrypted
*Added loop to wait for usb when reloading the cIOS before game start
The parental control feature is filtering games like following when usb loader is locked:
level 0 (everyone 0+) > shows only games with lvl 0
level 1 (childs 7+) > shows games with lvl 0, 1
level 2 (teens 12+) > shows games with lvl 0, 1, 2
level 3 (mature 16+) > shows games with lvl 0, 1, 2, 3
level 4 (adults only 18+) > shows all games (lvl 0, 1, 2, 3, 4)
level 4 is default when creating new configs
2010-12-19 19:20:33 +01:00
|
|
|
#include "libwiigui/LoadCoverImage.h"
|
2010-09-18 13:46:25 +02:00
|
|
|
#include "usbloader/GameList.h"
|
2010-10-28 11:00:52 +02:00
|
|
|
#include "settings/GameTitles.h"
|
*Completely rewrote the asynchron GuiImageData class (problems from switch Carousel<->Grid layour should be fixed now)
*Fixed bug mounting a wbfs partition which was formatted from an ext partition
*Rewrote the parental control feature. Removed loading pin or settings from the Wii Settings. Parental control is now completely managed in the loader from the settings selected and the password set.
*Saving password in config file is now encrypted
*Added loop to wait for usb when reloading the cIOS before game start
The parental control feature is filtering games like following when usb loader is locked:
level 0 (everyone 0+) > shows only games with lvl 0
level 1 (childs 7+) > shows games with lvl 0, 1
level 2 (teens 12+) > shows games with lvl 0, 1, 2
level 3 (mature 16+) > shows games with lvl 0, 1, 2, 3
level 4 (adults only 18+) > shows all games (lvl 0, 1, 2, 3, 4)
level 4 is default when creating new configs
2010-12-19 19:20:33 +01:00
|
|
|
#include "settings/CSettings.h"
|
2010-09-24 19:58:56 +02:00
|
|
|
#include "themes/CTheme.h"
|
*Completely rewrote the asynchron GuiImageData class (problems from switch Carousel<->Grid layour should be fixed now)
*Fixed bug mounting a wbfs partition which was formatted from an ext partition
*Rewrote the parental control feature. Removed loading pin or settings from the Wii Settings. Parental control is now completely managed in the loader from the settings selected and the password set.
*Saving password in config file is now encrypted
*Added loop to wait for usb when reloading the cIOS before game start
The parental control feature is filtering games like following when usb loader is locked:
level 0 (everyone 0+) > shows only games with lvl 0
level 1 (childs 7+) > shows games with lvl 0, 1
level 2 (teens 12+) > shows games with lvl 0, 1, 2
level 3 (mature 16+) > shows games with lvl 0, 1, 2, 3
level 4 (adults only 18+) > shows all games (lvl 0, 1, 2, 3, 4)
level 4 is default when creating new configs
2010-12-19 19:20:33 +01:00
|
|
|
#include "prompts/PromptWindows.h"
|
|
|
|
#include "language/gettext.h"
|
|
|
|
#include "menu.h"
|
2009-09-27 20:19:53 +02:00
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include <math.h>
|
|
|
|
#include <sstream>
|
|
|
|
|
2010-09-19 01:16:05 +02:00
|
|
|
//#define SCALE 0.8f
|
|
|
|
//#define DEG_OFFSET 7
|
|
|
|
#define RADIUS 780
|
|
|
|
//#define IN_SPEED 175
|
|
|
|
//#define SHIFT_SPEED 100
|
|
|
|
//#define SPEED_STEP 4
|
|
|
|
//#define SAFETY 320
|
|
|
|
#define goSteps 10
|
2009-09-27 20:19:53 +02:00
|
|
|
#include "../main.h"
|
|
|
|
|
|
|
|
extern const int vol;
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
static int Skew1[7][8] = { { -14, -66, 14, -34, 14, 34, -14, 66 }, { -10, -44, 10, -26, 10, 26, -10, 44 }, { -6, -22,
|
|
|
|
6, -14, 6, 14, -6, 22 }, { 0, -11, 0, -11, 0, 11, 0, 11 }, { -6, -14, 6, -22, 6, 22, -6, 14 }, { -10, -26, 10,
|
|
|
|
-44, 10, 44, -10, 26 }, { -14, -34, 14, -66, 14, 66, -14, 34 } };
|
|
|
|
static int Pos1[7][2][2] = {
|
|
|
|
// {{16:9 x,y},{ 4:3 x,y}}
|
|
|
|
{ { -230, 74 }, { -320, 74 } }, { { -70, 74 }, { -130, 74 } }, { { 88, 74 }, { 60, 74 } }, { { 239, 74 }, {
|
|
|
|
239, 74 } }, { { 390, 74 }, { 420, 74 } }, { { 550, 74 }, { 612, 74 } }, { { 710, 74 }, { 772, 74 } } };
|
|
|
|
static int Skew2[18][8] = { { -5, -49, 5, -27, 5, 0, -5, 0 }, { -5, 0, 5, 0, 5, 27, -5, 49 },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ -5, -49, 5, -27, 5, 0, -5, 0 }, { -5, 0, 5, 0, 5, 27, -5, 49 },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ -4, -22, 4, -14, 4, 0, -4, 0 }, { -4, 0, 4, 0, 4, 14, -4, 22 },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ 0, -9, 0, -5, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 5, 0, 9 },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0 },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ 0, -5, 0, -9, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 9, 0, 5 },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ -4, -14, 4, -22, 4, 0, -4, 0 }, { -4, 0, 4, 0, 4, 22, -4, 14 },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ -5, -27, 5, -49, 5, 0, -5, 0 }, { -5, 0, 5, 0, 5, 49, -5, 27 },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ -5, -27, 5, -49, 5, 0, -5, 0 }, { -5, 0, 5, 0, 5, 49, -5, 27 } };
|
|
|
|
static int Pos2[18][2][2] = {
|
|
|
|
// {{16:9 x,y},{ 4:3 x,y}}
|
|
|
|
{ { -91, 50 }, { -166, 50 } }, { { -91, 193 }, { -166, 193 } },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ { 3, 50 }, { -54, 50 } }, { { 3, 193 }, { -54, 193 } },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ { 97, 50 }, { 58, 50 } }, { { 97, 193 }, { 58, 193 } },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ { 187, 50 }, { 166, 50 } }, { { 187, 193 }, { 166, 193 } },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ { 272, 50 }, { 272, 50 } }, { { 272, 193 }, { 272, 193 } },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ { 358, 50 }, { 378, 50 } }, { { 358, 193 }, { 378, 193 } },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ { 449, 50 }, { 487, 50 } }, { { 449, 193 }, { 487, 193 } },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ { 545, 50 }, { 599, 50 } }, { { 545, 193 }, { 599, 193 } },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ { 641, 50 }, { 700, 50 } }, { { 641, 193 }, { 700, 193 } } };
|
|
|
|
static int Skew3[45][8] = { { -38, -110, 15, -42, 15, 65, -38, 32 }, { -38, -75, 15, -48, 15, 45, -38, 72 }, { -38,
|
|
|
|
-52, 15, -70, 15, 27, -38, 100 },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ -38, -110, 15, -42, 15, 65, -38, 32 }, { -38, -75, 15, -48, 15, 45, -38, 72 },
|
|
|
|
{ -38, -52, 15, -70, 15, 27, -38, 100 },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ -38, -70, 15, -24, 15, 40, -38, 27 }, { -38, -50, 15, -35, 15, 40, -38, 50 }, { -38, -34, 15, -47, 15, 24,
|
|
|
|
-38, 58 },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ -27, -55, 19, -22, 19, 30, -27, 22 }, { -27, -40, 19, -30, 19, 30, -27, 40 }, { -27, -20, 19, -30, 19, 20,
|
|
|
|
-27, 50 },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ -19, -28, 0, -17, 0, 15, -19, 10 }, { -19, -30, 0, -20, 0, 12, -19, 30 },
|
|
|
|
{ -19, -15, 0, -20, 0, 10, -19, 24 },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ -10, -20, 3, -13, 3, 14, -10, 10 }, { -10, -20, 3, -18, 3, 18, -10, 20 },
|
|
|
|
{ -10, -10, 3, -10, 3, 0, -10, 10 },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ -10, -15, 3, -12, 3, 13, -10, 13 },
|
|
|
|
{ -10, -17, 3, -10, 3, 10, -10, 17 },
|
|
|
|
{ -10, -10, 3, -15, 3, 10, -10, 10 },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ -10, -10, 3, -10, 3, 14, -10, 14 },
|
|
|
|
{ -10, -10, 3, -10, 3, 10, -10, 10 },//middle
|
|
|
|
{ -10, -10, 3, -10, 3, 10, -10, 10 },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ -14, -10, 4, -20, 3, 10, -14, 10 }, { -14, -10, 4, -17, 3, 17, -14, 10 },
|
|
|
|
{ -14, -10, 4, -10, 3, 10, -14, 10 },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ -10, -13, 3, -20, 3, 14, -10, 10 }, { -10, -18, 3, -20, 3, 20, -10, 18 },
|
|
|
|
{ -10, -10, 3, -10, 3, 20, -10, 5 },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ -19, -17, 0, -28, 0, 10, -19, 15 }, { -19, -20, 0, -30, 0, 30, -19, 12 },
|
|
|
|
{ -19, -20, 0, -15, 0, 30, -19, 10 },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ -27, -22, 19, -55, 19, 22, -27, 30 }, { -27, -30, 19, -40, 19, 40, -27, 30 }, { -27, -30, 19, -20, 19, 55,
|
|
|
|
-27, 20 },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ -38, -24, 15, -70, 15, 27, -38, 40 }, { -38, -35, 15, -50, 15, 50, -38, 40 }, { -38, -47, 15, -34, 15, 58,
|
|
|
|
-38, 24 },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ -38, -42, 15, -110, 15, 32, -38, 60 }, { -38, -48, 15, -75, 15, 70, -38, 45 }, { -38, -70, 15, -52, 15, 100,
|
|
|
|
-38, 27 },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ -38, -42, 15, -110, 15, 32, -38, 60 }, { -38, -48, 15, -75, 15, 70, -38, 45 }, { -38, -70, 15, -52, 15, 100,
|
|
|
|
-38, 27 } };
|
|
|
|
static int Pos3[45][2][2] = {
|
|
|
|
// {{16:9 x,y},{ 4:3 x,y}}
|
|
|
|
{ { -42, 49 }, { -91, 49 } }, { { -42, 153 }, { -91, 153 } }, { { -42, 261 }, { -91, 261 } },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ { 13, 58 }, { -29, 58 } }, { { 13, 153 }, { -29, 153 } }, { { 13, 250 }, { -29, 250 } },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ { 68, 67 }, { 33, 67 } }, { { 68, 153 }, { 33, 153 } }, { { 68, 239 }, { 33, 239 } },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ { 120, 74 }, { 92, 74 } }, { { 120, 153 }, { 92, 153 } }, { { 120, 232 }, { 92, 232 } },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ { 170, 78 }, { 149, 78 } }, { { 170, 153 }, { 149, 153 } }, { { 170, 228 }, { 149, 228 } },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ { 214, 80 }, { 200, 80 } }, { { 214, 153 }, { 200, 153 } }, { { 214, 226 }, { 200, 226 } },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ { 258, 81 }, { 251, 81 } }, { { 258, 153 }, { 251, 153 } }, { { 258, 224 }, { 251, 224 } },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ { 302, 81 }, { 302, 81 } }, { { 302, 153 }, { 302, 153 } }, { { 302, 223 }, { 302, 223 } },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ { 346, 81 }, { 353, 81 } }, { { 346, 153 }, { 353, 153 } }, { { 346, 223 }, { 353, 223 } },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ { 390, 80 }, { 404, 80 } }, { { 390, 153 }, { 404, 153 } }, { { 390, 225 }, { 404, 225 } },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ { 434, 77 }, { 457, 77 } }, { { 434, 153 }, { 457, 153 } }, { { 434, 227 }, { 457, 227 } },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ { 484, 73 }, { 512, 73 } }, { { 484, 153 }, { 512, 153 } }, { { 484, 231 }, { 512, 231 } },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ { 537, 67 }, { 572, 67 } }, { { 537, 153 }, { 572, 153 } }, { { 537, 239 }, { 572, 239 } },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ { 591, 58 }, { 633, 58 } }, { { 591, 153 }, { 633, 153 } }, { { 591, 250 }, { 633, 250 } },
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
{ { 660, 58 }, { 660, 58 } }, { { 660, 153 }, { 660, 153 } }, { { 660, 250 }, { 660, 250 } }
|
2010-09-19 01:16:05 +02:00
|
|
|
|
|
|
|
};
|
|
|
|
#define VALUE4ROWS(rows, val1, val2, val3) (rows==3 ? val3 : (rows==2 ? val2 : val1))
|
|
|
|
#define ROWS2PAGESIZE(rows) (rows==3 ? 45 : (rows==2 ? 18 : 7))
|
2010-09-24 02:48:03 +02:00
|
|
|
static inline int OFFSETLIMIT(int Offset, int rows, int gameCnt)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gameCnt += (rows - (gameCnt % rows)) % rows; // add count of skiped Entries at end if List
|
|
|
|
while (Offset > gameCnt)
|
|
|
|
Offset -= gameCnt;
|
|
|
|
while (Offset < 0)
|
|
|
|
Offset += gameCnt;
|
2010-09-19 01:16:05 +02:00
|
|
|
return Offset;
|
|
|
|
}
|
2009-09-27 20:19:53 +02:00
|
|
|
|
|
|
|
// Help-Function to Calc GameIndex
|
2010-09-24 02:48:03 +02:00
|
|
|
static int GetGameIndex(int pageEntry, int rows, int listOffset, int gameCnt)
|
2010-02-09 11:59:55 +01:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
int skip = (rows - (gameCnt % rows)) % rows; // count of skiped Entries at end if List
|
2010-09-19 01:16:05 +02:00
|
|
|
int pagesize = ROWS2PAGESIZE( rows );
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (gameCnt < (pagesize - 2 * rows))
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
int listStart = (pagesize - gameCnt) >> 1; // align list on the center
|
|
|
|
listStart = listStart - (listStart % rows); // align listStart to the top row
|
|
|
|
if (pageEntry < listStart || pageEntry >= listStart + gameCnt) return -1;
|
2010-09-19 01:16:05 +02:00
|
|
|
return pageEntry - listStart;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
listOffset = listOffset - (listOffset % rows); // align listOffset to the top row
|
|
|
|
listOffset = listOffset - 2 * rows; // align listOffset to the left full visible column
|
|
|
|
if (listOffset < 0) listOffset += gameCnt + skip; // set the correct Offset
|
|
|
|
pageEntry = (listOffset + pageEntry) % (gameCnt + skip); // get offset of pageEntry
|
|
|
|
if (pageEntry >= gameCnt) return -1;
|
2010-09-19 01:16:05 +02:00
|
|
|
return pageEntry;
|
|
|
|
}
|
2009-09-27 20:19:53 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
static GuiImageData *GameGridLoadCoverImage(void * Arg)
|
2010-02-09 11:59:55 +01:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
return LoadCoverImage((struct discHdr *) Arg, false, false);
|
2009-09-27 20:19:53 +02:00
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Constructor for the GuiGamegrid class.
|
|
|
|
*/
|
2010-12-12 17:31:13 +01:00
|
|
|
GuiGameGrid::GuiGameGrid(int w, int h, const char *themePath, const u8 *imagebg, int selectedGame) :
|
2010-12-28 18:02:10 +01:00
|
|
|
noCover(Resources::GetFile("nocoverFlat.png"), Resources::GetFileSize("nocoverFlat.png"))
|
2010-02-09 11:59:55 +01:00
|
|
|
{
|
2010-09-19 01:16:05 +02:00
|
|
|
width = w;
|
|
|
|
height = h;
|
2010-12-26 18:02:14 +01:00
|
|
|
theme_posX = thInt("0 - game grid layout pos x");
|
|
|
|
theme_posY = thInt("20 - game grid layout pos y");
|
2010-09-19 01:16:05 +02:00
|
|
|
|
|
|
|
selectable = true;
|
2010-09-24 02:48:03 +02:00
|
|
|
focus = 1; // allow focus
|
*Completely rewrote the asynchron GuiImageData class (problems from switch Carousel<->Grid layour should be fixed now)
*Fixed bug mounting a wbfs partition which was formatted from an ext partition
*Rewrote the parental control feature. Removed loading pin or settings from the Wii Settings. Parental control is now completely managed in the loader from the settings selected and the password set.
*Saving password in config file is now encrypted
*Added loop to wait for usb when reloading the cIOS before game start
The parental control feature is filtering games like following when usb loader is locked:
level 0 (everyone 0+) > shows only games with lvl 0
level 1 (childs 7+) > shows games with lvl 0, 1
level 2 (teens 12+) > shows games with lvl 0, 1, 2
level 3 (mature 16+) > shows games with lvl 0, 1, 2, 3
level 4 (adults only 18+) > shows all games (lvl 0, 1, 2, 3, 4)
level 4 is default when creating new configs
2010-12-19 19:20:33 +01:00
|
|
|
|
2010-09-19 01:16:05 +02:00
|
|
|
trigA = new GuiTrigger;
|
2010-09-24 02:48:03 +02:00
|
|
|
trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
|
2010-09-19 01:16:05 +02:00
|
|
|
trigL = new GuiTrigger;
|
2010-09-24 02:48:03 +02:00
|
|
|
trigL->SetButtonOnlyTrigger(-1, WPAD_BUTTON_LEFT | WPAD_CLASSIC_BUTTON_LEFT, PAD_BUTTON_LEFT);
|
2010-09-19 01:16:05 +02:00
|
|
|
trigR = new GuiTrigger;
|
2010-09-24 02:48:03 +02:00
|
|
|
trigR->SetButtonOnlyTrigger(-1, WPAD_BUTTON_RIGHT | WPAD_CLASSIC_BUTTON_RIGHT, PAD_BUTTON_RIGHT);
|
2010-09-19 01:16:05 +02:00
|
|
|
trig1 = new GuiTrigger;
|
2010-09-24 02:48:03 +02:00
|
|
|
trig1->SetButtonOnlyTrigger(-1, WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_X, PAD_BUTTON_X);
|
2010-09-19 01:16:05 +02:00
|
|
|
trig2 = new GuiTrigger;
|
2010-09-24 02:48:03 +02:00
|
|
|
trig2->SetButtonOnlyTrigger(-1, WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_Y, PAD_BUTTON_Y);
|
2010-09-19 01:16:05 +02:00
|
|
|
trigPlus = new GuiTrigger;
|
2010-09-24 02:48:03 +02:00
|
|
|
trigPlus->SetButtonOnlyTrigger(-1, WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS, 0);
|
2010-09-19 01:16:05 +02:00
|
|
|
trigMinus = new GuiTrigger;
|
2010-09-24 02:48:03 +02:00
|
|
|
trigMinus->SetButtonOnlyTrigger(-1, WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS, 0);
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
int btnHeight = (int) lround(sqrt(RADIUS * RADIUS - 90000) - RADIUS - 50);
|
2010-09-19 01:16:05 +02:00
|
|
|
|
|
|
|
// Button Left
|
2010-09-24 02:48:03 +02:00
|
|
|
btnLeft = new GuiButton(0, 0);
|
|
|
|
btnLeft->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
|
|
|
|
btnLeft->SetPosition(20, btnHeight);
|
|
|
|
btnLeft->SetParent(this);
|
|
|
|
btnLeft->SetSoundOver(btnSoundOver);
|
|
|
|
btnLeft->SetTrigger(trigL);
|
|
|
|
btnLeft->SetTrigger(trigMinus);
|
2010-09-19 01:16:05 +02:00
|
|
|
|
|
|
|
// Button Right
|
2010-09-24 02:48:03 +02:00
|
|
|
btnRight = new GuiButton(0, 0);
|
|
|
|
btnRight->SetParent(this);
|
|
|
|
btnRight->SetAlignment(ALIGN_RIGHT, ALIGN_MIDDLE);
|
|
|
|
btnRight->SetPosition(-20, btnHeight);
|
|
|
|
btnRight->SetSoundOver(btnSoundOver);
|
|
|
|
btnRight->SetTrigger(trigR);
|
|
|
|
btnRight->SetTrigger(trigPlus);
|
2010-09-19 01:16:05 +02:00
|
|
|
|
|
|
|
// Button RowUp
|
2010-09-24 02:48:03 +02:00
|
|
|
btnRowUp = new GuiButton(0, 0);
|
|
|
|
btnRowUp->SetParent(this);
|
|
|
|
btnRowUp->SetAlignment(ALIGN_LEFT, ALIGN_TOP);
|
|
|
|
btnRowUp->SetPosition(0, 0);
|
|
|
|
btnRowUp->SetTrigger(trig2);
|
2010-09-19 01:16:05 +02:00
|
|
|
|
|
|
|
// Button RowDown
|
2010-09-24 02:48:03 +02:00
|
|
|
btnRowDown = new GuiButton(0, 0);
|
|
|
|
btnRowDown->SetParent(this);
|
|
|
|
btnRowDown->SetAlignment(ALIGN_LEFT, ALIGN_TOP);
|
|
|
|
btnRowDown->SetPosition(0, 0);
|
|
|
|
btnRowDown->SetTrigger(trig1);
|
2010-09-19 01:16:05 +02:00
|
|
|
|
|
|
|
// Page-Stuff
|
2010-09-24 02:48:03 +02:00
|
|
|
gameIndex = NULL;
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
Reload(Settings.gridRows, 0);
|
2009-09-27 20:19:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destructor for the GuiGameGrid class.
|
|
|
|
*/
|
2010-02-09 11:59:55 +01:00
|
|
|
GuiGameGrid::~GuiGameGrid()
|
|
|
|
{
|
|
|
|
|
2010-09-19 01:16:05 +02:00
|
|
|
delete btnRight;
|
|
|
|
delete btnLeft;
|
|
|
|
delete btnRowUp;
|
|
|
|
delete btnRowDown;
|
|
|
|
|
|
|
|
delete trigA;
|
|
|
|
delete trigL;
|
|
|
|
delete trigR;
|
|
|
|
delete trigPlus;
|
|
|
|
delete trigMinus;
|
|
|
|
delete trig1;
|
|
|
|
delete trig2;
|
|
|
|
|
*Completely rewrote the asynchron GuiImageData class (problems from switch Carousel<->Grid layour should be fixed now)
*Fixed bug mounting a wbfs partition which was formatted from an ext partition
*Rewrote the parental control feature. Removed loading pin or settings from the Wii Settings. Parental control is now completely managed in the loader from the settings selected and the password set.
*Saving password in config file is now encrypted
*Added loop to wait for usb when reloading the cIOS before game start
The parental control feature is filtering games like following when usb loader is locked:
level 0 (everyone 0+) > shows only games with lvl 0
level 1 (childs 7+) > shows games with lvl 0, 1
level 2 (teens 12+) > shows games with lvl 0, 1, 2
level 3 (mature 16+) > shows games with lvl 0, 1, 2, 3
level 4 (adults only 18+) > shows all games (lvl 0, 1, 2, 3, 4)
level 4 is default when creating new configs
2010-12-19 19:20:33 +01:00
|
|
|
GuiImageAsync::ClearQueue();
|
|
|
|
|
|
|
|
for (u32 i = 0; i < game.size(); ++i)
|
2010-09-19 01:16:05 +02:00
|
|
|
delete game[i];
|
*Completely rewrote the asynchron GuiImageData class (problems from switch Carousel<->Grid layour should be fixed now)
*Fixed bug mounting a wbfs partition which was formatted from an ext partition
*Rewrote the parental control feature. Removed loading pin or settings from the Wii Settings. Parental control is now completely managed in the loader from the settings selected and the password set.
*Saving password in config file is now encrypted
*Added loop to wait for usb when reloading the cIOS before game start
The parental control feature is filtering games like following when usb loader is locked:
level 0 (everyone 0+) > shows only games with lvl 0
level 1 (childs 7+) > shows games with lvl 0, 1
level 2 (teens 12+) > shows games with lvl 0, 1, 2
level 3 (mature 16+) > shows games with lvl 0, 1, 2, 3
level 4 (adults only 18+) > shows all games (lvl 0, 1, 2, 3, 4)
level 4 is default when creating new configs
2010-12-19 19:20:33 +01:00
|
|
|
|
|
|
|
for (u32 i = 0; i < coverImg.size(); ++i)
|
2010-09-19 01:16:05 +02:00
|
|
|
delete coverImg[i];
|
*Completely rewrote the asynchron GuiImageData class (problems from switch Carousel<->Grid layour should be fixed now)
*Fixed bug mounting a wbfs partition which was formatted from an ext partition
*Rewrote the parental control feature. Removed loading pin or settings from the Wii Settings. Parental control is now completely managed in the loader from the settings selected and the password set.
*Saving password in config file is now encrypted
*Added loop to wait for usb when reloading the cIOS before game start
The parental control feature is filtering games like following when usb loader is locked:
level 0 (everyone 0+) > shows only games with lvl 0
level 1 (childs 7+) > shows games with lvl 0, 1
level 2 (teens 12+) > shows games with lvl 0, 1, 2
level 3 (mature 16+) > shows games with lvl 0, 1, 2, 3
level 4 (adults only 18+) > shows all games (lvl 0, 1, 2, 3, 4)
level 4 is default when creating new configs
2010-12-19 19:20:33 +01:00
|
|
|
|
|
|
|
for (u32 i = 0; i < titleTT.size(); ++i)
|
2010-09-19 01:16:05 +02:00
|
|
|
delete titleTT[i];
|
|
|
|
|
*Completely rewrote the asynchron GuiImageData class (problems from switch Carousel<->Grid layour should be fixed now)
*Fixed bug mounting a wbfs partition which was formatted from an ext partition
*Rewrote the parental control feature. Removed loading pin or settings from the Wii Settings. Parental control is now completely managed in the loader from the settings selected and the password set.
*Saving password in config file is now encrypted
*Added loop to wait for usb when reloading the cIOS before game start
The parental control feature is filtering games like following when usb loader is locked:
level 0 (everyone 0+) > shows only games with lvl 0
level 1 (childs 7+) > shows games with lvl 0, 1
level 2 (teens 12+) > shows games with lvl 0, 1, 2
level 3 (mature 16+) > shows games with lvl 0, 1, 2, 3
level 4 (adults only 18+) > shows all games (lvl 0, 1, 2, 3, 4)
level 4 is default when creating new configs
2010-12-19 19:20:33 +01:00
|
|
|
if(gameIndex)
|
|
|
|
delete [] gameIndex;
|
|
|
|
game.clear();
|
|
|
|
coverImg.clear();
|
|
|
|
titleTT.clear();
|
2009-09-27 20:19:53 +02:00
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
void GuiGameGrid::SetFocus(int f)
|
2010-02-09 11:59:55 +01:00
|
|
|
{
|
2010-09-19 01:16:05 +02:00
|
|
|
LOCK( this );
|
2010-09-24 02:48:03 +02:00
|
|
|
if (!gameList.size()) return;
|
2009-09-27 20:19:53 +02:00
|
|
|
|
2010-09-19 01:16:05 +02:00
|
|
|
focus = f;
|
2009-09-27 20:19:53 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
for (int i = 0; i < pagesize; i++)
|
2010-09-19 01:16:05 +02:00
|
|
|
game[i]->ResetState();
|
2009-09-27 20:19:53 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (f == 1 && selectedItem >= 0) game[selectedItem]->SetState(STATE_SELECTED);
|
2009-09-27 20:19:53 +02:00
|
|
|
}
|
|
|
|
|
2010-02-09 11:59:55 +01:00
|
|
|
void GuiGameGrid::ResetState()
|
|
|
|
{
|
2010-09-19 01:16:05 +02:00
|
|
|
LOCK( this );
|
2010-09-24 02:48:03 +02:00
|
|
|
if (state != STATE_DISABLED)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
state = STATE_DEFAULT;
|
|
|
|
stateChan = -1;
|
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
for (int i = 0; i < pagesize; i++)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
game[i]->ResetState();
|
|
|
|
}
|
2009-09-27 20:19:53 +02:00
|
|
|
}
|
|
|
|
|
2010-02-09 11:59:55 +01:00
|
|
|
int GuiGameGrid::GetOffset()
|
|
|
|
{
|
2010-09-19 01:16:05 +02:00
|
|
|
LOCK( this );
|
|
|
|
return listOffset;
|
2009-09-27 20:19:53 +02:00
|
|
|
}
|
|
|
|
|
2010-02-09 11:59:55 +01:00
|
|
|
int GuiGameGrid::GetClickedOption()
|
|
|
|
{
|
2010-09-19 01:16:05 +02:00
|
|
|
LOCK( this );
|
|
|
|
int found = -1;
|
2010-09-24 02:48:03 +02:00
|
|
|
if (clickedItem >= 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
game[clickedItem]->SetState(STATE_SELECTED);
|
2010-09-19 01:16:05 +02:00
|
|
|
found = gameIndex[clickedItem];
|
|
|
|
clickedItem = -1;
|
|
|
|
}
|
|
|
|
return found;
|
2009-09-27 20:19:53 +02:00
|
|
|
}
|
|
|
|
|
2010-02-09 11:59:55 +01:00
|
|
|
int GuiGameGrid::GetSelectedOption()
|
|
|
|
{
|
2010-09-19 01:16:05 +02:00
|
|
|
LOCK( this );
|
|
|
|
int found = -1;
|
2010-09-24 02:48:03 +02:00
|
|
|
for (int i = 0; i < pagesize; i++)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
if (game[i]->GetState() == STATE_SELECTED)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
game[i]->SetState(STATE_SELECTED);
|
2010-09-19 01:16:05 +02:00
|
|
|
found = gameIndex[i];
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return found;
|
2009-09-27 20:19:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Draw the button on screen
|
|
|
|
*/
|
2010-02-09 11:59:55 +01:00
|
|
|
void GuiGameGrid::Draw()
|
|
|
|
{
|
2010-09-19 01:16:05 +02:00
|
|
|
LOCK( this );
|
2010-09-24 02:48:03 +02:00
|
|
|
if (!this->IsVisible() || !gameList.size()) return;
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (goLeft > 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
goLeft--;
|
2010-09-19 22:25:12 +02:00
|
|
|
int wsi = Settings.widescreen ? 0 : 1;
|
2010-09-24 02:48:03 +02:00
|
|
|
float f2 = ((float) goLeft) / goSteps;
|
2010-09-19 01:16:05 +02:00
|
|
|
float f1 = 1.0 - f2;
|
2010-09-24 02:48:03 +02:00
|
|
|
int (*Pos)[2][2] = VALUE4ROWS( rows, Pos1, Pos2, Pos3 );
|
|
|
|
int (*Skew)[8] = VALUE4ROWS( rows, Skew1, Skew2, Skew3 );
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
for (int i = 0; i < pagesize - rows; i++)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-12-26 18:02:14 +01:00
|
|
|
game[i]->SetPosition(Pos[i][wsi][0] * f1 + Pos[i + rows][wsi][0] * f2 + theme_posX, Pos[i][wsi][1]
|
|
|
|
* f1 + Pos[i + rows][wsi][1] * f2 + theme_posY);
|
2010-09-24 02:48:03 +02:00
|
|
|
|
|
|
|
game[i]->SetSkew(Skew[i][0] * f1 + Skew[i + rows][0] * f2, Skew[i][1] * f1 + Skew[i + rows][1] * f2,
|
|
|
|
Skew[i][2] * f1 + Skew[i + rows][2] * f2, Skew[i][3] * f1 + Skew[i + rows][3] * f2, Skew[i][4] * f1
|
|
|
|
+ Skew[i + rows][4] * f2, Skew[i][5] * f1 + Skew[i + rows][5] * f2, Skew[i][6] * f1
|
|
|
|
+ Skew[i + rows][6] * f2, Skew[i][7] * f1 + Skew[i + rows][7] * f2);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (goRight > 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
goRight--;
|
2010-09-19 22:25:12 +02:00
|
|
|
int wsi = Settings.widescreen ? 0 : 1;
|
2010-09-24 02:48:03 +02:00
|
|
|
float f2 = ((float) goRight) / goSteps;
|
2010-09-19 01:16:05 +02:00
|
|
|
float f1 = 1.0 - f2;
|
2010-09-24 02:48:03 +02:00
|
|
|
int (*Pos)[2][2] = VALUE4ROWS( rows, Pos1, Pos2, Pos3 );
|
|
|
|
int (*Skew)[8] = VALUE4ROWS( rows, Skew1, Skew2, Skew3 );
|
|
|
|
for (int i = rows; i < pagesize; i++)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-12-26 18:02:14 +01:00
|
|
|
game[i]->SetPosition(Pos[i][wsi][0] * f1 + Pos[i - rows][wsi][0] * f2 + theme_posX, Pos[i][wsi][1]
|
|
|
|
* f1 + Pos[i - rows][wsi][1] * f2 + theme_posY);
|
2010-09-24 02:48:03 +02:00
|
|
|
|
|
|
|
game[i]->SetSkew(Skew[i][0] * f1 + Skew[i - rows][0] * f2, Skew[i][1] * f1 + Skew[i - rows][1] * f2,
|
|
|
|
Skew[i][2] * f1 + Skew[i - rows][2] * f2, Skew[i][3] * f1 + Skew[i - rows][3] * f2, Skew[i][4] * f1
|
|
|
|
+ Skew[i - rows][4] * f2, Skew[i][5] * f1 + Skew[i - rows][5] * f2, Skew[i][6] * f1
|
|
|
|
+ Skew[i - rows][6] * f2, Skew[i][7] * f1 + Skew[i - rows][7] * f2);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
for (int i = 0; i < pagesize; i++)
|
2010-09-19 01:16:05 +02:00
|
|
|
game[i]->Draw();
|
2010-09-24 02:48:03 +02:00
|
|
|
if (gameList.size() > pagesize - 2 * rows)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
btnRight->Draw();
|
|
|
|
btnLeft->Draw();
|
|
|
|
}
|
|
|
|
|
|
|
|
btnRowUp->Draw();
|
|
|
|
btnRowDown->Draw();
|
|
|
|
|
2010-10-27 16:45:27 +02:00
|
|
|
if (focus && Settings.tooltips == ON) for (int i = 0; i < pagesize; i++)
|
2010-09-24 02:48:03 +02:00
|
|
|
game[i]->DrawTooltip();
|
2010-09-19 01:16:05 +02:00
|
|
|
|
|
|
|
this->UpdateEffects();
|
2009-09-27 20:19:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Change the number of rows
|
|
|
|
*/
|
2010-09-24 02:48:03 +02:00
|
|
|
void GuiGameGrid::ChangeRows(int n)
|
2010-02-09 11:59:55 +01:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
if (n != rows) Reload(n, -1);
|
2009-09-27 20:19:53 +02:00
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
void GuiGameGrid::Update(GuiTrigger * t)
|
2010-02-09 11:59:55 +01:00
|
|
|
{
|
2010-09-19 01:16:05 +02:00
|
|
|
LOCK( this );
|
2010-09-24 02:48:03 +02:00
|
|
|
if (state == STATE_DISABLED || !t || !gameList.size()) return;
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (!(game[0]->GetEffect() || game[0]->GetEffectOnOver()))
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
for (int i = 0; i < pagesize; i++)
|
2010-09-19 01:16:05 +02:00
|
|
|
game[i]->SetEffectGrow();
|
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
btnRight->Update(t);
|
|
|
|
btnLeft->Update(t);
|
|
|
|
btnRowUp->Update(t);
|
|
|
|
btnRowDown->Update(t);
|
2010-09-19 01:16:05 +02:00
|
|
|
|
|
|
|
selectedItem = -1;
|
|
|
|
clickedItem = -1;
|
2010-09-24 02:48:03 +02:00
|
|
|
for (int i = 0; i < pagesize; i++)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
game[i]->Update(t);
|
|
|
|
if (game[i]->GetState() == STATE_SELECTED)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
selectedItem = i;
|
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (game[i]->GetState() == STATE_CLICKED)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
clickedItem = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
// navigation
|
2010-09-24 02:48:03 +02:00
|
|
|
if (focus && gameList.size() >= (pagesize - 2 * rows) && goLeft == 0 && goRight == 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
// Left/Right Navigation
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (btnLeft->GetState() == STATE_CLICKED)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
*Completely rewrote the asynchron GuiImageData class (problems from switch Carousel<->Grid layour should be fixed now)
*Fixed bug mounting a wbfs partition which was formatted from an ext partition
*Rewrote the parental control feature. Removed loading pin or settings from the Wii Settings. Parental control is now completely managed in the loader from the settings selected and the password set.
*Saving password in config file is now encrypted
*Added loop to wait for usb when reloading the cIOS before game start
The parental control feature is filtering games like following when usb loader is locked:
level 0 (everyone 0+) > shows only games with lvl 0
level 1 (childs 7+) > shows games with lvl 0, 1
level 2 (teens 12+) > shows games with lvl 0, 1, 2
level 3 (mature 16+) > shows games with lvl 0, 1, 2, 3
level 4 (adults only 18+) > shows all games (lvl 0, 1, 2, 3, 4)
level 4 is default when creating new configs
2010-12-19 19:20:33 +01:00
|
|
|
u32 buttons = t->wpad.btns_h;
|
2010-09-24 02:48:03 +02:00
|
|
|
if (!((buttons & WPAD_BUTTON_A) || (buttons & WPAD_BUTTON_MINUS) || t->Left()))
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
btnLeft->ResetState();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.xflip == XFLIP_SYSMENU || Settings.xflip == XFLIP_YES || Settings.xflip == XFLIP_DISK3D)
|
2010-09-19 01:16:05 +02:00
|
|
|
goRight = goSteps;
|
2010-09-24 02:48:03 +02:00
|
|
|
else goLeft = goSteps;
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (btnRight->GetState() == STATE_CLICKED)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
*Completely rewrote the asynchron GuiImageData class (problems from switch Carousel<->Grid layour should be fixed now)
*Fixed bug mounting a wbfs partition which was formatted from an ext partition
*Rewrote the parental control feature. Removed loading pin or settings from the Wii Settings. Parental control is now completely managed in the loader from the settings selected and the password set.
*Saving password in config file is now encrypted
*Added loop to wait for usb when reloading the cIOS before game start
The parental control feature is filtering games like following when usb loader is locked:
level 0 (everyone 0+) > shows only games with lvl 0
level 1 (childs 7+) > shows games with lvl 0, 1
level 2 (teens 12+) > shows games with lvl 0, 1, 2
level 3 (mature 16+) > shows games with lvl 0, 1, 2, 3
level 4 (adults only 18+) > shows all games (lvl 0, 1, 2, 3, 4)
level 4 is default when creating new configs
2010-12-19 19:20:33 +01:00
|
|
|
u32 buttons = t->wpad.btns_h;
|
2010-09-24 02:48:03 +02:00
|
|
|
if (!((buttons & WPAD_BUTTON_A) || (buttons & WPAD_BUTTON_PLUS) || t->Right()))
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
btnRight->ResetState();
|
|
|
|
return;
|
|
|
|
}
|
2010-10-27 16:45:27 +02:00
|
|
|
if (Settings.xflip == XFLIP_SYSMENU || Settings.xflip == XFLIP_YES || Settings.xflip == XFLIP_DISK3D)
|
2010-09-24 02:48:03 +02:00
|
|
|
goLeft = goSteps;
|
|
|
|
else goRight = goSteps;
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (goLeft == goSteps)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
GuiButton *tmpButton[rows];
|
|
|
|
GuiTooltip *tmpTooltip[rows];
|
2010-09-24 02:48:03 +02:00
|
|
|
listOffset = OFFSETLIMIT(listOffset + rows, rows, gameList.size()); // set the new listOffset
|
2010-09-19 01:16:05 +02:00
|
|
|
// Save left Tooltip & Button and destroy left Image + Image-Data
|
2010-09-24 02:48:03 +02:00
|
|
|
for (int i = 0; i < rows; i++)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
delete coverImg[i];
|
|
|
|
coverImg[i] = NULL;
|
|
|
|
game[i]->SetImage(NULL);
|
|
|
|
tmpTooltip[i] = titleTT[i];
|
|
|
|
tmpButton[i] = game[i];
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
// Move all Page-Entries one step left
|
2010-09-24 02:48:03 +02:00
|
|
|
for (int i = 0; i < (pagesize - rows); i++)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
titleTT[i] = titleTT[i + rows];
|
|
|
|
coverImg[i] = coverImg[i + rows];
|
|
|
|
game[i] = game[i + rows];
|
|
|
|
gameIndex[i] = gameIndex[i + rows];
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
// set saved Tooltip, Button & gameIndex to right
|
2010-09-19 22:25:12 +02:00
|
|
|
int wsi = Settings.widescreen ? 0 : 1;
|
2010-09-24 02:48:03 +02:00
|
|
|
int (*Pos)[2][2] = VALUE4ROWS( rows, Pos1, Pos2, Pos3 );
|
|
|
|
int (*Skew)[8] = VALUE4ROWS( rows, Skew1, Skew2, Skew3 );
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
for (int i = 0; i < rows; i++)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
int ii = i + pagesize - rows;
|
2010-09-24 02:48:03 +02:00
|
|
|
gameIndex[ii] = GetGameIndex(ii, rows, listOffset, gameList.size());
|
|
|
|
titleTT[ii] = tmpTooltip[i];
|
|
|
|
coverImg[ii] = NULL;
|
|
|
|
if (gameIndex[ii] != -1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
coverImg[ii] = new GuiImageAsync(GameGridLoadCoverImage, gameList[gameIndex[ii]],
|
|
|
|
sizeof(struct discHdr), &noCover);
|
|
|
|
if (coverImg[ii])
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
coverImg[ii] ->SetWidescreen(Settings.widescreen);
|
|
|
|
coverImg[ii] ->SetScale(VALUE4ROWS( rows, 1.0, 0.6, 0.26 ));
|
|
|
|
coverImg[ii] ->SetPosition(0, VALUE4ROWS( rows, 0, -50, -80 ));
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-10-28 11:00:52 +02:00
|
|
|
titleTT[ii] ->SetText(GameTitles.GetTitle(gameList[gameIndex[ii]]));
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
titleTT[ii] ->SetText(NULL);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
game[ii] = tmpButton[i];
|
|
|
|
game[ii] ->SetImage(coverImg[ii]);
|
|
|
|
game[ii] ->SetPosition(Pos[ii][wsi][0], Pos[ii][wsi][1]);
|
|
|
|
game[ii] ->SetSkew(&Skew[ii][0]);
|
|
|
|
game[ii] ->RemoveToolTip();
|
|
|
|
if (gameIndex[ii] != -1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
game[ii] ->SetClickable(true);
|
|
|
|
game[ii] ->SetVisible(true);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
game[ii] ->SetVisible(false);
|
|
|
|
game[ii] ->SetClickable(false);
|
|
|
|
game[ii] ->RemoveSoundOver();
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// Set Tooltip-Position
|
2010-09-19 22:25:12 +02:00
|
|
|
int ttoffset_x = Settings.widescreen ? VALUE4ROWS( rows, 70, 35, 0 ) : VALUE4ROWS( rows, 150, 55, 25 );
|
2010-09-19 01:16:05 +02:00
|
|
|
int ttoffset_y = -VALUE4ROWS( rows, 224, 133, 68 ) / 4;
|
2010-09-24 02:48:03 +02:00
|
|
|
for (int i = 0; i < pagesize; i++)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
switch ((i * 3) / pagesize)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
case 0:
|
2010-09-24 02:48:03 +02:00
|
|
|
game[i]->SetToolTip(titleTT[i], ttoffset_x, ttoffset_y, ALIGN_LEFT, ALIGN_MIDDLE);
|
2010-09-19 01:16:05 +02:00
|
|
|
break;
|
|
|
|
case 1:
|
2010-09-24 02:48:03 +02:00
|
|
|
game[i]->SetToolTip(titleTT[i], 0, ttoffset_y, ALIGN_CENTRE, ALIGN_MIDDLE);
|
2010-09-19 01:16:05 +02:00
|
|
|
break;
|
|
|
|
case 2:
|
2010-09-24 02:48:03 +02:00
|
|
|
game[i]->SetToolTip(titleTT[i], -ttoffset_x, ttoffset_y, ALIGN_RIGHT, ALIGN_MIDDLE);
|
2010-09-19 01:16:05 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
else if (goRight == goSteps)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
GuiButton *tmpButton[rows];
|
|
|
|
GuiTooltip *tmpTooltip[rows];
|
2010-09-24 02:48:03 +02:00
|
|
|
listOffset = OFFSETLIMIT(listOffset - rows, rows, gameList.size()); // set the new listOffset
|
2010-09-19 01:16:05 +02:00
|
|
|
// Save right Button & Tooltip and destroy right Image-Data
|
2010-09-24 02:48:03 +02:00
|
|
|
for (int i = 0; i < rows; i++)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
int ii = i + pagesize - rows;
|
2010-09-24 02:48:03 +02:00
|
|
|
delete coverImg[ii];
|
|
|
|
coverImg[ii] = NULL;
|
|
|
|
game[ii]->SetImage(NULL);
|
|
|
|
tmpTooltip[i] = titleTT[ii];
|
|
|
|
tmpButton[i] = game[ii];
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
// Move all Page-Entries one step right
|
2010-09-24 02:48:03 +02:00
|
|
|
for (int i = pagesize - 1; i >= rows; i--)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
titleTT[i] = titleTT[i - rows];
|
|
|
|
coverImg[i] = coverImg[i - rows];
|
|
|
|
game[i] = game[i - rows];
|
|
|
|
gameIndex[i] = gameIndex[i - rows];
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
// set saved Image, Button & gameIndex to left
|
2010-09-19 22:25:12 +02:00
|
|
|
int wsi = Settings.widescreen ? 0 : 1;
|
2010-09-24 02:48:03 +02:00
|
|
|
int (*Pos)[2][2] = VALUE4ROWS( rows, Pos1, Pos2, Pos3 );
|
|
|
|
int (*Skew)[8] = VALUE4ROWS( rows, Skew1, Skew2, Skew3 );
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
for (int i = 0; i < rows; i++)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
gameIndex[i] = GetGameIndex(i, rows, listOffset, gameList.size());
|
|
|
|
titleTT[i] = tmpTooltip[i];
|
|
|
|
coverImg[i] = NULL;
|
|
|
|
if (gameIndex[i] != -1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
coverImg[i] = new GuiImageAsync(GameGridLoadCoverImage, gameList[gameIndex[i]],
|
|
|
|
sizeof(struct discHdr), &noCover);
|
|
|
|
if (coverImg[i])
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
coverImg[i] ->SetWidescreen(Settings.widescreen);
|
|
|
|
coverImg[i] ->SetScale(VALUE4ROWS( rows, 1.0, 0.6, 0.26 ));
|
|
|
|
coverImg[i] ->SetPosition(0, VALUE4ROWS( rows, 0, -50, -80 ));
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-10-28 11:00:52 +02:00
|
|
|
titleTT[i] ->SetText(GameTitles.GetTitle(gameList[gameIndex[i]]));
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
titleTT[i] ->SetText(NULL);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
game[i] = tmpButton[i];
|
|
|
|
game[i] ->SetImage(coverImg[i]);
|
|
|
|
game[i] ->SetPosition(Pos[i][wsi][0], Pos[i][wsi][1]);
|
|
|
|
game[i] ->SetSkew(&Skew[i][0]);
|
|
|
|
game[i] ->RemoveToolTip();
|
|
|
|
if (gameIndex[i] != -1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
game[i] ->SetClickable(true);
|
|
|
|
game[i] ->SetVisible(true);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
game[i] ->SetVisible(false);
|
|
|
|
game[i] ->SetClickable(false);
|
|
|
|
game[i] ->RemoveSoundOver();
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// Set Tooltip-Position
|
2010-09-19 22:25:12 +02:00
|
|
|
int ttoffset_x = Settings.widescreen ? VALUE4ROWS( rows, 70, 35, 0 ) : VALUE4ROWS( rows, 150, 55, 25 );
|
2010-09-19 01:16:05 +02:00
|
|
|
int ttoffset_y = -VALUE4ROWS( rows, 224, 133, 68 ) / 4;
|
2010-09-24 02:48:03 +02:00
|
|
|
for (int i = 0; i < pagesize; i++)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
switch ((i * 3) / pagesize)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
case 0:
|
2010-09-24 02:48:03 +02:00
|
|
|
game[i]->SetToolTip(titleTT[i], ttoffset_x, ttoffset_y, ALIGN_LEFT, ALIGN_MIDDLE);
|
2010-09-19 01:16:05 +02:00
|
|
|
break;
|
|
|
|
case 1:
|
2010-09-24 02:48:03 +02:00
|
|
|
game[i]->SetToolTip(titleTT[i], 0, ttoffset_y, ALIGN_CENTRE, ALIGN_MIDDLE);
|
2010-09-19 01:16:05 +02:00
|
|
|
break;
|
|
|
|
case 2:
|
2010-09-24 02:48:03 +02:00
|
|
|
game[i]->SetToolTip(titleTT[i], -ttoffset_x, ttoffset_y, ALIGN_RIGHT, ALIGN_MIDDLE);
|
2010-09-19 01:16:05 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if ((btnRowUp->GetState() == STATE_CLICKED))
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
if ((rows == 1) && (gameList.size() >= 18))
|
|
|
|
this->ChangeRows(2);
|
|
|
|
else if ((rows == 2) && (gameList.size() >= 45)) this->ChangeRows(3);
|
2010-09-19 01:16:05 +02:00
|
|
|
btnRowUp->ResetState();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if ((btnRowDown->GetState() == STATE_CLICKED))
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
if (rows == 3)
|
|
|
|
this->ChangeRows(2);
|
|
|
|
else if (rows == 2) this->ChangeRows(1);
|
2010-09-19 01:16:05 +02:00
|
|
|
btnRowDown->ResetState();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (updateCB) updateCB(this);
|
2009-09-27 20:19:53 +02:00
|
|
|
}
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
void GuiGameGrid::Reload(int Rows, int ListOffset)
|
2010-02-09 11:59:55 +01:00
|
|
|
{
|
2010-09-19 01:16:05 +02:00
|
|
|
LOCK( this );
|
|
|
|
|
*Completely rewrote the asynchron GuiImageData class (problems from switch Carousel<->Grid layour should be fixed now)
*Fixed bug mounting a wbfs partition which was formatted from an ext partition
*Rewrote the parental control feature. Removed loading pin or settings from the Wii Settings. Parental control is now completely managed in the loader from the settings selected and the password set.
*Saving password in config file is now encrypted
*Added loop to wait for usb when reloading the cIOS before game start
The parental control feature is filtering games like following when usb loader is locked:
level 0 (everyone 0+) > shows only games with lvl 0
level 1 (childs 7+) > shows games with lvl 0, 1
level 2 (teens 12+) > shows games with lvl 0, 1, 2
level 3 (mature 16+) > shows games with lvl 0, 1, 2, 3
level 4 (adults only 18+) > shows all games (lvl 0, 1, 2, 3, 4)
level 4 is default when creating new configs
2010-12-19 19:20:33 +01:00
|
|
|
//Prevent to wait before all images are loaded before we can delete them
|
|
|
|
GuiImageAsync::ClearQueue();
|
|
|
|
|
2010-09-19 01:16:05 +02:00
|
|
|
// CleanUp
|
*Completely rewrote the asynchron GuiImageData class (problems from switch Carousel<->Grid layour should be fixed now)
*Fixed bug mounting a wbfs partition which was formatted from an ext partition
*Rewrote the parental control feature. Removed loading pin or settings from the Wii Settings. Parental control is now completely managed in the loader from the settings selected and the password set.
*Saving password in config file is now encrypted
*Added loop to wait for usb when reloading the cIOS before game start
The parental control feature is filtering games like following when usb loader is locked:
level 0 (everyone 0+) > shows only games with lvl 0
level 1 (childs 7+) > shows games with lvl 0, 1
level 2 (teens 12+) > shows games with lvl 0, 1, 2
level 3 (mature 16+) > shows games with lvl 0, 1, 2, 3
level 4 (adults only 18+) > shows all games (lvl 0, 1, 2, 3, 4)
level 4 is default when creating new configs
2010-12-19 19:20:33 +01:00
|
|
|
for (u32 i = 0; i < game.size(); ++i)
|
2010-09-24 02:48:03 +02:00
|
|
|
delete game[i];
|
2010-09-19 01:16:05 +02:00
|
|
|
|
*Completely rewrote the asynchron GuiImageData class (problems from switch Carousel<->Grid layour should be fixed now)
*Fixed bug mounting a wbfs partition which was formatted from an ext partition
*Rewrote the parental control feature. Removed loading pin or settings from the Wii Settings. Parental control is now completely managed in the loader from the settings selected and the password set.
*Saving password in config file is now encrypted
*Added loop to wait for usb when reloading the cIOS before game start
The parental control feature is filtering games like following when usb loader is locked:
level 0 (everyone 0+) > shows only games with lvl 0
level 1 (childs 7+) > shows games with lvl 0, 1
level 2 (teens 12+) > shows games with lvl 0, 1, 2
level 3 (mature 16+) > shows games with lvl 0, 1, 2, 3
level 4 (adults only 18+) > shows all games (lvl 0, 1, 2, 3, 4)
level 4 is default when creating new configs
2010-12-19 19:20:33 +01:00
|
|
|
for (u32 i = 0; i < coverImg.size(); ++i)
|
2010-09-24 02:48:03 +02:00
|
|
|
delete coverImg[i];
|
2010-09-19 01:16:05 +02:00
|
|
|
|
*Completely rewrote the asynchron GuiImageData class (problems from switch Carousel<->Grid layour should be fixed now)
*Fixed bug mounting a wbfs partition which was formatted from an ext partition
*Rewrote the parental control feature. Removed loading pin or settings from the Wii Settings. Parental control is now completely managed in the loader from the settings selected and the password set.
*Saving password in config file is now encrypted
*Added loop to wait for usb when reloading the cIOS before game start
The parental control feature is filtering games like following when usb loader is locked:
level 0 (everyone 0+) > shows only games with lvl 0
level 1 (childs 7+) > shows games with lvl 0, 1
level 2 (teens 12+) > shows games with lvl 0, 1, 2
level 3 (mature 16+) > shows games with lvl 0, 1, 2, 3
level 4 (adults only 18+) > shows all games (lvl 0, 1, 2, 3, 4)
level 4 is default when creating new configs
2010-12-19 19:20:33 +01:00
|
|
|
for (u32 i = 0; i < titleTT.size(); ++i)
|
2010-09-24 02:48:03 +02:00
|
|
|
delete titleTT[i];
|
2010-09-19 01:16:05 +02:00
|
|
|
|
*Completely rewrote the asynchron GuiImageData class (problems from switch Carousel<->Grid layour should be fixed now)
*Fixed bug mounting a wbfs partition which was formatted from an ext partition
*Rewrote the parental control feature. Removed loading pin or settings from the Wii Settings. Parental control is now completely managed in the loader from the settings selected and the password set.
*Saving password in config file is now encrypted
*Added loop to wait for usb when reloading the cIOS before game start
The parental control feature is filtering games like following when usb loader is locked:
level 0 (everyone 0+) > shows only games with lvl 0
level 1 (childs 7+) > shows games with lvl 0, 1
level 2 (teens 12+) > shows games with lvl 0, 1, 2
level 3 (mature 16+) > shows games with lvl 0, 1, 2, 3
level 4 (adults only 18+) > shows all games (lvl 0, 1, 2, 3, 4)
level 4 is default when creating new configs
2010-12-19 19:20:33 +01:00
|
|
|
if(gameIndex)
|
|
|
|
delete [] gameIndex;
|
|
|
|
game.clear();
|
|
|
|
coverImg.clear();
|
|
|
|
titleTT.clear();
|
2010-09-19 01:16:05 +02:00
|
|
|
|
|
|
|
goLeft = 0;
|
|
|
|
goRight = 0;
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
rows = Rows > 3 ? 3 : (Rows < 1 ? 1 : Rows);
|
|
|
|
if ((gameList.size() < 45) && (rows == 3)) rows = 2;
|
|
|
|
if ((gameList.size() < 18) && (rows == 2)) rows = 1;
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
if (ListOffset >= 0) // if ListOffset < 0 then no change
|
|
|
|
listOffset = ListOffset;
|
|
|
|
listOffset = OFFSETLIMIT(listOffset, rows, gameList.size());
|
2010-09-19 01:16:05 +02:00
|
|
|
|
|
|
|
selectedItem = -1;
|
|
|
|
clickedItem = -1;
|
|
|
|
|
|
|
|
pagesize = ROWS2PAGESIZE( rows );
|
|
|
|
|
|
|
|
// Page-Stuff
|
2010-09-24 02:48:03 +02:00
|
|
|
gameIndex = new int[pagesize];
|
*Completely rewrote the asynchron GuiImageData class (problems from switch Carousel<->Grid layour should be fixed now)
*Fixed bug mounting a wbfs partition which was formatted from an ext partition
*Rewrote the parental control feature. Removed loading pin or settings from the Wii Settings. Parental control is now completely managed in the loader from the settings selected and the password set.
*Saving password in config file is now encrypted
*Added loop to wait for usb when reloading the cIOS before game start
The parental control feature is filtering games like following when usb loader is locked:
level 0 (everyone 0+) > shows only games with lvl 0
level 1 (childs 7+) > shows games with lvl 0, 1
level 2 (teens 12+) > shows games with lvl 0, 1, 2
level 3 (mature 16+) > shows games with lvl 0, 1, 2, 3
level 4 (adults only 18+) > shows all games (lvl 0, 1, 2, 3, 4)
level 4 is default when creating new configs
2010-12-19 19:20:33 +01:00
|
|
|
titleTT.resize(pagesize);
|
|
|
|
coverImg.resize(pagesize);
|
|
|
|
game.resize(pagesize);
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-19 22:25:12 +02:00
|
|
|
int wsi = Settings.widescreen ? 0 : 1;
|
2010-09-24 02:48:03 +02:00
|
|
|
int (*Pos)[2][2] = VALUE4ROWS( rows, Pos1, Pos2, Pos3 );
|
|
|
|
int (*Skew)[8] = VALUE4ROWS( rows, Skew1, Skew2, Skew3 );
|
2010-09-19 01:16:05 +02:00
|
|
|
|
2010-09-19 22:25:12 +02:00
|
|
|
int ttoffset_x = Settings.widescreen ? VALUE4ROWS( rows, 70, 35, 0 ) : VALUE4ROWS( rows, 150, 55, 25 );
|
2010-09-19 01:16:05 +02:00
|
|
|
int ttoffset_y = -VALUE4ROWS( rows, 224, 133, 68 ) / 4;
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
for (int i = 0; i < pagesize; i++)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
//------------------------
|
|
|
|
// Index
|
|
|
|
//------------------------
|
2010-09-24 02:48:03 +02:00
|
|
|
gameIndex[i] = GetGameIndex(i, rows, listOffset, gameList.size());
|
2010-09-19 01:16:05 +02:00
|
|
|
|
|
|
|
//------------------------
|
|
|
|
// Tooltip
|
|
|
|
//------------------------
|
2010-09-24 02:48:03 +02:00
|
|
|
if (gameIndex[i] != -1)
|
2010-12-26 18:02:14 +01:00
|
|
|
titleTT[i] = new GuiTooltip(GameTitles.GetTitle(gameList[gameIndex[i]]), thInt("255 - tooltip alpha"));
|
|
|
|
else
|
|
|
|
titleTT[i] = new GuiTooltip(NULL, thInt("255 - tooltip alpha"));
|
2010-09-19 01:16:05 +02:00
|
|
|
|
|
|
|
//------------------------
|
|
|
|
// ImageData
|
|
|
|
//------------------------
|
2010-09-24 02:48:03 +02:00
|
|
|
// if( gameIndex[i] != -1 )
|
|
|
|
// cover[i] = LoadCoverImage(&gameList[gameIndex[i]], false /*bool Prefere3D*/);
|
|
|
|
// else
|
|
|
|
// cover[i] = new GuiImageData(NULL);
|
2010-09-19 01:16:05 +02:00
|
|
|
|
|
|
|
//------------------------
|
|
|
|
// Image
|
|
|
|
//------------------------
|
|
|
|
coverImg[i] = NULL;
|
2010-09-24 02:48:03 +02:00
|
|
|
if (gameIndex[i] != -1)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
*Completely rewrote the asynchron GuiImageData class (problems from switch Carousel<->Grid layour should be fixed now)
*Fixed bug mounting a wbfs partition which was formatted from an ext partition
*Rewrote the parental control feature. Removed loading pin or settings from the Wii Settings. Parental control is now completely managed in the loader from the settings selected and the password set.
*Saving password in config file is now encrypted
*Added loop to wait for usb when reloading the cIOS before game start
The parental control feature is filtering games like following when usb loader is locked:
level 0 (everyone 0+) > shows only games with lvl 0
level 1 (childs 7+) > shows games with lvl 0, 1
level 2 (teens 12+) > shows games with lvl 0, 1, 2
level 3 (mature 16+) > shows games with lvl 0, 1, 2, 3
level 4 (adults only 18+) > shows all games (lvl 0, 1, 2, 3, 4)
level 4 is default when creating new configs
2010-12-19 19:20:33 +01:00
|
|
|
coverImg[i] = new GuiImageAsync(GameGridLoadCoverImage, gameList[gameIndex[i]], sizeof(struct discHdr), &noCover);
|
2010-09-24 02:48:03 +02:00
|
|
|
if (coverImg[i])
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
coverImg[i]->SetWidescreen(Settings.widescreen);
|
2010-09-19 01:16:05 +02:00
|
|
|
// if ( rows == 2 ) coverImg[i]->SetScale(.6); //these are the numbers for 2 rows
|
|
|
|
// else if ( rows == 3 ) coverImg[i]->SetScale(.26); //these are the numbers for 3 rows
|
2010-09-24 02:48:03 +02:00
|
|
|
coverImg[i]->SetScale(VALUE4ROWS( rows, 1.0, 0.6, 0.26 ));
|
|
|
|
coverImg[i]->SetPosition(0, VALUE4ROWS( rows, 0, -50, -80 ));
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------
|
|
|
|
// GameButton
|
|
|
|
//------------------------
|
2010-09-24 02:48:03 +02:00
|
|
|
game[i] = new GuiButton(VALUE4ROWS( rows, 160, 75, 35 ), VALUE4ROWS( rows, 224, 133, 68 ));
|
|
|
|
game[i]->SetParent(this);
|
|
|
|
game[i]->SetImage(coverImg[i]);
|
|
|
|
game[i]->SetAlignment(ALIGN_TOP, ALIGN_LEFT);
|
2010-12-26 18:02:14 +01:00
|
|
|
game[i]->SetPosition(Pos[i][wsi][0] + theme_posX, Pos[i][wsi][1] + theme_posY);
|
2010-09-24 02:48:03 +02:00
|
|
|
game[i]->SetSkew(&Skew[i][0]);
|
|
|
|
game[i]->SetTrigger(trigA);
|
|
|
|
game[i]->SetSoundOver(btnSoundOver);
|
|
|
|
game[i]->SetSoundClick(btnSoundClick);
|
|
|
|
game[i]->SetRumble(false);
|
|
|
|
switch ((i * 3) / pagesize)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
|
|
|
case 0:
|
2010-09-24 02:48:03 +02:00
|
|
|
game[i]->SetToolTip(titleTT[i], ttoffset_x, ttoffset_y, ALIGN_LEFT, ALIGN_MIDDLE);
|
2010-09-19 01:16:05 +02:00
|
|
|
break;
|
|
|
|
case 1:
|
2010-09-24 02:48:03 +02:00
|
|
|
game[i]->SetToolTip(titleTT[i], 0, ttoffset_y, ALIGN_CENTRE, ALIGN_MIDDLE);
|
2010-09-19 01:16:05 +02:00
|
|
|
break;
|
|
|
|
case 2:
|
2010-09-24 02:48:03 +02:00
|
|
|
game[i]->SetToolTip(titleTT[i], -ttoffset_x, ttoffset_y, ALIGN_RIGHT, ALIGN_MIDDLE);
|
2010-09-19 01:16:05 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2010-09-24 02:48:03 +02:00
|
|
|
if (gameIndex[i] >= 0)
|
2010-09-19 01:16:05 +02:00
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
game[i]->SetClickable(true);
|
|
|
|
game[i]->SetVisible(true);
|
2010-09-19 01:16:05 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-09-24 02:48:03 +02:00
|
|
|
game[i]->SetVisible(false);
|
|
|
|
game[i]->SetClickable(false);
|
2010-09-19 01:16:05 +02:00
|
|
|
// game[i]->RemoveSoundOver();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Settings.gridRows = rows;
|
2009-09-27 20:19:53 +02:00
|
|
|
}
|
|
|
|
|