*several code optimizations

*added saving of game browser position (on all modes)
*several cleanups and small fixes
*added a "Block Category Menu" setting
*fixed bug with parental block and game settings (thanks NJ7 for finding it)
*fixed "All" not being translated in category menu
This commit is contained in:
dimok321 2011-06-24 19:11:36 +00:00
parent a3495651f0
commit 0f4eb6b209
102 changed files with 563 additions and 557 deletions

View File

@ -2,8 +2,8 @@
<app version="1">
<name> USB Loader GX</name>
<coder>USB Loader GX Team</coder>
<version>2.1 r1093</version>
<release_date>201106221731</release_date>
<version>2.1 r1094</version>
<release_date>201106221757</release_date>
<no_ios_reload/>
<short_description>Loads games from USB-devices</short_description>
<long_description>USB Loader GX is a libwiigui based USB iso loader with a wii-like GUI. You can install games to your HDDs and boot them with shorter loading times.

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-06-22 19:31+0200\n"
"POT-Creation-Date: 2011-06-24 21:05+0200\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: David Jelinek (djelinek@hotmail.com) e->e,r->r,u->u, c->c \n"
"Language-Team: r1056 - last version on http://djelinek.sweb.cz/_USBLoderGX/czech.lang \n"
@ -198,6 +198,9 @@ msgstr "Hudba na pozadí"
msgid "Big thanks to:"
msgstr "Velké díky pro:"
msgid "Block Categories Menu"
msgstr ""
msgid "Block Categories Modify"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-06-22 19:31+0200\n"
"POT-Creation-Date: 2011-06-24 21:05+0200\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: Fox888[dk]\n"
"Language-Team: [dk]\n"
@ -198,6 +198,9 @@ msgstr "Baggrundsmusik"
msgid "Big thanks to:"
msgstr "En stor tak til:"
msgid "Block Categories Menu"
msgstr ""
msgid "Block Categories Modify"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-06-22 19:31+0200\n"
"POT-Creation-Date: 2011-06-24 21:05+0200\n"
"PO-Revision-Date: 2011-06-20 07:25+0100\n"
"Last-Translator: glowy\n"
"Language-Team: tj_cool, glowy\n"
@ -198,6 +198,9 @@ msgstr "Achtergrondmuziek"
msgid "Big thanks to:"
msgstr "Grote dank aan:"
msgid "Block Categories Menu"
msgstr ""
msgid "Block Categories Modify"
msgstr "Blokkeer categorieën wijzigen"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-06-22 19:31+0200\n"
"POT-Creation-Date: 2011-06-24 21:05+0200\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -198,6 +198,9 @@ msgstr ""
msgid "Big thanks to:"
msgstr ""
msgid "Block Categories Menu"
msgstr ""
msgid "Block Categories Modify"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-06-22 19:31+0200\n"
"POT-Creation-Date: 2011-06-24 21:05+0200\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: c64rmx\n"
"Language-Team: \n"
@ -198,6 +198,9 @@ msgstr "Taustamusiikki"
msgid "Big thanks to:"
msgstr "Isot kiitokset:"
msgid "Block Categories Menu"
msgstr ""
msgid "Block Categories Modify"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-06-22 19:31+0200\n"
"POT-Creation-Date: 2011-06-24 21:05+0200\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: Kin8\n"
"Language-Team: Badablek, Amour, ikya, Cyan & Kin8\n"
@ -198,6 +198,9 @@ msgstr "Fond sonore"
msgid "Big thanks to:"
msgstr "Grand merci à:"
msgid "Block Categories Menu"
msgstr ""
msgid "Block Categories Modify"
msgstr "Bloquer modif. catégories"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-06-22 19:31+0200\n"
"POT-Creation-Date: 2011-06-24 21:05+0200\n"
"PO-Revision-Date: 2010-07-03 17:35-0800\n"
"Last-Translator: TheRealVisitor\n"
"Language-Team: Bertilax, Snoozer, wishmasterf, ZEN.13, TheRealVisitor\n"
@ -198,6 +198,9 @@ msgstr "Hintergrundmusik"
msgid "Big thanks to:"
msgstr "Großen Dank an:"
msgid "Block Categories Menu"
msgstr ""
msgid "Block Categories Modify"
msgstr "Sperre Kategorieänderung"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-06-22 19:31+0200\n"
"POT-Creation-Date: 2011-06-24 21:05+0200\n"
"PO-Revision-Date: 2009-12-29 11:05+0100\n"
"Last-Translator: Springdale\n"
"Language-Team: Tusk, Springdale\n"
@ -198,6 +198,9 @@ msgstr "Háttérzene"
msgid "Big thanks to:"
msgstr "Köszönet:"
msgid "Block Categories Menu"
msgstr ""
msgid "Block Categories Modify"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-06-22 19:31+0200\n"
"POT-Creation-Date: 2011-06-24 21:05+0200\n"
"PO-Revision-Date: 2011-03-10 21:00+0200\n"
"Last-Translator: Cambo \n"
"Language-Team: Cambo\n"
@ -198,6 +198,9 @@ msgstr "Musica Sottofondo"
msgid "Big thanks to:"
msgstr "Grazie mille a:"
msgid "Block Categories Menu"
msgstr ""
msgid "Block Categories Modify"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-06-22 19:31+0200\n"
"POT-Creation-Date: 2011-06-24 21:05+0200\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: hosigumayuugi\n"
"Language-Team: hosigumayuugi, papa, ichiroling\n"
@ -198,6 +198,9 @@ msgstr "BGM"
msgid "Big thanks to:"
msgstr "協力:"
msgid "Block Categories Menu"
msgstr ""
msgid "Block Categories Modify"
msgstr "カテゴリの編集を制限"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-06-22 19:31+0200\n"
"POT-Creation-Date: 2011-06-24 21:05+0200\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: nextos@korea.com\n"
"Language-Team: \n"
@ -198,6 +198,9 @@ msgstr "배경음악"
msgid "Big thanks to:"
msgstr "감사 :"
msgid "Block Categories Menu"
msgstr ""
msgid "Block Categories Modify"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-06-22 19:31+0200\n"
"POT-Creation-Date: 2011-06-24 21:05+0200\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: raschi\n"
"Language-Team: raschi\n"
@ -198,6 +198,9 @@ msgstr "Bakgrunnsmusikk"
msgid "Big thanks to:"
msgstr "Stor takk til:"
msgid "Block Categories Menu"
msgstr ""
msgid "Block Categories Modify"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-06-22 19:31+0200\n"
"POT-Creation-Date: 2011-06-24 21:05+0200\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: ziom666 (zadania_prog@vp.pl)\n"
"Language-Team: \n"
@ -198,6 +198,9 @@ msgstr "Muzyka w tle"
msgid "Big thanks to:"
msgstr "Podziekowania dla"
msgid "Block Categories Menu"
msgstr ""
msgid "Block Categories Modify"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-06-22 19:31+0200\n"
"POT-Creation-Date: 2011-06-24 21:05+0200\n"
"PO-Revision-Date: 2009-10-23 18:52+0200\n"
"Last-Translator: aniemotion\n"
"Language-Team: boto12, aniemotion\n"
@ -198,6 +198,9 @@ msgstr "Música de fundo"
msgid "Big thanks to:"
msgstr "Agradecimentos:"
msgid "Block Categories Menu"
msgstr ""
msgid "Block Categories Modify"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-06-22 19:31+0200\n"
"POT-Creation-Date: 2011-06-24 21:05+0200\n"
"PO-Revision-Date: 2011-06-14 00:00-0000\n"
"Last-Translator: pplucky <pplucky@gmail.com>\n"
"Language-Team: Sky8000, pplucky\n"
@ -198,6 +198,9 @@ msgstr "Música de fundo"
msgid "Big thanks to:"
msgstr "Agradecimentos:"
msgid "Block Categories Menu"
msgstr ""
msgid "Block Categories Modify"
msgstr "Bloquear Modif. Categorias"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-06-22 19:31+0200\n"
"POT-Creation-Date: 2011-06-24 21:05+0200\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: nikolai_ca\n"
"Language-Team: Kir, alendit, nikolai_ca\n"
@ -198,6 +198,9 @@ msgstr "Фоновая музыка"
msgid "Big thanks to:"
msgstr "Большое спасибо:"
msgid "Block Categories Menu"
msgstr ""
msgid "Block Categories Modify"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-06-22 19:31+0200\n"
"POT-Creation-Date: 2011-06-24 21:05+0200\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: knife.hu kavid emul8ion\n"
"Language-Team: kavid\n"
@ -198,6 +198,9 @@ msgstr "背景音乐"
msgid "Big thanks to:"
msgstr "非常感谢:"
msgid "Block Categories Menu"
msgstr ""
msgid "Block Categories Modify"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-06-22 19:31+0200\n"
"POT-Creation-Date: 2011-06-24 21:05+0200\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: SirPalax\n"
"Language-Team: Penn, SirPalax\n"
@ -198,6 +198,9 @@ msgstr "Música de fondo"
msgid "Big thanks to:"
msgstr "Gracias a:"
msgid "Block Categories Menu"
msgstr ""
msgid "Block Categories Modify"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-06-22 19:31+0200\n"
"POT-Creation-Date: 2011-06-24 21:05+0200\n"
"PO-Revision-Date: 2010-01-19 17:39+0200\n"
"Last-Translator: Katsurou\n"
"Language-Team: Katsurou, pirateX\n"
@ -198,6 +198,9 @@ msgstr "Bakgrundsmusik"
msgid "Big thanks to:"
msgstr "Stort tack till:"
msgid "Block Categories Menu"
msgstr ""
msgid "Block Categories Modify"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-06-22 19:31+0200\n"
"POT-Creation-Date: 2011-06-24 21:05+0200\n"
"PO-Revision-Date: 2010-02-15 21:00+0800\n"
"Last-Translator: Jane.H\n"
"Language-Team: kyogc, Miller, Mika Li, Jane.H\n"
@ -198,6 +198,9 @@ msgstr "背景音樂"
msgid "Big thanks to:"
msgstr "非常感謝:"
msgid "Block Categories Menu"
msgstr ""
msgid "Block Categories Modify"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-06-22 19:31+0200\n"
"POT-Creation-Date: 2011-06-24 21:05+0200\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: Nitro_subzero \n"
"Language-Team: Nitro_subzero\n"
@ -198,6 +198,9 @@ msgstr "ดนตรีเบื้องหลัง"
msgid "Big thanks to:"
msgstr "ขอขอบคุณ:"
msgid "Block Categories Menu"
msgstr ""
msgid "Block Categories Modify"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-06-22 19:31+0200\n"
"POT-Creation-Date: 2011-06-24 21:05+0200\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: omercigingelini\n"
"Language-Team: omercigingelini\n"
@ -198,6 +198,9 @@ msgstr "Arkaplan müziği"
msgid "Big thanks to:"
msgstr "Teşekkürler:"
msgid "Block Categories Menu"
msgstr ""
msgid "Block Categories Modify"
msgstr ""

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-06-14 20:50+0200\n"
"POT-Creation-Date: 2011-06-24 21:05+0200\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
@ -34,27 +34,6 @@ msgstr ""
msgid "r=0 g=0 b=0 a=255 - checkbox browser text color"
msgstr ""
msgid "9 - game list browser page size"
msgstr ""
msgid "right - game browser scrollbar align hor"
msgstr ""
msgid "top - game browser scrollbar align ver"
msgstr ""
msgid "0 - game browser scrollbar pos x"
msgstr ""
msgid "5 - game browser scrollbar pos y"
msgstr ""
msgid "r=0 g=0 b=0 a=255 - game browser list text color"
msgstr ""
msgid "r=0 g=0 b=0 a=255 - game browser list text color over"
msgstr ""
msgid "left - carousel layout left arrow align hor"
msgstr ""
@ -91,6 +70,27 @@ msgstr ""
msgid "255 - tooltip alpha"
msgstr ""
msgid "9 - game list browser page size"
msgstr ""
msgid "right - game browser scrollbar align hor"
msgstr ""
msgid "top - game browser scrollbar align ver"
msgstr ""
msgid "0 - game browser scrollbar pos x"
msgstr ""
msgid "5 - game browser scrollbar pos y"
msgstr ""
msgid "r=0 g=0 b=0 a=255 - game browser list text color"
msgstr ""
msgid "r=0 g=0 b=0 a=255 - game browser list text color over"
msgstr ""
msgid "right - options browser scrollbar align hor"
msgstr ""

View File

@ -34,7 +34,7 @@ class BoxCover : public GuiImage
{
public:
BoxCover(GuiImageData * img, bool flat = false);
~BoxCover();
virtual ~BoxCover();
//! Colors:
//! Gray Box (Default): r:233 g:233 b:233
//! Red Box (NSMB): r:198 g:34 b:4

View File

@ -360,23 +360,6 @@ extern "C" int CopyFile(const char * src, const char * dest)
return 1;
}
/****************************************************************************
* ClearList
*
* Clearing a vector list
****************************************************************************/
static inline void ClearList(std::vector<char *> &List)
{
for(u32 i = 0; i < List.size(); ++i)
{
if(List[i])
free(List[i]);
List[i] = NULL;
}
List.clear();
std::vector<char *>().swap(List);
}
/****************************************************************************
* MoveFile
*

View File

@ -20,7 +20,7 @@ class Text: public GuiText
//!\param c Font color
Text(const char * t, int s, GXColor c);
Text(const wchar_t * t, int s, GXColor c);
~Text();
virtual ~Text();
//!Sets the text of the GuiText element
//!\param t Text
void SetText(const char * t);

View File

@ -126,7 +126,7 @@ class GuiTrigger
//!Constructor
GuiTrigger();
//!Destructor
~GuiTrigger();
virtual ~GuiTrigger();
//!Sets a simple trigger. Requires: element is selected, and trigger button is pressed
//!\param ch Controller channel number
//!\param wiibtns Wii controller trigger button(s) - classic controller buttons are considered separately
@ -180,7 +180,7 @@ class GuiElement
//!Constructor
GuiElement();
//!Destructor
~GuiElement();
virtual ~GuiElement();
//!Set the element's parent
//!\param e Pointer to parent element
void SetParent(GuiElement * e);
@ -451,7 +451,7 @@ class GuiWindow: public GuiElement
//!\param h Height of window
GuiWindow(int w, int h);
//!Destructor
~GuiWindow();
virtual ~GuiWindow();
//!Appends a GuiElement to the GuiWindow
//!\param e The GuiElement to append. If it is already in the GuiWindow, it is removed first
void Append(GuiElement* e);
@ -544,7 +544,7 @@ class GuiImage: public GuiElement
//! = operator for copying images
GuiImage &operator=(GuiImage &srcimage);
//!Destructor
~GuiImage();
virtual ~GuiImage();
//!Sets the image rotation angle for drawing
//!\param a Angle (in degrees)
void SetAngle(float a);
@ -638,7 +638,7 @@ class GuiText: public GuiElement
//!\param t Text
GuiText(const char * t);
//!Destructor
~GuiText();
virtual ~GuiText();
//!Sets the text of the GuiText element
//!\param t Text
virtual void SetText(const char * t);
@ -740,7 +740,7 @@ class GuiTooltip: public GuiElement
GuiTooltip(const char *t, int Alpha = 255);
//!Destructor
~ GuiTooltip();
virtual ~GuiTooltip();
//!Gets the element's current scale
//!Considers scale, scaleDyn, and the parent element's GetScale() value
@ -790,7 +790,7 @@ class GuiButton: public GuiElement
GuiSound* sndOver, GuiSound* sndClick, u8 grow, GuiTooltip* tt, int ttx, int tty, int h_align,
int v_align);
//!Destructor
~GuiButton();
virtual ~GuiButton();
//!Sets the button's image
//!\param i Pointer to GuiImage object
void SetImage(GuiImage* i);
@ -894,7 +894,7 @@ class GuiKeyboard: public GuiWindow
{
public:
GuiKeyboard(char * t, u32 m, int min, int lang);
~GuiKeyboard();
virtual ~GuiKeyboard();
void Update(GuiTrigger * t);
char kbtextstr[256];
protected:
@ -951,7 +951,7 @@ class GuiNumpad: public GuiWindow
{
public:
GuiNumpad(char * t, u32 max);
~GuiNumpad();
virtual ~GuiNumpad();
void Update(GuiTrigger * t);
char kbtextstr[256];
protected:

View File

@ -35,7 +35,7 @@ class GuiCheckboxBrowser : public GuiElement, public sigslot::has_slots<>
{
public:
GuiCheckboxBrowser(int w, int h, int maxSize = 7);
~GuiCheckboxBrowser();
virtual ~GuiCheckboxBrowser();
bool AddEntrie(const string &text, bool checked = false);
int GetSelected() const { return pageIndex+selectedItem; };
void SetImage(GuiImage *Img);

View File

@ -68,15 +68,13 @@ void GuiDiskCover::SetState(int s, int c)
void Menu_DrawDiskCover(f32 xpos, f32 ypos, f32 zpos, u16 width, u16 height, u16 distance, u8 data[], f32 deg_alpha,
f32 deg_beta, f32 scaleX, f32 scaleY, u8 alpha, bool shadow);
void Menu_DrawDiskCoverShadow(f32 xpos, f32 ypos, f32 zpos, u16 width, u16 height, u16 distance, u8 data[],
f32 deg_alpha, f32 deg_beta, f32 scaleX, f32 scaleY, u8 alpha, bool shadow);
void GuiDiskCover::Draw()
{
LOCK( this );
if (!image || !this->IsVisible()) return;
float currScale = this->GetScale();
Menu_DrawDiskCover(this->GetLeft(), this->GetTop(), PosZ, width, height, Distance, image, imageangle, deg_beta,
widescreen ? currScale * Settings.WSFactor : currScale, currScale, 64, true);
Menu_DrawDiskCover(this->GetLeft(), this->GetTop(), PosZ, width, height, Distance, image, imageangle, deg_beta,

View File

@ -8,7 +8,7 @@ class GuiDiskCover: public GuiImage
public:
GuiDiskCover();
GuiDiskCover(GuiImageData * img);
~GuiDiskCover();
virtual ~GuiDiskCover();
void SetBeta(f32 beta);
void SetBetaRotateEffect(f32 beta, u16 Step);
bool GetBetaRotateEffect();

View File

@ -471,7 +471,7 @@ void GuiElement::SetEffect(int eff, int speed, f32 circles, int r, f32 startdegr
xoffsetDyn = 0; //!position of circle in x
yoffsetDyn = 0; //!position of circle in y
Radius = r; //!radius of the circle
degree = startdegree; //!for example -90 (°) to start at top of circle
degree = startdegree; //!for example -90 (<EFBFBD>) to start at top of circle
circleamount = circles; //!circleamoutn in degrees for example 360 for 1 circle
angleDyn = 0.0f; //!this is used by the code to calc the angle
anglespeed = anglespeedset; //!This is anglespeed depending on circle speed 1 is same speed and 0.5 half speed
@ -497,11 +497,11 @@ void GuiElement::SetEffect(int eff, int amount, int target)
else if (eff & EFFECT_SLIDE_RIGHT) xoffsetDyn = screenwidth;
}
if (eff & EFFECT_FADE && amount > 0)
if ((eff & EFFECT_FADE) && amount > 0)
{
alphaDyn = 0;
}
else if (eff & EFFECT_FADE && amount < 0)
else if ((eff & EFFECT_FADE) && amount < 0)
{
alphaDyn = alpha;
@ -814,7 +814,7 @@ void GuiElement::UnlockElement()
// LWP_MutexUnlock(mutex);
LWP_MutexLock(_lock_mutex);
// only the thread was locked this element, can call unlock
if (_lock_thread == LWP_GetSelf()) // but we check it here safe is safe
if (_lock_thread == LWP_GetSelf()) // but we check it here <EFBFBD> safe is safe
{
if (--_lock_count == 0) // dec count of locks and check if it last lock;
{

View File

@ -9,7 +9,7 @@ class GuiFileBrowser: public GuiElement, public sigslot::has_slots<>
{
public:
GuiFileBrowser(int w, int h);
~GuiFileBrowser();
virtual ~GuiFileBrowser();
void DisableTriggerUpdate(bool set);
void ResetState();
void SetFocus(int f);

View File

@ -1,47 +1,41 @@
#ifndef _GUIGAMEBROWSER_H_
#define _GUIGAMEBROWSER_H_
/****************************************************************************
* Copyright (C) 2011
* by Dimok
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any
* damages arising from the use of this software.
*
* Permission is granted to anyone to use this software for any
* purpose, including commercial applications, and to alter it and
* redistribute it freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you
* must not claim that you wrote the original software. If you use
* this software in a product, an acknowledgment in the product
* documentation would be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and
* must not be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
***************************************************************************/
#ifndef GUIGAMEBROWSER_H_
#define GUIGAMEBROWSER_H_
#include "gui.h"
#include "gui_scrollbar.hpp"
#include "usbloader/disc.h"
class GuiGameBrowser: public GuiElement, public sigslot::has_slots<>
class GuiGameBrowser : public GuiElement
{
public:
GuiGameBrowser(int w, int h, int selectedGame = 0);
~GuiGameBrowser();
int FindMenuItem(int c, int d);
int GetClickedOption();
int GetSelectedOption() { return listOffset+selectedItem; }
void ResetState();
void SetFocus(int f);
void Draw();
void Update(GuiTrigger * t);
int GetOffset();
protected:
void onListChange(int SelItem, int SelInd);
void UpdateListEntries();
int selectedItem;
int listOffset;
int scrollbaron;
int pagesize;
int maxTextWidth;
int * gameIndex;
GuiButton ** game;
GuiText ** gameTxt;
GuiText ** gameTxtOver;
GuiImage ** gameBg;
GuiImage ** newImg;
GuiImage * bgGameImg;
GuiImageData * bgGames;
GuiImageData * bgGamesEntry;
GuiImageData * newGames;
GuiTrigger * trigA;
GuiScrollbar scrollBar;
public:
GuiGameBrowser() {};
virtual ~GuiGameBrowser() {};
virtual int GetClickedOption() { return 0; };
virtual int GetSelectedOption() { return 0; };
virtual void SetSelectedOption(int ind) {};
virtual void setListOffset(int off) {}
virtual int getListOffset() const { return 0; }
};
#endif
#endif /* GUIGAMEBROWSER_H_ */

View File

@ -18,6 +18,7 @@
#include "settings/CSettings.h"
#include "GUI/LoadCoverImage.h"
#include "themes/CTheme.h"
#include "utils/tools.h"
#include "main.h"
#include <string.h>
@ -46,13 +47,13 @@ static GuiImageData *GameCarouselLoadCoverImage(void * Arg)
/**
* Constructor for the GuiGameCarousel class.
*/
GuiGameCarousel::GuiGameCarousel(int w, int h, const char *themePath, int selectedGame) :
GuiGameCarousel::GuiGameCarousel(int w, int h, const char *themePath, int offset) :
noCover(Resources::GetFile("nocover.png"), Resources::GetFileSize("nocover.png"))
{
width = w;
height = h;
pagesize = (gameList.size() < 11) ? gameList.size() : 11;
listOffset = (gameList.size() < 11) ? 0 : gameList.size()-2;
listOffset = (gameList.size() < 11) ? MIN(offset, gameList.size()-1) : MIN(offset, gameList.size())-2;
selectable = true;
selectedItem = -1;
focus = 1; // allow focus
@ -110,37 +111,7 @@ GuiGameCarousel::GuiGameCarousel(int w, int h, const char *themePath, int select
game.resize(pagesize);
coverImg.resize(pagesize);
for (int i = 0; i < pagesize; i++)
{
//------------------------
// Index
//------------------------
gameIndex[i] = GetGameIndex( i, listOffset, gameList.size() );
//------------------------
// Image
//------------------------
coverImg[i] = new (std::nothrow) GuiImageAsync(GameCarouselLoadCoverImage, gameList[gameIndex[i]],
sizeof(struct discHdr), &noCover);
if (coverImg[i]) coverImg[i]->SetWidescreen(Settings.widescreen);
//------------------------
// GameButton
//------------------------
game[i] = new GuiButton(122, 244);
game[i]->SetParent(this);
game[i]->SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
game[i]->SetPosition(0, 740);
game[i]->SetImage(coverImg[i]);
game[i]->SetScale(SCALE);
game[i]->SetRumble(false);
game[i]->SetTrigger(trigA);
game[i]->SetSoundClick(btnSoundClick);
game[i]->SetClickable(true);
game[i]->SetEffect(EFFECT_GOROUND, IN_SPEED, 90 - (pagesize - 2 * i - 1) * DEG_OFFSET / 2, RADIUS, 180, 1, 0,
RADIUS);
}
Refresh();
}
/**
@ -173,6 +144,65 @@ GuiGameCarousel::~GuiGameCarousel()
}
void GuiGameCarousel::setListOffset(int off)
{
LOCK( this );
if(gameList.size() < 11)
listOffset = MIN(off, gameList.size()-1);
else
listOffset = MIN(off, gameList.size()) - 2;
Refresh();
}
int GuiGameCarousel::getListOffset() const
{
if(gameList.size() < 11)
return listOffset;
else
return (listOffset + 2) % gameList.size();
}
void GuiGameCarousel::SetSelectedOption(int ind)
{
LOCK(this);
selectedItem = LIMIT(ind, 0, MIN(pagesize, MAX(0, gameList.size()-1)));
}
void GuiGameCarousel::Refresh()
{
for (int i = 0; i < pagesize; i++)
{
//------------------------
// Index
//------------------------
gameIndex[i] = GetGameIndex( i, listOffset, gameList.size() );
//------------------------
// Image
//------------------------
delete coverImg[i];
coverImg[i] = new (std::nothrow) GuiImageAsync(GameCarouselLoadCoverImage, gameList[gameIndex[i]], sizeof(struct discHdr), &noCover);
if (coverImg[i]) coverImg[i]->SetWidescreen(Settings.widescreen);
//------------------------
// GameButton
//------------------------
delete game[i];
game[i] = new GuiButton(122, 244);
game[i]->SetParent(this);
game[i]->SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
game[i]->SetPosition(0, 740);
game[i]->SetImage(coverImg[i]);
game[i]->SetScale(SCALE);
game[i]->SetRumble(false);
game[i]->SetTrigger(trigA);
game[i]->SetSoundClick(btnSoundClick);
game[i]->SetClickable(true);
game[i]->SetEffect(EFFECT_GOROUND, IN_SPEED, 90 - (pagesize - 2 * i - 1) * DEG_OFFSET / 2, RADIUS, 180, 1, 0, RADIUS);
}
}
void GuiGameCarousel::SetFocus(int f)
{
LOCK( this );
@ -201,12 +231,6 @@ void GuiGameCarousel::ResetState()
}
}
int GuiGameCarousel::GetOffset()
{
LOCK( this );
return listOffset;
}
int GuiGameCarousel::GetClickedOption()
{
LOCK( this );
@ -273,7 +297,7 @@ void GuiGameCarousel::Update(GuiTrigger * t)
btnRight->Update(t);
btnLeft->Update(t);
if (game[0]->GetEffect() & EFFECT_GOROUND || game[pagesize - 1]->GetEffect() & EFFECT_GOROUND)
if ((game[0]->GetEffect() & EFFECT_GOROUND) || (game[pagesize - 1]->GetEffect() & EFFECT_GOROUND))
{
return; // skip when rotate
}

View File

@ -2,24 +2,26 @@
#define _GUIGAMECAROUSEL_H_
#include <vector>
#include "gui.h"
#include "gui_gamebrowser.h"
#include "gui_image_async.h"
#include "usbloader/disc.h"
class GuiImageAsync;
class GuiGameCarousel: public GuiElement
class GuiGameCarousel : public GuiGameBrowser
{
public:
GuiGameCarousel(int w, int h, const char *themePath, int selectedGame = 0);
~GuiGameCarousel();
GuiGameCarousel(int w, int h, const char *themePath, int listOffset = 0);
virtual ~GuiGameCarousel();
int FindMenuItem(int c, int d);
int GetClickedOption();
int GetSelectedOption();
void SetSelectedOption(int ind);
void setListOffset(int off);
int getListOffset() const;
void Refresh();
void ResetState();
void SetFocus(int f);
void Draw();
void Update(GuiTrigger * t);
int GetOffset();
void Reload();
//GuiText * optionVal[PAGESIZE];
protected:
GuiImageData noCover;
int selectedItem;

View File

@ -19,6 +19,7 @@
#include "themes/CTheme.h"
#include "prompts/PromptWindows.h"
#include "language/gettext.h"
#include "utils/tools.h"
#include "menu.h"
#include <string.h>
@ -35,8 +36,6 @@
#define goSteps 10
#include "../main.h"
extern const int vol;
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 } };
@ -201,11 +200,12 @@ static GuiImageData *GameGridLoadCoverImage(void * Arg)
/**
* Constructor for the GuiGamegrid class.
*/
GuiGameGrid::GuiGameGrid(int w, int h, const char *themePath, int selectedGame) :
GuiGameGrid::GuiGameGrid(int w, int h, const char *themePath, int offset) :
noCover(Resources::GetFile("nocoverFlat.png"), Resources::GetFileSize("nocoverFlat.png"))
{
width = w;
height = h;
listOffset = MIN(offset, gameList.size()-1);
theme_posX = thInt("0 - game grid layout pos x");
theme_posY = thInt("20 - game grid layout pos y");
@ -264,7 +264,7 @@ GuiGameGrid::GuiGameGrid(int w, int h, const char *themePath, int selectedGame)
// Page-Stuff
gameIndex = NULL;
Reload(Settings.gridRows, 0);
Reload(Settings.gridRows, listOffset);
}
/**
@ -332,12 +332,6 @@ void GuiGameGrid::ResetState()
}
}
int GuiGameGrid::GetOffset()
{
LOCK( this );
return listOffset;
}
int GuiGameGrid::GetClickedOption()
{
LOCK( this );
@ -367,6 +361,12 @@ int GuiGameGrid::GetSelectedOption()
return found;
}
void GuiGameGrid::SetSelectedOption(int ind)
{
LOCK(this);
selectedItem = LIMIT(ind, 0, MIN(pagesize, MAX(0, gameList.size()-1)));
}
/**
* Draw the button on screen
*/

View File

@ -2,23 +2,25 @@
#define _GUIGAMEGRID_H_
#include <vector>
#include "gui.h"
#include "gui_gamebrowser.h"
#include "gui_image_async.h"
#include "usbloader/disc.h"
class GuiImageAsync;
class GuiGameGrid: public GuiElement
class GuiGameGrid : public GuiGameBrowser
{
public:
GuiGameGrid(int w, int h, const char *themePath, int selectedGame = 0);
~GuiGameGrid();
virtual ~GuiGameGrid();
int FindMenuItem(int c, int d);
int GetClickedOption();
int GetSelectedOption();
void SetSelectedOption(int ind);
void setListOffset(int off) { listOffset = off; Reload(rows, listOffset); }
int getListOffset() const { return listOffset; }
void ResetState();
void SetFocus(int f);
void Draw();
void Update(GuiTrigger * t);
int GetOffset();
void Reload(int Rows, int ListOffset);
void ChangeRows(int n);
protected:

View File

@ -7,16 +7,17 @@
***************************************************************************/
#include "gui.h"
#include "../wpad.h"
#include "wpad.h"
#include <unistd.h>
#include "gui_gamebrowser.h"
#include "../settings/CSettings.h"
#include "../main.h"
#include "gui_gamelist.h"
#include "settings/CSettings.h"
#include "main.h"
#include "settings/newtitles.h"
#include "settings/GameTitles.h"
#include "usbloader/GameList.h"
#include "themes/CTheme.h"
#include "utils/tools.h"
#include "menu.h"
#include <string.h>
@ -25,9 +26,9 @@
#define GAMESELECTSIZE 30
/**
* Constructor for the GuiGameBrowser class.
* Constructor for the GuiGameList class.
*/
GuiGameBrowser::GuiGameBrowser(int w, int h, int selectedGame)
GuiGameList::GuiGameList(int w, int h, int offset)
: scrollBar(h-10)
{
width = w;
@ -35,8 +36,8 @@ GuiGameBrowser::GuiGameBrowser(int w, int h, int selectedGame)
pagesize = thInt("9 - game list browser page size");
scrollbaron = (gameList.size() > pagesize) ? 1 : 0;
selectable = true;
listOffset = selectedGame - (selectedGame % pagesize);
selectedItem = selectedGame - listOffset;
listOffset = LIMIT(offset, 0, MAX(0, gameList.size()-pagesize));
selectedItem = 0;
focus = 1; // allow focus
trigA = new GuiTrigger;
@ -49,7 +50,11 @@ GuiGameBrowser::GuiGameBrowser(int w, int h, int selectedGame)
scrollBar.SetAlignment(thAlign("right - game browser scrollbar align hor"), thAlign("top - game browser scrollbar align ver"));
scrollBar.SetPosition(thInt("0 - game browser scrollbar pos x"), thInt("5 - game browser scrollbar pos y"));
scrollBar.SetButtonScroll(WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B);
scrollBar.listChanged.connect(this, &GuiGameBrowser::onListChange);
scrollBar.SetPageSize(pagesize);
scrollBar.SetSelectedItem(selectedItem);
scrollBar.SetSelectedIndex(listOffset);
scrollBar.SetEntrieCount(gameList.size());
scrollBar.listChanged.connect(this, &GuiGameList::onListChange);
bgGameImg = new GuiImage(bgGames);
bgGameImg->SetParent(this);
@ -59,21 +64,20 @@ GuiGameBrowser::GuiGameBrowser(int w, int h, int selectedGame)
maxTextWidth = bgGameImg->GetWidth() - scrollBar.GetWidth() - 38;
gameIndex = new int[pagesize];
game = new GuiButton *[pagesize];
gameTxt = new GuiText *[pagesize];
gameTxtOver = new GuiText *[pagesize];
gameBg = new GuiImage *[pagesize];
newImg = new GuiImage *[pagesize];
for (int i = 0; i < pagesize; i++)
for (int i = 0; i < pagesize; ++i)
{
gameTxt[i] = new GuiText(GameTitles.GetTitle(gameList[i]), 20, thColor("r=0 g=0 b=0 a=255 - game browser list text color"));
gameTxt[i] = new GuiText((char *) NULL, 20, thColor("r=0 g=0 b=0 a=255 - game browser list text color"));
gameTxt[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
gameTxt[i]->SetPosition(24, 0);
gameTxt[i]->SetMaxWidth(maxTextWidth, DOTTED);
gameTxtOver[i] = new GuiText(GameTitles.GetTitle(gameList[i]), 20, thColor("r=0 g=0 b=0 a=255 - game browser list text color over"));
gameTxtOver[i] = new GuiText((char *) NULL, 20, thColor("r=0 g=0 b=0 a=255 - game browser list text color over"));
gameTxtOver[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
gameTxtOver[i]->SetPosition(24, 0);
gameTxtOver[i]->SetMaxWidth(maxTextWidth, SCROLL_HORIZONTAL);
@ -94,16 +98,16 @@ GuiGameBrowser::GuiGameBrowser(int w, int h, int selectedGame)
game[i]->SetRumble(false);
game[i]->SetTrigger(trigA);
game[i]->SetSoundClick(btnSoundClick);
gameIndex[i] = i;
game[i]->SetVisible(false);
game[i]->SetState(STATE_DISABLED);
}
UpdateListEntries();
}
/**
* Destructor for the GuiGameBrowser class.
* Destructor for the GuiGameList class.
*/
GuiGameBrowser::~GuiGameBrowser()
GuiGameList::~GuiGameList()
{
delete bgGameImg;
delete bgGames;
@ -112,7 +116,7 @@ GuiGameBrowser::~GuiGameBrowser()
delete trigA;
for (int i = 0; i < pagesize; i++)
for (int i = 0; i < pagesize; ++i)
{
delete gameTxt[i];
delete gameTxtOver[i];
@ -120,27 +124,26 @@ GuiGameBrowser::~GuiGameBrowser()
delete game[i];
delete newImg[i];
}
delete[] gameIndex;
delete[] game;
delete[] gameTxt;
delete[] gameTxtOver;
delete[] gameBg;
}
void GuiGameBrowser::SetFocus(int f)
void GuiGameList::SetFocus(int f)
{
LOCK( this );
if (!gameList.size()) return;
focus = f;
for (int i = 0; i < pagesize; i++)
for (int i = 0; i < pagesize; ++i)
game[i]->ResetState();
if (f == 1) game[selectedItem]->SetState(STATE_SELECTED);
}
void GuiGameBrowser::ResetState()
void GuiGameList::ResetState()
{
LOCK( this );
if (state != STATE_DISABLED)
@ -149,76 +152,60 @@ void GuiGameBrowser::ResetState()
stateChan = -1;
}
for (int i = 0; i < pagesize; i++)
for (int i = 0; i < pagesize; ++i)
{
game[i]->ResetState();
}
}
int GuiGameBrowser::GetOffset()
{
return listOffset;
}
int GuiGameBrowser::GetClickedOption()
int GuiGameList::GetClickedOption()
{
int found = -1;
for (int i = 0; i < pagesize; i++)
for (int i = 0; i < pagesize; ++i)
{
if (game[i]->GetState() == STATE_CLICKED)
{
game[i]->SetState(STATE_SELECTED);
found = gameIndex[i];
found = listOffset + i;
break;
}
}
return found;
}
/****************************************************************************
* FindMenuItem
*
* Help function to find the next visible menu item on the list
***************************************************************************/
int GuiGameBrowser::FindMenuItem(int currentItem, int direction)
{
int nextItem = currentItem + direction;
if (nextItem < 0 || nextItem >= gameList.size()) return -1;
if (strlen(GameTitles.GetTitle(gameList[nextItem])) > 0)
return nextItem;
return FindMenuItem(nextItem, direction);
}
void GuiGameBrowser::onListChange(int SelItem, int SelInd)
void GuiGameList::onListChange(int SelItem, int SelInd)
{
selectedItem = SelItem;
listOffset = SelInd;
UpdateListEntries();
}
void GuiGameList::setListOffset(int off)
{
LOCK(this);
listOffset = LIMIT(off, 0, MAX(0, gameList.size()-pagesize));
}
void GuiGameList::SetSelectedOption(int ind)
{
LOCK(this);
selectedItem = LIMIT(ind, 0, MIN(pagesize, MAX(0, gameList.size()-1)));
}
/**
* Draw the button on screen
*/
void GuiGameBrowser::Draw()
void GuiGameList::Draw()
{
LOCK( this );
if (!this->IsVisible() || !gameList.size()) return;
bgGameImg->Draw();
int next = listOffset;
for (int i = 0; i < pagesize; i++)
for (int i = 0, next = listOffset; i < pagesize; ++i, ++next)
{
if (next >= 0)
{
if (next < gameList.size())
game[i]->Draw();
next = this->FindMenuItem(next, 1);
}
else break;
}
if (scrollbaron == 1)
@ -227,12 +214,11 @@ void GuiGameBrowser::Draw()
this->UpdateEffects();
}
void GuiGameBrowser::UpdateListEntries()
void GuiGameList::UpdateListEntries()
{
int next = listOffset;
for (int i = 0; i < pagesize; i++)
for (int i = 0, next = listOffset; i < pagesize; ++i, ++next)
{
if (next >= 0)
if (next < gameList.size())
{
if (game[i]->GetState() == STATE_DISABLED)
{
@ -259,9 +245,6 @@ void GuiGameBrowser::UpdateListEntries()
}
newImg[i]->SetVisible(isNew);
}
gameIndex[i] = next;
next = this->FindMenuItem(next, 1);
}
else
{
@ -271,13 +254,12 @@ void GuiGameBrowser::UpdateListEntries()
}
}
void GuiGameBrowser::Update(GuiTrigger * t)
void GuiGameList::Update(GuiTrigger * t)
{
LOCK( this );
if (state == STATE_DISABLED || !t || !gameList.size()) return;
static int pressedChan = -1;
int next;
if((t->wpad.btns_d & (WPAD_BUTTON_B | WPAD_BUTTON_DOWN | WPAD_BUTTON_UP | WPAD_BUTTON_LEFT | WPAD_BUTTON_RIGHT |
WPAD_CLASSIC_BUTTON_B | WPAD_CLASSIC_BUTTON_UP | WPAD_CLASSIC_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_LEFT | WPAD_CLASSIC_BUTTON_RIGHT)) ||
@ -288,23 +270,22 @@ void GuiGameBrowser::Update(GuiTrigger * t)
// update the location of the scroll box based on the position in the option list
scrollBar.Update(t);
next = listOffset;
if(pressedChan == -1 || (!t->wpad.btns_h && !t->pad.btns_h))
{
for (int i = 0; i < pagesize; i++)
for (int i = 0, next = listOffset; i < pagesize; ++i, ++next)
{
if (next >= 0) next = this->FindMenuItem(next, 1);
if (next >= gameList.size())
break;
if (i != selectedItem && game[i]->GetState() == STATE_SELECTED)
game[i]->ResetState();
else if (i == selectedItem && game[i]->GetState() == STATE_DEFAULT)
game[selectedItem]->SetState(STATE_SELECTED, -1);
if (i != selectedItem && game[i]->GetState() == STATE_SELECTED)
game[i]->ResetState();
else if (i == selectedItem && game[i]->GetState() == STATE_DEFAULT)
game[selectedItem]->SetState(STATE_SELECTED, -1);
game[i]->Update(t);
game[i]->Update(t);
if (game[i]->GetState() == STATE_SELECTED)
selectedItem = i;
if (game[i]->GetState() == STATE_SELECTED)
selectedItem = i;
}
}

47
source/GUI/gui_gamelist.h Normal file
View File

@ -0,0 +1,47 @@
#ifndef _GUIGAMELIST_H_
#define _GUIGAMELIST_H_
#include "gui_gamebrowser.h"
#include "gui_scrollbar.hpp"
#include "usbloader/disc.h"
class GuiGameList : public GuiGameBrowser, public sigslot::has_slots<>
{
public:
GuiGameList(int w, int h, int listOffset = 0);
virtual ~GuiGameList();
int GetClickedOption();
int GetSelectedOption() { return listOffset+selectedItem; }
void SetSelectedOption(int ind);
void setListOffset(int off);
int getListOffset() const { return listOffset; }
void ResetState();
void SetFocus(int f);
void Draw();
void Update(GuiTrigger * t);
protected:
void onListChange(int SelItem, int SelInd);
void UpdateListEntries();
int selectedItem;
int listOffset;
int scrollbaron;
int pagesize;
int maxTextWidth;
GuiButton ** game;
GuiText ** gameTxt;
GuiText ** gameTxtOver;
GuiImage ** gameBg;
GuiImage ** newImg;
GuiImage * bgGameImg;
GuiImageData * bgGames;
GuiImageData * bgGamesEntry;
GuiImageData * newGames;
GuiTrigger * trigA;
GuiScrollbar scrollBar;
};
#endif

View File

@ -11,7 +11,7 @@ class GuiImageAsync: public GuiImage
public:
GuiImageAsync(const char *Filename, GuiImageData * PreloadImg);
GuiImageAsync(ImageLoaderCallback Callback, const void *Arg, int ArgLen, GuiImageData * PreloadImg);
~GuiImageAsync();
virtual ~GuiImageAsync();
static void ClearQueue();
private:

View File

@ -10,7 +10,7 @@ class GuiOptionBrowser: public GuiElement, public sigslot::has_slots<>
{
public:
GuiOptionBrowser(int w, int h, OptionList * l, const char * background);
~GuiOptionBrowser();
virtual ~GuiOptionBrowser();
int FindMenuItem(int c, int d);
int GetClickedOption();
int GetSelectedOption();

View File

@ -30,7 +30,7 @@ class GuiScrollbar : public GuiElement, public sigslot::has_slots<>
{
public:
GuiScrollbar(int height, u8 mode = LISTMODE);
~GuiScrollbar();
virtual ~GuiScrollbar();
void SetDPadControl(bool a) { AllowDPad = a; }
void SetButtonScroll(u32 button) { ButtonScroll = button; }
void ScrollOneUp();

View File

@ -8,7 +8,7 @@ class GuiSearchBar: public GuiWindow
{
public:
GuiSearchBar(const wchar_t *SearchChars);
~GuiSearchBar();
virtual ~GuiSearchBar();
void Draw();
void Update(GuiTrigger * t);
wchar_t GetClicked();

View File

@ -144,10 +144,10 @@ bool GuiTrigger::Left()
if(wpad.exp.type == WPAD_EXP_CLASSIC)
wiibtn = WPAD_CLASSIC_BUTTON_LEFT;
if ((wpad.btns_d | wpad.btns_h) & wiibtn || (pad.btns_d | pad.btns_h)
& PAD_BUTTON_LEFT || pad.stickX < -PADCAL || WPAD_Stick(0, 0) < -PADCAL)
if (((wpad.btns_d | wpad.btns_h) & wiibtn) || ((pad.btns_d | pad.btns_h)
& PAD_BUTTON_LEFT) || pad.stickX < -PADCAL || WPAD_Stick(0, 0) < -PADCAL)
{
if (wpad.btns_d & wiibtn || pad.btns_d & PAD_BUTTON_LEFT)
if ((wpad.btns_d & wiibtn) || (pad.btns_d & PAD_BUTTON_LEFT))
{
scrollDelay = SCROLL_INITIAL_DELAY; // reset scroll delay.
return true;
@ -171,10 +171,10 @@ bool GuiTrigger::Right()
if(wpad.exp.type == WPAD_EXP_CLASSIC)
wiibtn = WPAD_CLASSIC_BUTTON_RIGHT;
if ((wpad.btns_d | wpad.btns_h) & wiibtn || (pad.btns_d | pad.btns_h)
& PAD_BUTTON_RIGHT || pad.stickX > PADCAL || WPAD_Stick(0, 0) > PADCAL)
if (((wpad.btns_d | wpad.btns_h) & wiibtn) || ((pad.btns_d | pad.btns_h)
& PAD_BUTTON_RIGHT) || pad.stickX > PADCAL || WPAD_Stick(0, 0) > PADCAL)
{
if (wpad.btns_d & wiibtn || pad.btns_d & PAD_BUTTON_RIGHT)
if ((wpad.btns_d & wiibtn) || (pad.btns_d & PAD_BUTTON_RIGHT))
{
scrollDelay = SCROLL_INITIAL_DELAY; // reset scroll delay.
return true;
@ -198,10 +198,10 @@ bool GuiTrigger::Up()
if(wpad.exp.type == WPAD_EXP_CLASSIC)
wiibtn = WPAD_CLASSIC_BUTTON_UP;
if ((wpad.btns_d | wpad.btns_h) & wiibtn || (pad.btns_d | pad.btns_h) & PAD_BUTTON_UP
if (((wpad.btns_d | wpad.btns_h) & wiibtn) || ((pad.btns_d | pad.btns_h) & PAD_BUTTON_UP)
|| pad.stickY > PADCAL || WPAD_Stick(0, 1) > PADCAL)
{
if (wpad.btns_d & wiibtn || pad.btns_d & PAD_BUTTON_UP)
if ((wpad.btns_d & wiibtn) || (pad.btns_d & PAD_BUTTON_UP))
{
scrollDelay = SCROLL_INITIAL_DELAY; // reset scroll delay.
return true;
@ -225,10 +225,10 @@ bool GuiTrigger::Down()
if(wpad.exp.type == WPAD_EXP_CLASSIC)
wiibtn = WPAD_CLASSIC_BUTTON_DOWN;
if ((wpad.btns_d | wpad.btns_h) & wiibtn || (pad.btns_d | pad.btns_h)
& PAD_BUTTON_DOWN || pad.stickY < -PADCAL || WPAD_Stick(0, 1) < -PADCAL)
if (((wpad.btns_d | wpad.btns_h) & wiibtn) || ((pad.btns_d | pad.btns_h)
& PAD_BUTTON_DOWN) || pad.stickY < -PADCAL || WPAD_Stick(0, 1) < -PADCAL)
{
if (wpad.btns_d & wiibtn || pad.btns_d & PAD_BUTTON_DOWN)
if ((wpad.btns_d & wiibtn) || (pad.btns_d & PAD_BUTTON_DOWN))
{
scrollDelay = SCROLL_INITIAL_DELAY; // reset scroll delay.
return true;

View File

@ -239,8 +239,7 @@ void GuiWindow::ToggleFocus(GuiTrigger * t)
}
}
// change focus
else if (t->wpad.btns_d & (WPAD_BUTTON_1 | WPAD_BUTTON_1 | WPAD_CLASSIC_BUTTON_PLUS) || t->pad.btns_d
& PAD_BUTTON_B)
else if ((t->wpad.btns_d & (WPAD_BUTTON_1 | WPAD_BUTTON_1 | WPAD_CLASSIC_BUTTON_PLUS)) || (t->pad.btns_d & PAD_BUTTON_B))
{
for (i = found; i < _elements.size(); i++)
{

View File

@ -34,7 +34,7 @@ class AifDecoder : public SoundDecoder
public:
AifDecoder(const char * filepath);
AifDecoder(const u8 * snd, int len);
~AifDecoder();
virtual ~AifDecoder();
int GetFormat() { return Format; };
int GetSampleRate() { return SampleRate; };
int Read(u8 * buffer, int buffer_size, int pos);

View File

@ -29,6 +29,8 @@
#include <unistd.h>
#include "BNSDecoder.hpp"
SoundBlock DecodefromBNS(const u8 *buffer, u32 size);
BNSDecoder::BNSDecoder(const char * filepath)
: SoundDecoder(filepath)
{

View File

@ -44,7 +44,7 @@ class BNSDecoder : public SoundDecoder
public:
BNSDecoder(const char * filepath);
BNSDecoder(const u8 * snd, int len);
~BNSDecoder();
virtual ~BNSDecoder();
int GetFormat() { return SoundData.format; };
int GetSampleRate() { return SoundData.frequency; };
int Read(u8 * buffer, int buffer_size, int pos);
@ -54,6 +54,4 @@ class BNSDecoder : public SoundDecoder
SoundBlock SoundData;
};
SoundBlock DecodefromBNS(const u8 *buffer, u32 size);
#endif

View File

@ -213,4 +213,6 @@ int Mp3Decoder::Read(u8 * buffer, int buffer_size, int pos)
mad_synth_frame(&Synth,&Frame);
SynthPos = 0;
}
return 0;
}

View File

@ -32,7 +32,7 @@ class Mp3Decoder : public SoundDecoder
public:
Mp3Decoder(const char * filepath);
Mp3Decoder(const u8 * sound, int len);
~Mp3Decoder();
virtual ~Mp3Decoder();
int GetFormat() { return Format; };
int GetSampleRate() { return SampleRate; };
int Rewind();

View File

@ -33,7 +33,7 @@ class OggDecoder : public SoundDecoder
public:
OggDecoder(const char * filepath);
OggDecoder(const u8 * snd, int len);
~OggDecoder();
virtual ~OggDecoder();
int GetFormat();
int GetSampleRate();
int Rewind();

View File

@ -49,7 +49,7 @@ class SoundDecoder
SoundDecoder();
SoundDecoder(const char * filepath);
SoundDecoder(const u8 * buffer, int size);
~SoundDecoder();
virtual ~SoundDecoder();
virtual int Read(u8 * buffer, int buffer_size, int pos);
virtual int Tell() { return CurPos; };
virtual int Seek(int pos) { CurPos = pos; return file_fd->seek(CurPos, SEEK_SET); };

View File

@ -106,14 +106,7 @@ void SoundHandler::RemoveDecoder(int voice)
return;
if(DecoderList[voice] != NULL)
{
if(DecoderList[voice]->GetSoundType() == SOUND_OGG) delete ((OggDecoder *) DecoderList[voice]);
else if(DecoderList[voice]->GetSoundType() == SOUND_MP3) delete ((Mp3Decoder *) DecoderList[voice]);
else if(DecoderList[voice]->GetSoundType() == SOUND_WAV) delete ((WavDecoder *) DecoderList[voice]);
else if(DecoderList[voice]->GetSoundType() == SOUND_AIF) delete ((AifDecoder *) DecoderList[voice]);
else if(DecoderList[voice]->GetSoundType() == SOUND_BNS) delete ((BNSDecoder *) DecoderList[voice]);
else delete DecoderList[voice];
}
delete DecoderList[voice];
DecoderList[voice] = NULL;
}

View File

@ -58,7 +58,7 @@ class WavDecoder : public SoundDecoder
public:
WavDecoder(const char * filepath);
WavDecoder(const u8 * snd, int len);
~WavDecoder();
virtual ~WavDecoder();
int GetFormat() { return Format; };
int GetSampleRate() { return SampleRate; };
int Read(u8 * buffer, int buffer_size, int pos);

View File

@ -20,7 +20,7 @@ class GuiBGM: public GuiSound
{
public:
GuiBGM(const u8 *s, int l, int v);
~GuiBGM();
virtual ~GuiBGM();
bool Load(const char *path);
bool LoadStandard();
bool ParsePath(const char * folderpath);

View File

@ -38,7 +38,7 @@ class GuiSound
GuiSound(const char * filepath);
GuiSound(const u8 * sound, int filesize, int volume, bool allocated = false, int voice = -1);
//!Destructor
~GuiSound();
virtual ~GuiSound();
//!Load a file and replace the old one
virtual bool Load(const char * filepath);
//!Load a file and replace the old one

View File

@ -60,9 +60,11 @@ int CheatMenu(const char * gameID)
if (download == 1)
{
download = CodeDownload(gameID);
if (download < 0 || c.openTxtfile(txtfilename) != 1) break;
if (download < 0 || c.openTxtfile(txtfilename) != 1)
break;
}
else break;
else
break;
case 1:
int cntcheats = c.getCnt();
OptionList cheatslst;

View File

@ -20,7 +20,6 @@ static u32 homebrewsize = 0;
static std::vector<std::string> Arguments;
extern const u8 app_booter_dol[];
extern const u32 app_booter_dol_size;
void AddBootArgument(const char * argv)
{

View File

@ -53,7 +53,7 @@ void UpdatePads()
if(userInput[i].wpad.exp.type == WPAD_EXP_NUNCHUK)
{
if(userInput[i].wpad.btns_h & WPAD_NUNCHUK_BUTTON_Z && userInput[i].wpad.btns_d & WPAD_NUNCHUK_BUTTON_C)
if((userInput[i].wpad.btns_h & WPAD_NUNCHUK_BUTTON_Z) && (userInput[i].wpad.btns_d & WPAD_NUNCHUK_BUTTON_C))
ScreenShot();
}
}

View File

@ -601,7 +601,10 @@ u32 wbfs_extract_disc(wbfs_disc_t*d, rw_sector_callback_t write_dst_wii_sector,
int dst_wbs_nlb = p->wbfs_sec_sz / p->wii_sec_sz;
copy_buffer = wbfs_ioalloc( p->wbfs_sec_sz );
if (!copy_buffer)
ERROR( "alloc memory" );
{
wbfs_error( "alloc memory" );
return 1;
}
for (i = 0; i < p->n_wbfs_sec_per_disc; i++)
{
@ -616,7 +619,6 @@ u32 wbfs_extract_disc(wbfs_disc_t*d, rw_sector_callback_t write_dst_wii_sector,
}
wbfs_iofree( copy_buffer );
return 0;
error: return 1;
}
u64 wbfs_estimate_disc(wbfs_t *p, read_wiidisc_callback_t read_src_wii_disc, void *callback_data, partition_selector_t sel)
@ -722,7 +724,7 @@ int wbfs_extract_file(wbfs_disc_t*d, char *path, void **data)
wd = wd_open_disc(read_wiidisc_wbfsdisc, d);
if (!wd)
{
ERROR( "opening wbfs disc" );
wbfs_error( "opening wbfs disc" );
return -1;
}
wd->extracted_size = 0;
@ -734,7 +736,8 @@ int wbfs_extract_file(wbfs_disc_t*d, char *path, void **data)
ret = -1;
}
wd_close_disc(wd);
error: return ret;
return ret;
}
int wbfs_get_fragments(wbfs_disc_t *d, _frag_append_t append_fragment, void *callback_data, u32 hdd_sector_size)

View File

@ -1,6 +1,9 @@
#include <unistd.h>
#include "GameBrowseMenu.hpp"
#include "Controls/DeviceHandler.hpp"
#include "GUI/gui_gamelist.h"
#include "GUI/gui_gamegrid.h"
#include "GUI/gui_gamecarousel.h"
#include "GUI/LoadCoverImage.h"
#include "prompts/PromptWindows.h"
#include "prompts/gameinfo.h"
@ -33,13 +36,10 @@
#include "wpad.h"
#include "sys.h"
extern int load_from_fs;
extern u8 mountMethod;
extern bool updateavailable;
extern struct discHdr *dvdheader;
extern int cntMissFiles;
static int lastSelectedGame = 0;
static bool WiiMoteInitiated = false;
static bool Exiting = false;
@ -52,8 +52,6 @@ GameBrowseMenu::GameBrowseMenu()
Exiting = false;
show_searchwindow = false;
gameBrowser = NULL;
gameGrid = NULL;
gameCarousel = NULL;
searchBar = NULL;
gameCover = NULL;
gameCoverImg = NULL;
@ -476,11 +474,7 @@ GameBrowseMenu::~GameBrowseMenu()
delete DownloadBtnTT;
delete IDBtnTT;
lastSelectedGame = LIMIT(GetSelectedGame(), 0, gameList.size()-1);
delete gameBrowser;
delete gameGrid;
delete gameCarousel;
mainWindow->Remove(searchBar);
delete searchBar;
@ -609,18 +603,13 @@ void GameBrowseMenu::ReloadBrowser()
}
}
if(GetSelectedGame() >= 0)
lastSelectedGame = LIMIT(GetSelectedGame(), 0, gameList.size()-1);
else
lastSelectedGame = LIMIT(lastSelectedGame, 0, gameList.size()-1);
//! Check if the loaded setting is still in range
Settings.SelectedGame = LIMIT(Settings.SelectedGame, 0, gameList.size()-1);
Settings.GameListOffset = LIMIT(Settings.GameListOffset, 0, gameList.size()-1);
delete gameBrowser;
delete gameGrid;
delete gameCarousel;
delete searchBar;
gameBrowser = NULL;
gameGrid = NULL;
gameCarousel = NULL;
searchBar = NULL;
if (Settings.gameDisplay == LIST_MODE)
@ -653,9 +642,10 @@ void GameBrowseMenu::ReloadBrowser()
dvdBtn->SetPosition(Settings.widescreen ? thInt("512 - list layout dvd btn pos x widescreen") : thInt("540 - list layout dvd btn pos x"),
thInt("13 - list layout dvd btn pos y"));
gameBrowser = new GuiGameBrowser(thInt("396 - game list layout width"), thInt("280 - game list layout height"), lastSelectedGame);
gameBrowser = new GuiGameList(thInt("396 - game list layout width"), thInt("280 - game list layout height"), Settings.GameListOffset);
gameBrowser->SetPosition(thInt("200 - game list layout pos x"), thInt("49 - game list layout pos y"));
gameBrowser->SetAlignment(ALIGN_LEFT, ALIGN_CENTRE);
gameBrowser->SetSelectedOption(Settings.SelectedGame);
}
else if (Settings.gameDisplay == GRID_MODE)
{
@ -687,9 +677,9 @@ void GameBrowseMenu::ReloadBrowser()
dvdBtn->SetPosition(Settings.widescreen ? thInt("448 - grid layout dvd btn pos x widescreen") : thInt("480 - grid layout dvd btn pos x"),
thInt("13 - grid layout dvd btn pos y"));
gameGrid = new GuiGameGrid(thInt("640 - game grid layout width"), thInt("400 - game grid layout height"), Settings.theme_path, lastSelectedGame);
gameGrid->SetPosition(thInt("0 - game grid layout pos x"), thInt("20 - game grid layout pos y"));
gameGrid->SetAlignment(ALIGN_LEFT, ALIGN_CENTRE);
gameBrowser = new GuiGameGrid(thInt("640 - game grid layout width"), thInt("400 - game grid layout height"), Settings.theme_path, Settings.GameListOffset);
gameBrowser->SetPosition(thInt("0 - game grid layout pos x"), thInt("20 - game grid layout pos y"));
gameBrowser->SetAlignment(ALIGN_LEFT, ALIGN_CENTRE);
}
else if (Settings.gameDisplay == CAROUSEL_MODE)
{
@ -721,9 +711,9 @@ void GameBrowseMenu::ReloadBrowser()
dvdBtn->SetPosition(Settings.widescreen ? thInt("448 - carousel layout dvd btn pos x widescreen") : thInt("480 - carousel layout dvd btn pos x"),
thInt("13 - carousel layout dvd btn pos y"));
gameCarousel = new GuiGameCarousel(thInt("640 - game carousel layout width"), thInt("400 - game carousel layout height"), Settings.theme_path, lastSelectedGame);
gameCarousel->SetPosition(thInt("0 - game carousel layout pos x"), thInt("-20 - game carousel layout pos y"));
gameCarousel->SetAlignment(ALIGN_LEFT, ALIGN_CENTRE);
gameBrowser = new GuiGameCarousel(thInt("640 - game carousel layout width"), thInt("400 - game carousel layout height"), Settings.theme_path, Settings.GameListOffset);
gameBrowser->SetPosition(thInt("0 - game carousel layout pos x"), thInt("-20 - game carousel layout pos y"));
gameBrowser->SetAlignment(ALIGN_LEFT, ALIGN_CENTRE);
}
@ -768,12 +758,6 @@ void GameBrowseMenu::ReloadBrowser()
if (gameBrowser)
Append(gameBrowser);
else if (gameGrid)
Append(gameGrid);
else if (gameCarousel)
Append(gameCarousel);
if (show_searchwindow)
{
searchBar = new GuiSearchBar(gameList.GetAvailableSearchChars());
@ -895,7 +879,7 @@ int GameBrowseMenu::MainLoop()
wString oldFilter(gameList.GetCurrentFilter());
gameList.FilterList(oldFilter.c_str());
if(Settings.GameSort & SORT_FAVORITE && gameList.size() == 0)
if((Settings.GameSort & SORT_FAVORITE) && gameList.size() == 0)
{
Settings.GameSort &= ~SORT_FAVORITE;
gameList.FilterList(oldFilter.c_str());
@ -1072,6 +1056,37 @@ int GameBrowseMenu::MainLoop()
}
}
else if(categBtn->GetState() == STATE_CLICKED)
{
if (!Settings.godmode && (Settings.ParentalBlocks & BLOCK_CATEGORIES_MENU))
{
WindowPrompt(tr( "Permission denied." ), tr( "Console must be unlocked for this option." ), tr( "OK" ));
categBtn->ResetState();
return returnMenu;
}
mainWindow->SetState(STATE_DISABLED);
CategorySwitchPrompt promptMenu;
promptMenu.SetAlignment(thAlign("center - category switch prompt align hor"), thAlign("middle - category switch prompt align ver"));
promptMenu.SetPosition(thInt("0 - category switch prompt pos x"), thInt("0 - category switch prompt pos y"));
promptMenu.SetEffect(EFFECT_FADE, 20);
mainWindow->Append(&promptMenu);
promptMenu.Show();
promptMenu.SetEffect(EFFECT_FADE, -20);
while(promptMenu.GetEffect() > 0) usleep(100);
mainWindow->Remove(&promptMenu);
categBtn->ResetState();
mainWindow->SetState(STATE_DEFAULT);
if(promptMenu.categoriesChanged())
{
wString oldFilter(gameList.GetCurrentFilter());
gameList.FilterList(oldFilter.c_str());
ReloadBrowser();
}
}
else if (Settings.gameDisplay == LIST_MODE && idBtn->GetState() == STATE_CLICKED)
{
gprintf("\tidBtn Clicked\n");
@ -1103,7 +1118,14 @@ int GameBrowseMenu::MainLoop()
}
}
gameClicked = GetClickedGame();
if(gameBrowser)
{
//! This is bad, but for saving pupose it will be in main loop
Settings.GameListOffset = gameBrowser->getListOffset();
Settings.SelectedGame = gameBrowser->GetSelectedOption()-Settings.GameListOffset;
}
gameClicked = gameBrowser ? gameBrowser->GetClickedOption() : -1;
if ((gameClicked >= 0 && gameClicked < (s32) gameList.size()) || mountMethod != 0)
{
OpenClickedGame();
@ -1153,30 +1175,6 @@ void GameBrowseMenu::CheckDiscSlotUpdate()
rockout(GetSelectedGame());
}
else if(categBtn->GetState() == STATE_CLICKED)
{
mainWindow->SetState(STATE_DISABLED);
CategorySwitchPrompt promptMenu;
promptMenu.SetAlignment(thAlign("center - category switch prompt align hor"), thAlign("middle - category switch prompt align ver"));
promptMenu.SetPosition(thInt("0 - category switch prompt pos x"), thInt("0 - category switch prompt pos y"));
promptMenu.SetEffect(EFFECT_FADE, 20);
mainWindow->Append(&promptMenu);
promptMenu.Show();
promptMenu.SetEffect(EFFECT_FADE, -20);
while(promptMenu.GetEffect() > 0) usleep(100);
mainWindow->Remove(&promptMenu);
categBtn->ResetState();
mainWindow->SetState(STATE_DEFAULT);
if(promptMenu.categoriesChanged())
{
wString oldFilter(gameList.GetCurrentFilter());
gameList.FilterList(oldFilter.c_str());
ReloadBrowser();
}
}
if(DiscDriveCoverOld != DiscDriveCover)
{
if(DiscDriveCover & 0x02)
@ -1220,34 +1218,6 @@ void GameBrowseMenu::UpdateClock()
clockTime->SetText(theTime);
}
int GameBrowseMenu::GetSelectedGame()
{
if(gameBrowser)
return gameBrowser->GetSelectedOption();
else if(gameCarousel)
return gameCarousel->GetSelectedOption();
else if(gameGrid)
return gameGrid->GetSelectedOption();
return -1;
}
int GameBrowseMenu::GetClickedGame()
{
if(gameBrowser)
return gameBrowser->GetClickedOption();
else if(gameCarousel)
return gameCarousel->GetClickedOption();
else if(gameGrid)
return gameGrid->GetClickedOption();
return -1;
}
void GameBrowseMenu::UpdateGameInfoText(const u8 * gameId)
{
if(!gameId)
@ -1334,6 +1304,7 @@ int GameBrowseMenu::OpenClickedGame()
}
rockout(gameSelected);
if(gameBrowser) gameBrowser->SetState(STATE_DISABLED);
struct discHdr *header = (mountMethod ? dvdheader : gameList[gameSelected]);
@ -1362,6 +1333,7 @@ int GameBrowseMenu::OpenClickedGame()
gameSelected = GamePrompt->GetSelectedGame();
delete GamePrompt;
SetState(STATE_DEFAULT);
if(gameBrowser) gameBrowser->SetState(STATE_DISABLED);
//update header and id if it was changed
header = (mountMethod ? dvdheader : gameList[gameSelected]);
snprintf(IDfull, sizeof(IDfull), "%s", (char *) header->id);
@ -1409,6 +1381,7 @@ int GameBrowseMenu::OpenClickedGame()
rockout(-1, -1);
mountMethod = 0;
if(gameBrowser) gameBrowser->SetState(STATE_DEFAULT);
if (searchBar)
{

View File

@ -1,10 +1,7 @@
#ifndef GAMEBROWSEMENU_HPP_
#define GAMEBROWSEMENU_HPP_
#include "GUI/gui.h"
#include "GUI/gui_gamebrowser.h"
#include "GUI/gui_gamegrid.h"
#include "GUI/gui_gamecarousel.h"
#include "GUI/gui_searchbar.h"
#include "utils/ThreadedTask.hpp"
@ -12,14 +9,13 @@ class GameBrowseMenu : public GuiWindow
{
public:
GameBrowseMenu();
~GameBrowseMenu();
virtual ~GameBrowseMenu();
static int Execute();
void ReloadBrowser();
protected:
private:
int MainLoop();
int OpenClickedGame();
int GetSelectedGame();
int GetClickedGame();
int GetSelectedGame() { return (gameBrowser ? gameBrowser->GetSelectedOption() : -1); }
void UpdateGameInfoText(const u8 * gameId);
void LoadCover(struct discHdr *header);
void CheckAlternativeDOL(const char * IDfull);
@ -41,8 +37,6 @@ class GameBrowseMenu : public GuiWindow
std::vector<GuiButton *> ToolBar;
GuiGameBrowser * gameBrowser;
GuiGameGrid * gameGrid;
GuiGameCarousel * gameCarousel;
GuiSearchBar * searchBar;
GuiImageData * btnInstall;

View File

@ -10,7 +10,7 @@ class WDMMenu : public GuiWindow
{
public:
WDMMenu(const struct discHdr * header);
~WDMMenu();
virtual ~WDMMenu();
int GetChoice();
static int Show(const struct discHdr * header);
static u32 GetAlternateDolOffset() { return AlternateDolOffset; }

View File

@ -71,8 +71,6 @@ extern const u32 gxdrawhooks[4];
extern const u32 gxflushhooks[4];
extern const u32 ossleepthreadhooks[4];
extern const u32 axnextframehooks[4];
extern const u32 wpadbuttonsdownhooks[4];
extern const u32 wpadbuttonsdown2hooks[4];
void SetCheatFilepath(const char * path)
{

View File

@ -36,72 +36,72 @@
//#include "main.h"
u32 hooktype = 0;
extern const char * CheatFilepath;
extern void patchhook(u32 address, u32 len);
extern void patchhook2(u32 address, u32 len);
extern void patchhook3(u32 address, u32 len);
//extern void patchhook2(u32 address, u32 len);
//extern void patchhook3(u32 address, u32 len);
extern void multidolpatchone(u32 address, u32 len);
extern void multidolpatchtwo(u32 address, u32 len);
//extern void multidolpatchone(u32 address, u32 len);
//extern void multidolpatchtwo(u32 address, u32 len);
extern void regionfreejap(u32 address, u32 len);
extern void regionfreeusa(u32 address, u32 len);
extern void regionfreepal(u32 address, u32 len);
//extern void regionfreejap(u32 address, u32 len);
//extern void regionfreeusa(u32 address, u32 len);
//extern void regionfreepal(u32 address, u32 len);
extern void removehealthcheck(u32 address, u32 len);
//extern void removehealthcheck(u32 address, u32 len);
extern void copyflagcheck1(u32 address, u32 len);
extern void copyflagcheck2(u32 address, u32 len);
extern void copyflagcheck3(u32 address, u32 len);
extern void copyflagcheck4(u32 address, u32 len);
extern void copyflagcheck5(u32 address, u32 len);
//extern void copyflagcheck1(u32 address, u32 len);
//extern void copyflagcheck2(u32 address, u32 len);
//extern void copyflagcheck3(u32 address, u32 len);
//extern void copyflagcheck4(u32 address, u32 len);
//extern void copyflagcheck5(u32 address, u32 len);
extern void patchupdatecheck(u32 address, u32 len);
//extern void patchupdatecheck(u32 address, u32 len);
extern void movedvdhooks(u32 address, u32 len);
//extern void movedvdhooks(u32 address, u32 len);
extern void multidolhook(u32 address);
extern void langvipatch(u32 address, u32 len, u8 langbyte);
extern void vipatch(u32 address, u32 len);
static const u32 multidolpatch1[2] = { 0x3C03FFB4, 0x28004F43 };
//static const u32 multidolpatch1[2] = { 0x3C03FFB4, 0x28004F43 };
static const u32 healthcheckhook[2] = { 0x41810010, 0x881D007D };
//static const u32 healthcheckhook[2] = { 0x41810010, 0x881D007D };
static const u32 updatecheckhook[3] = { 0x80650050, 0x80850054, 0xA0A50058 };
//static const u32 updatecheckhook[3] = { 0x80650050, 0x80850054, 0xA0A50058 };
static const u32 multidolpatch2[2] = { 0x3F608000, 0x807B0018 };
//static const u32 multidolpatch2[2] = { 0x3F608000, 0x807B0018 };
static const u32 recoveryhooks[3] = { 0xA00100AC, 0x5400073E, 0x2C00000F };
//static const u32 recoveryhooks[3] = { 0xA00100AC, 0x5400073E, 0x2C00000F };
static const u32 nocopyflag1[3] = { 0x540007FF, 0x4182001C, 0x80630068 };
//static const u32 nocopyflag1[3] = { 0x540007FF, 0x4182001C, 0x80630068 };
static const u32 nocopyflag2[3] = { 0x540007FF, 0x41820024, 0x387E12E2 };
//static const u32 nocopyflag2[3] = { 0x540007FF, 0x41820024, 0x387E12E2 };
// this one is for the GH3 and VC saves
//static const u32 nocopyflag3[5] = {
// 0x2C030000, 0x40820010, 0x88010020, 0x28000002, 0x41820234
//};
static const u32 nocopyflag3[5] = { 0x2C030000, 0x41820200, 0x48000058, 0x38610100 };
//static const u32 nocopyflag3[5] = { 0x2C030000, 0x41820200, 0x48000058, 0x38610100 };
// this removes the display warning for no copy VC and GH3 saves
static const u32 nocopyflag4[4] = { 0x80010008, 0x2C000000, 0x4182000C, 0x3BE00001 };
//static const u32 nocopyflag4[4] = { 0x80010008, 0x2C000000, 0x4182000C, 0x3BE00001 };
static const u32 nocopyflag5[3] = { 0x801D0024, 0x540007FF, 0x41820024 };
//static const u32 nocopyflag5[3] = { 0x801D0024, 0x540007FF, 0x41820024 };
static const u32 movedvdpatch[3] = { 0x2C040000, 0x41820120, 0x3C608109 };
//static const u32 movedvdpatch[3] = { 0x2C040000, 0x41820120, 0x3C608109 };
static const u32 regionfreehooks[5] = { 0x7C600774, 0x2C000001, 0x41820030, 0x40800010, 0x2C000000 };
//static const u32 regionfreehooks[5] = { 0x7C600774, 0x2C000001, 0x41820030, 0x40800010, 0x2C000000 };
static const u32 cIOScode[16] = { 0x7f06c378, 0x7f25cb78, 0x387e02c0, 0x4cc63182 };
//static const u32 cIOScode[16] = { 0x7f06c378, 0x7f25cb78, 0x387e02c0, 0x4cc63182 };
static const u32 cIOSblock[16] = { 0x2C1800F9, 0x40820008, 0x3B000024 };
//static const u32 cIOSblock[16] = { 0x2C1800F9, 0x40820008, 0x3B000024 };
static const u32 fwritepatch[8] = { 0x9421FFD0, 0x7C0802A6, 0x90010034, 0xBF210014, 0x7C9B2378, 0x7CDC3378, 0x7C7A1B78,
0x7CB92B78 // bushing fwrite
};
//static const u32 fwritepatch[8] = { 0x9421FFD0, 0x7C0802A6, 0x90010034, 0xBF210014, 0x7C9B2378, 0x7CDC3378, 0x7C7A1B78,
// 0x7CB92B78 // bushing fwrite
// };
static const u32 vipatchcode[3] = { 0x4182000C, 0x4180001C, 0x48000018 };
@ -131,9 +131,9 @@ const u32 multidolchanhooks[4] = { 0x4200FFF4, 0x48000004, 0x38800000, 0x4E80002
const u32 langpatch[3] = { 0x7C600775, 0x40820010, 0x38000000 };
static const u32 oldpatch002[3] = { 0x2C000000, 0x40820214, 0x3C608000 };
//static const u32 oldpatch002[3] = { 0x2C000000, 0x40820214, 0x3C608000 };
static const u32 newpatch002[3] = { 0x2C000000, 0x48000214, 0x3C608000 };
//static const u32 newpatch002[3] = { 0x2C000000, 0x48000214, 0x3C608000 };
//---------------------------------------------------------------------------------
bool dogamehooks(void *addr, u32 len)

View File

@ -30,7 +30,7 @@ class CategoryPrompt : public GuiWindow, public sigslot::has_slots<>
{
public:
CategoryPrompt(const string &title);
~CategoryPrompt();
virtual ~CategoryPrompt();
int Show();
bool categoriesChanged() const { return changed; }
protected:

View File

@ -62,7 +62,7 @@ void CategorySelectPrompt::onBrowserRefresh()
}
}
browser->AddEntrie(GameCategories.CategoryList.getCurrentName(), checked);
browser->AddEntrie(tr(GameCategories.CategoryList.getCurrentName().c_str()), checked);
}
while(GameCategories.CategoryList.goToNext());

View File

@ -59,7 +59,7 @@ void CategorySwitchPrompt::onBrowserRefresh()
}
}
browser->AddEntrie(GameCategories.CategoryList.getCurrentName(), checked);
browser->AddEntrie(tr(GameCategories.CategoryList.getCurrentName().c_str()), checked);
}
while(GameCategories.CategoryList.goToNext());

View File

@ -43,7 +43,7 @@ class CheckboxPrompt : private PromptWindow, public sigslot::has_slots<>
//! Constructor
CheckboxPrompt(const char * title = 0, const char *msg = 0);
//! Destructor
~CheckboxPrompt();
virtual ~CheckboxPrompt();
//! Add new checkbox
void AddCheckBox(const char *text);
//! Default function to get the button pressed

View File

@ -181,7 +181,7 @@ GameWindow::GameWindow(int Selected)
Append(FavoriteBtn[i]);
}
//check if unlocked
if (mountMethod != 2 && (Settings.godmode || !(Settings.ParentalBlocks & BLOCK_GAME_INSTALL)))
if (mountMethod != 2 && (Settings.godmode || !(Settings.ParentalBlocks & BLOCK_GAME_SETTINGS)))
{
backBtn->SetAlignment(ALIGN_RIGHT, ALIGN_BOTTOM);
backBtn->SetPosition(-50, -40);

View File

@ -11,7 +11,7 @@ class GameWindow : public GuiWindow
{
public:
GameWindow(int GameSelected);
~GameWindow();
virtual ~GameWindow();
int Show();
int GetSelectedGame() { return gameSelected; };
void SetGameBrowseMenu(GameBrowseMenu *m) { browserMenu = m; };

View File

@ -34,7 +34,7 @@ class HomebrewPrompt : public PromptWindow, public sigslot::has_slots<>
HomebrewPrompt(const char *name, const char *coder, const char *version,
const char *release_date, const char *long_description,
GuiImageData * iconImgData, u64 filesize);
~HomebrewPrompt();
virtual ~HomebrewPrompt();
int MainLoop();
private:
void onListChange(int SelItem, int SelInd);

View File

@ -32,7 +32,7 @@ class PromptWindow : public GuiWindow
//! Constructor
PromptWindow(const char *title = 0, const char *msg = 0);
//! Destructor
~PromptWindow();
virtual ~PromptWindow();
//! Set title text
void SetTitle(const char *text) { titleTxt->SetText(text); };
//! Set message text

View File

@ -45,13 +45,8 @@
/*** Extern variables ***/
s32 gameStart = 0;
extern float gamesize;
extern u8 shutdown;
extern u8 reset;
extern u8 mountMethod;
extern struct discHdr *dvdheader;
extern char game_partition[6];
extern int connection;
/****************************************************************************
* OnScreenNumpad

View File

@ -123,6 +123,8 @@ void CSettings::SetDefault()
EnabledCategories.resize(1);
EnabledCategories[0] = 0;
Wiinnertag = OFF;
SelectedGame = 0;
GameListOffset = 0;
}
bool CSettings::Load()
@ -279,6 +281,8 @@ bool CSettings::Save()
fprintf(file, "\n");
fprintf(file, "Wiinnertag = %d\n", Wiinnertag);
fprintf(file, "WiinnertagPath = %s\n", WiinnertagPath);
fprintf(file, "SelectedGame = %d\n", SelectedGame);
fprintf(file, "GameListOffset = %d\n", GameListOffset);
fclose(file);
return true;
@ -540,6 +544,14 @@ bool CSettings::SetSetting(char *name, char *value)
{
if (sscanf(value, "%d", &i) == 1) Wiinnertag = i;
}
else if(strcmp(name, "SelectedGame") == 0)
{
if (sscanf(value, "%d", &i) == 1) SelectedGame = i;
}
else if(strcmp(name, "GameListOffset") == 0)
{
if (sscanf(value, "%d", &i) == 1) GameListOffset = i;
}
else if (strcmp(name, "InstallPartitions") == 0)
{
InstallPartitions = strtoul(value, 0, 16);

View File

@ -121,6 +121,8 @@ class CSettings
f32 WSFactor;
f32 FontScaleFactor;
short Wiinnertag;
short SelectedGame;
short GameListOffset;
std::vector<u32> EnabledCategories;
protected:
bool ValidVersion(FILE * file);

View File

@ -172,6 +172,7 @@ enum
BLOCK_CATEGORIES_MOD = 0x010000,
BLOCK_FEATURE_SETTINGS = 0x020000,
BLOCK_HARD_DRIVE_SETTINGS = 0x040000,
BLOCK_CATEGORIES_MENU = 0x080000,
BLOCK_ALL = 0xFFFFFFFF,
};

View File

@ -30,7 +30,6 @@ class CustomPathsSM : public SettingsMenu
{
public:
CustomPathsSM();
virtual int GetType() { return CCustomPathsSM; };
protected:
void SetOptionValues();
int GetMenuInternal();

View File

@ -30,7 +30,6 @@ class FeatureSettingsMenu : public SettingsMenu
{
public:
FeatureSettingsMenu();
virtual int GetType() { return CFeatureSettings; };
protected:
void SetOptionValues();
int GetMenuInternal();

View File

@ -354,7 +354,7 @@ void FlyingButtonsMenu::ShowButtonsEffects(int effect, int effect_speed)
return;
//! Don't lock on fade in for initiation purpose
if(effect & EFFECT_FADE && effect_speed > 0)
if((effect & EFFECT_FADE) && effect_speed > 0)
return;
while (parentElement && MainButton[FirstItem]->GetEffect() > 0)

View File

@ -34,7 +34,7 @@ class FlyingButtonsMenu : public GuiWindow
{
public:
FlyingButtonsMenu(const char * menu_title);
~FlyingButtonsMenu();
virtual ~FlyingButtonsMenu();
virtual int MainLoop();
virtual void HideMenu();
virtual void ShowMenu();

View File

@ -30,8 +30,7 @@ class GuiSettingsMenu : public SettingsMenu
{
public:
GuiSettingsMenu();
~GuiSettingsMenu();
virtual int GetType() { return CGUISettingsMenu; };
virtual ~GuiSettingsMenu();
protected:
void SetOptionValues();
int GetMenuInternal();

View File

@ -31,8 +31,7 @@ class GameLoadSM : public SettingsMenu
{
public:
GameLoadSM(const char * GameID);
~GameLoadSM();
virtual int GetType() { return CGameLoadSM; };
virtual ~GameLoadSM();
protected:
void SetDefaultConfig();
void SetOptionNames();

View File

@ -100,6 +100,11 @@ void GameSettingsMenu::CreateSettingsMenu(int menuNr)
//! Categories
else if(menuNr == Idx++)
{
if (!Settings.godmode && (Settings.ParentalBlocks & BLOCK_CATEGORIES_MENU))
{
WindowPrompt(tr( "Permission denied." ), tr( "Console must be unlocked for this option." ), tr( "OK" ));
return;
}
HideMenu();
Remove(backBtn);
ResumeGui();
@ -149,24 +154,6 @@ void GameSettingsMenu::CreateSettingsMenu(int menuNr)
void GameSettingsMenu::DeleteSettingsMenu()
{
if(!CurrentMenu)
return;
int type = CurrentMenu->GetType();
switch(type)
{
case CGameLoadSM:
delete ((GameLoadSM *) CurrentMenu);
break;
case CUninstallSM:
delete ((UninstallSM *) CurrentMenu);
break;
case CSettingsMenu:
default:
delete CurrentMenu;
break;
}
delete CurrentMenu;
CurrentMenu = NULL;
}

View File

@ -33,7 +33,7 @@ class GameSettingsMenu : public FlyingButtonsMenu
{
public:
GameSettingsMenu(GameBrowseMenu *parent, struct discHdr * header);
~GameSettingsMenu();
virtual ~GameSettingsMenu();
static int Show(GameBrowseMenu *parent, struct discHdr *header);
protected:
virtual void CreateSettingsMenu(int index);

View File

@ -261,39 +261,6 @@ void GlobalSettings::CreateSettingsMenu(int menuNr)
void GlobalSettings::DeleteSettingsMenu()
{
if(!CurrentMenu)
return;
int type = CurrentMenu->GetType();
switch(type)
{
case CGUISettingsMenu:
delete ((GuiSettingsMenu *) CurrentMenu);
break;
case CLoaderSettings:
delete ((LoaderSettings *) CurrentMenu);
break;
case CParentalControlSM:
delete ((ParentalControlSM *) CurrentMenu);
break;
case CSoundSettingsMenu:
delete ((SoundSettingsMenu *) CurrentMenu);
break;
case CCustomPathsSM:
delete ((CustomPathsSM *) CurrentMenu);
break;
case CFeatureSettings:
delete ((FeatureSettingsMenu *) CurrentMenu);
break;
case CHardDriveSM:
delete ((HardDriveSM *) CurrentMenu);
break;
case CSettingsMenu:
default:
delete CurrentMenu;
break;
}
delete CurrentMenu;
CurrentMenu = NULL;
}

View File

@ -30,7 +30,7 @@ class GlobalSettings : public FlyingButtonsMenu
{
public:
GlobalSettings();
~GlobalSettings();
virtual ~GlobalSettings();
static int Show();
protected:
virtual void CreateSettingsMenu(int index);

View File

@ -30,8 +30,7 @@ class HardDriveSM : public SettingsMenu
{
public:
HardDriveSM();
~HardDriveSM();
virtual int GetType() { return CHardDriveSM; };
virtual ~HardDriveSM();
protected:
void SetOptionValues();
int GetMenuInternal();

View File

@ -30,7 +30,6 @@ class LoaderSettings : public SettingsMenu
{
public:
LoaderSettings();
virtual int GetType() { return CLoaderSettings; };
protected:
void SetOptionValues();
int GetMenuInternal();

View File

@ -74,6 +74,7 @@ ParentalControlSM::ParentalControlSM()
Options->SetName(Idx++, "%s", tr( "Block Cover Downloads" ));
Options->SetName(Idx++, "%s", tr( "Block Game Install" ));
Options->SetName(Idx++, "%s", tr( "Block GameID Change" ));
Options->SetName(Idx++, "%s", tr( "Block Categories Menu" ));
Options->SetName(Idx++, "%s", tr( "Block Categories Modify" ));
SetOptionValues();
@ -157,6 +158,9 @@ void ParentalControlSM::SetOptionValues()
//! Settings: Block GameID Change
Options->SetValue(Idx++, "%s", tr(OnOffText[((Settings.ParentalBlocks & BLOCK_GAMEID_CHANGE) != 0)]));
//! Settings: Block Categories Menu
Options->SetValue(Idx++, "%s", tr(OnOffText[((Settings.ParentalBlocks & BLOCK_CATEGORIES_MENU) != 0)]));
//! Settings: Block Categories Modify
Options->SetValue(Idx++, "%s", tr(OnOffText[((Settings.ParentalBlocks & BLOCK_CATEGORIES_MOD) != 0)]));
}
@ -334,6 +338,12 @@ int ParentalControlSM::GetMenuInternal()
Settings.ParentalBlocks ^= BLOCK_GAMEID_CHANGE;
}
//! Settings: Block Categories Menu
else if (ret == ++Idx)
{
Settings.ParentalBlocks ^= BLOCK_CATEGORIES_MENU;
}
//! Settings: Block Categories Modify
else if (ret == ++Idx)
{

View File

@ -30,7 +30,6 @@ class ParentalControlSM : public SettingsMenu
{
public:
ParentalControlSM();
virtual int GetType() { return CParentalControlSM; };
protected:
void SetOptionValues();
int GetMenuInternal();

View File

@ -28,28 +28,13 @@
#include "GUI/gui_optionbrowser.h"
#include "menu.h"
enum
{
CSettingsMenu = 0,
CGUISettingsMenu,
CLoaderSettings,
CParentalControlSM,
CSoundSettingsMenu,
CCustomPathsSM,
CGameLoadSM,
CUninstallSM,
CFeatureSettings,
CHardDriveSM,
};
class SettingsMenu : public GuiWindow
{
public:
SettingsMenu(const char * title, OptionList * option, int returnTo);
~SettingsMenu();
virtual ~SettingsMenu();
int GetClickedOption();
int GetMenu();
virtual int GetType() { return CSettingsMenu; }
protected:
virtual int GetMenuInternal() { return MENU_NONE; };
int returnToMenu;

View File

@ -30,7 +30,6 @@ class SoundSettingsMenu : public SettingsMenu
{
public:
SoundSettingsMenu();
virtual int GetType() { return CSoundSettingsMenu; };
protected:
void SetOptionValues();
int GetMenuInternal();

View File

@ -30,7 +30,6 @@ class UninstallSM : public SettingsMenu
{
public:
UninstallSM(struct discHdr * header);
virtual int GetType() { return CUninstallSM; };
protected:
void SetOptionValues();
int GetMenuInternal();

View File

@ -30,9 +30,6 @@ extern "C"
extern s32 MagicPatches(s32);
}
extern char game_partition[6];
extern u8 load_from_fs;
//Wiilight stuff
static vu32 *_wiilight_reg = (u32*) 0xCD0000C0;
void wiilight(int enable) // Toggle wiilight (thanks Bool for wiilight source)

View File

@ -31,7 +31,7 @@ class ThemeDownloader : public FlyingButtonsMenu
{
public:
ThemeDownloader();
~ThemeDownloader();
virtual ~ThemeDownloader();
static int Run();
int MainLoop();
protected:

View File

@ -34,7 +34,7 @@ class ThemeMenu : public FlyingButtonsMenu
{
public:
ThemeMenu();
~ThemeMenu();
virtual ~ThemeMenu();
static int Run();
int MainLoop();
protected:

View File

@ -14,8 +14,6 @@
#include "patches/wip.h"
#include "settings/SettingsEnums.h"
extern bool geckoinit;
/* Apploader function pointers */
typedef int (*app_main)(void **dst, int *size, int *offset);
typedef void (*app_init)(void(*report)(const char *fmt, ...));

View File

@ -350,6 +350,7 @@ void PatchCountryStrings(void *Address, int Size)
SearchPattern[0] = 0x01;
SearchPattern[1] = 0x55; // U
SearchPattern[2] = 0x53; // S
break;
}
switch (diskid[3])
@ -372,6 +373,7 @@ void PatchCountryStrings(void *Address, int Size)
default:
PatchData[1] = 0x55; // U
PatchData[2] = 0x53; // S
break;
}
while (Size >= 4)

Some files were not shown because too many files have changed in this diff Show More