-updated NIN_CFG_VERSION to 7 for Nintendont argsboot and added triforce arcade option to game settings menu. tested and working.

-fixed wii u widescreen option in game config menu. should properly work now. thanks pBullet!
-added a fix for coverflow titles display when coverflow has 3 or more rows. for some reason 3 or more rows caused the title to display improperly.
-removed **disabled** message from source menu. no need for it - was a stupid idea. if you don't want it to display then remove it from your source menu or don't add it. when a view is disabled in wiiflow_lite.ini then only that view icon is disabled from showing on the main menu screen.
-removed titles.ini which wasn't really used except for displaying the return to channel in settings. I googled it and nothing really showed up. it seemed to be the same as custom_titles.ini - it seemed useless.
-removed cacheing sourceflow list. the list is never big enuff to worry about cacheing. plus if you add or remove source btns you won't have to reload cache for the changes to take effect.
-removed max_source_btns from wiiflow_lite.ini - added code to get highest source menu btn so now source menu can have as many buttons as you like.  
-removed Manage Languages Menu - restored option to just change wiiflow language. no need for downloading languages and the google link didn't work anyway. when i make a pack all the languages will be included.
-added flat cover options for sourceflow and homebrew view. can be turned on/off via their config menu's accessed via 'HOME' btn.
-added config menu for homebrew view - press 'HOME' btn while in homebrew view to access it. config menu options are -  switch apps partition, adjust coverflow, smallbox on/off, and flat covers on/off.
-updated config menu for source menu/flow. options include - sourceflow on/off, adjust coverflow, smallbox on/off, flat covers on/off, and for source menu only - multisource on/off.
-added coverflow layouts/versions for individual plugins - which means each plugin can have its own coverflow layout without affecting the others.
-set HQ cover to default to ON
-made it so coverflow doesn't reload every time you access another menu or change favorites or whatever.
-added error messages to game and app launching if any of the bin files needed for launching are missing. previously whenever these errors occurred wiiflow would just exit without the user knowing why. Now the error message should display before exit so the user has an idea what went wrong. had to move cleanup() back some for the errors to show. hopefully that doesn't cause out of mem issues for users with large game collections.
-added error messages to game config menu. now all config options will show but if you can't use it then a error shows telling you. such as 'use neek2o' will be available but if you set it to on and neek2o isn't installed then an error message shows. added error msgs for extracting and flashing saves too.
-added show_mem=yes/no option to wiiflow_lite.ini under [DEBUG]. manually edit wiiflow_lite.ini to turn it on/off. if set to 'yes' wiiflow will show how much free mem is available on screen. no need to compile wiiflow for this option anymore.
-cleaned up some of the boot up code.
-starting a random game - just hold 'B' and press '-'.  no longer press'B' on config or question mark icon and no need to allow it in wiiflow_lite.ini
This commit is contained in:
fledge68 2016-11-07 15:06:00 +00:00
parent db8a2b137c
commit 630594d976
36 changed files with 1316 additions and 1496 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 MiB

After

Width:  |  Height:  |  Size: 3.1 MiB

View File

@ -9,10 +9,8 @@
#define HOMEBREW_DIR "%s:/apps" #define HOMEBREW_DIR "%s:/apps"
#define DF_GC_GAMES_DIR "%s:/games" #define DF_GC_GAMES_DIR "%s:/games"
#define CFG_FILENAME "wiiflow_lite.ini" #define CFG_FILENAME "wiiflow_lite.ini"
#define LANG_FILENAME "languages.ini"
#define CAT_FILENAME "categories_lite.ini" #define CAT_FILENAME "categories_lite.ini"
#define SOURCE_FILENAME "source_menu.ini" #define SOURCE_FILENAME "source_menu.ini"
#define TITLES_FILENAME "titles.ini"
#define CTITLES_FILENAME "custom_titles.ini" #define CTITLES_FILENAME "custom_titles.ini"
#define TITLES_DUMP_FILENAME "titlesdump.ini" #define TITLES_DUMP_FILENAME "titlesdump.ini"
#define GAME_SETTINGS1_FILENAME "gameconfig1.ini" #define GAME_SETTINGS1_FILENAME "gameconfig1.ini"
@ -24,7 +22,7 @@
#define CHANNEL_DOMAIN "CHANNELS" #define CHANNEL_DOMAIN "CHANNELS"
#define PLUGIN_DOMAIN "PLUGINS" #define PLUGIN_DOMAIN "PLUGINS"
#define HOMEBREW_DOMAIN "HOMEBREW" #define HOMEBREW_DOMAIN "HOMEBREW"
#define MUSIC_DOMAIN "MUSIC" #define SOURCEFLOW_DOMAIN "SOURCEFLOW"
#define DEVELOPERS "Fledge68" #define DEVELOPERS "Fledge68"
#define PAST_DEVELOPERS "FIX94, OverjoY, Hibernatus, Narolez, Hulk, Miigotu, r-win" #define PAST_DEVELOPERS "FIX94, OverjoY, Hibernatus, Narolez, Hulk, Miigotu, r-win"

View File

@ -44,7 +44,8 @@ u8 NinDevice = 0;
bool NinArgsboot = false; bool NinArgsboot = false;
void Nintendont_SetOptions(const char *game, const char *gameID, char *CheatPath,char *NewCheatPath, const char *partition, void Nintendont_SetOptions(const char *game, const char *gameID, char *CheatPath,char *NewCheatPath, const char *partition,
bool cheats, u8 emuMC, u8 videomode, bool widescreen, bool usb_hid, bool native_ctl, bool deflicker, bool wiiu_widescreen, bool NIN_Debugger) bool cheats, u8 emuMC, u8 videomode, bool widescreen, bool usb_hid, bool native_ctl, bool deflicker,
bool wiiu_widescreen, bool NIN_Debugger, bool tri_arcade)
{ {
NinDevice = DeviceHandle.PathToDriveType(game); NinDevice = DeviceHandle.PathToDriveType(game);
memset(&NinCfg, 0, sizeof(NIN_CFG)); memset(&NinCfg, 0, sizeof(NIN_CFG));
@ -53,12 +54,30 @@ void Nintendont_SetOptions(const char *game, const char *gameID, char *CheatPath
//check version //check version
u32 NIN_cfg_version = NIN_CFG_VERSION; u32 NIN_cfg_version = NIN_CFG_VERSION;
char NINVersion[7]= "";
u32 NINRev = 0;
for(u8 i = SD; i < MAXDEVICES; ++i) for(u8 i = SD; i < MAXDEVICES; ++i)
{ {
const char *dol_path = fmt(NIN_LOADER_PATH, DeviceName[i]); const char *dol_path = fmt(NIN_LOADER_PATH, DeviceName[i]);
if(!fsop_FileExist(dol_path)) if(!fsop_FileExist(dol_path))
continue; continue;
//u8 *buffer = NULL;
u32 filesize = 0; u32 filesize = 0;
const char *str = "$$Version:";
u8 *buffer = fsop_ReadFile(dol_path, &filesize);
for(u32 i = 0; i < filesize; i += 32)
{
if(memcmp(buffer+i, str, strlen(str)) == 0)
{
// Write buffer in NINVersion
snprintf(NINVersion, sizeof(NINVersion), "%s", buffer+i+strlen(str));
NINRev = atoi(strchr(NINVersion, '.')+1);
break;
}
}
free(buffer);
break;
/*u32 filesize = 0;
u8 *buffer = fsop_ReadFile(dol_path, &filesize); u8 *buffer = fsop_ReadFile(dol_path, &filesize);
char NINversion[21]; char NINversion[21];
for(u32 i = 0; i < filesize-60; ++i) for(u32 i = 0; i < filesize-60; ++i)
@ -98,13 +117,24 @@ void Nintendont_SetOptions(const char *game, const char *gameID, char *CheatPath
} }
} }
free(buffer); free(buffer);
break; break;*/
} }
if(NINRev == 0)
return;
if(NINRev >= 135 && NINRev < 354)
NIN_cfg_version = 3;
else if(NINRev >= 354 && NINRev < 358)
NIN_cfg_version = 4;
else if(NINRev >= 358 && NINRev < 368)
NIN_cfg_version = 5;
else if(NINRev >= 368 && NINRev < 424)
NIN_cfg_version = 6;
NinCfg.Version = NIN_cfg_version; NinCfg.Version = NIN_cfg_version;
if(memcmp("0x474851",gameID,3)==0) /*if(memcmp("0x474851",gameID,3)==0)
NinCfg.MaxPads = 1; NinCfg.MaxPads = 1;
else else*/
NinCfg.MaxPads = 4; NinCfg.MaxPads = 4;
NinCfg.Config |= NIN_CFG_AUTO_BOOT; NinCfg.Config |= NIN_CFG_AUTO_BOOT;
@ -138,6 +168,9 @@ void Nintendont_SetOptions(const char *game, const char *gameID, char *CheatPath
if(widescreen) if(widescreen)
NinCfg.Config |= NIN_CFG_FORCE_WIDE; NinCfg.Config |= NIN_CFG_FORCE_WIDE;
if(tri_arcade)
NinCfg.Config |= NIN_CFG_ARCADE_MODE;
if(emuMC > 0) if(emuMC > 0)
NinCfg.Config |= NIN_CFG_MEMCARDEMU; NinCfg.Config |= NIN_CFG_MEMCARDEMU;
@ -156,7 +189,7 @@ void Nintendont_SetOptions(const char *game, const char *gameID, char *CheatPath
} }
else else
ptr = strchr(CheatPath, '/'); ptr = strchr(CheatPath, '/');
snprintf(NinCfg.CheatPath,sizeof(NinCfg.CheatPath),ptr); snprintf(NinCfg.CheatPath, sizeof(NinCfg.CheatPath), ptr);
NinCfg.Config |= NIN_CFG_CHEAT_PATH; NinCfg.Config |= NIN_CFG_CHEAT_PATH;
} }
if(cheats) if(cheats)

View File

@ -29,7 +29,8 @@ bool Nintendont_Installed();
bool Nintendont_GetLoader(); bool Nintendont_GetLoader();
void Nintendont_BootDisc(u8 emuMC, bool widescreen, bool usb_hid, bool native_ctl, bool deflicker); void Nintendont_BootDisc(u8 emuMC, bool widescreen, bool usb_hid, bool native_ctl, bool deflicker);
void Nintendont_SetOptions(const char *game, const char *gameID, char *CheatPath, char *NewCheatPath, const char *partition, void Nintendont_SetOptions(const char *game, const char *gameID, char *CheatPath, char *NewCheatPath, const char *partition,
bool cheats, u8 emuMC, u8 videomode, bool widescreen, bool usb_hid, bool native_ctl, bool deflicker, bool wiiu_widescreen, bool NIN_Debugger); bool cheats, u8 emuMC, u8 videomode, bool widescreen, bool usb_hid, bool native_ctl, bool deflicker,
bool wiiu_widescreen, bool NIN_Debugger, bool tri_arcade);
void Nintendont_WriteOptions(); void Nintendont_WriteOptions();
// Devolution // Devolution

View File

@ -2,8 +2,7 @@
#ifndef __COMMON_CONFIG_H__ #ifndef __COMMON_CONFIG_H__
#define __COMMON_CONFIG_H__ #define __COMMON_CONFIG_H__
#define NIN_CFG_VERSION 0x00000003 #define NIN_CFG_VERSION 0x00000007
#define OLD_NIN_CFG_VERSION 0x00000002
#define NIN_CFG_MAXPAD 4 #define NIN_CFG_MAXPAD 4
#define MEM_CARD_MAX (5) #define MEM_CARD_MAX (5)
#define MEM_CARD_CODE(x) (1<<(x+2)) #define MEM_CARD_CODE(x) (1<<(x+2))
@ -13,7 +12,7 @@
typedef struct NIN_CFG typedef struct NIN_CFG
{ {
unsigned int Magicbytes; // 0x01070CF6 unsigned int Magicbytes; // 0x01070CF6
unsigned int Version; // 0x00000001 unsigned int Version;
unsigned int Config; unsigned int Config;
unsigned int VideoMode; unsigned int VideoMode;
unsigned int Language; unsigned int Language;
@ -42,6 +41,7 @@ enum ninconfig
NIN_CFG_MC_MULTI = (1<<13), NIN_CFG_MC_MULTI = (1<<13),
NIN_CFG_NATIVE_SI = (1<<14), NIN_CFG_NATIVE_SI = (1<<14),
NIN_CFG_WIIU_WIDE = (1<<15), NIN_CFG_WIIU_WIDE = (1<<15),
NIN_CFG_ARCADE_MODE = (1<<16),
}; };
enum ninvideomode enum ninvideomode

View File

@ -1,4 +1,3 @@
// Coverflow
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
@ -1646,6 +1645,7 @@ void CCoverFlow::_updateTarget(int i, bool instant)
cvr.txtTargetAngle = lo.txtLeftAngle; cvr.txtTargetAngle = lo.txtLeftAngle;
cvr.txtTargetPos = lo.txtLeftPos; cvr.txtTargetPos = lo.txtLeftPos;
cvr.txtTargetColor = 0; cvr.txtTargetColor = 0;
cvr.txtColor = 0;//instant fade out if was displayed
cvr.title.setFrame(lo.txtSideWidth, lo.txtSideStyle, false, instant); cvr.title.setFrame(lo.txtSideWidth, lo.txtSideStyle, false, instant);
} }
// Right covers // Right covers
@ -1669,6 +1669,7 @@ void CCoverFlow::_updateTarget(int i, bool instant)
cvr.txtTargetAngle = lo.txtRightAngle; cvr.txtTargetAngle = lo.txtRightAngle;
cvr.txtTargetPos = lo.txtRightPos; cvr.txtTargetPos = lo.txtRightPos;
cvr.txtTargetColor = 0; cvr.txtTargetColor = 0;
cvr.txtColor = 0;//instant fade out if was displayed
cvr.title.setFrame(lo.txtSideWidth, lo.txtSideStyle, false, instant); cvr.title.setFrame(lo.txtSideWidth, lo.txtSideStyle, false, instant);
} }
// New center cover // New center cover
@ -1682,7 +1683,7 @@ void CCoverFlow::_updateTarget(int i, bool instant)
cvr.txtTargetColor = 0xFF; cvr.txtTargetColor = 0xFF;
cvr.txtTargetAngle = lo.txtCenterAngle; cvr.txtTargetAngle = lo.txtCenterAngle;
cvr.txtTargetPos = lo.txtCenterPos; cvr.txtTargetPos = lo.txtCenterPos;
cvr.title.setFrame(lo.txtCenterWidth, lo.txtCenterStyle, false, instant); cvr.title.setFrame(lo.txtCenterWidth, lo.txtCenterStyle, false, true);
} }
else // Center of a row else // Center of a row
{ {
@ -1692,6 +1693,7 @@ void CCoverFlow::_updateTarget(int i, bool instant)
cvr.targetPos = lo.rowCenterPos; cvr.targetPos = lo.rowCenterPos;
cvr.targetScale = lo.rowCenterScale; cvr.targetScale = lo.rowCenterScale;
cvr.txtTargetColor = 0; cvr.txtTargetColor = 0;
cvr.txtColor = 0;//instant fade out if was displayed
if (y < vcenter) if (y < vcenter)
{ {
cvr.txtTargetAngle = lo.txtLeftAngle; cvr.txtTargetAngle = lo.txtLeftAngle;
@ -1760,7 +1762,7 @@ void CCoverFlow::_updateTarget(int i, bool instant)
cvr.txtTargetAngle = lo.txtCenterAngle; cvr.txtTargetAngle = lo.txtCenterAngle;
cvr.txtTargetPos = lo.txtCenterPos; cvr.txtTargetPos = lo.txtCenterPos;
cvr.txtTargetColor = 0xFF; cvr.txtTargetColor = 0xFF;
cvr.title.setFrame(lo.txtCenterWidth, lo.txtCenterStyle, false, instant); cvr.title.setFrame(lo.txtCenterWidth, lo.txtCenterStyle, false, true);
} }
else else
{ {
@ -1769,6 +1771,7 @@ void CCoverFlow::_updateTarget(int i, bool instant)
cvr.txtTargetAngle = m_mouse[chan] > i ? lo.txtLeftAngle : lo.txtRightAngle; cvr.txtTargetAngle = m_mouse[chan] > i ? lo.txtLeftAngle : lo.txtRightAngle;
cvr.txtTargetPos = m_mouse[chan] > i ? lo.txtLeftPos : lo.txtRightPos; cvr.txtTargetPos = m_mouse[chan] > i ? lo.txtLeftPos : lo.txtRightPos;
cvr.txtTargetColor = 0; cvr.txtTargetColor = 0;
cvr.txtColor = 0;//instant fade out if was displayed
cvr.title.setFrame(lo.txtSideWidth, lo.txtSideStyle, false, instant); cvr.title.setFrame(lo.txtSideWidth, lo.txtSideStyle, false, instant);
} }
if (_invisibleCover(x, y)) if (_invisibleCover(x, y))
@ -2057,7 +2060,7 @@ void CCoverFlow::mouse(int chan, int x, int y)
} }
if (m != m_mouse[chan]) if (m != m_mouse[chan])
{ {
if ((u32)m_mouse[chan] < m_range) if ((u32)m_mouse[chan] < m_range && m_mouse[chan] >= 0)
_playSound(m_hoverSound); _playSound(m_hoverSound);
_updateAllTargets(); _updateAllTargets();
} }
@ -2465,7 +2468,7 @@ void CCoverFlow::_coverTick(int i)
m_covers[i].txtAngle += (m_covers[i].txtTargetAngle - m_covers[i].txtAngle) * speed; m_covers[i].txtAngle += (m_covers[i].txtTargetAngle - m_covers[i].txtAngle) * speed;
m_covers[i].txtPos += (m_covers[i].txtTargetPos - m_covers[i].txtPos) * speed; m_covers[i].txtPos += (m_covers[i].txtTargetPos - m_covers[i].txtPos) * speed;
int colorDist = (int)m_covers[i].txtTargetColor - (int)m_covers[i].txtColor; int colorDist = (int)m_covers[i].txtTargetColor - (int)m_covers[i].txtColor;
m_covers[i].txtColor += abs(colorDist) >= 2 ? (u8)(colorDist / 2) : (u8)colorDist; m_covers[i].txtColor += abs(colorDist) >= 8 ? (u8)(colorDist / 8) : (u8)colorDist;
m_covers[i].title.tick(); m_covers[i].title.tick();
} }
@ -2610,6 +2613,7 @@ bool CCoverFlow::fullCoverCached(const char *id)
bool CCoverFlow::_loadCoverTexPNG(u32 i, bool box, bool hq, bool blankBoxCover) bool CCoverFlow::_loadCoverTexPNG(u32 i, bool box, bool hq, bool blankBoxCover)
{ {
gprintf("loading %s cover\n", box ? (blankBoxCover ? "blank" : "box") : "flat");
if(!m_loadingCovers) return false; if(!m_loadingCovers) return false;
u8 textureFmt = m_compressTextures ? GX_TF_CMPR : GX_TF_RGB565; u8 textureFmt = m_compressTextures ? GX_TF_CMPR : GX_TF_RGB565;
@ -2843,7 +2847,11 @@ CCoverFlow::CLRet CCoverFlow::_loadCoverTex(u32 i, bool box, bool hq, bool blank
SWFCHeader header; SWFCHeader header;
if(fileSize > sizeof(header)) if(fileSize > sizeof(header))
{ {
fread(&header, 1, sizeof(header), fp); if(fread(&header, 1, sizeof(header), fp) != sizeof(header))
{
fclose(fp);
return _loadCoverTexPNG(i, box, hq, blankBoxCover) ? CL_OK : CL_ERROR;
}
//make sure wfc cache file matches what we want //make sure wfc cache file matches what we want
if(header.newFmt == 1 && (header.full != 0) == box && (header.cmpr != 0) == m_compressTextures) if(header.newFmt == 1 && (header.full != 0) == box && (header.cmpr != 0) == m_compressTextures)
{ {
@ -2883,7 +2891,11 @@ CCoverFlow::CLRet CCoverFlow::_loadCoverTex(u32 i, bool box, bool hq, bool blank
else else
{ {
fseek(fp, sizeof(header) + bufSize - texLen, SEEK_SET); fseek(fp, sizeof(header) + bufSize - texLen, SEEK_SET);
fread(tex.data, 1, texLen, fp); if(fread(tex.data, 1, texLen, fp) != texLen)
{
fclose(fp);
return _loadCoverTexPNG(i, box, hq, blankBoxCover) ? CL_OK : CL_ERROR;
}
} }
} }
if(!allocFailed) if(!allocFailed)

View File

@ -1,9 +1,11 @@
#include "fanart.hpp" #include "fanart.hpp"
#include "pngu.h" #include "pngu.h"
#include "boxmesh.hpp" #include "boxmesh.hpp"
#include "text.hpp" #include "text.hpp"
#include "gecko/gecko.hpp" #include "gecko/gecko.hpp"
#include "memory/mem2.hpp" #include "memory/mem2.hpp"
using namespace std; using namespace std;
static guVector _GRRaxisx = (guVector){1, 0, 0}; // DO NOT MODIFY!!! static guVector _GRRaxisx = (guVector){1, 0, 0}; // DO NOT MODIFY!!!

View File

@ -349,39 +349,19 @@ void GetFiles(const char *Path, const vector<string>& FileTypes,
SubPaths.clear(); SubPaths.clear();
} }
void ListGenerator::createSFList(u8 maxBtns, Config &m_sourceMenuCfg, bool show_homebrew, bool show_channel, bool show_plugin, bool show_gc, void ListGenerator::createSFList(u8 maxBtns, Config &m_sourceMenuCfg, const string& sourceDir)
const string& sourceDir, const string& DBName, bool UpdateCache)
{ {
Clear(); Clear();
if(!DBName.empty())
{
if(UpdateCache)
fsop_deleteFile(DBName.c_str());
else
{
CCache(*this, DBName, LOAD);
if(!this->empty())
return;
fsop_deleteFile(DBName.c_str());
}
}
char btn_selected[256]; char btn_selected[256];
for(u8 i = 0; i < maxBtns; i++) for(u8 i = 0; i < maxBtns; i++)
{ {
memset(btn_selected, 0, 256); memset(btn_selected, 0, 256);
strncpy(btn_selected, fmt("BUTTON_%i", i), 255); strncpy(btn_selected, fmt("BUTTON_%i", i), 255);
string source = m_sourceMenuCfg.getString(btn_selected, "source",""); const char *source = m_sourceMenuCfg.getString(btn_selected, "source","").c_str();
if(source == "") if(source == NULL)
continue;
if(source == "dml" && !show_gc)
continue;
else if(source == "emunand" && !show_channel)
continue;
else if(source == "homebrew" && (!show_homebrew))
continue;
else if((source == "plugin" || source == "allplugins") && !show_plugin)
continue; continue;
const char *path = fmt("%s/%s", sourceDir.c_str(), m_sourceMenuCfg.getString(btn_selected, "image", "").c_str()); const char *path = fmt("%s/%s", sourceDir.c_str(), m_sourceMenuCfg.getString(btn_selected, "image", "").c_str());
memset((void*)&ListElement, 0, sizeof(dir_discHdr)); memset((void*)&ListElement, 0, sizeof(dir_discHdr));
ListElement.index = m_cacheList.size(); ListElement.index = m_cacheList.size();
strncpy(ListElement.id, "SOURCE", 6); strncpy(ListElement.id, "SOURCE", 6);
@ -394,6 +374,4 @@ void ListGenerator::createSFList(u8 maxBtns, Config &m_sourceMenuCfg, bool show_
Asciify(ListElement.title); Asciify(ListElement.title);
m_cacheList.push_back(ListElement); m_cacheList.push_back(ListElement);
} }
if(!this->empty() && !DBName.empty()) /* Write a new Cache */
CCache(*this, DBName, SAVE);
} }

View File

@ -32,8 +32,7 @@ using namespace std;
class ListGenerator : public vector<dir_discHdr> class ListGenerator : public vector<dir_discHdr>
{ {
public: public:
void createSFList(u8 maxBtns, Config &m_sourceMenuCfg, bool show_homebrew, bool show_channel, bool show_plugin, bool show_gc, const string& sourceDir, void createSFList(u8 maxBtns, Config &m_sourceMenuCfg, const string& sourceDir);
const string& DBName, bool UpdateCache);
void Init(const char *settingsDir, const char *Language); void Init(const char *settingsDir, const char *Language);
void Clear(); void Clear();
void CreateList(u32 Flow, u32 Device, const string& Path, const vector<string>& FileTypes, void CreateList(u32 Flow, u32 Device, const string& Path, const vector<string>& FileTypes,

View File

@ -38,7 +38,6 @@ int main(int argc, char **argv)
NandHandle.Init(); NandHandle.Init();
char *gameid = NULL; char *gameid = NULL;
bool Emulator_boot = false;
bool iosOK = true; bool iosOK = true;
for(u8 i = 0; i < argc; i++) for(u8 i = 0; i < argc; i++)
@ -47,7 +46,7 @@ int main(int argc, char **argv)
{ {
while(argv[i][0] && !isdigit(argv[i][0])) while(argv[i][0] && !isdigit(argv[i][0]))
argv[i]++; argv[i]++;
if (atoi(argv[i]) < 254 && atoi(argv[i]) > 0) if(atoi(argv[i]) < 254 && atoi(argv[i]) > 0)
mainIOS = atoi(argv[i]); mainIOS = atoi(argv[i]);
} }
else if(strlen(argv[i]) == 6) else if(strlen(argv[i]) == 6)
@ -59,8 +58,6 @@ int main(int argc, char **argv)
gameid = NULL; gameid = NULL;
} }
} }
else if(argv[i] != NULL && strcasestr(argv[i], "EMULATOR_MAGIC") != NULL)
Emulator_boot = true;
} }
check_neek2o(); check_neek2o();
/* Init ISFS */ /* Init ISFS */
@ -105,12 +102,11 @@ int main(int argc, char **argv)
else else
{ {
writeStub(); writeStub();
if(Emulator_boot)
mainMenu.m_Emulator_boot = true;
if(gameid != NULL && strlen(gameid) == 6) if(gameid != NULL && strlen(gameid) == 6)
mainMenu.directlaunch(gameid); mainMenu.directlaunch(gameid);
else else
mainMenu.main(); mainMenu.main();
//if mainMenu.init set exit=true then mainMenu.main while loop does nothing and returns to here to exit wiiflow
} }
//Exit WiiFlow, no game booted... //Exit WiiFlow, no game booted...
mainMenu.cleanup();// cleanup and clear memory mainMenu.cleanup();// cleanup and clear memory

View File

@ -69,19 +69,17 @@ CMenu::CMenu()
m_wbf1_font = NULL; m_wbf1_font = NULL;
m_wbf2_font = NULL; m_wbf2_font = NULL;
m_current_view = COVERFLOW_WII; m_current_view = COVERFLOW_WII;
m_Emulator_boot = false;
m_prevBg = NULL; m_prevBg = NULL;
m_nextBg = NULL; m_nextBg = NULL;
m_lqBg = NULL; m_lqBg = NULL;
m_use_sd_logging = false; m_use_sd_logging = false;
m_use_wifi_gecko = false; m_use_wifi_gecko = false;
init_network = false; m_init_network = false;
m_use_source = true; m_use_source = true;
m_sourceflow = false; m_sourceflow = false;
m_numPlugins = 0; m_numPlugins = 0;
m_clearCats = true; m_clearCats = true;
m_catStartPage = 1; m_catStartPage = 1;
m_combined_view = false;
/* Explorer stuff */ /* Explorer stuff */
m_txt_view = false; m_txt_view = false;
m_txt_path = NULL; m_txt_path = NULL;
@ -129,7 +127,7 @@ void CMenu::init()
} }
} }
loadDefaultFont();// load default font _loadDefaultFont();// load default font
if(drive == check) // Should not happen if(drive == check) // Should not happen
{ {
_buildMenus(); _buildMenus();
@ -152,7 +150,7 @@ void CMenu::init()
m_use_sd_logging = m_cfg.getBool("DEBUG", "sd_write_log", false); m_use_sd_logging = m_cfg.getBool("DEBUG", "sd_write_log", false);
LogToSD_SetBuffer(m_use_sd_logging); LogToSD_SetBuffer(m_use_sd_logging);
/* Init Network if wanted */ /* Init Network if wanted */
init_network = (m_cfg.getBool("GENERAL", "async_network") || has_enabled_providers() || m_use_wifi_gecko); m_init_network = (m_cfg.getBool("GENERAL", "async_network") || has_enabled_providers() || m_use_wifi_gecko);
_netInit(); _netInit();
/* Try to find/make the wiiflow data directory */ /* Try to find/make the wiiflow data directory */
@ -182,11 +180,17 @@ void CMenu::init()
drive = DeviceName[i]; drive = DeviceName[i];
break; break;
} }
if(drive == check)//if no available USB partition then force SD if(drive == check && DeviceHandle.IsInserted(SD))//if no available USB partition then force SD
{
drive = DeviceName[SD];
//show error msg later to keep form calling _buildMenus() twice
}
else if(drive == check)
{ {
_buildMenus(); _buildMenus();
error(_fmt("errboot5", L"data_on_usb=yes and No available usb partitions for data!\nUsing SD.")); error(_fmt("errboot6", L"No available usb partitions for data and no SD inserted!\nExiting."));
drive = DeviceName[SD]; m_exit = true;
return;
} }
} }
else else
@ -416,7 +420,11 @@ void CMenu::init()
/* Init Button Manager and build the menus */ /* Init Button Manager and build the menus */
m_btnMgr.init(); m_btnMgr.init();
m_btnMgr.setRumble(m_cfg.getBool("GENERAL", "rumble", true)); m_btnMgr.setRumble(m_cfg.getBool("GENERAL", "rumble", true));
show_mem = m_cfg.getBool("DEBUG", "show_mem", false);
_buildMenus(); _buildMenus();
if(drive == DeviceName[SD] && onUSB)
error(_fmt("errboot5", L"data_on_usb=yes and No available usb partitions for data!\nUsing SD."));
/* Check if locked, set return to, set exit to, and init multi threading */ /* Check if locked, set return to, set exit to, and init multi threading */
m_locked = m_cfg.getString("GENERAL", "parent_code", "").size() >= 4; m_locked = m_cfg.getString("GENERAL", "parent_code", "").size() >= 4;
@ -596,7 +604,7 @@ void CMenu::_Theme_Cleanup(void)
void CMenu::_netInit(void) void CMenu::_netInit(void)
{ {
if(networkInit || !init_network || m_exit) if(networkInit || !m_init_network || m_exit)
return; return;
_initAsyncNetwork(); _initAsyncNetwork();
while(net_get_status() == -EBUSY) while(net_get_status() == -EBUSY)
@ -1266,9 +1274,9 @@ void CMenu::_buildMenus(void)
_initCFThemeMenu(); _initCFThemeMenu();
_initGameSettingsMenu(); _initGameSettingsMenu();
_initCheatSettingsMenu(); _initCheatSettingsMenu();
_initLangSettingsMenu();
_initSourceMenu(); _initSourceMenu();
_initCfgSrc(); _initCfgSrc();
_initCfgHB();
_initPluginSettingsMenu(); _initPluginSettingsMenu();
_initCategorySettingsMenu(); _initCategorySettingsMenu();
_initSystemMenu(); _initSystemMenu();
@ -1635,7 +1643,7 @@ void CMenu::_mainLoopCommon(bool withCF, bool adjusting)
m_fa.tick(); m_fa.tick();
m_fa.hideCover() ? CoverFlow.hideCover() : CoverFlow.showCover(); m_fa.hideCover() ? CoverFlow.hideCover() : CoverFlow.showCover();
CoverFlow.setFanartPlaying(m_fa.isLoaded()); CoverFlow.setFanartPlaying(m_fa.isLoaded());
CoverFlow.setFanartTextColor(m_fa.getTextColor(m_coverflow.getColor("_COVERFLOW", "font_color", CColor(0xFFFFFFFF)))); CoverFlow.setFanartTextColor(m_fa.getTextColor(m_theme.getColor("_COVERFLOW", "font_color", CColor(0xFFFFFFFF))));
m_vid.prepare(); m_vid.prepare();
m_vid.setup2DProjection(false, true); m_vid.setup2DProjection(false, true);
@ -1751,10 +1759,11 @@ void CMenu::_mainLoopCommon(bool withCF, bool adjusting)
theme.cameraSound->Play(255); theme.cameraSound->Play(255);
} }
#ifdef SHOWMEM if(show_mem)
m_btnMgr.setText(m_mem1FreeSize, wfmt(L"Mem1 lo Free:%u, Mem1 Free:%u, Mem2 Free:%u", {
MEM1_lo_freesize(), MEM1_freesize(), MEM2_freesize()), true); m_btnMgr.setText(m_mem1FreeSize, wfmt(L"Mem1 lo Free:%u, Mem1 Free:%u", MEM1_lo_freesize(), MEM1_freesize()), true);
#endif m_btnMgr.setText(m_mem2FreeSize, wfmt(L"Mem2 Free:%u", MEM2_freesize()), true);
}
#ifdef SHOWMEMGECKO #ifdef SHOWMEMGECKO
mem1 = MEM1_freesize(); mem1 = MEM1_freesize();
@ -1902,19 +1911,18 @@ void CMenu::_updateText(void)
_textCategorySettings(); _textCategorySettings();
_textCheatSettings(); _textCheatSettings();
_textSystem(); _textSystem();
_textMain();
_textConfig(); _textConfig();
_textConfig3(); _textConfig3();
_textConfigScreen(); _textConfigScreen();
_textConfig4(); _textConfig4();
_textConfigAdv(); _textConfigAdv();
_textConfigSnd(); _textConfigSnd();
_textCfgHB();
_textGame(); _textGame();
_textDownload(); _textDownload();
_textCode(); _textCode();
_textWBFS(); _textWBFS();
_textGameSettings(); _textGameSettings();
_textLangSettings();
_textNandEmu(); _textNandEmu();
_textHome(); _textHome();
_textExitTo(); _textExitTo();
@ -2119,11 +2127,16 @@ void CMenu::_initCF(void)
m_cfg.setBool("GENERAL", "dump_list", false); m_cfg.setBool("GENERAL", "dump_list", false);
} }
CoverFlow.setSorting(m_combined_view ? (Sorting)0 : (Sorting)m_cfg.getInt(_domainFromView(), "sort", 0)); CoverFlow.setSorting(m_current_view == COVERFLOW_MAX ? (Sorting)0 : (Sorting)m_cfg.getInt(_domainFromView(), "sort", 0));
if(m_current_view == COVERFLOW_HOMEBREW)
CoverFlow.setBoxMode(m_cfg.getBool(HOMEBREW_DOMAIN, "box_mode", true));
else if(m_sourceflow)
CoverFlow.setBoxMode(m_cfg.getBool(SOURCEFLOW_DOMAIN, "box_mode", true));
else
CoverFlow.setBoxMode(m_cfg.getBool("GENERAL", "box_mode", true)); CoverFlow.setBoxMode(m_cfg.getBool("GENERAL", "box_mode", true));
CoverFlow.setCompression(m_cfg.getBool("GENERAL", "allow_texture_compression", true)); CoverFlow.setCompression(m_cfg.getBool("GENERAL", "allow_texture_compression", true));
CoverFlow.setBufferSize(m_cfg.getInt("GENERAL", "cover_buffer", 20)); CoverFlow.setBufferSize(m_cfg.getInt("GENERAL", "cover_buffer", 20));
CoverFlow.setHQcover(m_cfg.getBool("GENERAL", "cover_use_hq", false)); CoverFlow.setHQcover(m_cfg.getBool("GENERAL", "cover_use_hq", true));
CoverFlow.start(m_imgsDir); CoverFlow.start(m_imgsDir);
if(!CoverFlow.empty()) if(!CoverFlow.empty())
@ -2144,12 +2157,7 @@ bool CMenu::_loadList(void)
if(m_sourceflow) if(m_sourceflow)
{ {
string cacheDir(fmt("%s/sourceflow.db", m_listCacheDir.c_str())); m_cacheList.createSFList(m_max_source_btn, m_source, m_sourceDir);
bool updateCache = m_cfg.getBool("SOURCEFLOW", "update_cache");
u8 maxBtns = m_cfg.getInt("GENERAL", "max_source_buttons", 71);
bool show_homebrew = (!m_locked || !m_cfg.getBool(HOMEBREW_DOMAIN, "parental", false));
m_cacheList.createSFList(maxBtns, m_source, show_homebrew, show_channel, show_plugin, show_gamecube, m_sourceDir, cacheDir, updateCache);
m_cfg.remove("SOURCEFLOW", "update_cache");
for(vector<dir_discHdr>::iterator tmp_itr = m_cacheList.begin(); tmp_itr != m_cacheList.end(); tmp_itr++) for(vector<dir_discHdr>::iterator tmp_itr = m_cacheList.begin(); tmp_itr != m_cacheList.end(); tmp_itr++)
m_gameList.push_back(*tmp_itr); m_gameList.push_back(*tmp_itr);
m_cacheList.Clear(); m_cacheList.Clear();
@ -2162,16 +2170,16 @@ bool CMenu::_loadList(void)
return m_gameList.size() > 0 ? true : false; return m_gameList.size() > 0 ? true : false;
} }
gprintf("Creating Gamelist\n"); gprintf("Creating Gamelist\n");
if(m_current_view == COVERFLOW_PLUGIN || (m_combined_view && m_cfg.getBool(PLUGIN_DOMAIN, "source"))) if(m_cfg.getBool(PLUGIN_DOMAIN, "source"))
_loadPluginList(); _loadPluginList();
if(m_current_view == COVERFLOW_WII || (m_combined_view && m_cfg.getBool(WII_DOMAIN, "source"))) if(m_cfg.getBool(WII_DOMAIN, "source"))
_loadWiiList(); _loadWiiList();
if(m_current_view == COVERFLOW_CHANNEL || (m_combined_view && m_cfg.getBool(CHANNEL_DOMAIN, "source"))) if(m_cfg.getBool(CHANNEL_DOMAIN, "source"))
_loadChannelList(); _loadChannelList();
if(m_current_view == COVERFLOW_GAMECUBE || (m_combined_view && m_cfg.getBool(GC_DOMAIN, "source"))) if(m_cfg.getBool(GC_DOMAIN, "source"))
_loadGamecubeList(); _loadGamecubeList();
m_cacheList.Clear(); m_cacheList.Clear();
@ -2411,7 +2419,7 @@ typedef struct map_entry
u8 sha1[20]; u8 sha1[20];
} ATTRIBUTE_PACKED map_entry_t; } ATTRIBUTE_PACKED map_entry_t;
void CMenu::loadDefaultFont(void) void CMenu::_loadDefaultFont(void)
{ {
if(m_base_font != NULL) if(m_base_font != NULL)
return; return;
@ -2494,7 +2502,7 @@ void CMenu::_cleanupDefaultFont()
const char *CMenu::_domainFromView() const char *CMenu::_domainFromView()
{ {
if(m_sourceflow) if(m_sourceflow)
return "SOURCEFLOW"; return SOURCEFLOW_DOMAIN;
switch(m_current_view) switch(m_current_view)
{ {
case COVERFLOW_CHANNEL: case COVERFLOW_CHANNEL:
@ -2511,12 +2519,12 @@ const char *CMenu::_domainFromView()
return "NULL"; return "NULL";
} }
void CMenu::UpdateCache(u32 view) /*void CMenu::UpdateCache(u32 view)
{ {
if(view == COVERFLOW_MAX) if(view == COVERFLOW_MAX)
{ {
UpdateCache(COVERFLOW_WII); UpdateCache(COVERFLOW_WII);
UpdateCache(COVERFLOW_HOMEBREW); //UpdateCache(COVERFLOW_HOMEBREW);
UpdateCache(COVERFLOW_GAMECUBE); UpdateCache(COVERFLOW_GAMECUBE);
UpdateCache(COVERFLOW_PLUGIN); UpdateCache(COVERFLOW_PLUGIN);
UpdateCache(COVERFLOW_CHANNEL); UpdateCache(COVERFLOW_CHANNEL);
@ -2529,8 +2537,8 @@ void CMenu::UpdateCache(u32 view)
break; break;
case COVERFLOW_HOMEBREW: case COVERFLOW_HOMEBREW:
m_cfg.setBool(HOMEBREW_DOMAIN, "update_cache", true); m_cfg.setBool(HOMEBREW_DOMAIN, "update_cache", true);
break; break;*/
case COVERFLOW_GAMECUBE: /*case COVERFLOW_GAMECUBE:
m_cfg.setBool(GC_DOMAIN, "update_cache", true); m_cfg.setBool(GC_DOMAIN, "update_cache", true);
break; break;
case COVERFLOW_PLUGIN: case COVERFLOW_PLUGIN:
@ -2538,8 +2546,16 @@ void CMenu::UpdateCache(u32 view)
break; break;
default: default:
m_cfg.setBool(WII_DOMAIN, "update_cache", true); m_cfg.setBool(WII_DOMAIN, "update_cache", true);
} }*/
} /*if(m_cfg.getBool(WII_DOMAIN, "source"))
m_cfg.setBool(WII_DOMAIN, "update_cache", true);
if(m_cfg.getBool(GC_DOMAIN, "source"))
m_cfg.setBool(GC_DOMAIN, "update_cache", true);
if(m_cfg.getBool(CHANNEL_DOMAIN, "source"))
m_cfg.setBool(CHANNEL_DOMAIN, "update_cache", true);
if(m_cfg.getBool(PLUGIN_DOMAIN, "source"))
m_cfg.setBool(PLUGIN_DOMAIN, "update_cache", true);
}*/
void CMenu::RemoveCover(const char *id) void CMenu::RemoveCover(const char *id)
{ {
@ -2620,7 +2636,7 @@ const char *CMenu::getBoxPath(const dir_discHdr *element)
{ {
const char *m_sflowDir = m_cfg.getString("GENERAL", "dir_Source", fmt("%s/source_menu", m_dataDir.c_str())).c_str(); const char *m_sflowDir = m_cfg.getString("GENERAL", "dir_Source", fmt("%s/source_menu", m_dataDir.c_str())).c_str();
const char *coverImg = strrchr(element->path, '/') + 1; const char *coverImg = strrchr(element->path, '/') + 1;
if(coverImg == NULL || m_cfg.getBool("SOURCEFLOW", "smallbox")) if(coverImg == NULL || m_cfg.getBool(SOURCEFLOW_DOMAIN, "smallbox"))
return NULL; return NULL;
return fmt("%s/full_covers/%s", m_sflowDir, coverImg); return fmt("%s/full_covers/%s", m_sflowDir, coverImg);
} }
@ -2649,7 +2665,7 @@ const char *CMenu::getFrontPath(const dir_discHdr *element)
if(coverImg == NULL) if(coverImg == NULL)
return NULL; return NULL;
const char *coverPath = fmt("%s/front_covers/%s", m_sflowDir, coverImg); const char *coverPath = fmt("%s/front_covers/%s", m_sflowDir, coverImg);
if(m_cfg.getBool("SOURCEFLOW", "smallbox") || !fsop_FileExist(coverPath)) if(m_cfg.getBool(SOURCEFLOW_DOMAIN, "smallbox") || !fsop_FileExist(coverPath))
{ {
coverPath = fmt("%s/small_covers/%s", m_sflowDir, coverImg); coverPath = fmt("%s/small_covers/%s", m_sflowDir, coverImg);
if(!fsop_FileExist(coverPath)) if(!fsop_FileExist(coverPath))

View File

@ -1,6 +1,5 @@
#ifndef __MENU_HPP #ifndef __MENU_HPP
#define __MENU_HPP #define __MENU_HPP
//#define SHOWMEM
//#define SHOWMEMGECKO //#define SHOWMEMGECKO
#include <ogc/pad.h> #include <ogc/pad.h>
@ -40,27 +39,24 @@ public:
void init(); void init();
void error(const wstringEx &msg); void error(const wstringEx &msg);
void terror(const char *key, const wchar_t *msg) { error(_fmt(key, msg)); } void terror(const char *key, const wchar_t *msg) { error(_fmt(key, msg)); }
void exitHandler(int ExitTo);
int main(void); int main(void);
void cleanup(void); void cleanup(void);
void loadDefaultFont(void); void directlaunch(const char *GameID);
void TempLoadIOS(int IOS = 0); void TempLoadIOS(int IOS = 0);
const char *getBoxPath(const dir_discHdr *element); const char *getBoxPath(const dir_discHdr *element);
const char *getFrontPath(const dir_discHdr *element); const char *getFrontPath(const dir_discHdr *element);
const char *getBlankCoverPath(const dir_discHdr *element); const char *getBlankCoverPath(const dir_discHdr *element);
private:
u8 m_prev_view; u8 m_prev_view;
u8 m_current_view; u8 m_current_view;
bool m_combined_view;
u8 enabledPluginsCount; u8 enabledPluginsCount;
u8 m_catStartPage; u8 m_catStartPage;
bool m_clearCats; bool m_clearCats;
bool show_channel; bool show_mem;
bool show_plugin;
bool show_gamecube;
vector<dir_discHdr> m_gameList; vector<dir_discHdr> m_gameList;
private:
struct SZone struct SZone
{ {
int x; int x;
@ -92,17 +88,25 @@ private:
u8 m_aa; u8 m_aa;
u8 m_numCFVersions; u8 m_numCFVersions;
u8 m_numPlugins; u8 m_numPlugins;
u8 m_max_source_btn;
const char *cf_domain; const char *cf_domain;
bool m_use_source; bool m_use_source;// source_menu.ini found & ok to use source menu/flow
bool m_multisource; bool m_multisource;// multi select source menu
bool m_sourceflow; bool m_sourceflow;// in sourceflow view
bool m_load_view; bool m_refreshGameList;
bool m_bnr_settings; bool m_bnr_settings;
bool m_directLaunch; bool m_directLaunch;
bool m_locked; bool m_locked;
bool m_favorites; bool m_favorites;
bool m_music_info; bool m_music_info;
bool m_allow_random; bool m_devo_installed;
bool m_nintendont_installed;
bool m_reload;
bool m_use_wifi_gecko;
bool m_use_sd_logging;
bool m_init_network;
bool m_source_autoboot;
dir_discHdr m_autoboot_hdr;
s16 m_showtimer; s16 m_showtimer;
string m_curLanguage; string m_curLanguage;
@ -132,6 +136,12 @@ private:
string m_languagesDir; string m_languagesDir;
string m_helpDir; string m_helpDir;
/* NandEmulation */
string m_saveExtGameId;
bool m_forceext;
bool m_emuSaveNand;
s32 m_partRequest;
/* Explorer stuff */ /* Explorer stuff */
bool m_txt_view; bool m_txt_view;
const char *m_txt_path; const char *m_txt_path;
@ -146,8 +156,8 @@ private:
string m_data_update_zip; string m_data_update_zip;
u32 m_data_update_size; u32 m_data_update_size;
string m_ver; string m_ver;
/* End Updates */
// // Background image stuff
TexData m_curBg; TexData m_curBg;
const TexData *m_prevBg; const TexData *m_prevBg;
const TexData *m_nextBg; const TexData *m_nextBg;
@ -162,7 +172,9 @@ private:
TexData m_config4Bg; TexData m_config4Bg;
TexData m_configAdvBg; TexData m_configAdvBg;
TexData m_configSndBg; TexData m_configSndBg;
TexData m_cheatBg;
TexData m_downloadBg; TexData m_downloadBg;
TexData m_gameinfoBg;
TexData m_gameBg; TexData m_gameBg;
TexData m_codeBg; TexData m_codeBg;
TexData m_aboutBg; TexData m_aboutBg;
@ -171,45 +183,41 @@ private:
TexData m_gameSettingsBg; TexData m_gameSettingsBg;
TexData m_gameBgLQ; TexData m_gameBgLQ;
TexData m_mainBgLQ; TexData m_mainBgLQ;
//Main Coverflow //Main Coverflow
s16 m_mainBtnConfig; s16 m_mainBtnConfig;
s16 m_mainBtnInfo; s16 m_mainBtnHome;
s16 m_mainBtnFavoritesOn; s16 m_mainBtnFavoritesOn;
s16 m_mainBtnFavoritesOff; s16 m_mainBtnFavoritesOff;
s16 m_mainLblLetter;
s16 m_mainLblCurMusic; s16 m_mainLblCurMusic;
#ifdef SHOWMEM s16 m_mainLblLetter;
s16 m_mem1FreeSize;
s16 m_mem2FreeSize;
#endif
#ifdef SHOWMEMGECKO
unsigned int mem1old;
unsigned int mem1;
unsigned int mem2old;
unsigned int mem2;
#endif
s16 m_mainLblNotice; s16 m_mainLblNotice;
s16 m_mainLblMessage;
s16 m_mainBtnNext; s16 m_mainBtnNext;
s16 m_mainBtnPrev; s16 m_mainBtnPrev;
s16 m_mainBtnQuit;
s16 m_mainBtnDVD; s16 m_mainBtnDVD;
s16 m_mainBtnGamecube; s16 m_mainBtnGamecube;
s16 m_mainBtnPlugin; s16 m_mainBtnPlugin;
s16 m_mainBtnWii; s16 m_mainBtnWii;
s16 m_mainBtnChannel; s16 m_mainBtnChannel;
s16 m_mainBtnHomebrew; s16 m_mainBtnHomebrew;
s16 m_mainBtnInstall;
s16 m_mainBtnSelPart;
s16 m_mainLblMessage;
s16 m_mainLblUser[6]; s16 m_mainLblUser[6];
bool m_devo_installed; s16 m_mem1FreeSize;
bool m_nintendont_installed; s16 m_mem2FreeSize;
#ifdef SHOWMEMGECKO
unsigned int mem1old;
unsigned int mem1;
unsigned int mem2old;
unsigned int mem2;
#endif
//Main Config menus //Main Config menus
s16 m_configLblPage; s16 m_configLblPage;
s16 m_configBtnPageM; s16 m_configBtnPageM;
s16 m_configBtnPageP; s16 m_configBtnPageP;
s16 m_configBtnBack; s16 m_configBtnBack;
s16 m_configLblTitle; s16 m_configLblTitle;
s16 m_configLblDownload; s16 m_configLblDownload;
s16 m_configBtnDownload; s16 m_configBtnDownload;
s16 m_configLblParental; s16 m_configLblParental;
@ -222,17 +230,21 @@ private:
s16 m_configLblCfg4; s16 m_configLblCfg4;
s16 m_configBtnCfg4; s16 m_configBtnCfg4;
s16 m_configLblUser[4]; s16 m_configLblUser[4];
s16 m_configAdvLblTheme; s16 m_configAdvLblTheme;
s16 m_configAdvLblCurTheme; s16 m_configAdvLblCurTheme;
s16 m_configAdvBtnCurThemeM; s16 m_configAdvBtnCurThemeM;
s16 m_configAdvBtnCurThemeP; s16 m_configAdvBtnCurThemeP;
s16 m_configAdvLblLanguage; s16 m_configAdvLblLanguage;
s16 m_configAdvBtnManageLanguage; s16 m_configAdvLblCurLanguage;
s16 m_configAdvBtnCurLanguageM;
s16 m_configAdvBtnCurLanguageP;
s16 m_configAdvLblCFTheme; s16 m_configAdvLblCFTheme;
s16 m_configAdvBtnCFTheme; s16 m_configAdvBtnCFTheme;
s16 m_configAdvLblBootChange; s16 m_configAdvLblBootChange;
s16 m_configAdvBtnBootChange; s16 m_configAdvBtnBootChange;
s16 m_configAdvLblUser[4]; s16 m_configAdvLblUser[4];
s16 m_config3LblGameLanguage; s16 m_config3LblGameLanguage;
s16 m_config3LblLanguage; s16 m_config3LblLanguage;
s16 m_config3BtnLanguageP; s16 m_config3BtnLanguageP;
@ -241,7 +253,6 @@ private:
s16 m_config3LblVideo; s16 m_config3LblVideo;
s16 m_config3BtnVideoP; s16 m_config3BtnVideoP;
s16 m_config3BtnVideoM; s16 m_config3BtnVideoM;
s16 m_config3LblGCGameLanguage; s16 m_config3LblGCGameLanguage;
s16 m_config3LblGCLanguage; s16 m_config3LblGCLanguage;
s16 m_config3BtnGCLanguageP; s16 m_config3BtnGCLanguageP;
@ -254,10 +265,10 @@ private:
s16 m_config3LblGCLoader; s16 m_config3LblGCLoader;
s16 m_config3BtnGCLoaderP; s16 m_config3BtnGCLoaderP;
s16 m_config3BtnGCLoaderM; s16 m_config3BtnGCLoaderM;
s16 m_config3LblOcarina; s16 m_config3LblOcarina;
s16 m_config3BtnOcarina; s16 m_config3BtnOcarina;
s16 m_config3LblUser[4]; s16 m_config3LblUser[4];
s16 m_config4LblReturnTo; s16 m_config4LblReturnTo;
s16 m_config4LblReturnToVal; s16 m_config4LblReturnToVal;
s16 m_config4BtnReturnToM; s16 m_config4BtnReturnToM;
@ -269,6 +280,7 @@ private:
s16 m_config4LblPathManager; s16 m_config4LblPathManager;
s16 m_config4BtnPathManager; s16 m_config4BtnPathManager;
s16 m_config4LblUser[4]; s16 m_config4LblUser[4];
s16 m_configSndLblBnrVol; s16 m_configSndLblBnrVol;
s16 m_configSndLblBnrVolVal; s16 m_configSndLblBnrVolVal;
s16 m_configSndBtnBnrVolP; s16 m_configSndBtnBnrVolP;
@ -286,6 +298,7 @@ private:
s16 m_configSndBtnCFVolP; s16 m_configSndBtnCFVolP;
s16 m_configSndBtnCFVolM; s16 m_configSndBtnCFVolM;
s16 m_configSndLblUser[4]; s16 m_configSndLblUser[4];
s16 m_configScreenLblTVHeight; s16 m_configScreenLblTVHeight;
s16 m_configScreenLblTVHeightVal; s16 m_configScreenLblTVHeightVal;
s16 m_configScreenBtnTVHeightP; s16 m_configScreenBtnTVHeightP;
@ -304,6 +317,7 @@ private:
s16 m_configScreenBtnTVYP; s16 m_configScreenBtnTVYP;
s16 m_configScreenLblUser[4]; s16 m_configScreenLblUser[4];
//Download menu //Download menu
s16 m_downloadPrioVal;
enum CoverPrio enum CoverPrio
{ {
C_TYPE_PRIOA = (1<<0), C_TYPE_PRIOA = (1<<0),
@ -331,26 +345,26 @@ private:
FLAT, FLAT,
CFLAT, CFLAT,
}; };
s16 m_downloadPrioVal;
s16 m_downloadLblTitle; s16 m_downloadLblTitle;
s16 m_downloadPBar;
s16 m_downloadBtnCancel;
s16 m_downloadBtnAll;
s16 m_downloadBtnMissing;
s16 m_downloadBtnGameTDBDownload;
s16 m_downloadLblGameTDBDownload;
s16 m_downloadLblMessage[2];
s16 m_downloadLblCovers;
s16 m_downloadLblGameTDB; s16 m_downloadLblGameTDB;
s16 m_downloadLblUser[4]; s16 m_downloadLblUser[4];
s16 m_downloadLblCovers;
s16 m_downloadBtnAll;
s16 m_downloadBtnMissing;
s16 m_downloadLblGameTDBDownload;
s16 m_downloadBtnGameTDBDownload;
s16 m_downloadLblCoverSet;
s16 m_downloadBtnCoverSet;
s16 m_downloadBtnCancel;// used as back btn
s16 m_downloadPBar;
s16 m_downloadLblMessage[2];
//settings
s16 m_downloadLblSetTitle;
s16 m_downloadBtnBack;
s16 m_downloadLblCoverPrio; s16 m_downloadLblCoverPrio;
s16 m_downloadLblPrio; s16 m_downloadLblPrio;
s16 m_downloadBtnPrioM; s16 m_downloadBtnPrioM;
s16 m_downloadBtnPrioP; s16 m_downloadBtnPrioP;
s16 m_downloadBtnVersion;
s16 m_downloadLblCoverSet;
s16 m_downloadBtnCoverSet;
s16 m_downloadLblSetTitle;
s16 m_downloadLblRegion; s16 m_downloadLblRegion;
enum Regions enum Regions
{ {
@ -391,7 +405,6 @@ private:
s16 m_downloadBtnKOs; s16 m_downloadBtnKOs;
s16 m_downloadBtnZHCNs; s16 m_downloadBtnZHCNs;
s16 m_downloadBtnAUs; s16 m_downloadBtnAUs;
s16 m_downloadBtnBack;
static s8 _versionDownloaderInit(CMenu *m); static s8 _versionDownloaderInit(CMenu *m);
static s8 _versionTxtDownloaderInit(CMenu *m); static s8 _versionTxtDownloaderInit(CMenu *m);
s8 _versionDownloader(); s8 _versionDownloader();
@ -403,14 +416,13 @@ private:
LOAD_IOS_SUCCEEDED, LOAD_IOS_SUCCEEDED,
LOAD_IOS_NOT_NEEDED LOAD_IOS_NOT_NEEDED
}; };
s16 m_gameLblInfo;
s16 m_gameBtnFavoriteOn; s16 m_gameBtnFavoriteOn;
s16 m_gameBtnFavoriteOff; s16 m_gameBtnFavoriteOff;
s16 m_gameBtnAdultOn; s16 m_gameBtnAdultOn;
s16 m_gameBtnAdultOff; s16 m_gameBtnAdultOff;
s16 m_gameBtnPlay;
s16 m_gameBtnDelete; s16 m_gameBtnDelete;
s16 m_gameBtnSettings; s16 m_gameBtnSettings;
s16 m_gameBtnPlay;
s16 m_gameBtnBack; s16 m_gameBtnBack;
s16 m_gameLblUser[5]; s16 m_gameLblUser[5];
// Parental code menu // Parental code menu
@ -489,6 +501,9 @@ private:
s16 m_gameSettingsLblDeflicker; s16 m_gameSettingsLblDeflicker;
s16 m_gameSettingsBtnDeflicker; s16 m_gameSettingsBtnDeflicker;
s16 m_gameSettingsLblArcade;
s16 m_gameSettingsBtnArcade;
s16 m_gameSettingsLblGCLoader; s16 m_gameSettingsLblGCLoader;
s16 m_gameSettingsLblGCLoader_Val; s16 m_gameSettingsLblGCLoader_Val;
s16 m_gameSettingsBtnGCLoader_P; s16 m_gameSettingsBtnGCLoader_P;
@ -578,7 +593,6 @@ private:
s16 m_cheatLblItem[4]; s16 m_cheatLblItem[4];
s16 m_cheatBtnItem[4]; s16 m_cheatBtnItem[4];
s16 m_cheatLblUser[4]; s16 m_cheatLblUser[4];
TexData m_cheatBg;
GCTCheats m_cheatfile; GCTCheats m_cheatfile;
// Gameinfo menu // Gameinfo menu
s16 m_gameinfoLblTitle; s16 m_gameinfoLblTitle;
@ -594,16 +608,10 @@ private:
s16 m_gameinfoLblUser[5]; s16 m_gameinfoLblUser[5];
s16 m_gameinfoLblControlsReq[4]; s16 m_gameinfoLblControlsReq[4];
s16 m_gameinfoLblControls[4]; s16 m_gameinfoLblControls[4];
TexData m_gameinfoBg;
TexData m_rating; TexData m_rating;
TexData m_wifi; TexData m_wifi;
TexData m_controlsreq[4]; TexData m_controlsreq[4];
TexData m_controls[4]; TexData m_controls[4];
// NandEmulation
string m_saveExtGameId;
bool m_forceext;
bool m_emuSaveNand;
s32 m_partRequest;
// Zones // Zones
SZone m_mainPrevZone; SZone m_mainPrevZone;
SZone m_mainNextZone; SZone m_mainNextZone;
@ -611,7 +619,6 @@ private:
SZone m_mainButtonsZone2; SZone m_mainButtonsZone2;
SZone m_mainButtonsZone3; SZone m_mainButtonsZone3;
SZone m_gameButtonsZone; SZone m_gameButtonsZone;
bool m_reload;
WPADData *wd[WPAD_MAX_WIIMOTES]; WPADData *wd[WPAD_MAX_WIIMOTES];
void LeftStick(); void LeftStick();
@ -746,8 +753,6 @@ private:
CColor lblFontColor; CColor lblFontColor;
CColor txtFontColor; CColor txtFontColor;
CColor titleFontColor; CColor titleFontColor;
CColor selubtnFontColor;
CColor selsbtnFontColor;
TexData bg; TexData bg;
TexData btnTexL; TexData btnTexL;
TexData btnTexR; TexData btnTexR;
@ -859,8 +864,8 @@ private:
bool _loadPluginList(void); bool _loadPluginList(void);
bool _loadHomebrewList(void); bool _loadHomebrewList(void);
void _initCF(void); void _initCF(void);
void _initBoot(void);
// //
void _initBoot(void);
void _initMainMenu(); void _initMainMenu();
void _initErrorMenu(); void _initErrorMenu();
void _initConfigMenu(); void _initConfigMenu();
@ -869,7 +874,6 @@ private:
void _initConfig4Menu(); void _initConfig4Menu();
void _initConfigSndMenu(); void _initConfigSndMenu();
void _initConfigScreenMenu(); void _initConfigScreenMenu();
void _initLangSettingsMenu();
void _initGameMenu(); void _initGameMenu();
void _initDownloadMenu(); void _initDownloadMenu();
void _initCodeMenu(); void _initCodeMenu();
@ -878,9 +882,9 @@ private:
void _initCFThemeMenu(); void _initCFThemeMenu();
void _initGameSettingsMenu(); void _initGameSettingsMenu();
void _initCheatSettingsMenu(); void _initCheatSettingsMenu();
void _initCheatButtons();
void _initSourceMenu(); void _initSourceMenu();
void _initCfgSrc(); void _initCfgSrc();
void _initCfgHB();
void _initPluginSettingsMenu(); void _initPluginSettingsMenu();
void _initCategorySettingsMenu(); void _initCategorySettingsMenu();
void _initSystemMenu(); void _initSystemMenu();
@ -894,11 +898,11 @@ private:
// //
void _textSource(void); void _textSource(void);
void _textCfgSrc(void); void _textCfgSrc(void);
void _textCfgHB(void);
void _textPluginSettings(void); void _textPluginSettings(void);
void _textCategorySettings(void); void _textCategorySettings(void);
void _textCheatSettings(void); void _textCheatSettings(void);
void _textSystem(void); void _textSystem(void);
void _textMain(void);
void _textError(void); void _textError(void);
void _textConfig(void); void _textConfig(void);
void _textConfig3(void); void _textConfig3(void);
@ -906,7 +910,6 @@ private:
void _textConfig4(void); void _textConfig4(void);
void _textConfigAdv(void); void _textConfigAdv(void);
void _textConfigSnd(void); void _textConfigSnd(void);
void _textLangSettings(void);
void _textGame(void); void _textGame(void);
void _textDownload(void); void _textDownload(void);
void _textCode(void); void _textCode(void);
@ -923,11 +926,6 @@ private:
void _textWad(void); void _textWad(void);
void _textPaths(void); void _textPaths(void);
// //
void _refreshBoot();
void _refreshCfgSrc();
void _refreshExplorer(s8 direction = 0);
void _refreshLangSettings();
//
void _hideCheatSettings(bool instant = false); void _hideCheatSettings(bool instant = false);
void _hideError(bool instant = false); void _hideError(bool instant = false);
void _hideMain(bool instant = false); void _hideMain(bool instant = false);
@ -938,12 +936,12 @@ private:
void _hideConfig4(bool instant = false); void _hideConfig4(bool instant = false);
void _hideConfigAdv(bool instant = false); void _hideConfigAdv(bool instant = false);
void _hideConfigSnd(bool instant = false); void _hideConfigSnd(bool instant = false);
void _hideLangSettings(bool instant = false);
void _hideGame(bool instant = false); void _hideGame(bool instant = false);
void _hideDownload(bool instant = false); void _hideDownload(bool instant = false);
void _hideSettings(bool instant = false); void _hideSettings(bool instant = false);
void _hideCode(bool instant = false); void _hideCode(bool instant = false);
void _hideAbout(bool instant = false); void _hideAbout(bool instant = false);
void _hideBoot(bool instant = false);
void _hideWBFS(bool instant = false); void _hideWBFS(bool instant = false);
void _hideCFTheme(bool instant = false); void _hideCFTheme(bool instant = false);
void _hideGameSettings(bool instant = false); void _hideGameSettings(bool instant = false);
@ -971,15 +969,14 @@ private:
void _showConfig4(void); void _showConfig4(void);
void _showConfigAdv(void); void _showConfigAdv(void);
void _showConfigSnd(void); void _showConfigSnd(void);
void _setPartition(s8 direction = 0); void _showNandEmu(void);
void _showLangSettings(void);
void _showGame(void); void _showGame(void);
void _showDownload(void); void _showDownload(void);
void _showSettings(); void _showSettings();
void _showCode(void); void _showCode(void);
void _showAbout(void); void _showAbout(void);
void _showBoot(void);
void _showSource(void); void _showSource(void);
void _showSourceNotice(void);
void _showPluginSettings(void); void _showPluginSettings(void);
void _showCategorySettings(void); void _showCategorySettings(void);
void _showCheatSettings(void); void _showCheatSettings(void);
@ -996,6 +993,8 @@ private:
void _showWad(void); void _showWad(void);
void _showPaths(void); void _showPaths(void);
void _showCF(bool refreshList = false);
void _refreshExplorer(s8 direction = 0);
void _setSrcOptions(void); void _setSrcOptions(void);
bool _sideCover(const char *magic); bool _sideCover(const char *magic);
bool _shortCover(const char *magic); bool _shortCover(const char *magic);
@ -1010,7 +1009,9 @@ private:
void _updateBg(void); void _updateBg(void);
void _drawBg(void); void _drawBg(void);
void _updateText(void); void _updateText(void);
void _showNandEmu(void); void _setPartition(s8 direction = 0);
void _setCFVersion(int version);
int _getCFVersion(void);
// //
void _config(int page); void _config(int page);
int _configCommon(void); int _configCommon(void);
@ -1034,7 +1035,6 @@ private:
void _downloadUrl(const char *url, u8 **dl_file, u32 *dl_size); void _downloadUrl(const char *url, u8 **dl_file, u32 *dl_size);
void _download(string gameId = string()); void _download(string gameId = string());
void _downloadBnr(const char *gameID); void _downloadBnr(const char *gameID);
bool _LangSettings(void);
bool _code(char code[4], bool erase = false); bool _code(char code[4], bool erase = false);
void _about(bool help = false); void _about(bool help = false);
bool _wbfsOp(WBFS_OP op); bool _wbfsOp(WBFS_OP op);
@ -1049,6 +1049,7 @@ private:
void _CheatSettings(); void _CheatSettings();
bool _Source(); bool _Source();
void _CfgSrc(); void _CfgSrc();
void _CfgHB();
void _PluginSettings(); void _PluginSettings();
void _CategorySettings(bool fromGameSet = false); void _CategorySettings(bool fromGameSet = false);
bool _Home(); bool _Home();
@ -1057,15 +1058,8 @@ private:
void _Paths(); void _Paths();
void _sourceFlow(); void _sourceFlow();
void _mainLoopCommon(bool withCF = false, bool adjusting = false); void _mainLoopCommon(bool withCF = false, bool adjusting = false);
public:
void directlaunch(const char *GameID);
private:
dir_discHdr m_autoboot_hdr;
bool m_source_autoboot;
bool m_use_wifi_gecko;
bool m_use_sd_logging;
bool init_network;
void _netInit(); void _netInit();
void _loadDefaultFont(void);
bool _loadFile(u8 * &buffer, u32 &size, const char *path, const char *file); bool _loadFile(u8 * &buffer, u32 &size, const char *path, const char *file);
int _loadIOS(u8 ios, int userIOS, string id, bool RealNAND_Channels = false); int _loadIOS(u8 ios, int userIOS, string id, bool RealNAND_Channels = false);
void _launch(const dir_discHdr *hdr); void _launch(const dir_discHdr *hdr);
@ -1074,6 +1068,8 @@ private:
void _launchHomebrew(const char *filepath, vector<string> arguments); void _launchHomebrew(const char *filepath, vector<string> arguments);
void _launchGC(dir_discHdr *hdr, bool disc); void _launchGC(dir_discHdr *hdr, bool disc);
void _launchShutdown(); void _launchShutdown();
void _exitWiiflow();
void exitHandler(int ExitTo);
void _setAA(int aa); void _setAA(int aa);
void _loadCFCfg(); void _loadCFCfg();
void _loadCFLayout(int version, bool forceAA = false, bool otherScrnFmt = false); void _loadCFLayout(int version, bool forceAA = false, bool otherScrnFmt = false);
@ -1086,7 +1082,7 @@ private:
void _Theme_Cleanup(); void _Theme_Cleanup();
const char *_domainFromView(void); const char *_domainFromView(void);
const char *_cfDomain(bool selected = false); const char *_cfDomain(bool selected = false);
void UpdateCache(u32 view = COVERFLOW_MAX); //void UpdateCache(u32 view = COVERFLOW_MAX);
void RemoveCover(const char *id); void RemoveCover(const char *id);
SFont _font(const char *domain, const char *key, u32 fontSize, u32 lineSpacing, u32 weight, u32 index, const char *genKey); SFont _font(const char *domain, const char *key, u32 fontSize, u32 lineSpacing, u32 weight, u32 index, const char *genKey);
TexData _texture(const char *domain, const char *key, TexData &def, bool freeDef = true); TexData _texture(const char *domain, const char *key, TexData &def, bool freeDef = true);
@ -1094,7 +1090,6 @@ private:
void _showWaitMessage(); void _showWaitMessage();
public: public:
void _hideWaitMessage(); void _hideWaitMessage();
bool m_Emulator_boot;
void GC_Messenger(int message, int info, char *cinfo); void GC_Messenger(int message, int info, char *cinfo);
/* general thread updating stuff */ /* general thread updating stuff */

View File

@ -1,7 +1,5 @@
#include "menu.hpp" #include "menu.hpp"
#include "channel/nand.hpp"
#include "loader/alt_ios.h"
#include "loader/cios.h" #include "loader/cios.h"
#include "const_str.hpp" #include "const_str.hpp"
@ -95,10 +93,8 @@ void CMenu::_showAbout(void)
m_btnMgr.show(m_aboutLblIOS); m_btnMgr.show(m_aboutLblIOS);
m_btnMgr.show(m_aboutLblInfo,false); m_btnMgr.show(m_aboutLblInfo,false);
for(u8 i = 0; i < ARRAY_SIZE(m_aboutLblUser); ++i) for(u8 i = 0; i < ARRAY_SIZE(m_aboutLblUser); ++i)
{
if(m_aboutLblUser[i] != -1) if(m_aboutLblUser[i] != -1)
m_btnMgr.show(m_aboutLblUser[i]); m_btnMgr.show(m_aboutLblUser[i]);
}
} }
void CMenu::_initAboutMenu() void CMenu::_initAboutMenu()

View File

@ -1,28 +1,9 @@
/****************************************************************************
* Copyright (C) 2012 FIX94
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#include "menu.hpp" #include "menu.hpp"
#include "const_str.hpp"
#include "channel/nand_save.hpp" #include "channel/nand_save.hpp"
s16 m_bootLblTitle; s16 m_bootLblTitle;
s16 m_bootBtnBack; s16 m_bootBtnBack;
/*s16 m_bootLblPage;
s16 m_bootBtnPageM;
s16 m_bootBtnPageP;*/
s16 m_bootLblUser[4]; s16 m_bootLblUser[4];
s16 m_bootLblLoadCIOS; s16 m_bootLblLoadCIOS;
@ -40,34 +21,15 @@ s16 m_bootLblAsyncNet;
s16 m_bootBtnAsyncNet; s16 m_bootBtnAsyncNet;
u8 set_port = 0; u8 set_port = 0;
u8 boot_curPage = 1;
//u8 boot_Pages = 2;
static void showBoot(void) void CMenu::_hideBoot(bool instant)
{ {
m_btnMgr.show(m_bootLblTitle);
m_btnMgr.show(m_bootBtnBack);
/*m_btnMgr.show(m_bootLblPage);
m_btnMgr.show(m_bootBtnPageM);
m_btnMgr.show(m_bootBtnPageP);*/
for(u8 i = 0; i < ARRAY_SIZE(m_bootLblUser); ++i)
if(m_bootLblUser[i] != -1)
m_btnMgr.show(m_bootLblUser[i]);
}
static void hideBoot(bool instant, bool common)
{
if(common)
{
m_btnMgr.hide(m_bootLblTitle, instant); m_btnMgr.hide(m_bootLblTitle, instant);
m_btnMgr.hide(m_bootBtnBack, instant); m_btnMgr.hide(m_bootBtnBack, instant);
/*m_btnMgr.hide(m_bootLblPage, instant);
m_btnMgr.hide(m_bootBtnPageM, instant);
m_btnMgr.hide(m_bootBtnPageP, instant);*/
for(u8 i = 0; i < ARRAY_SIZE(m_bootLblUser); ++i) for(u8 i = 0; i < ARRAY_SIZE(m_bootLblUser); ++i)
if(m_bootLblUser[i] != -1) if(m_bootLblUser[i] != -1)
m_btnMgr.hide(m_bootLblUser[i], instant); m_btnMgr.hide(m_bootLblUser[i], instant);
}
m_btnMgr.hide(m_bootLblLoadCIOS, instant); m_btnMgr.hide(m_bootLblLoadCIOS, instant);
m_btnMgr.hide(m_bootBtnLoadCIOS, instant); m_btnMgr.hide(m_bootBtnLoadCIOS, instant);
@ -83,15 +45,44 @@ static void hideBoot(bool instant, bool common)
m_btnMgr.hide(m_bootBtnAsyncNet, instant); m_btnMgr.hide(m_bootBtnAsyncNet, instant);
} }
void CMenu::_showBoot()
{
m_btnMgr.show(m_bootLblTitle);
m_btnMgr.show(m_bootBtnBack);
for(u8 i = 0; i < ARRAY_SIZE(m_bootLblUser); ++i)
if(m_bootLblUser[i] != -1)
m_btnMgr.show(m_bootLblUser[i]);
m_btnMgr.setText(m_bootBtnLoadCIOS, _optBoolToString(cur_load));
m_btnMgr.setText(m_bootBtnUSBPort, wfmt(L"%i", set_port));
if(cur_ios > 0)
m_btnMgr.setText(m_bootLblCurCIOSrev, wfmt(L"%i", cur_ios));
else
m_btnMgr.setText(m_bootLblCurCIOSrev, L"AUTO");
m_btnMgr.show(m_bootLblLoadCIOS);
m_btnMgr.show(m_bootBtnLoadCIOS);
m_btnMgr.show(m_bootLblCIOSrev);
m_btnMgr.show(m_bootLblCurCIOSrev);
m_btnMgr.show(m_bootLblCIOSrevM);
m_btnMgr.show(m_bootLblCIOSrevP);
m_btnMgr.show(m_bootLblUSBPort);
m_btnMgr.show(m_bootBtnUSBPort);
m_btnMgr.setText(m_bootBtnAsyncNet, m_cfg.getBool("GENERAL", "async_network", false) ? _t("on", L"On") : _t("off", L"Off"));
m_btnMgr.show(m_bootLblAsyncNet);
m_btnMgr.show(m_bootBtnAsyncNet);
}
bool CMenu::_Boot(void) bool CMenu::_Boot(void)
{ {
boot_curPage = 1;
SetupInput();
set_port = currentPort; set_port = currentPort;
bool prev_load = cur_load; bool prev_load = cur_load;
u8 prev_ios = cur_ios; u8 prev_ios = cur_ios;
showBoot(); SetupInput();
_refreshBoot(); _showBoot();
while(!m_exit) while(!m_exit)
{ {
@ -102,22 +93,6 @@ bool CMenu::_Boot(void)
m_btnMgr.up(); m_btnMgr.up();
else if(BTN_DOWN_PRESSED) else if(BTN_DOWN_PRESSED)
m_btnMgr.down(); m_btnMgr.down();
/*else if((BTN_MINUS_PRESSED || BTN_LEFT_PRESSED) || (BTN_A_PRESSED && m_btnMgr.selected(m_bootBtnPageM)))
{
boot_curPage--;
if(boot_curPage == 0) boot_curPage = boot_Pages;
if(BTN_LEFT_PRESSED || BTN_MINUS_PRESSED)
m_btnMgr.click(m_bootBtnPageM);
_refreshBoot();
}
else if(((BTN_PLUS_PRESSED || BTN_RIGHT_PRESSED)) || (BTN_A_PRESSED && m_btnMgr.selected(m_bootBtnPageP)))
{
boot_curPage++;
if(boot_curPage > boot_Pages) boot_curPage = 1;
if(BTN_RIGHT_PRESSED || BTN_PLUS_PRESSED)
m_btnMgr.click(m_bootBtnPageP);
_refreshBoot();
}*/
else if(BTN_A_PRESSED) else if(BTN_A_PRESSED)
{ {
if(m_btnMgr.selected(m_bootBtnBack)) if(m_btnMgr.selected(m_bootBtnBack))
@ -165,7 +140,7 @@ bool CMenu::_Boot(void)
InternalSave.SaveIOS(); InternalSave.SaveIOS();
if(set_port != currentPort) if(set_port != currentPort)
InternalSave.SavePort(set_port); InternalSave.SavePort(set_port);
hideBoot(false, true); _hideBoot();
if(prev_load != cur_load || prev_ios != cur_ios || set_port != currentPort) if(prev_load != cur_load || prev_ios != cur_ios || set_port != currentPort)
{ {
@ -176,55 +151,11 @@ bool CMenu::_Boot(void)
return 0; return 0;
} }
void CMenu::_refreshBoot()
{
hideBoot(true, false);
//m_btnMgr.setText(m_bootLblPage, wfmt(L"%i / %i", boot_curPage, boot_Pages));
if(boot_curPage == 1)
{
m_btnMgr.setText(m_bootBtnLoadCIOS, _optBoolToString(cur_load));
m_btnMgr.setText(m_bootBtnUSBPort, wfmt(L"%i", set_port));
if(cur_ios > 0)
m_btnMgr.setText(m_bootLblCurCIOSrev, wfmt(L"%i", cur_ios));
else
m_btnMgr.setText(m_bootLblCurCIOSrev, L"AUTO");
m_btnMgr.show(m_bootLblLoadCIOS);
m_btnMgr.show(m_bootBtnLoadCIOS);
m_btnMgr.show(m_bootLblCIOSrev);
m_btnMgr.show(m_bootLblCurCIOSrev);
m_btnMgr.show(m_bootLblCIOSrevM);
m_btnMgr.show(m_bootLblCIOSrevP);
m_btnMgr.show(m_bootLblUSBPort);
m_btnMgr.show(m_bootBtnUSBPort);
m_btnMgr.setText(m_bootBtnAsyncNet, m_cfg.getBool("GENERAL", "async_network", false) ? _t("on", L"On") : _t("off", L"Off"));
m_btnMgr.show(m_bootLblAsyncNet);
m_btnMgr.show(m_bootBtnAsyncNet);
}
}
void CMenu::_textBoot(void)
{
m_btnMgr.setText(m_bootLblTitle, _t("cfgbt1", L"Startup Settings"));
m_btnMgr.setText(m_bootLblLoadCIOS, _t("cfgbt2", L"Force Load cIOS"));
m_btnMgr.setText(m_bootLblCIOSrev, _t("cfgbt3", L"Force cIOS Revision"));
m_btnMgr.setText(m_bootLblUSBPort, _t("cfgbt4", L"USB Port"));
m_btnMgr.setText(m_bootLblAsyncNet, _t("cfgp3", L"Init network on boot"));
m_btnMgr.setText(m_bootBtnBack, _t("cfg10", L"Back"));
}
void CMenu::_initBoot(void) void CMenu::_initBoot(void)
{ {
_addUserLabels(m_bootLblUser, ARRAY_SIZE(m_bootLblUser), "BOOT"); _addUserLabels(m_bootLblUser, ARRAY_SIZE(m_bootLblUser), "BOOT");
m_bootLblTitle = _addTitle("BOOT/TITLE", theme.titleFont, L"", 0, 10, 640, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE); m_bootLblTitle = _addTitle("BOOT/TITLE", theme.titleFont, L"", 0, 10, 640, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE);
m_bootBtnBack = _addButton("BOOT/BACK_BTN", theme.btnFont, L"", 420, 400, 200, 48, theme.btnFontColor); m_bootBtnBack = _addButton("BOOT/BACK_BTN", theme.btnFont, L"", 420, 400, 200, 48, theme.btnFontColor);
/*m_bootLblPage = _addLabel("BOOT/PAGE_BTN", theme.btnFont, L"", 68, 400, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC);
m_bootBtnPageM = _addPicButton("BOOT/PAGE_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 20, 400, 48, 48);
m_bootBtnPageP = _addPicButton("BOOT/PAGE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 172, 400, 48, 48);*/
m_bootLblLoadCIOS = _addLabel("BOOT/LOAD_CIOS", theme.lblFont, L"", 20, 125, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_bootLblLoadCIOS = _addLabel("BOOT/LOAD_CIOS", theme.lblFont, L"", 20, 125, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_bootBtnLoadCIOS = _addButton("BOOT/LOAD_CIOS_BTN", theme.btnFont, L"", 420, 130, 200, 48, theme.btnFontColor); m_bootBtnLoadCIOS = _addButton("BOOT/LOAD_CIOS_BTN", theme.btnFont, L"", 420, 130, 200, 48, theme.btnFontColor);
@ -242,9 +173,6 @@ void CMenu::_initBoot(void)
_setHideAnim(m_bootLblTitle, "BOOT/TITLE", 0, 0, -2.f, 0.f); _setHideAnim(m_bootLblTitle, "BOOT/TITLE", 0, 0, -2.f, 0.f);
_setHideAnim(m_bootBtnBack, "BOOT/BACK_BTN", 0, 0, 1.f, -1.f); _setHideAnim(m_bootBtnBack, "BOOT/BACK_BTN", 0, 0, 1.f, -1.f);
/*_setHideAnim(m_bootLblPage, "BOOT/PAGE_BTN", 0, 0, 1.f, -1.f);
_setHideAnim(m_bootBtnPageM, "BOOT/PAGE_MINUS", 0, 0, 1.f, -1.f);
_setHideAnim(m_bootBtnPageP, "BOOT/PAGE_PLUS", 0, 0, 1.f, -1.f);*/
_setHideAnim(m_bootLblLoadCIOS, "BOOT/LOAD_CIOS", 50, 0, -2.f, 0.f); _setHideAnim(m_bootLblLoadCIOS, "BOOT/LOAD_CIOS", 50, 0, -2.f, 0.f);
_setHideAnim(m_bootBtnLoadCIOS, "BOOT/LOAD_CIOS_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_bootBtnLoadCIOS, "BOOT/LOAD_CIOS_BTN", -50, 0, 1.f, 0.f);
@ -260,6 +188,16 @@ void CMenu::_initBoot(void)
_setHideAnim(m_bootLblAsyncNet, "BOOT/ASYNCNET", 50, 0, -2.f, 0.f); _setHideAnim(m_bootLblAsyncNet, "BOOT/ASYNCNET", 50, 0, -2.f, 0.f);
_setHideAnim(m_bootBtnAsyncNet, "BOOT/ASYNCNET_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_bootBtnAsyncNet, "BOOT/ASYNCNET_BTN", -50, 0, 1.f, 0.f);
hideBoot(true, true); _hideBoot(true);
_textBoot(); _textBoot();
} }
void CMenu::_textBoot(void)
{
m_btnMgr.setText(m_bootLblTitle, _t("cfgbt1", L"Startup Settings"));
m_btnMgr.setText(m_bootLblLoadCIOS, _t("cfgbt2", L"Force Load cIOS"));
m_btnMgr.setText(m_bootLblCIOSrev, _t("cfgbt3", L"Force cIOS Revision"));
m_btnMgr.setText(m_bootLblUSBPort, _t("cfgbt4", L"USB Port"));
m_btnMgr.setText(m_bootLblAsyncNet, _t("cfgp3", L"Init network on boot"));
m_btnMgr.setText(m_bootBtnBack, _t("cfg10", L"Back"));
}

View File

@ -1,7 +1,5 @@
#include "menu.hpp"
#include <string.h> #include "menu.hpp"
#include <gccore.h>
// Category menu // Category menu
s16 m_categoryLblPage; s16 m_categoryLblPage;
@ -38,10 +36,8 @@ void CMenu::_hideCategorySettings(bool instant)
m_btnMgr.hide(m_categoryBtnBack, instant); m_btnMgr.hide(m_categoryBtnBack, instant);
for(u8 i = 0; i < ARRAY_SIZE(m_categoryLblUser); ++i) for(u8 i = 0; i < ARRAY_SIZE(m_categoryLblUser); ++i)
{
if(m_categoryLblUser[i] != -1) if(m_categoryLblUser[i] != -1)
m_btnMgr.hide(m_categoryLblUser[i], instant); m_btnMgr.hide(m_categoryLblUser[i], instant);
}
for(u8 i = 1; i < 11; ++i) for(u8 i = 1; i < 11; ++i)
{ {
@ -57,10 +53,9 @@ void CMenu::_showCategorySettings(void)
{ {
_setBg(m_categoryBg, m_categoryBg); _setBg(m_categoryBg, m_categoryBg);
for(u8 i = 0; i < ARRAY_SIZE(m_categoryLblUser); ++i) for(u8 i = 0; i < ARRAY_SIZE(m_categoryLblUser); ++i)
{
if(m_categoryLblUser[i] != -1) if(m_categoryLblUser[i] != -1)
m_btnMgr.show(m_categoryLblUser[i]); m_btnMgr.show(m_categoryLblUser[i]);
}
m_btnMgr.show(m_categoryLblTitle); m_btnMgr.show(m_categoryLblTitle);
m_btnMgr.show(m_categoryBtnClear); m_btnMgr.show(m_categoryBtnClear);
m_btnMgr.show(m_categoryBtnBack); m_btnMgr.show(m_categoryBtnBack);
@ -271,10 +266,8 @@ void CMenu::_CategorySettings(bool fromGameSet)
else else
{ {
_setIDCats(); _setIDCats();
m_load_view = true; m_refreshGameList = true;
} }
//m_cat.save();
break; break;
} }
else if(BTN_UP_PRESSED) else if(BTN_UP_PRESSED)
@ -327,6 +320,7 @@ void CMenu::_CategorySettings(bool fromGameSet)
{ {
if(m_btnMgr.selected(m_categoryBtnClear)) if(m_btnMgr.selected(m_categoryBtnClear))
{ {
m_refreshGameList = true;
bool hiddenCat = false; bool hiddenCat = false;
for(int j = 1; j < m_max_categories; ++j) for(int j = 1; j < m_max_categories; ++j)
{ {
@ -343,6 +337,7 @@ void CMenu::_CategorySettings(bool fromGameSet)
} }
for(u8 i = 1; i < 11; ++i) for(u8 i = 1; i < 11; ++i)
{ {
m_refreshGameList = true;
if(m_btnMgr.selected(m_categoryBtnCat[i]) || m_btnMgr.selected(m_categoryBtnCats[i]) || m_btnMgr.selected(m_categoryBtnCatHid[i]) || m_btnMgr.selected(m_categoryBtnCatReq[i])) if(m_btnMgr.selected(m_categoryBtnCat[i]) || m_btnMgr.selected(m_categoryBtnCats[i]) || m_btnMgr.selected(m_categoryBtnCatHid[i]) || m_btnMgr.selected(m_categoryBtnCatReq[i]))
{ {
lastBtn = m_categoryBtnCat[i]; lastBtn = m_categoryBtnCat[i];

View File

@ -1,7 +1,6 @@
#include "menu.hpp" #include "menu.hpp"
using namespace std; using namespace std;
const CMenu::SCFParamDesc CMenu::_cfParams[] = { const CMenu::SCFParamDesc CMenu::_cfParams[] = {
@ -315,7 +314,7 @@ void CMenu::_cfTheme(void)
SetupInput(); SetupInput();
_initCF(); _initCF();
_showCFTheme(curParam, cfVersion, wide); _showCFTheme(curParam, cfVersion, wide);
_loadCFLayout(cfVersion, true, wide != m_vid.wide()); _loadCFLayout(cfVersion, false, wide != m_vid.wide());
CoverFlow.applySettings(); CoverFlow.applySettings();
while(!m_exit) while(!m_exit)
{ {
@ -422,7 +421,7 @@ void CMenu::_cfTheme(void)
{ {
cfVersion = 1 + loopNum((u8)cfVersion, m_numCFVersions); cfVersion = 1 + loopNum((u8)cfVersion, m_numCFVersions);
_showCFTheme(curParam, cfVersion, wide); _showCFTheme(curParam, cfVersion, wide);
_loadCFLayout(cfVersion, true, wide != m_vid.wide()); _loadCFLayout(cfVersion, false, wide != m_vid.wide());
CoverFlow.applySettings(); CoverFlow.applySettings();
showBtnsDelay = 150; showBtnsDelay = 150;
} }

View File

@ -1,9 +1,7 @@
#include <string.h>
#include <gccore.h>
#include "menu.hpp" #include "menu.hpp"
#include "lockMutex.hpp"
#include "gui/text.hpp" #include "gui/text.hpp"
#include "lockMutex.hpp"
#include "network/http.h" #include "network/http.h"
#define GECKOURL "http://geckocodes.org/codes/%c/%s.txt" #define GECKOURL "http://geckocodes.org/codes/%c/%s.txt"

View File

@ -156,7 +156,6 @@ int CMenu::_config1(void)
{ {
if (m_btnMgr.selected(m_configBtnDownload)) if (m_btnMgr.selected(m_configBtnDownload))
{ {
m_load_view = true;
_hideConfig(); _hideConfig();
_download(); _download();
_showConfig(); _showConfig();
@ -167,7 +166,7 @@ int CMenu::_config1(void)
_hideConfig(); _hideConfig();
if (_code(code) && memcmp(code, m_cfg.getString("GENERAL", "parent_code", "").c_str(), 4) == 0) if (_code(code) && memcmp(code, m_cfg.getString("GENERAL", "parent_code", "").c_str(), 4) == 0)
{ {
m_load_view = true; m_refreshGameList = true;
m_locked = false; m_locked = false;
} }
else else
@ -180,7 +179,7 @@ int CMenu::_config1(void)
_hideConfig(); _hideConfig();
if (_code(code, true)) if (_code(code, true))
{ {
m_load_view = true; m_refreshGameList = true;
m_cfg.setString("GENERAL", "parent_code", string(code, 4).c_str()); m_cfg.setString("GENERAL", "parent_code", string(code, 4).c_str());
m_locked = true; m_locked = true;
} }
@ -194,7 +193,6 @@ int CMenu::_config1(void)
} }
else if (m_btnMgr.selected(m_configBtnCfg4)) else if (m_btnMgr.selected(m_configBtnCfg4))
{ {
m_load_view = true;
_hideConfig(); _hideConfig();
_NandEmuCfg(); _NandEmuCfg();
_showConfig(); _showConfig();
@ -202,7 +200,7 @@ int CMenu::_config1(void)
} }
} }
if(currentPartition != bCurrentPartition) if(currentPartition != bCurrentPartition)
m_load_view = true; m_refreshGameList = true;
_hideConfig(); _hideConfig();
return change; return change;
} }

View File

@ -1,21 +1,17 @@
#include "menu.hpp" #include "menu.hpp"
#include "defines.h"
#include "channel/channels.h" #include "channel/channels.h"
#include "channel/nand.hpp"
#include "loader/cios.h"
#include "loader/nk.h"
static const int g_curPage = 4; static const int g_curPage = 4;
Config custom_titles;
int currentChannelIndex = -1;
int amountOfChannels = -1;
template <class T> static inline T loopNum(T i, T s) template <class T> static inline T loopNum(T i, T s)
{ {
return (i + s) % s; return (i + s) % s;
} }
int currentChannelIndex = -1;
int amountOfChannels = -1;
const CMenu::SOption CMenu::_exitTo[5] = { const CMenu::SOption CMenu::_exitTo[5] = {
{ "def", L"Default" }, { "def", L"Default" },
{ "menu", L"System Menu" }, { "menu", L"System Menu" },
@ -67,8 +63,6 @@ void CMenu::_showConfig4(void)
m_btnMgr.setText(m_config4BtnHome, _t(CMenu::_exitTo[i].id, CMenu::_exitTo[i].text)); m_btnMgr.setText(m_config4BtnHome, _t(CMenu::_exitTo[i].id, CMenu::_exitTo[i].text));
m_btnMgr.setText(m_config4BtnSaveFavMode, m_cfg.getBool("GENERAL", "save_favorites_mode") ? _t("on", L"On") : _t("off", L"Off")); m_btnMgr.setText(m_config4BtnSaveFavMode, m_cfg.getBool("GENERAL", "save_favorites_mode") ? _t("on", L"On") : _t("off", L"Off"));
Config titles, custom_titles;
titles.load(fmt("%s/" TITLES_FILENAME, m_settingsDir.c_str()));
custom_titles.load(fmt("%s/" CTITLES_FILENAME, m_settingsDir.c_str())); custom_titles.load(fmt("%s/" CTITLES_FILENAME, m_settingsDir.c_str()));
ChannelHandle.Init(m_loc.getString(m_curLanguage, "gametdb_code", "EN")); ChannelHandle.Init(m_loc.getString(m_curLanguage, "gametdb_code", "EN"));
@ -82,7 +76,7 @@ void CMenu::_showConfig4(void)
{ {
if(strncmp(currentChanId.c_str(), ChannelHandle.GetId(i), 4) == 0) if(strncmp(currentChanId.c_str(), ChannelHandle.GetId(i), 4) == 0)
{ {
channelName = custom_titles.getWString("TITLES", currentChanId, titles.getWString("TITLES", currentChanId, ChannelHandle.GetName(i))); channelName = custom_titles.getWString("TITLES", currentChanId, ChannelHandle.GetName(i));
currentChannelIndex = i; currentChannelIndex = i;
break; break;
} }
@ -121,8 +115,6 @@ int CMenu::_config4(void)
_hideConfig4(); _hideConfig4();
_Paths(); _Paths();
_showConfig4(); _showConfig4();
m_load_view = true;
break;
} }
else if (m_btnMgr.selected(m_config4BtnReturnToP)) else if (m_btnMgr.selected(m_config4BtnReturnToP))
{ {
@ -146,6 +138,8 @@ int CMenu::_config4(void)
} }
NANDemuView = curNANDemuView; NANDemuView = curNANDemuView;
_hideConfig4(); _hideConfig4();
if(custom_titles.loaded())
custom_titles.unload();
return change; return change;
} }

View File

@ -1,11 +1,7 @@
#include <dirent.h> #include <dirent.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <unistd.h>
#include <algorithm> #include <algorithm>
#include "menu.hpp" #include "menu.hpp"
#include "loader/wbfs.h"
using namespace std; using namespace std;
@ -16,7 +12,16 @@ template <class T> static inline T loopNum(T i, T s)
return (i + s) % s; return (i + s) % s;
} }
s16 m_configAdvBtnLanguage; u32 available_pos = 0;
vector<string> languages_available;
void AddLanguage(char *Path)
{
char lng[32];
memset(lng, 0, 32);
char *lang_chr = strrchr(Path, '/')+1;
memcpy(lng, lang_chr, min(31u, (u32)(strrchr(lang_chr, '.')-lang_chr)));
languages_available.push_back(lng);
}
void CMenu::_hideConfigAdv(bool instant) void CMenu::_hideConfigAdv(bool instant)
{ {
@ -29,7 +34,9 @@ void CMenu::_hideConfigAdv(bool instant)
m_btnMgr.hide(m_configAdvBtnCurThemeM, instant); m_btnMgr.hide(m_configAdvBtnCurThemeM, instant);
m_btnMgr.hide(m_configAdvBtnCurThemeP, instant); m_btnMgr.hide(m_configAdvBtnCurThemeP, instant);
m_btnMgr.hide(m_configAdvLblLanguage, instant); m_btnMgr.hide(m_configAdvLblLanguage, instant);
m_btnMgr.hide(m_configAdvBtnLanguage, instant); m_btnMgr.hide(m_configAdvLblCurLanguage, instant);
m_btnMgr.hide(m_configAdvBtnCurLanguageM, instant);
m_btnMgr.hide(m_configAdvBtnCurLanguageP, instant);
m_btnMgr.hide(m_configAdvLblCFTheme, instant); m_btnMgr.hide(m_configAdvLblCFTheme, instant);
m_btnMgr.hide(m_configAdvBtnCFTheme, instant); m_btnMgr.hide(m_configAdvBtnCFTheme, instant);
for(u8 i = 0; i < ARRAY_SIZE(m_configAdvLblUser); ++i) for(u8 i = 0; i < ARRAY_SIZE(m_configAdvLblUser); ++i)
@ -45,20 +52,24 @@ void CMenu::_showConfigAdv(void)
m_btnMgr.show(m_configAdvBtnCurThemeM); m_btnMgr.show(m_configAdvBtnCurThemeM);
m_btnMgr.show(m_configAdvBtnCurThemeP); m_btnMgr.show(m_configAdvBtnCurThemeP);
m_btnMgr.show(m_configAdvLblTheme); m_btnMgr.show(m_configAdvLblTheme);
if(!m_locked)
{
m_btnMgr.show(m_configAdvLblBootChange); m_btnMgr.show(m_configAdvLblBootChange);
m_btnMgr.show(m_configAdvBtnBootChange); m_btnMgr.show(m_configAdvBtnBootChange);
m_btnMgr.show(m_configAdvLblLanguage); m_btnMgr.show(m_configAdvLblLanguage);
m_btnMgr.show(m_configAdvBtnLanguage); m_btnMgr.show(m_configAdvLblCurLanguage);
m_btnMgr.show(m_configAdvBtnCurLanguageM);
m_btnMgr.show(m_configAdvBtnCurLanguageP);
m_btnMgr.show(m_configAdvLblCFTheme); m_btnMgr.show(m_configAdvLblCFTheme);
m_btnMgr.show(m_configAdvBtnCFTheme); m_btnMgr.show(m_configAdvBtnCFTheme);
}
for(u32 i = 0; i < ARRAY_SIZE(m_configAdvLblUser); ++i) for(u32 i = 0; i < ARRAY_SIZE(m_configAdvLblUser); ++i)
if(m_configAdvLblUser[i] != -1) if(m_configAdvLblUser[i] != -1)
m_btnMgr.show(m_configAdvLblUser[i]); m_btnMgr.show(m_configAdvLblUser[i]);
m_btnMgr.setText(m_configAdvLblCurTheme, m_cfg.getString("GENERAL", "theme")); m_btnMgr.setText(m_configAdvLblCurTheme, m_cfg.getString("GENERAL", "theme"));
m_btnMgr.setText(m_configAdvLblCurLanguage, m_curLanguage);
} }
static void listThemes(const char * path, vector<string> &themes) static void listThemes(const char * path, vector<string> &themes)
@ -90,11 +101,9 @@ static void listThemes(const char * path, vector<string> &themes)
int CMenu::_configAdv(void) int CMenu::_configAdv(void)
{ {
int change = CONFIG_PAGE_NO_CHANGE; int change = CONFIG_PAGE_NO_CHANGE;
vector<string> themes; vector<string> themes;
string prevTheme = m_cfg.getString("GENERAL", "theme"); string prevTheme = m_cfg.getString("GENERAL", "theme");
bool lang_changed = false;
listThemes(m_themeDir.c_str(), themes); listThemes(m_themeDir.c_str(), themes);
int curTheme = 0; int curTheme = 0;
for (u32 i = 0; i < themes.size(); ++i) for (u32 i = 0; i < themes.size(); ++i)
@ -103,6 +112,22 @@ int CMenu::_configAdv(void)
curTheme = i; curTheme = i;
break; break;
} }
languages_available.clear();
languages_available.push_back("Default");
GetFiles(m_languagesDir.c_str(), stringToVector(".ini", '|'), AddLanguage, false, 0);
sort(languages_available.begin(), languages_available.end());
for(u32 i = 0; i < languages_available.size(); ++i)
{
if(m_curLanguage == languages_available[i])
{
available_pos = i;
break;
}
}
bool lang_changed = false;
_showConfigAdv(); _showConfigAdv();
while(!m_exit) while(!m_exit)
{ {
@ -123,18 +148,28 @@ int CMenu::_configAdv(void)
s8 direction = m_btnMgr.selected(m_configAdvBtnCurThemeP) ? 1 : -1; s8 direction = m_btnMgr.selected(m_configAdvBtnCurThemeP) ? 1 : -1;
curTheme = loopNum(curTheme + direction, (int)themes.size()); curTheme = loopNum(curTheme + direction, (int)themes.size());
m_cfg.setString("GENERAL", "theme", themes[curTheme]); m_cfg.setString("GENERAL", "theme", themes[curTheme]);
//m_cfg.setInt(_domainFromView(), "last_cf_mode", 1);
_showConfigAdv(); _showConfigAdv();
} }
else if(m_btnMgr.selected(m_configAdvBtnLanguage)) else if(m_btnMgr.selected(m_configAdvBtnCurLanguageP) || m_btnMgr.selected(m_configAdvBtnCurLanguageM))
{ {
_hideConfigAdv(); s8 direction = m_btnMgr.selected(m_configAdvBtnCurLanguageP) ? 1 : -1;
lang_changed = _LangSettings(); available_pos = loopNum(available_pos + direction, languages_available.size());
m_curLanguage = languages_available[available_pos];
if(!m_loc.load(fmt("%s/%s.ini", m_languagesDir.c_str(), m_curLanguage.c_str())))
{
m_curLanguage = "Default";
m_cfg.setString("GENERAL", "language", m_curLanguage.c_str());
m_loc.unload();
}
else
m_cfg.setString("GENERAL", "language", m_curLanguage.c_str());
lang_changed = true;
_updateText();
_showConfigAdv(); _showConfigAdv();
} }
else if(m_btnMgr.selected(m_configAdvBtnCFTheme)) else if(m_btnMgr.selected(m_configAdvBtnCFTheme))
{ {
m_load_view = true; m_refreshGameList = true;
_hideConfigAdv(); _hideConfigAdv();
_cfTheme(); _cfTheme();
_showConfigAdv(); _showConfigAdv();
@ -143,7 +178,7 @@ int CMenu::_configAdv(void)
} }
_hideConfigAdv(); _hideConfigAdv();
if(lang_changed) if(lang_changed)
m_load_view = true; m_refreshGameList = true;
return change; return change;
} }
@ -152,12 +187,15 @@ void CMenu::_initConfigAdvMenu()
{ {
_addUserLabels(m_configAdvLblUser, ARRAY_SIZE(m_configAdvLblUser), "CONFIG_ADV"); _addUserLabels(m_configAdvLblUser, ARRAY_SIZE(m_configAdvLblUser), "CONFIG_ADV");
m_configAdvBg = _texture("CONFIG_ADV/BG", "texture", theme.bg, false); m_configAdvBg = _texture("CONFIG_ADV/BG", "texture", theme.bg, false);
m_configAdvLblTheme = _addLabel("CONFIG_ADV/THEME", theme.lblFont, L"", 20, 125, 290, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_configAdvLblTheme = _addLabel("CONFIG_ADV/THEME", theme.lblFont, L"", 20, 125, 290, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_configAdvLblCurTheme = _addLabel("CONFIG_ADV/THEME_BTN", theme.btnFont, L"", 468, 130, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC); m_configAdvLblCurTheme = _addLabel("CONFIG_ADV/THEME_BTN", theme.btnFont, L"", 468, 130, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC);
m_configAdvBtnCurThemeM = _addPicButton("CONFIG_ADV/THEME_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 420, 130, 48, 48); m_configAdvBtnCurThemeM = _addPicButton("CONFIG_ADV/THEME_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 420, 130, 48, 48);
m_configAdvBtnCurThemeP = _addPicButton("CONFIG_ADV/THEME_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 572, 130, 48, 48); m_configAdvBtnCurThemeP = _addPicButton("CONFIG_ADV/THEME_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 572, 130, 48, 48);
m_configAdvLblLanguage = _addLabel("CONFIG_ADV/LANGUAGE", theme.lblFont, L"", 20, 185, 290, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_configAdvLblLanguage = _addLabel("CONFIG_ADV/LANGUAGE", theme.lblFont, L"", 20, 185, 290, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_configAdvBtnLanguage = _addButton("CONFIG_ADV/LANGUAGE_BTN", theme.btnFont, L"", 420, 190, 200, 48, theme.btnFontColor); m_configAdvLblCurLanguage = _addLabel("CONFIG_ADV/LANGUAGE_BTN", theme.btnFont, L"", 468, 190, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC);
m_configAdvBtnCurLanguageM = _addPicButton("CONFIG_ADV/LANGUAGE_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 420, 190, 48, 48);
m_configAdvBtnCurLanguageP = _addPicButton("CONFIG_ADV/LANGUAGE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 572, 190, 48, 48);
m_configAdvLblCFTheme = _addLabel("CONFIG_ADV/CUSTOMIZE_CF", theme.lblFont, L"", 20, 245, 290, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_configAdvLblCFTheme = _addLabel("CONFIG_ADV/CUSTOMIZE_CF", theme.lblFont, L"", 20, 245, 290, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_configAdvBtnCFTheme = _addButton("CONFIG_ADV/CUSTOMIZE_CF_BTN", theme.btnFont, L"", 420, 250, 200, 48, theme.btnFontColor); m_configAdvBtnCFTheme = _addButton("CONFIG_ADV/CUSTOMIZE_CF_BTN", theme.btnFont, L"", 420, 250, 200, 48, theme.btnFontColor);
m_configAdvLblBootChange = _addLabel("CONFIG_ADV/BOOT_CHANGE", theme.lblFont, L"", 20, 305, 290, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_configAdvLblBootChange = _addLabel("CONFIG_ADV/BOOT_CHANGE", theme.lblFont, L"", 20, 305, 290, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
@ -168,7 +206,9 @@ void CMenu::_initConfigAdvMenu()
_setHideAnim(m_configAdvBtnCurThemeM, "CONFIG_ADV/THEME_MINUS", -50, 0, 1.f, 0.f); _setHideAnim(m_configAdvBtnCurThemeM, "CONFIG_ADV/THEME_MINUS", -50, 0, 1.f, 0.f);
_setHideAnim(m_configAdvBtnCurThemeP, "CONFIG_ADV/THEME_PLUS", -50, 0, 1.f, 0.f); _setHideAnim(m_configAdvBtnCurThemeP, "CONFIG_ADV/THEME_PLUS", -50, 0, 1.f, 0.f);
_setHideAnim(m_configAdvLblLanguage, "CONFIG_ADV/LANGUAGE", 50, 0, -2.f, 0.f); _setHideAnim(m_configAdvLblLanguage, "CONFIG_ADV/LANGUAGE", 50, 0, -2.f, 0.f);
_setHideAnim(m_configAdvBtnLanguage, "CONFIG_ADV/LANGUAGE_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_configAdvLblCurLanguage, "CONFIG_ADV/LANGUAGE_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_configAdvBtnCurLanguageM, "CONFIG_ADV/LANGUAGE_MINUS", -50, 0, 1.f, 0.f);
_setHideAnim(m_configAdvBtnCurLanguageP, "CONFIG_ADV/LANGUAGE_PLUS", -50, 0, 1.f, 0.f);
_setHideAnim(m_configAdvLblCFTheme, "CONFIG_ADV/CUSTOMIZE_CF", 50, 0, -2.f, 0.f); _setHideAnim(m_configAdvLblCFTheme, "CONFIG_ADV/CUSTOMIZE_CF", 50, 0, -2.f, 0.f);
_setHideAnim(m_configAdvBtnCFTheme, "CONFIG_ADV/CUSTOMIZE_CF_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_configAdvBtnCFTheme, "CONFIG_ADV/CUSTOMIZE_CF_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_configAdvLblBootChange, "CONFIG_ADV/BOOT_CHANGE", 50, 0, -2.f, 0.f); _setHideAnim(m_configAdvLblBootChange, "CONFIG_ADV/BOOT_CHANGE", 50, 0, -2.f, 0.f);
@ -180,8 +220,8 @@ void CMenu::_initConfigAdvMenu()
void CMenu::_textConfigAdv(void) void CMenu::_textConfigAdv(void)
{ {
m_btnMgr.setText(m_configAdvLblTheme, _t("cfga7", L"Theme")); m_btnMgr.setText(m_configAdvLblTheme, _t("cfga7", L"Theme"));
m_btnMgr.setText(m_configAdvLblLanguage, _t("cfgc9", L"Manage Languages")); m_btnMgr.setText(m_configAdvLblLanguage, _t("cfgc9", L"WiiFlow Language"));// manage wiiflow languages
m_btnMgr.setText(m_configAdvBtnLanguage, _t("cfgc5", L"Go")); //m_btnMgr.setText(m_configAdvBtnLanguage, _t("cfgc5", L"Go"));
m_btnMgr.setText(m_configAdvLblCFTheme, _t("cfgc4", L"Adjust Coverflow")); m_btnMgr.setText(m_configAdvLblCFTheme, _t("cfgc4", L"Adjust Coverflow"));
m_btnMgr.setText(m_configAdvBtnCFTheme, _t("cfgc5", L"Go")); m_btnMgr.setText(m_configAdvBtnCFTheme, _t("cfgc5", L"Go"));
m_btnMgr.setText(m_configAdvLblBootChange, _t("cfgc8", L"Startup Settings")); m_btnMgr.setText(m_configAdvLblBootChange, _t("cfgc8", L"Startup Settings"));

View File

@ -1,33 +1,19 @@
/****************************************************************************
* Copyright (C) 2013 FIX94
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#include "menu.hpp" #include "menu.hpp"
#include "defines.h"
s16 m_coverbnrLblTitle; s16 m_coverbnrLblTitle;
s16 m_coverbnrBtnBack; s16 m_coverbnrBtnBack;
s16 m_coverbnrLblDlCover; s16 m_coverbnrLblDlCover;
s16 m_coverbnrLblDeleteCover;
s16 m_coverbnrLblDlBanner;
s16 m_coverbnrLblDeleteBanner;
s16 m_coverbnrBtnDlCover; s16 m_coverbnrBtnDlCover;
s16 m_coverbnrLblDeleteCover;
s16 m_coverbnrBtnDeleteCover; s16 m_coverbnrBtnDeleteCover;
s16 m_coverbnrLblDlBanner;
s16 m_coverbnrBtnDlBanner; s16 m_coverbnrBtnDlBanner;
s16 m_coverbnrLblDeleteBanner;
s16 m_coverbnrBtnDeleteBanner; s16 m_coverbnrBtnDeleteBanner;
s16 m_coverbnrLblUser[4]; s16 m_coverbnrLblUser[4];

View File

@ -6,14 +6,27 @@
#define ARRAY_SIZE(a) (sizeof a / sizeof a[0]) #define ARRAY_SIZE(a) (sizeof a / sizeof a[0])
u8 m_gameSettingsMaxPgs = 5;
u8 m_gameSettingsPage = 0;
u8 GCLoader = 0;
template <class T> static inline T loopNum(T i, T s) template <class T> static inline T loopNum(T i, T s)
{ {
return (i + s) % s; return (i + s) % s;
} }
u8 m_gameSettingsMaxPgs = 5; wstringEx CMenu::_optBoolToString(int i)
u8 m_gameSettingsPage = 0; {
u8 GCLoader = 0; switch (i)
{
case 0:
return _t("off", L"Off");
case 1:
return _t("on", L"On");
default:
return _t("def", L"Default");
}
}
void CMenu::_hideGameSettings(bool instant) void CMenu::_hideGameSettings(bool instant)
{ {
@ -96,6 +109,9 @@ void CMenu::_hideGameSettings(bool instant)
m_btnMgr.hide(m_gameSettingsBtnNATIVE_CTL, instant); m_btnMgr.hide(m_gameSettingsBtnNATIVE_CTL, instant);
m_btnMgr.hide(m_gameSettingsLblDeflicker, instant); m_btnMgr.hide(m_gameSettingsLblDeflicker, instant);
m_btnMgr.hide(m_gameSettingsBtnDeflicker, instant); m_btnMgr.hide(m_gameSettingsBtnDeflicker, instant);
m_btnMgr.hide(m_gameSettingsLblArcade, instant);
m_btnMgr.hide(m_gameSettingsBtnArcade, instant);
//
m_btnMgr.hide(m_gameSettingsLblCustom, instant); m_btnMgr.hide(m_gameSettingsLblCustom, instant);
m_btnMgr.hide(m_gameSettingsBtnCustom, instant); m_btnMgr.hide(m_gameSettingsBtnCustom, instant);
m_btnMgr.hide(m_gameSettingsLblLaunchNK, instant); m_btnMgr.hide(m_gameSettingsLblLaunchNK, instant);
@ -106,19 +122,6 @@ void CMenu::_hideGameSettings(bool instant)
m_btnMgr.hide(m_gameSettingsLblUser[i], instant); m_btnMgr.hide(m_gameSettingsLblUser[i], instant);
} }
wstringEx CMenu::_optBoolToString(int i)
{
switch (i)
{
case 0:
return _t("off", L"Off");
case 1:
return _t("on", L"On");
default:
return _t("def", L"Default");
}
}
void CMenu::_hideGameSettingsPg(void) void CMenu::_hideGameSettingsPg(void)
{ {
//Does not hide title, page, back, or user labels //Does not hide title, page, back, or user labels
@ -212,6 +215,9 @@ void CMenu::_hideGameSettingsPg(void)
} }
if(m_gameSettingsPage == 4) if(m_gameSettingsPage == 4)
{ {
m_btnMgr.hide(m_gameSettingsLblArcade);
m_btnMgr.hide(m_gameSettingsBtnArcade);
m_btnMgr.hide(m_gameSettingsLblCustom); m_btnMgr.hide(m_gameSettingsLblCustom);
m_btnMgr.hide(m_gameSettingsBtnCustom); m_btnMgr.hide(m_gameSettingsBtnCustom);
@ -271,8 +277,6 @@ void CMenu::_showGameSettings(void)
m_gameSettingsMaxPgs = 5; m_gameSettingsMaxPgs = 5;
else if(GameHdr->type == TYPE_GC_GAME && GCLoader == DEVOLUTION) else if(GameHdr->type == TYPE_GC_GAME && GCLoader == DEVOLUTION)
m_gameSettingsMaxPgs = 2; m_gameSettingsMaxPgs = 2;
else if(GameHdr->type == TYPE_GC_GAME && GCLoader != DEVOLUTION)
m_gameSettingsMaxPgs = 3;
if(m_gameSettingsPage == 1) if(m_gameSettingsPage == 1)
{ {
@ -304,8 +308,18 @@ void CMenu::_showGameSettings(void)
} }
if(m_gameSettingsPage == 2) if(m_gameSettingsPage == 2)
{ {
//if it's not GC or it is but loader is not devolution if(GameHdr->type == TYPE_GC_GAME && GCLoader == DEVOLUTION)
if(GameHdr->type != TYPE_GC_GAME || (GameHdr->type == TYPE_GC_GAME && GCLoader != DEVOLUTION)) {
m_btnMgr.show(m_gameSettingsLblDevoMemcardEmu);
m_btnMgr.show(m_gameSettingsBtnDevoMemcardEmu);
m_btnMgr.show(m_gameSettingsLblWidescreen);
m_btnMgr.show(m_gameSettingsBtnWidescreen);
m_btnMgr.show(m_gameSettingsLblLED);
m_btnMgr.show(m_gameSettingsBtnLED);
}
else
{ {
m_btnMgr.show(m_gameSettingsLblDebugger); m_btnMgr.show(m_gameSettingsLblDebugger);
m_btnMgr.show(m_gameSettingsLblDebuggerV); m_btnMgr.show(m_gameSettingsLblDebuggerV);
@ -331,17 +345,6 @@ void CMenu::_showGameSettings(void)
m_btnMgr.show(m_gameSettingsLblCheat); m_btnMgr.show(m_gameSettingsLblCheat);
m_btnMgr.show(m_gameSettingsBtnCheat); m_btnMgr.show(m_gameSettingsBtnCheat);
} }
else //devolution
{
m_btnMgr.show(m_gameSettingsLblDevoMemcardEmu);
m_btnMgr.show(m_gameSettingsBtnDevoMemcardEmu);
m_btnMgr.show(m_gameSettingsLblWidescreen);
m_btnMgr.show(m_gameSettingsBtnWidescreen);
m_btnMgr.show(m_gameSettingsLblLED);
m_btnMgr.show(m_gameSettingsBtnLED);
}
} }
if(m_gameSettingsPage == 3) if(m_gameSettingsPage == 3)
{ {
@ -390,17 +393,22 @@ void CMenu::_showGameSettings(void)
} }
if(m_gameSettingsPage == 4) if(m_gameSettingsPage == 4)
{ {
if(GameHdr->type == TYPE_GC_GAME)
{
m_btnMgr.show(m_gameSettingsBtnArcade);
m_btnMgr.show(m_gameSettingsLblArcade);
}
else
{
if(GameHdr->type == TYPE_CHANNEL || GameHdr->type == TYPE_EMUCHANNEL) if(GameHdr->type == TYPE_CHANNEL || GameHdr->type == TYPE_EMUCHANNEL)
{ {
m_btnMgr.show(m_gameSettingsLblCustom); m_btnMgr.show(m_gameSettingsLblCustom);
m_btnMgr.show(m_gameSettingsBtnCustom); m_btnMgr.show(m_gameSettingsBtnCustom);
if(m_cfg.getInt(CHANNEL_DOMAIN, "partition", 0) == 1)
{
m_btnMgr.show(m_gameSettingsLblLaunchNK); m_btnMgr.show(m_gameSettingsLblLaunchNK);
m_btnMgr.show(m_gameSettingsBtnLaunchNK); m_btnMgr.show(m_gameSettingsBtnLaunchNK);
} }
}
else if(GameHdr->type == TYPE_WII_GAME) else if(GameHdr->type == TYPE_WII_GAME)
{ {
m_btnMgr.show(m_gameSettingsLblEmulationVal); m_btnMgr.show(m_gameSettingsLblEmulationVal);
@ -408,12 +416,9 @@ void CMenu::_showGameSettings(void)
m_btnMgr.show(m_gameSettingsBtnEmulationP); m_btnMgr.show(m_gameSettingsBtnEmulationP);
m_btnMgr.show(m_gameSettingsBtnEmulationM); m_btnMgr.show(m_gameSettingsBtnEmulationM);
if(_checkSave(string((const char *)GameHdr->id), true))
{
m_btnMgr.show(m_gameSettingsLblExtractSave); m_btnMgr.show(m_gameSettingsLblExtractSave);
m_btnMgr.show(m_gameSettingsBtnExtractSave); m_btnMgr.show(m_gameSettingsBtnExtractSave);
} }
}
m_btnMgr.show(m_gameSettingsLblGameIOS); m_btnMgr.show(m_gameSettingsLblGameIOS);
m_btnMgr.show(m_gameSettingsLblIOS); m_btnMgr.show(m_gameSettingsLblIOS);
@ -423,11 +428,13 @@ void CMenu::_showGameSettings(void)
m_btnMgr.show(m_gameSettingsLblLED); m_btnMgr.show(m_gameSettingsLblLED);
m_btnMgr.show(m_gameSettingsBtnLED); m_btnMgr.show(m_gameSettingsBtnLED);
} }
}
if(m_gameSettingsPage == 5) if(m_gameSettingsPage == 5)
{ {
m_btnMgr.show(m_gameSettingsLblFlashSave); m_btnMgr.show(m_gameSettingsLblFlashSave);
m_btnMgr.show(m_gameSettingsBtnFlashSave); m_btnMgr.show(m_gameSettingsBtnFlashSave);
//maybe only show this if mariokart wii
m_btnMgr.show(m_gameSettingsLblPrivateServer); m_btnMgr.show(m_gameSettingsLblPrivateServer);
m_btnMgr.show(m_gameSettingsBtnPrivateServer); m_btnMgr.show(m_gameSettingsBtnPrivateServer);
} }
@ -441,7 +448,7 @@ void CMenu::_showGameSettings(void)
u32 maxpage = m_gameSettingsMaxPgs; u32 maxpage = m_gameSettingsMaxPgs;
m_btnMgr.setText(m_gameSettingsLblPage, wfmt(L"%i / %i", page, maxpage)); m_btnMgr.setText(m_gameSettingsLblPage, wfmt(L"%i / %i", page, maxpage));
m_btnMgr.setText(m_gameSettingsBtnOcarina, _optBoolToString(m_gcfg2.getOptBool(id, "cheat", 0))); m_btnMgr.setText(m_gameSettingsBtnOcarina, _optBoolToString(m_gcfg2.getOptBool(id, "cheat", 0)));// cheats default to 0 off
m_btnMgr.setText(m_gameSettingsBtnLED, _optBoolToString(m_gcfg2.getOptBool(id, "led", 0))); m_btnMgr.setText(m_gameSettingsBtnLED, _optBoolToString(m_gcfg2.getOptBool(id, "led", 0)));
i = min((u32)m_gcfg2.getInt(id, "debugger", 0), ARRAY_SIZE(CMenu::_debugger) - 1u); i = min((u32)m_gcfg2.getInt(id, "debugger", 0), ARRAY_SIZE(CMenu::_debugger) - 1u);
@ -449,12 +456,14 @@ void CMenu::_showGameSettings(void)
if(GameHdr->type == TYPE_GC_GAME) if(GameHdr->type == TYPE_GC_GAME)
{ {
//widescreen is shared by all, in the future might seperate them //widescreen is shared by devo and nintendont, in the future might seperate them
m_btnMgr.setText(m_gameSettingsLblWidescreen, _t("cfgg36", L"Widescreen Patch"));
m_btnMgr.setText(m_gameSettingsBtnWidescreen, _optBoolToString(m_gcfg2.getOptBool(id, "widescreen", m_cfg.getBool(GC_DOMAIN, "widescreen", 0)))); m_btnMgr.setText(m_gameSettingsBtnWidescreen, _optBoolToString(m_gcfg2.getOptBool(id, "widescreen", m_cfg.getBool(GC_DOMAIN, "widescreen", 0))));
m_btnMgr.setText(m_gameSettingsBtnDevoMemcardEmu, _optBoolToString(m_gcfg2.getOptBool(id, "devo_memcard_emu", 0))); m_btnMgr.setText(m_gameSettingsBtnDevoMemcardEmu, _optBoolToString(m_gcfg2.getOptBool(id, "devo_memcard_emu", 0)));
m_btnMgr.setText(m_gameSettingsBtnUSB_HID, _optBoolToString(m_gcfg2.getOptBool(id, "USB_HID", m_cfg.getBool(GC_DOMAIN, "USB_HID", 0)))); m_btnMgr.setText(m_gameSettingsBtnUSB_HID, _optBoolToString(m_gcfg2.getOptBool(id, "USB_HID", m_cfg.getBool(GC_DOMAIN, "USB_HID", 0))));
m_btnMgr.setText(m_gameSettingsBtnNATIVE_CTL, _optBoolToString(m_gcfg2.getOptBool(id, "NATIVE_CTL", m_cfg.getBool(GC_DOMAIN, "NATIVE_CTL", 0)))); m_btnMgr.setText(m_gameSettingsBtnNATIVE_CTL, _optBoolToString(m_gcfg2.getOptBool(id, "NATIVE_CTL", m_cfg.getBool(GC_DOMAIN, "NATIVE_CTL", 0))));
m_btnMgr.setText(m_gameSettingsBtnDeflicker, _optBoolToString(m_gcfg2.getOptBool(id, "Deflicker", m_cfg.getBool(GC_DOMAIN, "Deflicker", 0)))); m_btnMgr.setText(m_gameSettingsBtnDeflicker, _optBoolToString(m_gcfg2.getOptBool(id, "Deflicker", m_cfg.getBool(GC_DOMAIN, "Deflicker", 0))));
m_btnMgr.setText(m_gameSettingsBtnArcade, _optBoolToString(m_gcfg2.getOptBool(id, "triforce_arcade", m_cfg.getBool(GC_DOMAIN, "triforce_arcade", 0))));
i = min((u32)m_gcfg2.getInt(id, "video_mode", 0), ARRAY_SIZE(CMenu::_GCvideoModes) - 1u); i = min((u32)m_gcfg2.getInt(id, "video_mode", 0), ARRAY_SIZE(CMenu::_GCvideoModes) - 1u);
m_btnMgr.setText(m_gameSettingsLblVideo, _t(CMenu::_GCvideoModes[i].id, CMenu::_GCvideoModes[i].text)); m_btnMgr.setText(m_gameSettingsLblVideo, _t(CMenu::_GCvideoModes[i].id, CMenu::_GCvideoModes[i].text));
@ -462,16 +471,16 @@ void CMenu::_showGameSettings(void)
i = min((u32)m_gcfg2.getInt(id, "language", 0), ARRAY_SIZE(CMenu::_GClanguages) - 1u); i = min((u32)m_gcfg2.getInt(id, "language", 0), ARRAY_SIZE(CMenu::_GClanguages) - 1u);
m_btnMgr.setText(m_gameSettingsLblLanguage, _t(CMenu::_GClanguages[i].id, CMenu::_GClanguages[i].text)); m_btnMgr.setText(m_gameSettingsLblLanguage, _t(CMenu::_GClanguages[i].id, CMenu::_GClanguages[i].text));
if(GCLoader == NINTENDONT && IsOnWiiU())
m_btnMgr.setText(m_gameSettingsLblWidescreen, _t("cfgg46", L"WiiU Widescreen"));
else
m_btnMgr.setText(m_gameSettingsLblWidescreen, _t("cfgg36", L"Widescreen Patch"));
if(GCLoader == NINTENDONT) if(GCLoader == NINTENDONT)
{ {
m_btnMgr.setText(m_gameSettingsLblEmuMemCard, _t("cfgg47", L"Emulated MemCard")); m_btnMgr.setText(m_gameSettingsLblEmuMemCard, _t("cfgg47", L"Emulated MemCard"));
i = min((u32)m_gcfg2.getInt(id, "nin_memcard", 0), ARRAY_SIZE(CMenu::_NinEmuCard) - 1u); i = min((u32)m_gcfg2.getInt(id, "nin_memcard", 0), ARRAY_SIZE(CMenu::_NinEmuCard) - 1u);
m_btnMgr.setText(m_gameSettingsLblEmuMemCard_Val, _t(CMenu::_NinEmuCard[i].id, CMenu::_NinEmuCard[i].text)); m_btnMgr.setText(m_gameSettingsLblEmuMemCard_Val, _t(CMenu::_NinEmuCard[i].id, CMenu::_NinEmuCard[i].text));
if(IsOnWiiU())
{
m_btnMgr.setText(m_gameSettingsLblWidescreen, _t("cfgg46", L"WiiU Widescreen"));
m_btnMgr.setText(m_gameSettingsBtnWidescreen, _optBoolToString(m_gcfg2.getOptBool(id, "wiiu_widescreen", m_cfg.getBool(GC_DOMAIN, "wiiu_widescreen", 0))));
}
} }
i = min((u32)m_gcfg2.getInt(id, "gc_loader", 0), ARRAY_SIZE(CMenu::_GCLoader) - 1u); i = min((u32)m_gcfg2.getInt(id, "gc_loader", 0), ARRAY_SIZE(CMenu::_GCLoader) - 1u);
@ -535,7 +544,7 @@ void CMenu::_gameSettings(void)
m_btnMgr.up(); m_btnMgr.up();
else if(BTN_DOWN_PRESSED) else if(BTN_DOWN_PRESSED)
m_btnMgr.down(); m_btnMgr.down();
if((BTN_MINUS_PRESSED || BTN_LEFT_PRESSED || (BTN_A_PRESSED && m_btnMgr.selected(m_gameSettingsBtnPageM))) && !m_locked) if(BTN_MINUS_PRESSED || BTN_LEFT_PRESSED || (BTN_A_PRESSED && m_btnMgr.selected(m_gameSettingsBtnPageM)))
{ {
_hideGameSettingsPg(); _hideGameSettingsPg();
if(m_gameSettingsPage == 1) if(m_gameSettingsPage == 1)
@ -545,7 +554,7 @@ void CMenu::_gameSettings(void)
m_btnMgr.click(m_gameSettingsBtnPageM); m_btnMgr.click(m_gameSettingsBtnPageM);
_showGameSettings(); _showGameSettings();
} }
else if((BTN_PLUS_PRESSED || BTN_RIGHT_PRESSED || (BTN_A_PRESSED && m_btnMgr.selected(m_gameSettingsBtnPageP))) && !m_locked) else if(BTN_PLUS_PRESSED || BTN_RIGHT_PRESSED || (BTN_A_PRESSED && m_btnMgr.selected(m_gameSettingsBtnPageP)))
{ {
_hideGameSettingsPg(); _hideGameSettingsPg();
if(m_gameSettingsPage == m_gameSettingsMaxPgs) if(m_gameSettingsPage == m_gameSettingsMaxPgs)
@ -586,6 +595,12 @@ void CMenu::_gameSettings(void)
} }
else if(m_btnMgr.selected(m_gameSettingsBtnLaunchNK)) else if(m_btnMgr.selected(m_gameSettingsBtnLaunchNK))
{ {
//show error msg if emunand not on USB1 && neek2o doesn't exist
if(m_cfg.getInt(CHANNEL_DOMAIN, "partition", 0) != 1)
error(_t("cfgg48", L"EmuNAND not on USB1!"));
else if(!fsop_FileExist("usb1:/sneek/kernel.bin"))
error(_t("cfgg49", L"Neek2o Not Found!"));
else
m_gcfg2.setBool(id, "useneek", !m_gcfg2.getBool(id, "useneek", 0)); m_gcfg2.setBool(id, "useneek", !m_gcfg2.getBool(id, "useneek", 0));
_showGameSettings(); _showGameSettings();
} }
@ -724,6 +739,11 @@ void CMenu::_gameSettings(void)
m_gcfg2.setBool(id, "USB_HID", !m_gcfg2.getBool(id, "USB_HID", 0)); m_gcfg2.setBool(id, "USB_HID", !m_gcfg2.getBool(id, "USB_HID", 0));
_showGameSettings(); _showGameSettings();
} }
else if(m_btnMgr.selected(m_gameSettingsBtnArcade))
{
m_gcfg2.setBool(id, "triforce_arcade", !m_gcfg2.getBool(id, "triforce_arcade", 0));
_showGameSettings();
}
else if(m_btnMgr.selected(m_gameSettingsBtnPrivateServer)) else if(m_btnMgr.selected(m_gameSettingsBtnPrivateServer))
{ {
m_gcfg2.setBool(id, "private_server", !m_gcfg2.getBool(id, "private_server", 0)); m_gcfg2.setBool(id, "private_server", !m_gcfg2.getBool(id, "private_server", 0));
@ -739,14 +759,16 @@ void CMenu::_gameSettings(void)
{ {
_hideGameSettings(); _hideGameSettings();
m_forceext = true; m_forceext = true;
_AutoExtractSave(id); if(!_AutoExtractSave(id))
error(_t("cfgg50", L"No save to extract!"));
_showGameSettings(); _showGameSettings();
} }
else if(m_btnMgr.selected(m_gameSettingsBtnFlashSave)) else if(m_btnMgr.selected(m_gameSettingsBtnFlashSave))
{ {
_hideGameSettings(); _hideGameSettings();
m_forceext = true; m_forceext = true;
_FlashSave(id); if(!_FlashSave(id))
error(_t("cfgg51", L"No save to flash to real NAND!"));
_showGameSettings(); _showGameSettings();
} }
} }
@ -867,6 +889,10 @@ void CMenu::_initGameSettingsMenu()
m_gameSettingsLblExtractSave = _addLabel("GAME_SETTINGS/EXTRACT_SAVE", theme.lblFont, L"", 20, 305, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_gameSettingsLblExtractSave = _addLabel("GAME_SETTINGS/EXTRACT_SAVE", theme.lblFont, L"", 20, 305, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_gameSettingsBtnExtractSave = _addButton("GAME_SETTINGS/EXTRACT_SAVE_BTN", theme.btnFont, L"", 420, 310, 200, 48, theme.btnFontColor); m_gameSettingsBtnExtractSave = _addButton("GAME_SETTINGS/EXTRACT_SAVE_BTN", theme.btnFont, L"", 420, 310, 200, 48, theme.btnFontColor);
//GC Nintendont Page 4 line 1
m_gameSettingsLblArcade = _addLabel("GAME_SETTINGS/ARCADE", theme.lblFont, L"", 20, 125, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_gameSettingsBtnArcade = _addButton("GAME_SETTINGS/ARCADE_BTN", theme.btnFont, L"", 420, 130, 200, 48, theme.btnFontColor);
//Channels Page 4 line 1 and line 4 but only if emu NAND on USB1 //Channels Page 4 line 1 and line 4 but only if emu NAND on USB1
m_gameSettingsLblCustom = _addLabel("GAME_SETTINGS/CUSTOM", theme.lblFont, L"", 20, 125, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_gameSettingsLblCustom = _addLabel("GAME_SETTINGS/CUSTOM", theme.lblFont, L"", 20, 125, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_gameSettingsBtnCustom = _addButton("GAME_SETTINGS/CUSTOM_BTN", theme.btnFont, L"", 420, 130, 200, 48, theme.btnFontColor); m_gameSettingsBtnCustom = _addButton("GAME_SETTINGS/CUSTOM_BTN", theme.btnFont, L"", 420, 130, 200, 48, theme.btnFontColor);
@ -966,6 +992,9 @@ void CMenu::_initGameSettingsMenu()
_setHideAnim(m_gameSettingsLblWidescreen, "GAME_SETTINGS/DM_WIDESCREEN", 50, 0, -2.f, 0.f); _setHideAnim(m_gameSettingsLblWidescreen, "GAME_SETTINGS/DM_WIDESCREEN", 50, 0, -2.f, 0.f);
_setHideAnim(m_gameSettingsBtnWidescreen, "GAME_SETTINGS/DM_WIDESCREEN_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_gameSettingsBtnWidescreen, "GAME_SETTINGS/DM_WIDESCREEN_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_gameSettingsLblArcade, "GAME_SETTINGS/ARCADE", 50, 0, -2.f, 0.f);
_setHideAnim(m_gameSettingsBtnArcade, "GAME_SETTINGS/ARCADE_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_gameSettingsLblGCLoader, "GAME_SETTINGS/GC_LOADER", 50, 0, -2.f, 0.f); _setHideAnim(m_gameSettingsLblGCLoader, "GAME_SETTINGS/GC_LOADER", 50, 0, -2.f, 0.f);
_setHideAnim(m_gameSettingsLblGCLoader_Val, "GAME_SETTINGS/GC_LOADER_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_gameSettingsLblGCLoader_Val, "GAME_SETTINGS/GC_LOADER_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_gameSettingsBtnGCLoader_P, "GAME_SETTINGS/GC_LOADER_PLUS", -50, 0, 1.f, 0.f); _setHideAnim(m_gameSettingsBtnGCLoader_P, "GAME_SETTINGS/GC_LOADER_PLUS", -50, 0, 1.f, 0.f);
@ -1035,6 +1064,7 @@ void CMenu::_textGameSettings(void)
m_btnMgr.setText(m_gameSettingsLblUSB_HID, _t("cfgg42", L"USB-HID Controller")); m_btnMgr.setText(m_gameSettingsLblUSB_HID, _t("cfgg42", L"USB-HID Controller"));
m_btnMgr.setText(m_gameSettingsLblNATIVE_CTL, _t("cfgg43", L"Native Control")); m_btnMgr.setText(m_gameSettingsLblNATIVE_CTL, _t("cfgg43", L"Native Control"));
m_btnMgr.setText(m_gameSettingsLblArcade, _t("cfgg48", L"Triforce Arcade Mode"));
m_btnMgr.setText(m_gameSettingsLblEmulation, _t("cfgg24", L"NAND Emulation")); m_btnMgr.setText(m_gameSettingsLblEmulation, _t("cfgg24", L"NAND Emulation"));
m_btnMgr.setText(m_gameSettingsLblGameIOS, _t("cfgg10", L"IOS")); m_btnMgr.setText(m_gameSettingsLblGameIOS, _t("cfgg10", L"IOS"));
m_btnMgr.setText(m_gameSettingsLblLED, _t("cfgg38", L"Activity LED")); m_btnMgr.setText(m_gameSettingsLblLED, _t("cfgg38", L"Activity LED"));

View File

@ -0,0 +1,182 @@
#include "menu.hpp"
s16 m_cfghbLblTitle;
s16 m_cfghbBtnBack;
s16 m_cfghbLblUser[4];
s16 m_cfghbLblAdjustCF;
s16 m_cfghbBtnAdjustCF;
s16 m_cfghbLblSmallbox;
s16 m_cfghbBtnSmallbox;
s16 m_cfghbLblBoxMode;
s16 m_cfghbBtnBoxMode;
s16 m_cfghbLblPartition;
s16 m_cfghbLblPartitionVal;
s16 m_cfghbBtnPartitionP;
s16 m_cfghbBtnPartitionM;
TexData m_cfghbBg;
static void _showCfgHB(void)
{
m_btnMgr.show(m_cfghbLblTitle);
m_btnMgr.show(m_cfghbBtnBack);
for(u8 i = 0; i < ARRAY_SIZE(m_cfghbLblUser); ++i)
if(m_cfghbLblUser[i] != -1)
m_btnMgr.show(m_cfghbLblUser[i]);
m_btnMgr.show(m_cfghbLblAdjustCF);
m_btnMgr.show(m_cfghbBtnAdjustCF);
m_btnMgr.show(m_cfghbLblSmallbox);
m_btnMgr.show(m_cfghbBtnSmallbox);
m_btnMgr.show(m_cfghbLblBoxMode);
m_btnMgr.show(m_cfghbBtnBoxMode);
m_btnMgr.show(m_cfghbLblPartition);
m_btnMgr.show(m_cfghbLblPartitionVal);
m_btnMgr.show(m_cfghbBtnPartitionP);
m_btnMgr.show(m_cfghbBtnPartitionM);
}
static void _hideCfgHB(bool instant)
{
m_btnMgr.hide(m_cfghbLblTitle, instant);
m_btnMgr.hide(m_cfghbBtnBack, instant);
for(u8 i = 0; i < ARRAY_SIZE(m_cfghbLblUser); ++i)
if(m_cfghbLblUser[i] != -1)
m_btnMgr.hide(m_cfghbLblUser[i], instant);
m_btnMgr.hide(m_cfghbLblAdjustCF, instant);
m_btnMgr.hide(m_cfghbBtnAdjustCF, instant);
m_btnMgr.hide(m_cfghbLblSmallbox, instant);
m_btnMgr.hide(m_cfghbBtnSmallbox, instant);
m_btnMgr.hide(m_cfghbLblBoxMode, instant);
m_btnMgr.hide(m_cfghbBtnBoxMode, instant);
m_btnMgr.hide(m_cfghbLblPartition, instant);
m_btnMgr.hide(m_cfghbLblPartitionVal, instant);
m_btnMgr.hide(m_cfghbBtnPartitionP, instant);
m_btnMgr.hide(m_cfghbBtnPartitionM, instant);
}
void CMenu::_CfgHB(void)
{
m_btnMgr.setText(m_cfghbBtnSmallbox, m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox") ? _t("on", L"On") : _t("off", L"Off"));
m_btnMgr.setText(m_cfghbBtnBoxMode, m_cfg.getBool(HOMEBREW_DOMAIN, "box_mode") ? _t("on", L"On") : _t("off", L"Off"));
currentPartition = m_cfg.getInt(HOMEBREW_DOMAIN, "partition", 0);
const char *partitionname = DeviceName[currentPartition];
m_btnMgr.setText(m_cfghbLblPartitionVal, upperCase(partitionname));
SetupInput();
_setBg(m_cfghbBg, m_cfghbBg);
_showCfgHB();
while(!m_exit)
{
_mainLoopCommon();
if(BTN_HOME_PRESSED || BTN_B_PRESSED)
break;
else if(BTN_UP_PRESSED)
m_btnMgr.up();
else if(BTN_DOWN_PRESSED)
m_btnMgr.down();
else if(BTN_A_PRESSED)
{
if(m_btnMgr.selected(m_cfghbBtnBack))
break;
else if (m_btnMgr.selected(m_cfghbBtnAdjustCF))
{
m_refreshGameList = true;
_hideCfgHB(true);
_cfTheme();
_showCfgHB();
}
else if (m_btnMgr.selected(m_cfghbBtnSmallbox))
{
m_refreshGameList = true;
m_cfg.setBool(HOMEBREW_DOMAIN, "smallbox", !m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox", false));
m_btnMgr.setText(m_cfghbBtnSmallbox, m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox") ? _t("on", L"On") : _t("off", L"Off"));
}
else if (m_btnMgr.selected(m_cfghbBtnBoxMode))
{
m_refreshGameList = true;
m_cfg.setBool(HOMEBREW_DOMAIN, "box_mode", !m_cfg.getBool(HOMEBREW_DOMAIN, "box_mode", false));
m_btnMgr.setText(m_cfghbBtnBoxMode, m_cfg.getBool(HOMEBREW_DOMAIN, "box_mode") ? _t("on", L"On") : _t("off", L"Off"));
}
else if (m_btnMgr.selected(m_cfghbBtnPartitionP) || m_btnMgr.selected(m_cfghbBtnPartitionM))
{
m_refreshGameList = true;
s8 direction = m_btnMgr.selected(m_cfghbBtnPartitionP) ? 1 : -1;
_setPartition(direction);
const char *partitionname = DeviceName[currentPartition];
m_btnMgr.setText(m_cfghbLblPartitionVal, upperCase(partitionname));
}
}
}
_hideCfgHB(true);
}
void CMenu::_textCfgHB(void)
{
m_btnMgr.setText(m_cfghbLblTitle, _t("cfghb1", L"Homebrew Settings"));
m_btnMgr.setText(m_cfghbLblAdjustCF, _t("cfgc4", L"Adjust Coverflow"));
m_btnMgr.setText(m_cfghbBtnAdjustCF, _t("cfgc5", L"Go"));
m_btnMgr.setText(m_cfghbLblSmallbox, _t("cfghb2", L"Coverflow Smallbox"));
m_btnMgr.setText(m_cfghbLblBoxMode, _t("cfghb6", L"Box Mode"));
m_btnMgr.setText(m_cfghbLblPartition, _t("cfghb3", L"Homebrew Partition"));
m_btnMgr.setText(m_cfghbBtnBack, _t("cfg10", L"Back"));
}
void CMenu::_initCfgHB(void)
{
m_cfghbBg = _texture("CFG_HB/BG", "texture", theme.bg, false);
_addUserLabels(m_cfghbLblUser, ARRAY_SIZE(m_cfghbLblUser), "CFG_HB");
m_cfghbLblTitle = _addTitle("CFG_HB/TITLE", theme.titleFont, L"", 0, 10, 640, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE);
m_cfghbBtnBack = _addButton("CFG_HB/BACK_BTN", theme.btnFont, L"", 420, 400, 200, 48, theme.btnFontColor);
m_cfghbLblAdjustCF = _addLabel("CFG_HB/ADJUST_CF", theme.lblFont, L"", 20, 125, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_cfghbBtnAdjustCF = _addButton("CFG_HB/ADJUST_CF_BTN", theme.btnFont, L"", 420, 130, 200, 48, theme.btnFontColor);
m_cfghbLblSmallbox = _addLabel("CFG_HB/HB_SMALLBOX", theme.lblFont, L"", 20, 185, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_cfghbBtnSmallbox = _addButton("CFG_HB/HB_SMALLBOX_BTN", theme.btnFont, L"", 420, 190, 200, 48, theme.btnFontColor);
m_cfghbLblBoxMode = _addLabel("CFG_HB/HB_BOXMODE", theme.lblFont, L"", 20, 245, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_cfghbBtnBoxMode = _addButton("CFG_HB/HB_BOXMODE_BTN", theme.btnFont, L"", 420, 250, 200, 48, theme.btnFontColor);
m_cfghbLblPartition = _addLabel("CFG_HB/HB_PARTITION", theme.lblFont, L"", 20, 305, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_cfghbLblPartitionVal = _addLabel("CFG_HB/HB_PARTITION_VAL", theme.btnFont, L"", 468, 310, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC);
m_cfghbBtnPartitionM = _addPicButton("CFG_HB/HB_PARTITION_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 420, 310, 48, 48);
m_cfghbBtnPartitionP = _addPicButton("CFG_HB/HB_PARTITION_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 572, 310, 48, 48);
_setHideAnim(m_cfghbLblTitle, "CFG_HB/TITLE", 0, 0, -2.f, 0.f);
_setHideAnim(m_cfghbBtnBack, "CFG_HB/BACK_BTN", 0, 0, 1.f, -1.f);
_setHideAnim(m_cfghbLblAdjustCF, "CFG_HB/ADJUST_CF", -50, 0, -2.f, 0.f);
_setHideAnim(m_cfghbBtnAdjustCF, "CFG_HB/ADJUST_CF_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_cfghbLblSmallbox, "CFG_HB/HB_SMALLBOX", -50, 0, -2.f, 0.f);
_setHideAnim(m_cfghbBtnSmallbox, "CFG_HB/HB_SMALLBOX_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_cfghbLblBoxMode, "CFG_HB/HB_BOXMODE", -50, 0, -2.f, 0.f);
_setHideAnim(m_cfghbBtnBoxMode, "CFG_HB/HB_BOXMODE_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_cfghbLblPartition, "CFG_HB/HB_PARTITION", -50, 0, -2.f, 0.f);
_setHideAnim(m_cfghbLblPartitionVal, "CFG_HB/HB_PARTITION_VAL", -50, 0, 1.f, 0.f);
_setHideAnim(m_cfghbBtnPartitionM, "CFG_HB/HB_PARTITION_MINUS", -50, 0, 1.f, 0.f);
_setHideAnim(m_cfghbBtnPartitionP, "CFG_HB/HB_PARTITION_PLUS", -50, 0, 1.f, 0.f);
_hideCfgHB(true);
_textCfgHB();
}

View File

@ -1,26 +1,8 @@
/****************************************************************************
* Copyright (C) 2012 Fledge68
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#include "menu.hpp" #include "menu.hpp"
s16 m_cfgsrcLblTitle; s16 m_cfgsrcLblTitle;
s16 m_cfgsrcBtnBack; s16 m_cfgsrcBtnBack;
s16 m_cfgsrcLblPage;
s16 m_cfgsrcBtnPageM;
s16 m_cfgsrcBtnPageP;
s16 m_cfgsrcLblUser[4]; s16 m_cfgsrcLblUser[4];
s16 m_cfgsrcLblEnableSF; s16 m_cfgsrcLblEnableSF;
@ -29,40 +11,24 @@ s16 m_cfgsrcBtnEnableSF;
s16 m_cfgsrcLblSmallbox; s16 m_cfgsrcLblSmallbox;
s16 m_cfgsrcBtnSmallbox; s16 m_cfgsrcBtnSmallbox;
s16 m_cfgsrcLblClearSF; s16 m_cfgsrcLblBoxMode;
s16 m_cfgsrcBtnClearSF; s16 m_cfgsrcBtnBoxMode;
s16 m_cfgsrcLblAdjustCF;
s16 m_cfgsrcBtnAdjustCF;
s16 m_cfgsrcLblMultisource; s16 m_cfgsrcLblMultisource;
s16 m_cfgsrcBtnMultisource; s16 m_cfgsrcBtnMultisource;
u8 cfgsrc_curPage = 1; TexData m_cfgsrcBg;
u8 cfgsrc_Pages = 1;
static void showCfgSrc(void) static void _hideCfgSrc(bool instant)
{ {
m_btnMgr.show(m_cfgsrcLblTitle);
m_btnMgr.show(m_cfgsrcBtnBack);
m_btnMgr.show(m_cfgsrcLblPage);
m_btnMgr.show(m_cfgsrcBtnPageM);
m_btnMgr.show(m_cfgsrcBtnPageP);
for(u8 i = 0; i < ARRAY_SIZE(m_cfgsrcLblUser); ++i)
if(m_cfgsrcLblUser[i] != -1)
m_btnMgr.show(m_cfgsrcLblUser[i]);
}
static void hideCfgSrc(bool instant, bool common)
{
if(common)
{
m_btnMgr.hide(m_cfgsrcLblTitle, instant); m_btnMgr.hide(m_cfgsrcLblTitle, instant);
m_btnMgr.hide(m_cfgsrcBtnBack, instant); m_btnMgr.hide(m_cfgsrcBtnBack, instant);
m_btnMgr.hide(m_cfgsrcLblPage, instant);
m_btnMgr.hide(m_cfgsrcBtnPageM, instant);
m_btnMgr.hide(m_cfgsrcBtnPageP, instant);
for(u8 i = 0; i < ARRAY_SIZE(m_cfgsrcLblUser); ++i) for(u8 i = 0; i < ARRAY_SIZE(m_cfgsrcLblUser); ++i)
if(m_cfgsrcLblUser[i] != -1) if(m_cfgsrcLblUser[i] != -1)
m_btnMgr.hide(m_cfgsrcLblUser[i], instant); m_btnMgr.hide(m_cfgsrcLblUser[i], instant);
}
m_btnMgr.hide(m_cfgsrcLblEnableSF, instant); m_btnMgr.hide(m_cfgsrcLblEnableSF, instant);
m_btnMgr.hide(m_cfgsrcBtnEnableSF, instant); m_btnMgr.hide(m_cfgsrcBtnEnableSF, instant);
@ -70,19 +36,66 @@ static void hideCfgSrc(bool instant, bool common)
m_btnMgr.hide(m_cfgsrcLblSmallbox, instant); m_btnMgr.hide(m_cfgsrcLblSmallbox, instant);
m_btnMgr.hide(m_cfgsrcBtnSmallbox, instant); m_btnMgr.hide(m_cfgsrcBtnSmallbox, instant);
m_btnMgr.hide(m_cfgsrcLblClearSF, instant); m_btnMgr.hide(m_cfgsrcLblBoxMode, instant);
m_btnMgr.hide(m_cfgsrcBtnClearSF, instant); m_btnMgr.hide(m_cfgsrcBtnBoxMode, instant);
m_btnMgr.hide(m_cfgsrcLblAdjustCF, instant);
m_btnMgr.hide(m_cfgsrcBtnAdjustCF, instant);
m_btnMgr.hide(m_cfgsrcLblMultisource, instant); m_btnMgr.hide(m_cfgsrcLblMultisource, instant);
m_btnMgr.hide(m_cfgsrcBtnMultisource, instant); m_btnMgr.hide(m_cfgsrcBtnMultisource, instant);
} }
static void _showCfgSrc(bool m_sourceflow)
{
m_btnMgr.show(m_cfgsrcLblTitle);
m_btnMgr.show(m_cfgsrcBtnBack);
for(u8 i = 0; i < ARRAY_SIZE(m_cfgsrcLblUser); ++i)
if(m_cfgsrcLblUser[i] != -1)
m_btnMgr.show(m_cfgsrcLblUser[i]);
m_btnMgr.show(m_cfgsrcLblEnableSF);
m_btnMgr.show(m_cfgsrcBtnEnableSF);
if(m_sourceflow)
{
m_btnMgr.show(m_cfgsrcLblSmallbox);
m_btnMgr.show(m_cfgsrcBtnSmallbox);
m_btnMgr.show(m_cfgsrcLblBoxMode);
m_btnMgr.show(m_cfgsrcBtnBoxMode);
m_btnMgr.show(m_cfgsrcLblAdjustCF);
m_btnMgr.show(m_cfgsrcBtnAdjustCF);
m_btnMgr.hide(m_cfgsrcLblMultisource, true);
m_btnMgr.hide(m_cfgsrcBtnMultisource, true);
}
else
{
m_btnMgr.show(m_cfgsrcLblMultisource);
m_btnMgr.show(m_cfgsrcBtnMultisource);
m_btnMgr.hide(m_cfgsrcLblSmallbox, true);
m_btnMgr.hide(m_cfgsrcBtnSmallbox, true);
m_btnMgr.hide(m_cfgsrcLblBoxMode, true);
m_btnMgr.hide(m_cfgsrcBtnBoxMode, true);
m_btnMgr.hide(m_cfgsrcLblAdjustCF, true);
m_btnMgr.hide(m_cfgsrcBtnAdjustCF, true);
}
}
void CMenu::_CfgSrc(void) void CMenu::_CfgSrc(void)
{ {
cfgsrc_curPage = 1;
SetupInput(); SetupInput();
showCfgSrc(); _setBg(m_cfgsrcBg, m_cfgsrcBg);
_refreshCfgSrc(); m_btnMgr.setText(m_cfgsrcBtnEnableSF, m_cfg.getBool(SOURCEFLOW_DOMAIN, "enabled") ? _t("on", L"On") : _t("off", L"Off"));
m_btnMgr.setText(m_cfgsrcBtnSmallbox, m_cfg.getBool(SOURCEFLOW_DOMAIN, "smallbox") ? _t("on", L"On") : _t("off", L"Off"));
m_btnMgr.setText(m_cfgsrcBtnBoxMode, m_cfg.getBool(SOURCEFLOW_DOMAIN, "box_mode") ? _t("on", L"On") : _t("off", L"Off"));
m_btnMgr.setText(m_cfgsrcBtnMultisource, m_cfg.getBool("GENERAL", "multisource") ? _t("on", L"On") : _t("off", L"Off"));
_showCfgSrc(m_sourceflow);
while(!m_exit) while(!m_exit)
{ {
@ -93,103 +106,56 @@ void CMenu::_CfgSrc(void)
m_btnMgr.up(); m_btnMgr.up();
else if(BTN_DOWN_PRESSED) else if(BTN_DOWN_PRESSED)
m_btnMgr.down(); m_btnMgr.down();
else if((BTN_MINUS_PRESSED || BTN_LEFT_PRESSED) || (BTN_A_PRESSED && m_btnMgr.selected(m_cfgsrcBtnPageM)))
{
cfgsrc_curPage--;
if(cfgsrc_curPage == 0) cfgsrc_curPage = cfgsrc_Pages;
if(BTN_LEFT_PRESSED || BTN_MINUS_PRESSED)
m_btnMgr.click(m_cfgsrcBtnPageM);
_refreshCfgSrc();
}
else if(((BTN_PLUS_PRESSED || BTN_RIGHT_PRESSED)) || (BTN_A_PRESSED && m_btnMgr.selected(m_cfgsrcBtnPageP)))
{
cfgsrc_curPage++;
if(cfgsrc_curPage > cfgsrc_Pages) cfgsrc_curPage = 1;
if(BTN_RIGHT_PRESSED || BTN_PLUS_PRESSED)
m_btnMgr.click(m_cfgsrcBtnPageP);
_refreshCfgSrc();
}
else if(BTN_A_PRESSED) else if(BTN_A_PRESSED)
{ {
if(m_btnMgr.selected(m_cfgsrcBtnBack)) if(m_btnMgr.selected(m_cfgsrcBtnBack))
break; break;
else if (m_btnMgr.selected(m_cfgsrcBtnEnableSF)) else if(m_btnMgr.selected(m_cfgsrcBtnEnableSF))
{ {
m_sourceflow = !m_sourceflow; m_sourceflow = !m_sourceflow;
m_cfg.setBool("SOURCEFLOW", "enabled", m_sourceflow); m_cfg.setBool(SOURCEFLOW_DOMAIN, "enabled", m_sourceflow);
m_cfg.setBool("GENERAL", "multisource", false); m_btnMgr.setText(m_cfgsrcBtnEnableSF, m_sourceflow ? _t("on", L"On") : _t("off", L"Off"));
m_btnMgr.setText(m_cfgsrcBtnEnableSF, m_cfg.getBool("SOURCEFLOW", "enabled") ? _t("on", L"On") : _t("off", L"Off")); _showCfgSrc(m_sourceflow);
} }
else if (m_btnMgr.selected(m_cfgsrcBtnSmallbox)) else if(m_btnMgr.selected(m_cfgsrcBtnSmallbox))
{ {
if(m_sourceflow) m_refreshGameList = true;
m_load_view = true;
fsop_deleteFolder(fmt("%s/sourceflow", m_cacheDir.c_str())); fsop_deleteFolder(fmt("%s/sourceflow", m_cacheDir.c_str()));
m_cfg.setBool("SOURCEFLOW", "smallbox", !m_cfg.getBool("SOURCEFLOW", "smallbox", false)); m_cfg.setBool(SOURCEFLOW_DOMAIN, "smallbox", !m_cfg.getBool(SOURCEFLOW_DOMAIN, "smallbox", false));
m_btnMgr.setText(m_cfgsrcBtnSmallbox, m_cfg.getBool("SOURCEFLOW", "smallbox") ? _t("on", L"On") : _t("off", L"Off")); m_btnMgr.setText(m_cfgsrcBtnSmallbox, m_cfg.getBool(SOURCEFLOW_DOMAIN, "smallbox") ? _t("on", L"On") : _t("off", L"Off"));
} }
else if (m_btnMgr.selected(m_cfgsrcBtnClearSF)) else if(m_btnMgr.selected(m_cfgsrcBtnBoxMode))
{ {
m_cfg.setBool("SOURCEFLOW", "update_cache", true); m_refreshGameList = true;
if(m_sourceflow) fsop_deleteFolder(fmt("%s/sourceflow", m_cacheDir.c_str()));
m_load_view = true; m_cfg.setBool(SOURCEFLOW_DOMAIN, "box_mode", !m_cfg.getBool(SOURCEFLOW_DOMAIN, "box_mode", false));
m_btnMgr.setText(m_cfgsrcBtnBoxMode, m_cfg.getBool(SOURCEFLOW_DOMAIN, "box_mode") ? _t("on", L"On") : _t("off", L"Off"));
} }
else if (m_btnMgr.selected(m_cfgsrcBtnMultisource)) else if(m_btnMgr.selected(m_cfgsrcBtnAdjustCF))
{
m_refreshGameList = true;
_hideCfgSrc(true);
_cfTheme();
_showCfgSrc(m_sourceflow);
}
else if(m_btnMgr.selected(m_cfgsrcBtnMultisource))
{ {
m_multisource = !m_multisource; m_multisource = !m_multisource;
m_cfg.setBool("GENERAL", "multisource", m_multisource); m_cfg.setBool("GENERAL", "multisource", m_multisource);
m_cfg.setBool("SOURCEFLOW", "enabled", false); m_btnMgr.setText(m_cfgsrcBtnMultisource, m_multisource ? _t("on", L"On") : _t("off", L"Off"));
m_btnMgr.setText(m_cfgsrcBtnMultisource, m_cfg.getBool("GENERAL", "multisource") ? _t("on", L"On") : _t("off", L"Off"));
} }
} }
} }
hideCfgSrc(false, true); _hideCfgSrc(false);
} }
void CMenu::_refreshCfgSrc()
{
hideCfgSrc(true, false);
m_btnMgr.setText(m_cfgsrcLblPage, wfmt(L"%i / %i", cfgsrc_curPage, cfgsrc_Pages));
if(cfgsrc_curPage == 1)
{
m_btnMgr.setText(m_cfgsrcBtnEnableSF, m_cfg.getBool("SOURCEFLOW", "enabled") ? _t("on", L"On") : _t("off", L"Off"));
m_btnMgr.setText(m_cfgsrcBtnSmallbox, m_cfg.getBool("SOURCEFLOW", "smallbox") ? _t("on", L"On") : _t("off", L"Off"));
m_btnMgr.setText(m_cfgsrcBtnMultisource, m_cfg.getBool("GENERAL", "multisource") ? _t("on", L"On") : _t("off", L"Off"));
m_btnMgr.show(m_cfgsrcLblEnableSF);
m_btnMgr.show(m_cfgsrcBtnEnableSF);
m_btnMgr.show(m_cfgsrcLblSmallbox);
m_btnMgr.show(m_cfgsrcBtnSmallbox);
m_btnMgr.show(m_cfgsrcLblClearSF);
m_btnMgr.show(m_cfgsrcBtnClearSF);
m_btnMgr.show(m_cfgsrcLblMultisource);
m_btnMgr.show(m_cfgsrcBtnMultisource);
}
}
void CMenu::_textCfgSrc(void)
{
m_btnMgr.setText(m_cfgsrcLblTitle, _t("cfgsm1", L"Source Menu Settings"));
m_btnMgr.setText(m_cfgsrcLblEnableSF, _t("cfgsm3", L"Enable Sourceflow"));
m_btnMgr.setText(m_cfgsrcLblSmallbox, _t("cfgsm4", L"Sourceflow Smallbox"));
m_btnMgr.setText(m_cfgsrcLblClearSF, _t("cfgsm5", L"Clear Sourceflow Cache"));
m_btnMgr.setText(m_cfgsrcBtnClearSF, _t("cfgc5", L"Go"));
m_btnMgr.setText(m_cfgsrcLblMultisource, _t("cfgbt6", L"Enable Multisource Features"));
m_btnMgr.setText(m_cfgsrcBtnBack, _t("cfg10", L"Back"));
}
void CMenu::_initCfgSrc(void) void CMenu::_initCfgSrc(void)
{ {
m_cfgsrcBg = _texture("CFG_SRC/BG", "texture", theme.bg, false);
_addUserLabels(m_cfgsrcLblUser, ARRAY_SIZE(m_cfgsrcLblUser), "CFG_SRC"); _addUserLabels(m_cfgsrcLblUser, ARRAY_SIZE(m_cfgsrcLblUser), "CFG_SRC");
m_cfgsrcLblTitle = _addTitle("CFG_SRC/TITLE", theme.titleFont, L"", 0, 10, 640, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE); m_cfgsrcLblTitle = _addTitle("CFG_SRC/TITLE", theme.titleFont, L"", 0, 10, 640, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE);
m_cfgsrcBtnBack = _addButton("CFG_SRC/BACK_BTN", theme.btnFont, L"", 420, 400, 200, 48, theme.btnFontColor); m_cfgsrcBtnBack = _addButton("CFG_SRC/BACK_BTN", theme.btnFont, L"", 420, 400, 200, 48, theme.btnFontColor);
m_cfgsrcLblPage = _addLabel("CFG_SRC/PAGE_BTN", theme.btnFont, L"", 68, 400, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC);
m_cfgsrcBtnPageM = _addPicButton("CFG_SRC/PAGE_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 20, 400, 48, 48);
m_cfgsrcBtnPageP = _addPicButton("CFG_SRC/PAGE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 172, 400, 48, 48);
m_cfgsrcLblEnableSF = _addLabel("CFG_SRC/ENABLE_SF", theme.lblFont, L"", 20, 125, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_cfgsrcLblEnableSF = _addLabel("CFG_SRC/ENABLE_SF", theme.lblFont, L"", 20, 125, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_cfgsrcBtnEnableSF = _addButton("CFG_SRC/ENABLE_SF_BTN", theme.btnFont, L"", 420, 130, 200, 48, theme.btnFontColor); m_cfgsrcBtnEnableSF = _addButton("CFG_SRC/ENABLE_SF_BTN", theme.btnFont, L"", 420, 130, 200, 48, theme.btnFontColor);
@ -197,17 +163,17 @@ void CMenu::_initCfgSrc(void)
m_cfgsrcLblSmallbox = _addLabel("CFG_SRC/SF_SMALLBOX", theme.lblFont, L"", 20, 185, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_cfgsrcLblSmallbox = _addLabel("CFG_SRC/SF_SMALLBOX", theme.lblFont, L"", 20, 185, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_cfgsrcBtnSmallbox = _addButton("CFG_SRC/SF_SMALLBOX_BTN", theme.btnFont, L"", 420, 190, 200, 48, theme.btnFontColor); m_cfgsrcBtnSmallbox = _addButton("CFG_SRC/SF_SMALLBOX_BTN", theme.btnFont, L"", 420, 190, 200, 48, theme.btnFontColor);
m_cfgsrcLblClearSF = _addLabel("CFG_SRC/CLEAR_SF", theme.lblFont, L"", 20, 245, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_cfgsrcLblBoxMode = _addLabel("CFG_SRC/SF_BOXMODE", theme.lblFont, L"", 20, 245, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_cfgsrcBtnClearSF = _addButton("CFG_SRC/CLEAR_SF_BTN", theme.btnFont, L"", 420, 250, 200, 48, theme.btnFontColor); m_cfgsrcBtnBoxMode = _addButton("CFG_SRC/SF_BOXMODE_BTN", theme.btnFont, L"", 420, 250, 200, 48, theme.btnFontColor);
m_cfgsrcLblMultisource = _addLabel("CFG_SRC/MULTISOURCE", theme.lblFont, L"", 20, 305, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_cfgsrcLblAdjustCF = _addLabel("CFG_SRC/SF_ADJUSTCF", theme.lblFont, L"", 20, 305, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_cfgsrcBtnMultisource = _addButton("CFG_SRC/MULTISOURCE_BTN", theme.btnFont, L"", 420, 310, 200, 48, theme.btnFontColor); m_cfgsrcBtnAdjustCF = _addButton("CFG_SRC/SF_ADJUSTCF_BTN", theme.btnFont, L"", 420, 310, 200, 48, theme.btnFontColor);
m_cfgsrcLblMultisource = _addLabel("CFG_SRC/MULTISOURCE", theme.lblFont, L"", 20, 185, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_cfgsrcBtnMultisource = _addButton("CFG_SRC/MULTISOURCE_BTN", theme.btnFont, L"", 420, 190, 200, 48, theme.btnFontColor);
_setHideAnim(m_cfgsrcLblTitle, "CFG_SRC/TITLE", 0, 0, -2.f, 0.f); _setHideAnim(m_cfgsrcLblTitle, "CFG_SRC/TITLE", 0, 0, -2.f, 0.f);
_setHideAnim(m_cfgsrcBtnBack, "CFG_SRC/BACK_BTN", 0, 0, 1.f, -1.f); _setHideAnim(m_cfgsrcBtnBack, "CFG_SRC/BACK_BTN", 0, 0, 1.f, -1.f);
_setHideAnim(m_cfgsrcLblPage, "CFG_SRC/PAGE_BTN", 0, 0, 1.f, -1.f);
_setHideAnim(m_cfgsrcBtnPageM, "CFG_SRC/PAGE_MINUS", 0, 0, 1.f, -1.f);
_setHideAnim(m_cfgsrcBtnPageP, "CFG_SRC/PAGE_PLUS", 0, 0, 1.f, -1.f);
_setHideAnim(m_cfgsrcLblEnableSF, "CFG_SRC/ENABLE_SF", -50, 0, -2.f, 0.f); _setHideAnim(m_cfgsrcLblEnableSF, "CFG_SRC/ENABLE_SF", -50, 0, -2.f, 0.f);
_setHideAnim(m_cfgsrcBtnEnableSF, "CFG_SRC/ENABLE_SF_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_cfgsrcBtnEnableSF, "CFG_SRC/ENABLE_SF_BTN", -50, 0, 1.f, 0.f);
@ -215,12 +181,27 @@ void CMenu::_initCfgSrc(void)
_setHideAnim(m_cfgsrcLblSmallbox, "CFG_SRC/SF_SMALLBOX", -50, 0, -2.f, 0.f); _setHideAnim(m_cfgsrcLblSmallbox, "CFG_SRC/SF_SMALLBOX", -50, 0, -2.f, 0.f);
_setHideAnim(m_cfgsrcBtnSmallbox, "CFG_SRC/SF_SMALLBOX_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_cfgsrcBtnSmallbox, "CFG_SRC/SF_SMALLBOX_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_cfgsrcLblClearSF, "CFG_SRC/CLEAR_SF", -50, 0, -2.f, 0.f); _setHideAnim(m_cfgsrcLblBoxMode, "CFG_SRC/SF_BOX_MODE", -50, 0, -2.f, 0.f);
_setHideAnim(m_cfgsrcBtnClearSF, "CFG_SRC/CLEAR_SF_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_cfgsrcBtnBoxMode, "CFG_SRC/SF_BOX_MODE_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_cfgsrcLblAdjustCF, "CFG_SRC/SF_ADJUSTCF", -50, 0, -2.f, 0.f);
_setHideAnim(m_cfgsrcBtnAdjustCF, "CFG_SRC/SF_ADJUSTCF_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_cfgsrcLblMultisource, "CFG_SRC/MULTISOURCE", -50, 0, -2.f, 0.f); _setHideAnim(m_cfgsrcLblMultisource, "CFG_SRC/MULTISOURCE", -50, 0, -2.f, 0.f);
_setHideAnim(m_cfgsrcBtnMultisource, "CFG_SRC/MULTISOURCE_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_cfgsrcBtnMultisource, "CFG_SRC/MULTISOURCE_BTN", -50, 0, 1.f, 0.f);
hideCfgSrc(true, true); _hideCfgSrc(true);
_textCfgSrc(); _textCfgSrc();
} }
void CMenu::_textCfgSrc(void)
{
m_btnMgr.setText(m_cfgsrcLblTitle, _t("cfgsm1", L"Source Menu Settings"));
m_btnMgr.setText(m_cfgsrcLblEnableSF, _t("cfgsm3", L"Enable Sourceflow"));
m_btnMgr.setText(m_cfgsrcLblSmallbox, _t("cfgsm4", L"Sourceflow Smallbox"));
m_btnMgr.setText(m_cfgsrcLblBoxMode, _t("cfghb6", L"Box Mode"));
m_btnMgr.setText(m_cfgsrcLblAdjustCF, _t("cfgc4", L"Adjust Coverflow"));
m_btnMgr.setText(m_cfgsrcBtnAdjustCF, _t("cfgc5", L"Go"));
m_btnMgr.setText(m_cfgsrcLblMultisource, _t("cfgbt6", L"Enable Multisource Features"));
m_btnMgr.setText(m_cfgsrcBtnBack, _t("cfg10", L"Back"));
}

View File

@ -21,7 +21,7 @@
#define TAG_LOC "{loc}" #define TAG_LOC "{loc}"
#define TAG_CONSOLE "{console}" #define TAG_CONSOLE "{console}"
#define TITLES_URL "http://www.gametdb.com/titles.txt?LANG=%s" //#define TITLES_URL "http://www.gametdb.com/titles.txt?LANG=%s"
#define GAMETDB_URL "http://www.gametdb.com/wiitdb.zip?LANG=%s&FALLBACK=TRUE&WIIWARE=TRUE&GAMECUBE=TRUE" #define GAMETDB_URL "http://www.gametdb.com/wiitdb.zip?LANG=%s&FALLBACK=TRUE&WIIWARE=TRUE&GAMECUBE=TRUE"
#define UPDATE_URL_VERSION "http://nintendont.gxarena.com/banners/versions.txt" #define UPDATE_URL_VERSION "http://nintendont.gxarena.com/banners/versions.txt"
#define CUSTOM_BANNER_URL "http://nintendont.gxarena.com/banners/{gameid}.bnr" #define CUSTOM_BANNER_URL "http://nintendont.gxarena.com/banners/{gameid}.bnr"
@ -306,16 +306,13 @@ void CMenu::_showDownload(void)
m_btnMgr.show(m_downloadLblGameTDB); m_btnMgr.show(m_downloadLblGameTDB);
m_btnMgr.show(m_downloadLblTitle); m_btnMgr.show(m_downloadLblTitle);
m_btnMgr.show(m_downloadBtnCancel); m_btnMgr.show(m_downloadBtnCancel);
m_btnMgr.show(m_downloadLblCovers);
m_btnMgr.show(m_downloadBtnAll); m_btnMgr.show(m_downloadBtnAll);
m_btnMgr.show(m_downloadBtnMissing); m_btnMgr.show(m_downloadBtnMissing);
m_btnMgr.show(m_downloadLblCoverSet); m_btnMgr.show(m_downloadLblCoverSet);
m_btnMgr.show(m_downloadBtnCoverSet); m_btnMgr.show(m_downloadBtnCoverSet);
m_btnMgr.show(m_downloadLblCovers);
if (!m_locked)
{
m_btnMgr.show(m_downloadLblGameTDBDownload); m_btnMgr.show(m_downloadLblGameTDBDownload);
m_btnMgr.show(m_downloadBtnGameTDBDownload); m_btnMgr.show(m_downloadBtnGameTDBDownload);
}
for(u8 i = 0; i < ARRAY_SIZE(m_downloadLblUser); ++i) for(u8 i = 0; i < ARRAY_SIZE(m_downloadLblUser); ++i)
if(m_downloadLblUser[i] != -1) if(m_downloadLblUser[i] != -1)
m_btnMgr.show(m_downloadLblUser[i]); m_btnMgr.show(m_downloadLblUser[i]);
@ -1218,6 +1215,7 @@ void CMenu::_download(string gameId)
{ {
if ((m_btnMgr.selected(m_downloadBtnAll) || m_btnMgr.selected(m_downloadBtnMissing) || !gameId.empty()) && !m_thrdWorking) if ((m_btnMgr.selected(m_downloadBtnAll) || m_btnMgr.selected(m_downloadBtnMissing) || !gameId.empty()) && !m_thrdWorking)
{ {
m_refreshGameList = true;
bool dlAll = m_btnMgr.selected(m_downloadBtnAll); bool dlAll = m_btnMgr.selected(m_downloadBtnAll);
m_btnMgr.show(m_downloadPBar); m_btnMgr.show(m_downloadPBar);
m_btnMgr.setProgress(m_downloadPBar, 0.f); m_btnMgr.setProgress(m_downloadPBar, 0.f);
@ -1443,6 +1441,7 @@ void CMenu::_download(string gameId)
else if (m_btnMgr.selected(m_downloadBtnGameTDBDownload) && !m_thrdWorking) else if (m_btnMgr.selected(m_downloadBtnGameTDBDownload) && !m_thrdWorking)
{ {
m_refreshGameList = true;
m_btnMgr.show(m_downloadPBar); m_btnMgr.show(m_downloadPBar);
m_btnMgr.setProgress(m_downloadPBar, 0.f); m_btnMgr.setProgress(m_downloadPBar, 0.f);
_hideSettings(); _hideSettings();
@ -2017,11 +2016,14 @@ int CMenu::_gametdbDownloaderAsync()
fsop_deleteFile(fmt("%s/gametdb_offsets.bin", m_settingsDir.c_str())); fsop_deleteFile(fmt("%s/gametdb_offsets.bin", m_settingsDir.c_str()));
// Update cache // Update cache
UpdateCache(); //UpdateCache();
m_cfg.setBool(WII_DOMAIN, "update_cache", true);
m_cfg.setBool(GC_DOMAIN, "update_cache", true);
m_cfg.setBool(CHANNEL_DOMAIN, "update_cache", true);
LWP_MutexLock(m_mutex); LWP_MutexLock(m_mutex);
_setThrdMsg(_t("dlmsg26", L"Updating cache..."), 0.f); _setThrdMsg(_t("dlmsg26", L"Updating cache..."), 0.f);
LWP_MutexUnlock(m_mutex); LWP_MutexUnlock(m_mutex);
m_load_view = true; m_refreshGameList = true;
} }
} }
} }

View File

@ -34,7 +34,7 @@ void CMenu::error(const wstringEx &msg)
do do
{ {
_mainLoopCommon(); _mainLoopCommon();
} while (!BTN_B_PRESSED && !BTN_A_PRESSED && !BTN_HOME_PRESSED); } while (!m_exit && !BTN_B_PRESSED && !BTN_A_PRESSED && !BTN_HOME_PRESSED);
_hideError(false); _hideError(false);
} }

View File

@ -24,7 +24,6 @@
#include "homebrew/homebrew.h" #include "homebrew/homebrew.h"
#include "loader/alt_ios.h" #include "loader/alt_ios.h"
#include "loader/wdvd.h" #include "loader/wdvd.h"
//#include "loader/alt_ios.h"
#include "loader/playlog.h" #include "loader/playlog.h"
#include "loader/wbfs.h" #include "loader/wbfs.h"
#include "loader/wip.h" #include "loader/wip.h"
@ -194,17 +193,6 @@ const CMenu::SOption CMenu::_debugger[3] = {
{ "dbgfwrite", L"OSReport" }, { "dbgfwrite", L"OSReport" },
}; };
/*
0 No Hook
1 VBI
2 KPAD read
3 Joypad Hook
4 GXDraw Hook
5 GXFlush Hook
6 OSSleepThread Hook
7 AXNextFrame Hook
*/
map<u8, u8> CMenu::_installed_cios; map<u8, u8> CMenu::_installed_cios;
u8 banner_title[84]; u8 banner_title[84];
@ -213,7 +201,6 @@ static inline int loopNum(int i, int s)
return (i + s) % s; return (i + s) % s;
} }
static void _extractBannerTitle(int language) static void _extractBannerTitle(int language)
{ {
memset(banner_title, 0, 84); memset(banner_title, 0, 84);
@ -257,6 +244,14 @@ static int GetLanguage(const char *lang)
return CONF_LANG_ENGLISH; // Default to EN return CONF_LANG_ENGLISH; // Default to EN
} }
static void setLanguage(int l)
{
if (l > 0 && l <= 10)
configbytes[0] = l - 1;
else
configbytes[0] = 0xCD;
}
static u8 GetRequestedGameIOS(dir_discHdr *hdr) static u8 GetRequestedGameIOS(dir_discHdr *hdr)
{ {
u8 IOS = 0; u8 IOS = 0;
@ -338,14 +333,6 @@ void CMenu::_showGame(void)
} }
} }
static void setLanguage(int l)
{
if (l > 0 && l <= 10)
configbytes[0] = l - 1;
else
configbytes[0] = 0xCD;
}
void CMenu::_cleanupBanner(bool gamechange) void CMenu::_cleanupBanner(bool gamechange)
{ {
//banner //banner
@ -575,17 +562,14 @@ void CMenu::_game(bool launch)
else if((BTN_1_PRESSED || BTN_2_PRESSED) && !coverFlipped) else if((BTN_1_PRESSED || BTN_2_PRESSED) && !coverFlipped)
{ {
s8 direction = BTN_1_PRESSED ? 1 : -1; s8 direction = BTN_1_PRESSED ? 1 : -1;
const char *domain = _domainFromView(); int cfVersion = loopNum((_getCFVersion() - 1) + direction, m_numCFVersions) + 1;
int cfVersion = 1+loopNum((m_cfg.getInt(domain, "last_cf_mode", 1)-1) + direction, m_numCFVersions);
_loadCFLayout(cfVersion); _loadCFLayout(cfVersion);
CoverFlow.applySettings(); CoverFlow.applySettings();
m_cfg.setInt(domain, "last_cf_mode" , cfVersion); _setCFVersion(cfVersion);
} }
else if(launch || BTN_A_PRESSED) else if(launch || BTN_A_PRESSED)
{ {
if(m_btnMgr.selected(m_mainBtnQuit)) if(m_btnMgr.selected(m_gameBtnDelete) && !m_locked)
break;
else if(m_btnMgr.selected(m_gameBtnDelete) && !m_locked)
{ {
_hideGame(); _hideGame();
m_banner.SetShowBanner(false); m_banner.SetShowBanner(false);
@ -600,7 +584,7 @@ void CMenu::_game(bool launch)
else else
wfcPath = fmt("%s/%s/%s.wfc", m_cacheDir.c_str(), coverDir, CoverFlow.getPathId(hdr, true)); wfcPath = fmt("%s/%s/%s.wfc", m_cacheDir.c_str(), coverDir, CoverFlow.getPathId(hdr, true));
fsop_deleteFile(wfcPath); fsop_deleteFile(wfcPath);
m_load_view = true; m_refreshGameList = true;
} }
else else
{ {
@ -615,6 +599,19 @@ void CMenu::_game(bool launch)
startGameSound = -6; startGameSound = -6;
_showGame(); _showGame();
} }
else if(m_btnMgr.selected(m_gameBtnSettings) && !NoGameID(hdr->type) && !m_locked)
{
_hideGame();
m_gameSelected = true;// reset to true to make sure sound plays during settings
m_banner.ToggleGameSettings();
_gameSettings();
m_banner.ToggleGameSettings();
_showGame();
if(!m_gameSound.IsPlaying())
startGameSound = -6;
}
else if(m_btnMgr.selected(m_gameBtnFavoriteOn) || m_btnMgr.selected(m_gameBtnFavoriteOff)) else if(m_btnMgr.selected(m_gameBtnFavoriteOn) || m_btnMgr.selected(m_gameBtnFavoriteOff))
{ {
if(hdr->type == TYPE_PLUGIN) if(hdr->type == TYPE_PLUGIN)
@ -622,7 +619,7 @@ void CMenu::_game(bool launch)
else else
m_gcfg1.setBool("FAVORITES", id, !m_gcfg1.getBool("FAVORITES", id, false)); m_gcfg1.setBool("FAVORITES", id, !m_gcfg1.getBool("FAVORITES", id, false));
} }
else if(m_btnMgr.selected(m_gameBtnAdultOn) || m_btnMgr.selected(m_gameBtnAdultOff)) else if((m_btnMgr.selected(m_gameBtnAdultOn) || m_btnMgr.selected(m_gameBtnAdultOff)) && !m_locked)
{ {
if(hdr->type == TYPE_PLUGIN) if(hdr->type == TYPE_PLUGIN)
m_gcfg1.setBool("ADULTONLY_PLUGINS", id, !m_gcfg1.getBool("ADULTONLY_PLUGINS", id, false)); m_gcfg1.setBool("ADULTONLY_PLUGINS", id, !m_gcfg1.getBool("ADULTONLY_PLUGINS", id, false));
@ -645,19 +642,6 @@ void CMenu::_game(bool launch)
m_btnMgr.hide(m_gameBtnBackFull); m_btnMgr.hide(m_gameBtnBackFull);
m_btnMgr.hide(m_gameBtnToggleFull); m_btnMgr.hide(m_gameBtnToggleFull);
} }
else if(m_btnMgr.selected(m_gameBtnSettings) && !NoGameID(hdr->type))
{
_hideGame();
m_gameSelected = true;// reset to true to make sure sound plays during settings
m_banner.ToggleGameSettings();
_gameSettings();
m_banner.ToggleGameSettings();
_showGame();
if(!m_gameSound.IsPlaying())
startGameSound = -6;
}
else if(launch || m_btnMgr.selected(m_gameBtnPlay) || m_btnMgr.selected(m_gameBtnPlayFull) || !ShowPointer()) else if(launch || m_btnMgr.selected(m_gameBtnPlay) || m_btnMgr.selected(m_gameBtnPlayFull) || !ShowPointer())
{ {
_hideGame(); _hideGame();
@ -728,7 +712,7 @@ void CMenu::_game(bool launch)
{ {
if(CoverFlow.mouseOver(m_cursor[chan].x(), m_cursor[chan].y())) if(CoverFlow.mouseOver(m_cursor[chan].x(), m_cursor[chan].y()))
{ {
cf_version = m_cfg.getInt(_domainFromView(), "last_cf_mode", 1); cf_version = _getCFVersion();
domain = fmt("%s_%i_S", cf_domain, cf_version); domain = fmt("%s_%i_S", cf_domain, cf_version);
key = "flip_pos"; key = "flip_pos";
if(!m_vid.wide()) if(!m_vid.wide())
@ -870,7 +854,7 @@ void CMenu::_game(bool launch)
_hideGame(); _hideGame();
} }
void CMenu::directlaunch(const char *GameID) void CMenu::directlaunch(const char *GameID)// from boot arg for wii only
{ {
m_directLaunch = true; m_directLaunch = true;
for(currentPartition = SD; currentPartition < USB8; currentPartition++) for(currentPartition = SD; currentPartition < USB8; currentPartition++)
@ -933,7 +917,7 @@ void CMenu::_launch(const dir_discHdr *hdr)
if(strchr(launchHdr.path, ':') != NULL)//it's a rom path if(strchr(launchHdr.path, ':') != NULL)//it's a rom path
{ {
//check if music player plugin, if so launch wiiflow's music player //check if music player plugin, if so launch wiiflow's music player
if(plugin_dol_len == strlen(MUSIC_DOMAIN) && strcmp(plugin_dol_name, MUSIC_DOMAIN) == 0) if(plugin_dol_len == 5 && strcasecmp(plugin_dol_name, "music") == 0)
{ {
MusicPlayer.LoadFile(launchHdr.path, false); MusicPlayer.LoadFile(launchHdr.path, false);
m_exit = false; m_exit = false;
@ -959,11 +943,12 @@ void CMenu::_launch(const dir_discHdr *hdr)
const char *loader = fmt("%s:/%s/WiiFlowLoader.dol", device, strchr(m_pluginsDir.c_str(), '/') + 1); const char *loader = fmt("%s:/%s/WiiFlowLoader.dol", device, strchr(m_pluginsDir.c_str(), '/') + 1);
vector<string> arguments = m_plugin.CreateArgs(device, path, title, loader, title_len_no_ext, launchHdr.settings[0]); vector<string> arguments = m_plugin.CreateArgs(device, path, title, loader, title_len_no_ext, launchHdr.settings[0]);
// find plugin dol - it does not have to be in dev:/wiiflow/plugins
const char *plugin_file = plugin_dol_name; /* try full path */ const char *plugin_file = plugin_dol_name; /* try full path */
if(strchr(plugin_file, ':') == NULL || !fsop_FileExist(plugin_file)) /* try universal plugin folder */ if(strchr(plugin_file, ':') == NULL || !fsop_FileExist(plugin_file)) /* if not found try wiiflow plugin folder */
{ {
plugin_file = fmt("%s/%s", m_pluginsDir.c_str(), plugin_dol_name); plugin_file = fmt("%s/%s", m_pluginsDir.c_str(), plugin_dol_name);
if(!fsop_FileExist(plugin_file)) /* try device search */ if(!fsop_FileExist(plugin_file)) /* not found - try device search */
{ {
for(u8 i = SD; i < MAXDEVICES; ++i) for(u8 i = SD; i < MAXDEVICES; ++i)
{ {
@ -1011,7 +996,8 @@ void CMenu::_launchGC(dir_discHdr *hdr, bool disc)
gcLaunchFail = true; gcLaunchFail = true;
return; return;
} }
/* GC Loader Found we can go ahead with launchShutdown() */
/* clear coverflow, start wiiflow wait animation, set exit handler */
_launchShutdown(); _launchShutdown();
m_gcfg1.setInt("PLAYCOUNT", id, m_gcfg1.getInt("PLAYCOUNT", id, 0) + 1); m_gcfg1.setInt("PLAYCOUNT", id, m_gcfg1.getInt("PLAYCOUNT", id, 0) + 1);
m_gcfg1.setUInt("LASTPLAYED", id, time(NULL)); m_gcfg1.setUInt("LASTPLAYED", id, time(NULL));
@ -1051,9 +1037,10 @@ void CMenu::_launchGC(dir_discHdr *hdr, bool disc)
bool usb_hid = m_gcfg2.getBool(id, "usb_hid", m_cfg.getBool(GC_DOMAIN, "usb_hid", false)); bool usb_hid = m_gcfg2.getBool(id, "usb_hid", m_cfg.getBool(GC_DOMAIN, "usb_hid", false));
bool native_ctl = m_gcfg2.getBool(id, "native_ctl", m_cfg.getBool(GC_DOMAIN, "native_ctl", false)); bool native_ctl = m_gcfg2.getBool(id, "native_ctl", m_cfg.getBool(GC_DOMAIN, "native_ctl", false));
bool deflicker = m_gcfg2.getBool(id, "Deflicker", m_cfg.getBool(GC_DOMAIN, "Deflicker", false)); bool deflicker = m_gcfg2.getBool(id, "Deflicker", m_cfg.getBool(GC_DOMAIN, "Deflicker", false));
bool tri_arcade = m_gcfg2.getBool(id, "triforce_arcade", m_cfg.getBool(GC_DOMAIN, "triforce_arcade", false));
if(disc == true) if(disc == true)
{ {
emuMC = m_cfg.getInt(GC_DOMAIN, "emu_memcard", 1); //emuMC = m_cfg.getInt(GC_DOMAIN, "emu_memcard", 1);
Nintendont_BootDisc(emuMC, widescreen, usb_hid, native_ctl, deflicker); Nintendont_BootDisc(emuMC, widescreen, usb_hid, native_ctl, deflicker);
} }
else else
@ -1078,13 +1065,24 @@ void CMenu::_launchGC(dir_discHdr *hdr, bool disc)
snprintf(NewCheatPath, sizeof(NewCheatPath), "%s%s.gct",GC_Path,id); snprintf(NewCheatPath, sizeof(NewCheatPath), "%s%s.gct",GC_Path,id);
Nintendont_SetOptions(path, id, CheatPath, NewCheatPath, DeviceName[currentPartition], Nintendont_SetOptions(path, id, CheatPath, NewCheatPath, DeviceName[currentPartition],
cheats, emuMC, videoMode, widescreen, usb_hid, native_ctl, deflicker, wiiu_widescreen, NIN_Debugger); cheats, emuMC, videoMode, widescreen, usb_hid, native_ctl, deflicker, wiiu_widescreen, NIN_Debugger, tri_arcade);
} }
} }
/* configs no longer needed */
m_gcfg1.save(true); m_gcfg1.save(true);
m_gcfg2.save(true); m_gcfg2.save(true);
m_cat.save(true); m_cat.save(true);
m_cfg.save(true); m_cfg.save(true);
if(loader == 1)
{
bool ret = (Nintendont_GetLoader() && LoadAppBooter(fmt("%s/app_booter.bin", m_binsDir.c_str())));
if(ret == false)
{
error(_t("errgame14", L"app_booter.bin not found!"));
_exitWiiflow();
}
}
/* no more error msgs - remove btns and sounds */
cleanup(); cleanup();
GC_SetVideoMode(videoMode, loader); GC_SetVideoMode(videoMode, loader);
@ -1104,20 +1102,17 @@ void CMenu::_launchGC(dir_discHdr *hdr, bool disc)
} }
else else
{ {
bool ret = (Nintendont_GetLoader() && LoadAppBooter(fmt("%s/app_booter.bin", m_binsDir.c_str())));
Nintendont_WriteOptions(); Nintendont_WriteOptions();
ShutdownBeforeExit(); ShutdownBeforeExit();
if(ret == true)
{
loadIOS(58, false); //nintendont NEEDS ios58 loadIOS(58, false); //nintendont NEEDS ios58
BootHomebrew(); //regular dol BootHomebrew(); //regular dol
} }
}
Sys_Exit(); Sys_Exit();
} }
void CMenu::_launchHomebrew(const char *filepath, vector<string> arguments) void CMenu::_launchHomebrew(const char *filepath, vector<string> arguments)
{ {
/* clear coverflow, start wiiflow wait animation, set exit handler */
_launchShutdown(); _launchShutdown();
m_gcfg1.save(true); m_gcfg1.save(true);
m_gcfg2.save(true); m_gcfg2.save(true);
@ -1125,9 +1120,15 @@ void CMenu::_launchHomebrew(const char *filepath, vector<string> arguments)
m_cfg.save(true); m_cfg.save(true);
Playlog_Delete(); Playlog_Delete();
cleanup(); // wifi and sd gecko doesnt work anymore after cleanup
bool ret = (LoadHomebrew(filepath) && LoadAppBooter(fmt("%s/app_booter.bin", m_binsDir.c_str()))); bool ret = (LoadHomebrew(filepath) && LoadAppBooter(fmt("%s/app_booter.bin", m_binsDir.c_str())));
if(ret == false)
{
error(_t("errgame14", L"app_booter.bin not found!"));
_exitWiiflow();
}
/* no more error msgs - remove btns and sounds */
cleanup(); // wifi and sd gecko doesnt work anymore after cleanup
AddBootArgument(filepath); AddBootArgument(filepath);
for(u32 i = 0; i < arguments.size(); ++i) for(u32 i = 0; i < arguments.size(); ++i)
@ -1137,14 +1138,12 @@ void CMenu::_launchHomebrew(const char *filepath, vector<string> arguments)
} }
ShutdownBeforeExit(); ShutdownBeforeExit();
if(ret == true)
{
loadIOS(58, false); loadIOS(58, false);
BootHomebrew(); BootHomebrew();
}
Sys_Exit(); Sys_Exit();
} }
/* dont confuse loadIOS with _loadIOS */
int CMenu::_loadIOS(u8 gameIOS, int userIOS, string id, bool RealNAND_Channels) int CMenu::_loadIOS(u8 gameIOS, int userIOS, string id, bool RealNAND_Channels)
{ {
gprintf("Game ID# %s requested IOS %d. User selected %d\n", id.c_str(), gameIOS, userIOS); gprintf("Game ID# %s requested IOS %d. User selected %d\n", id.c_str(), gameIOS, userIOS);
@ -1225,6 +1224,7 @@ int CMenu::_loadIOS(u8 gameIOS, int userIOS, string id, bool RealNAND_Channels)
void CMenu::_launchChannel(dir_discHdr *hdr) void CMenu::_launchChannel(dir_discHdr *hdr)
{ {
/* clear coverflow, start wiiflow wait animation, set exit handler */
_launchShutdown(); _launchShutdown();
string id = string(hdr->id); string id = string(hdr->id);
@ -1275,11 +1275,11 @@ void CMenu::_launchChannel(dir_discHdr *hdr)
bool use_led = m_gcfg2.getBool(id, "led", false); bool use_led = m_gcfg2.getBool(id, "led", false);
u32 gameIOS = ChannelHandle.GetRequestedIOS(gameTitle); u32 gameIOS = ChannelHandle.GetRequestedIOS(gameTitle);
/* configs no longer needed */
m_gcfg1.save(true); m_gcfg1.save(true);
m_gcfg2.save(true); m_gcfg2.save(true);
m_cat.save(true); m_cat.save(true);
m_cfg.save(true); m_cfg.save(true);
cleanup();
if(NANDemuView && !neek2o()) if(NANDemuView && !neek2o())
{ {
@ -1288,17 +1288,27 @@ void CMenu::_launchChannel(dir_discHdr *hdr)
if(!Load_Neek2o_Kernel()) if(!Load_Neek2o_Kernel())
{ {
error(_t("errneek1", L"Cannot launch neek2o. Verify your neek2o setup")); error(_t("errneek1", L"Cannot launch neek2o. Verify your neek2o setup"));
Sys_Exit(); _exitWiiflow();
} }
else
{
cleanup();
ShutdownBeforeExit(); ShutdownBeforeExit();
Launch_nk(gameTitle, NandHandle.Get_NandPath(), returnTo ? (((u64)(0x00010001) << 32) | (returnTo & 0xFFFFFFFF)) : 0); Launch_nk(gameTitle, NandHandle.Get_NandPath(), returnTo ? (((u64)(0x00010001) << 32) | (returnTo & 0xFFFFFFFF)) : 0);
while(1) usleep(500); while(1) usleep(500);
} }
} }
}
if(WII_Launch == false && ExternalBooter_LoadBins(m_binsDir.c_str()) == false) if(WII_Launch == false && ExternalBooter_LoadBins(m_binsDir.c_str()) == false)
Sys_Exit(); {
error(_t("errgame15", L"Missing ext_loader.bin or ext_booter.bin!"));
_exitWiiflow();
}
if(_loadIOS(gameIOS, userIOS, id, !NANDemuView) == LOAD_IOS_FAILED) if(_loadIOS(gameIOS, userIOS, id, !NANDemuView) == LOAD_IOS_FAILED)
Sys_Exit(); {
/* error message already shown */
_exitWiiflow();
}
if((CurrentIOS.Type == IOS_TYPE_D2X || neek2o()) && returnTo != 0) if((CurrentIOS.Type == IOS_TYPE_D2X || neek2o()) && returnTo != 0)
{ {
@ -1317,10 +1327,13 @@ void CMenu::_launchChannel(dir_discHdr *hdr)
{ {
NandHandle.Disable_Emu(); NandHandle.Disable_Emu();
error(_t("errgame5", L"Enabling emu failed!")); error(_t("errgame5", L"Enabling emu failed!"));
Sys_Exit(); _exitWiiflow();
} }
DeviceHandle.MountAll(); DeviceHandle.MountAll();
} }
cleanup();//done with error menu can now cleanup
if(WII_Launch) if(WII_Launch)
{ {
ShutdownBeforeExit(); ShutdownBeforeExit();
@ -1343,6 +1356,7 @@ void CMenu::_launchChannel(dir_discHdr *hdr)
void CMenu::_launchGame(dir_discHdr *hdr, bool dvd) void CMenu::_launchGame(dir_discHdr *hdr, bool dvd)
{ {
/* clear coverflow, start wiiflow wait animation, set exit handler */
_launchShutdown(); _launchShutdown();
string id(hdr->id); string id(hdr->id);
string path(hdr->path); string path(hdr->path);
@ -1429,15 +1443,15 @@ void CMenu::_launchGame(dir_discHdr *hdr, bool dvd)
const char *rtrn = m_cfg.getString("GENERAL", "returnto", "").c_str(); const char *rtrn = m_cfg.getString("GENERAL", "returnto", "").c_str();
int aspectRatio = min((u32)m_gcfg2.getInt(id, "aspect_ratio", 0), ARRAY_SIZE(CMenu::_AspectRatio) - 1u)-1; int aspectRatio = min((u32)m_gcfg2.getInt(id, "aspect_ratio", 0), ARRAY_SIZE(CMenu::_AspectRatio) - 1u)-1;
string emuPath;
int emuPartition = 0;
u8 emulate_mode = min((u32)m_gcfg2.getInt(id, "emulate_save", 0), ARRAY_SIZE(CMenu::_SaveEmu) - 1u); u8 emulate_mode = min((u32)m_gcfg2.getInt(id, "emulate_save", 0), ARRAY_SIZE(CMenu::_SaveEmu) - 1u);
if(emulate_mode == 0)// default then use global if(emulate_mode == 0)// default then use global
emulate_mode = min(max(0, m_cfg.getInt(WII_DOMAIN, "save_emulation", 0)), (int)ARRAY_SIZE(CMenu::_GlobalSaveEmu) - 1); emulate_mode = min(max(0, m_cfg.getInt(WII_DOMAIN, "save_emulation", 0)), (int)ARRAY_SIZE(CMenu::_GlobalSaveEmu) - 1);
else else
emulate_mode--; emulate_mode--;
string emuPath;
int emuPartition = 0;
if(emulate_mode && !dvd && !neek2o()) if(emulate_mode && !dvd && !neek2o())
{ {
emuPartition = _FindEmuPart(emuPath, false, true); emuPartition = _FindEmuPart(emuPath, false, true);
@ -1452,10 +1466,10 @@ void CMenu::_launchGame(dir_discHdr *hdr, bool dvd)
{ {
m_forceext = false; m_forceext = false;
_hideWaitMessage(); _hideWaitMessage();
/*_AutoExtractSave(id) returns true if /*_AutoExtractSave(id) returns
if save is not on real nand (nothing to extract) true if the save is already on emu nand (then no extraction)
if the save is already on emu nand (then no extraction) true if the save was successfully extracted
if the save was successfully extracted false if save is not on real nand (nothing to extract)
false if user chooses to have game create new save*/ false if user chooses to have game create new save*/
if(!_AutoExtractSave(id)) if(!_AutoExtractSave(id))
NandHandle.CreateTitleTMD(hdr);//setup emu nand for gamesave NandHandle.CreateTitleTMD(hdr);//setup emu nand for gamesave
@ -1512,7 +1526,7 @@ void CMenu::_launchGame(dir_discHdr *hdr, bool dvd)
m_gcfg2.save(true); m_gcfg2.save(true);
m_cat.save(true); m_cat.save(true);
m_cfg.save(true); m_cfg.save(true);
cleanup(); // wifi and sd gecko doesnt work anymore after cleanup //cleanup(); wifi and sd gecko doesnt work anymore after cleanup
//this is a temp region change of real nand(rn) for gamesave or off or DVD if tempregionrn is set true //this is a temp region change of real nand(rn) for gamesave or off or DVD if tempregionrn is set true
bool patchregion = false; bool patchregion = false;
@ -1521,13 +1535,19 @@ void CMenu::_launchGame(dir_discHdr *hdr, bool dvd)
gprintf("Check\n"); gprintf("Check\n");
patchregion = NandHandle.Do_Region_Change(id, true); patchregion = NandHandle.Do_Region_Change(id, true);
} }
//load external booter bin file. if fails then wiiflow exits. would be better to show error message first. //load external booter bin file
if(ExternalBooter_LoadBins(m_binsDir.c_str()) == false) if(ExternalBooter_LoadBins(m_binsDir.c_str()) == false)
Sys_Exit(); {
error(_t("errgame15", L"Missing ext_loader.bin or ext_booter.bin!"));
_exitWiiflow();
}
if((!dvd || neek2o()) && !Sys_DolphinMode()) if((!dvd || neek2o()) && !Sys_DolphinMode())
{ {
if(_loadIOS(gameIOS, userIOS, id) == LOAD_IOS_FAILED) if(_loadIOS(gameIOS, userIOS, id) == LOAD_IOS_FAILED)
Sys_Exit(); {
/* error message already shown */
_exitWiiflow();
}
} }
if(CurrentIOS.Type == IOS_TYPE_D2X) if(CurrentIOS.Type == IOS_TYPE_D2X)
@ -1553,6 +1573,10 @@ void CMenu::_launchGame(dir_discHdr *hdr, bool dvd)
DeviceHandle.MountAll(); DeviceHandle.MountAll();
} }
} }
/* no more error msgs - clear btns and snds */
cleanup(); //wifi and sd gecko doesnt work anymore after cleanup
bool wbfs_partition = false; bool wbfs_partition = false;
if(!dvd) if(!dvd)
{ {
@ -1579,9 +1603,18 @@ void CMenu::_launchGame(dir_discHdr *hdr, bool dvd)
Sys_Exit(); Sys_Exit();
} }
void CMenu::_exitWiiflow()
{
//Exit WiiFlow, no game booted...
cleanup();// cleanup and clear memory
ShutdownBeforeExit();// unmount devices and close inputs
Sys_Exit();
}
void CMenu::_initGameMenu() void CMenu::_initGameMenu()
{ {
CColor fontColor(0xD0BFDFFF); //CColor fontColor(0xD0BFDFFF);
TexData texGameFavOn; TexData texGameFavOn;
TexData texGameFavOnSel; TexData texGameFavOnSel;
TexData texGameFavOff; TexData texGameFavOff;

View File

@ -67,8 +67,16 @@ bool CMenu::_Home(void)
} }
else if(m_btnMgr.selected(m_homeBtnReloadCache)) else if(m_btnMgr.selected(m_homeBtnReloadCache))
{ {
UpdateCache(m_current_view); //UpdateCache(m_current_view);
m_load_view = true; if(m_cfg.getBool(WII_DOMAIN, "source"))
m_cfg.setBool(WII_DOMAIN, "update_cache", true);
if(m_cfg.getBool(GC_DOMAIN, "source"))
m_cfg.setBool(GC_DOMAIN, "update_cache", true);
if(m_cfg.getBool(CHANNEL_DOMAIN, "source"))
m_cfg.setBool(CHANNEL_DOMAIN, "update_cache", true);
if(m_cfg.getBool(PLUGIN_DOMAIN, "source"))
m_cfg.setBool(PLUGIN_DOMAIN, "update_cache", true);
m_refreshGameList = true;
break; break;
} }
/*else if(m_btnMgr.selected(m_homeBtnUpdate) && !m_locked) /*else if(m_btnMgr.selected(m_homeBtnUpdate) && !m_locked)
@ -116,7 +124,7 @@ bool CMenu::_Home(void)
{ {
_hideHome(); _hideHome();
_PluginSettings(); _PluginSettings();
if(m_load_view) if(m_refreshGameList)
break; break;
_showHome(); _showHome();
} }

View File

@ -1,349 +0,0 @@
/****************************************************************************
* Copyright (C) 2013 FIX94
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#include "menu.hpp"
#include <algorithm>
TexData m_LangSettingsBg;
s16 m_LangSettingsLblUser[4];
s16 m_LangSettingsLblTitle;
s16 m_LangSettingsLblLanguage;
s16 m_LangSettingsLblCurLanguage;
s16 m_LangSettingsBtnCurLanguageM;
s16 m_LangSettingsBtnCurLanguageP;
s16 m_LangSettingsLblGetLanguages;
s16 m_LangSettingsBtnGetLanguages;
s16 m_LangSettingsLblDlLang;
s16 m_LangSettingsLblCurDLLang;
s16 m_LangSettingsBtnCurDlLangM;
s16 m_LangSettingsBtnCurDlLangP;
s16 m_LangSettingsLblDownload;
s16 m_LangSettingsBtnDownload;
s16 m_LangSettingsBtnBack;
typedef struct {
char lang[32];
} language_list;
language_list *lang_list_mem = NULL;
u32 mem_pos = 0;
u32 language_cnt = 0;
wstringEx dl_lang_ex;
#define SVN_URL "http://open-wiiflow-mod.googlecode.com/svn/trunk/wii/wiiflow"
template <class T> static inline T loopNum(T i, T s)
{
return (i + s) % s;
}
u32 available_pos = 0;
vector<string> languages_available;
void AddLanguage(char *Path)
{
char lng[32];
memset(lng, 0, 32);
char *lang_chr = strrchr(Path, '/')+1;
memcpy(lng, lang_chr, std::min(31u, (u32)(strrchr(lang_chr, '.')-lang_chr)));
languages_available.push_back(lng);
}
void CMenu::_hideLangSettings(bool instant)
{
m_btnMgr.hide(m_LangSettingsLblTitle, instant);
m_btnMgr.hide(m_LangSettingsLblLanguage, instant);
m_btnMgr.hide(m_LangSettingsLblCurLanguage, instant);
m_btnMgr.hide(m_LangSettingsBtnCurLanguageM, instant);
m_btnMgr.hide(m_LangSettingsBtnCurLanguageP, instant);
m_btnMgr.hide(m_LangSettingsLblGetLanguages, instant);
m_btnMgr.hide(m_LangSettingsBtnGetLanguages, instant);
m_btnMgr.hide(m_LangSettingsLblDlLang, instant);
m_btnMgr.hide(m_LangSettingsLblCurDLLang, instant);
m_btnMgr.hide(m_LangSettingsBtnCurDlLangM, instant);
m_btnMgr.hide(m_LangSettingsBtnCurDlLangP, instant);
m_btnMgr.hide(m_LangSettingsLblDownload, instant);
m_btnMgr.hide(m_LangSettingsBtnDownload, instant);
m_btnMgr.hide(m_LangSettingsBtnBack, instant);
for(u8 i = 0; i < ARRAY_SIZE(m_LangSettingsLblUser); ++i)
if(m_LangSettingsLblUser[i] != -1)
m_btnMgr.hide(m_LangSettingsLblUser[i], instant);
}
void CMenu::_showLangSettings(void)
{
m_btnMgr.show(m_LangSettingsLblTitle);
m_btnMgr.show(m_LangSettingsLblLanguage);
m_btnMgr.show(m_LangSettingsLblCurLanguage);
m_btnMgr.show(m_LangSettingsBtnCurLanguageM);
m_btnMgr.show(m_LangSettingsBtnCurLanguageP);
if(lang_list_mem == NULL)
{
m_btnMgr.show(m_LangSettingsLblGetLanguages);
m_btnMgr.show(m_LangSettingsBtnGetLanguages);
}
else /* with the list we dont need the get languages button */
{
m_btnMgr.hide(m_LangSettingsLblGetLanguages);
m_btnMgr.hide(m_LangSettingsBtnGetLanguages);
m_btnMgr.show(m_LangSettingsLblDlLang);
m_btnMgr.show(m_LangSettingsLblCurDLLang);
m_btnMgr.show(m_LangSettingsBtnCurDlLangM);
m_btnMgr.show(m_LangSettingsBtnCurDlLangP);
m_btnMgr.show(m_LangSettingsLblDownload);
m_btnMgr.show(m_LangSettingsBtnDownload);
//gprintf("Currently %s selected (pos %u)\n", lang_list_mem[mem_pos].lang, mem_pos);
dl_lang_ex.fromUTF8(lang_list_mem[mem_pos].lang);
m_btnMgr.setText(m_LangSettingsLblCurDLLang, dl_lang_ex);
}
m_btnMgr.show(m_LangSettingsBtnBack);
for(u32 i = 0; i < ARRAY_SIZE(m_LangSettingsLblUser); ++i)
if(m_LangSettingsLblUser[i] != -1)
m_btnMgr.show(m_LangSettingsLblUser[i]);
m_btnMgr.setText(m_LangSettingsLblCurLanguage, m_curLanguage);
}
void CMenu::_refreshLangSettings(void)
{
languages_available.clear();
/* Get right Positions first */
languages_available.push_back("Default");
GetFiles(m_languagesDir.c_str(), stringToVector(".ini", '|'), AddLanguage, false, 0);
std::sort(languages_available.begin(), languages_available.end());
for(u32 i = 0; i < languages_available.size(); ++i)
{
if(m_curLanguage == languages_available[i])
{
available_pos = i;
break;
}
}
_showLangSettings();
}
bool CMenu::_LangSettings(void)
{
_refreshLangSettings();
bool lang_changed = false;
while(!m_exit)
{
_mainLoopCommon();
if(BTN_HOME_PRESSED || BTN_B_PRESSED)
break;
else if(BTN_A_PRESSED)
{
if(m_btnMgr.selected(m_LangSettingsBtnBack))
break;
else if(m_btnMgr.selected(m_LangSettingsBtnCurLanguageP) || m_btnMgr.selected(m_LangSettingsBtnCurLanguageM))
{
s8 direction = m_btnMgr.selected(m_LangSettingsBtnCurLanguageP) ? 1 : -1;
available_pos = loopNum(available_pos + direction, languages_available.size());
m_curLanguage = languages_available[available_pos];
if(!m_loc.load(fmt("%s/%s.ini", m_languagesDir.c_str(), m_curLanguage.c_str())))
{
m_curLanguage = "Default";
m_cfg.setString("GENERAL", "language", m_curLanguage.c_str());
m_loc.unload();
}
else
m_cfg.setString("GENERAL", "language", m_curLanguage.c_str());
lang_changed = true;
_updateText();
_showLangSettings();
}
else if(m_btnMgr.selected(m_LangSettingsBtnGetLanguages))
{
/* reset our variables doh */
_hideLangSettings();
language_cnt = 0;
mem_pos = 0;
u8 *file = NULL;
u32 filesize = 0;
_downloadUrl(fmt("%s/Languages/", SVN_URL), &file, &filesize);
if(m_buffer != NULL)
{
const char *search_char = "<li><a";
/* getting count */
char *start = (strstr((char*)file, search_char)); /* skipping the .. */
start = strstr(start, "\n") + 1; /* skipping the line */
char *tmp = start;
while((tmp = strstr(tmp, search_char)) != NULL)
{
language_cnt++;
tmp = strstr(tmp, "\n") + 1; /* next line */
}
gprintf("Found %u languages\n", language_cnt);
/* creating list */
tmp = start;
lang_list_mem = (language_list*)MEM2_alloc(language_cnt*sizeof(language_list));
memset(lang_list_mem, 0, language_cnt*sizeof(language_list));
for(u32 i = 0; i < language_cnt; ++i)
{
tmp = strstr(tmp, search_char);
char *lang_chr = strchr(tmp, 0x22) + 1; /* the " is the beginning for the name */
memcpy(lang_list_mem[i].lang, lang_chr, std::min(31u, (u32)(strchr(lang_chr, '.') - lang_chr)));
//gprintf("%s added\n", lang_list_mem[i].lang);
tmp = strstr(tmp, "\n") + 1; /* next line */
}
//gprintf("Finished creating the list\n");
free(m_buffer);
m_buffer = NULL;
}
_showLangSettings();
}
else if(m_btnMgr.selected(m_LangSettingsBtnCurDlLangP) || m_btnMgr.selected(m_LangSettingsBtnCurDlLangM))
{
s8 direction = m_btnMgr.selected(m_LangSettingsBtnCurDlLangP) ? 1 : -1;
mem_pos = loopNum(mem_pos + direction, language_cnt);
_showLangSettings();
}
else if(m_btnMgr.selected(m_LangSettingsBtnDownload))
{
_hideLangSettings();
m_loc.unload();
/* Get main ini */
u8 *file = NULL;
u32 filesize = 0;
_downloadUrl(fmt("%s/Languages/%s.ini", SVN_URL, lang_list_mem[mem_pos].lang), &file, &filesize);
if(m_buffer != NULL)
{
if(filesize > 0)
{
const char *language_ini = fmt("%s/%s.ini", m_languagesDir.c_str(), lang_list_mem[mem_pos].lang);
fsop_deleteFile(language_ini);
fsop_WriteFile(language_ini, file, filesize);
gprintf("Wrote %s with the size %u\n", language_ini, filesize);
}
free(m_buffer);
m_buffer = NULL;
}
/* Get help file */
file = NULL;
filesize = 0;
_downloadUrl(fmt("%s/help/%s.txt", SVN_URL, lang_list_mem[mem_pos].lang), &file, &filesize);
if(m_buffer != NULL)
{
if(filesize > 0)
{
const char *language_help = fmt("%s/%s.txt", m_helpDir.c_str(), lang_list_mem[mem_pos].lang);
fsop_deleteFile(language_help);
fsop_WriteFile(language_help, file, filesize);
gprintf("Wrote %s with the size %u\n", language_help, filesize);
}
free(m_buffer);
m_buffer = NULL;
}
/* reload */
m_loc.load(fmt("%s/%s.ini", m_languagesDir.c_str(), m_curLanguage.c_str()));
_updateText();
_refreshLangSettings();
}
}
}
_hideLangSettings();
if(lang_list_mem != NULL)
free(lang_list_mem);
lang_list_mem = NULL;
return lang_changed;
}
void CMenu::_initLangSettingsMenu()
{
_addUserLabels(m_LangSettingsLblUser, ARRAY_SIZE(m_LangSettingsLblUser), "LANGUAGE");
m_LangSettingsLblTitle = _addTitle("LANGUAGE/TITLE", theme.titleFont, L"", 0, 10, 640, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE);
m_LangSettingsBg = _texture("LANGUAGE/BG", "texture", theme.bg, false);
m_LangSettingsLblLanguage = _addLabel("LANGUAGE/LANGUAGE", theme.lblFont, L"", 20, 125, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_LangSettingsLblCurLanguage = _addLabel("LANGUAGE/LANGUAGE_BTN", theme.btnFont, L"", 468, 130, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC);
m_LangSettingsBtnCurLanguageM = _addPicButton("LANGUAGE/LANGUAGE_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 420, 130, 48, 48);
m_LangSettingsBtnCurLanguageP = _addPicButton("LANGUAGE/LANGUAGE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 572, 130, 48, 48);
m_LangSettingsLblGetLanguages = _addLabel("LANGUAGE/GET_LANG", theme.lblFont, L"", 20, 185, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_LangSettingsBtnGetLanguages = _addButton("LANGUAGE/GET_LANG_BTN", theme.btnFont, L"", 420, 190, 200, 48, theme.btnFontColor);
m_LangSettingsLblDlLang = _addLabel("LANGUAGE/DL_LANG", theme.lblFont, L"", 20, 245, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_LangSettingsLblCurDLLang = _addLabel("LANGUAGE/DL_LANG_BTN", theme.btnFont, L"", 468, 250, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC);
m_LangSettingsBtnCurDlLangM = _addPicButton("LANGUAGE/DL_LANG_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 420, 250, 48, 48);
m_LangSettingsBtnCurDlLangP = _addPicButton("LANGUAGE/DL_LANG_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 572, 250, 48, 48);
m_LangSettingsLblDownload = _addLabel("LANGUAGE/DOWNLOAD", theme.lblFont, L"", 20, 305, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_LangSettingsBtnDownload = _addButton("LANGUAGE/DOWNLOAD_BTN", theme.btnFont, L"", 420, 310, 200, 48, theme.btnFontColor);
m_LangSettingsBtnBack = _addButton("LANGUAGE/BACK_BTN", theme.btnFont, L"", 420, 400, 200, 48, theme.btnFontColor);
_setHideAnim(m_LangSettingsLblTitle, "LANGUAGE/TITLE", 0, 0, -2.f, 0.f);
_setHideAnim(m_LangSettingsLblLanguage, "LANGUAGE/LANGUAGE", 50, 0, -2.f, 0.f);
_setHideAnim(m_LangSettingsLblCurLanguage, "LANGUAGE/LANGUAGE_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_LangSettingsBtnCurLanguageM, "LANGUAGE/LANGUAGE_MINUS", -50, 0, 1.f, 0.f);
_setHideAnim(m_LangSettingsBtnCurLanguageP, "LANGUAGE/LANGUAGE_PLUS", -50, 0, 1.f, 0.f);
_setHideAnim(m_LangSettingsLblGetLanguages, "LANGUAGE/GET_LANG", 50, 0, -2.f, 0.f);
_setHideAnim(m_LangSettingsBtnGetLanguages, "LANGUAGE/GET_LANG_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_LangSettingsLblDlLang, "LANGUAGE/DL_LANG", 50, 0, -2.f, 0.f);
_setHideAnim(m_LangSettingsLblCurDLLang, "LANGUAGE/DL_LANG_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_LangSettingsBtnCurDlLangM, "LANGUAGE/DL_LANG_MINUS", -50, 0, 1.f, 0.f);
_setHideAnim(m_LangSettingsBtnCurDlLangP, "LANGUAGE/DL_LANG_PLUS", -50, 0, 1.f, 0.f);
_setHideAnim(m_LangSettingsLblDownload, "LANGUAGE/DOWNLOAD", 50, 0, -2.f, 0.f);
_setHideAnim(m_LangSettingsBtnDownload, "LANGUAGE/DOWNLOAD_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_LangSettingsBtnBack, "LANGUAGE/BACK_BTN", 0, 0, 1.f, -1.f);
_hideLangSettings(true);
_textLangSettings();
}
void CMenu::_textLangSettings(void)
{
m_btnMgr.setText(m_LangSettingsLblLanguage, _t("cfga6", L"Language"));
m_btnMgr.setText(m_LangSettingsLblTitle, _t("cfglng1", L"Manage Languages"));
m_btnMgr.setText(m_LangSettingsLblGetLanguages, _t("cfglng2", L"Get Languages"));
m_btnMgr.setText(m_LangSettingsBtnGetLanguages, _t("cfgc5", L"Go"));
m_btnMgr.setText(m_LangSettingsLblDlLang, _t("cfglng3", L"Select File"));
m_btnMgr.setText(m_LangSettingsLblDownload, _t("cfglng4", L"Download selected File"));
m_btnMgr.setText(m_LangSettingsBtnDownload, _t("cfg4", L"Download"));
m_btnMgr.setText(m_LangSettingsBtnBack, _t("cfg10", L"Back"));
}

View File

@ -25,15 +25,13 @@ void CMenu::_hideMain(bool instant)
m_btnMgr.hide(m_mainBtnNext, instant); m_btnMgr.hide(m_mainBtnNext, instant);
m_btnMgr.hide(m_mainBtnPrev, instant); m_btnMgr.hide(m_mainBtnPrev, instant);
m_btnMgr.hide(m_mainBtnConfig, instant); m_btnMgr.hide(m_mainBtnConfig, instant);
m_btnMgr.hide(m_mainBtnQuit, instant); m_btnMgr.hide(m_mainBtnHome, instant);
m_btnMgr.hide(m_mainBtnHomebrew, instant); m_btnMgr.hide(m_mainBtnHomebrew, instant);
m_btnMgr.hide(m_mainBtnChannel, instant); m_btnMgr.hide(m_mainBtnChannel, instant);
m_btnMgr.hide(m_mainBtnWii, instant); m_btnMgr.hide(m_mainBtnWii, instant);
m_btnMgr.hide(m_mainBtnGamecube, instant); m_btnMgr.hide(m_mainBtnGamecube, instant);
m_btnMgr.hide(m_mainBtnPlugin, instant); m_btnMgr.hide(m_mainBtnPlugin, instant);
m_btnMgr.hide(m_mainBtnDVD, instant); m_btnMgr.hide(m_mainBtnDVD, instant);
m_btnMgr.hide(m_mainBtnInstall, instant);
m_btnMgr.hide(m_mainBtnSelPart, instant);
m_btnMgr.hide(m_mainLblMessage, instant); m_btnMgr.hide(m_mainLblMessage, instant);
m_btnMgr.hide(m_mainBtnFavoritesOn, instant); m_btnMgr.hide(m_mainBtnFavoritesOn, instant);
m_btnMgr.hide(m_mainBtnFavoritesOff, instant); m_btnMgr.hide(m_mainBtnFavoritesOff, instant);
@ -44,144 +42,27 @@ void CMenu::_hideMain(bool instant)
m_btnMgr.hide(m_mainLblUser[i], instant); m_btnMgr.hide(m_mainLblUser[i], instant);
} }
void CMenu::_showMain(void) void CMenu::_showMain()
{ {
_hideWaitMessage();
#ifdef SHOWMEM
m_btnMgr.show(m_mem1FreeSize);
m_btnMgr.show(m_mem2FreeSize);
#endif
m_vid.set2DViewport(m_cfg.getInt("GENERAL", "tv_width", 640), m_cfg.getInt("GENERAL", "tv_height", 480),
m_cfg.getInt("GENERAL", "tv_x", 0), m_cfg.getInt("GENERAL", "tv_y", 0));
_setBg(m_mainBg, m_mainBgLQ); _setBg(m_mainBg, m_mainBgLQ);
//m_btnMgr.show(m_mainBtnInfo); if(m_refreshGameList)
m_btnMgr.show(m_mainBtnConfig); _showCF(m_refreshGameList);
m_btnMgr.show(m_mainBtnQuit);// home btn
switch(m_current_view)
{
case COVERFLOW_GAMECUBE:
if(show_channel)
m_btnMgr.show(m_mainBtnChannel);
else if(show_plugin)
m_btnMgr.show(m_mainBtnPlugin);
else
m_btnMgr.show(m_mainBtnWii);
break;
case COVERFLOW_CHANNEL:
if(show_plugin)
m_btnMgr.show(m_mainBtnPlugin);
else
m_btnMgr.show(m_mainBtnWii);
break;
case COVERFLOW_MAX:
case COVERFLOW_HOMEBREW:
case COVERFLOW_PLUGIN:
m_btnMgr.show(m_mainBtnWii);
break;
default:
if(show_gamecube)
m_btnMgr.show(m_mainBtnGamecube);
else if(show_channel)
m_btnMgr.show(m_mainBtnChannel);
else if(show_plugin)
m_btnMgr.show(m_mainBtnPlugin);
else
m_btnMgr.show(m_mainBtnWii);
break;
}
for(u8 i = 0; i < ARRAY_SIZE(m_mainLblUser); ++i)
if(m_mainLblUser[i] != -1)
m_btnMgr.show(m_mainLblUser[i]);
wstringEx Msg;
wstringEx Pth;
if(m_gameList.empty())
{
switch(m_current_view)
{
case COVERFLOW_WII:
Msg = _t("main2", L"No games found in ");
Pth = wstringEx(fmt(wii_games_dir, DeviceName[currentPartition]));
break;
case COVERFLOW_GAMECUBE:
Msg = _t("main2", L"No games found in ");
Pth = wstringEx(fmt(gc_games_dir, DeviceName[currentPartition]));
break;
case COVERFLOW_CHANNEL:
Msg = _t("main3", L"No titles found in ");
Pth = wstringEx(fmt("%s:/%s/%s", DeviceName[currentPartition], EMU_NANDS_DIR, m_cfg.getString(CHANNEL_DOMAIN, "current_emunand").c_str()));
break;
case COVERFLOW_HOMEBREW:
Msg = _t("main4", L"No apps found in ");
Pth = wstringEx(fmt(HOMEBREW_DIR, DeviceName[currentPartition]));
break;
case COVERFLOW_PLUGIN:
m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount);
if(enabledPluginsCount == 0)
Msg = _t("main6", L"No plugins selected.");
else
Msg = _t("main5", L"No roms/items found.");
Pth = "";
break;
}
Msg.append(Pth);
m_btnMgr.setText(m_mainLblMessage, Msg);
m_btnMgr.show(m_mainLblMessage);
}
} }
void CMenu::LoadView(void) void CMenu::_showCF(bool refreshList)
{ {
m_load_view = false; m_refreshGameList = false;
_hideMain(true); _hideMain(true);
if(refreshList)
{
if(!m_vid.showingWaitMessage()) if(!m_vid.showingWaitMessage())
_showWaitMessage(); _showWaitMessage();
if(m_clearCats)// clear categories unless a source menu btn has selected one /* create gameList */
{
m_cat.remove("GENERAL", "selected_categories");
m_cat.remove("GENERAL", "required_categories");
}
m_clearCats = true;
m_favorites = false;
if(m_cfg.getBool("GENERAL", "save_favorites_mode", false))
m_favorites = m_cfg.getBool(_domainFromView(), "favorites", false);
cf_domain = "_COVERFLOW";
if(m_current_view == COVERFLOW_HOMEBREW && m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox", false))
cf_domain = "_SMALLFLOW";
if(m_sourceflow && m_cfg.getBool(_domainFromView(), "smallbox", true))
cf_domain = "_SMALLFLOW";
if(m_current_view == COVERFLOW_PLUGIN && !m_sourceflow)
{
m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount);
if(enabledPluginsCount > 0)
{
int sdc = 0;
int shc = 0;
for(u8 i = 0; m_plugin.PluginExist(i); ++i)
{
if(m_plugin.GetEnableStatus(m_cfg, m_plugin.getPluginMagic(i)))
{
if(_sideCover(m_plugin.PluginMagicWord))
sdc++;
else if(_shortCover(m_plugin.PluginMagicWord))
shc++;
}
}
if(sdc == enabledPluginsCount)
cf_domain = "_SIDEFLOW";
else if(shc == enabledPluginsCount)
cf_domain = "_SHORTFLOW";
}
}
_loadList(); _loadList();
/* autoboot stuff */
if(m_source_autoboot == true) if(m_source_autoboot == true)
{ /* search for the requested file */ { /* search for the requested file */
bool game_found = false; bool game_found = false;
@ -219,12 +100,96 @@ void CMenu::LoadView(void)
m_source_autoboot = false; m_source_autoboot = false;
} }
_hideWaitMessage();
}
wstringEx Msg;
wstringEx Pth;
if(m_gameList.empty())
{
switch(m_current_view)
{
case COVERFLOW_WII:
Msg = _t("main2", L"No games found in ");
Pth = wstringEx(fmt(wii_games_dir, DeviceName[currentPartition]));
break;
case COVERFLOW_GAMECUBE:
Msg = _t("main2", L"No games found in ");
Pth = wstringEx(fmt(gc_games_dir, DeviceName[currentPartition]));
break;
case COVERFLOW_CHANNEL:
Msg = _t("main3", L"No titles found in ");
Pth = wstringEx(fmt("%s:/%s/%s", DeviceName[currentPartition], EMU_NANDS_DIR, m_cfg.getString(CHANNEL_DOMAIN, "current_emunand").c_str()));
break;
case COVERFLOW_HOMEBREW:
Msg = _t("main4", L"No apps found in ");
Pth = wstringEx(fmt(HOMEBREW_DIR, DeviceName[currentPartition]));
break;
case COVERFLOW_PLUGIN:
m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount);
if(enabledPluginsCount == 0)
Msg = _t("main6", L"No plugins selected.");
else
Msg = _t("main5", L"No roms/items found.");
Pth = "";
break;
}
Msg.append(Pth);
m_btnMgr.setText(m_mainLblMessage, Msg);
m_btnMgr.show(m_mainLblMessage);
return;
}
/* setup for filter list and coverflow stuff */
if(m_clearCats)// clear categories unless a source menu btn has selected one
{
// do not clear hidden categories to keep games hidden
m_cat.remove("GENERAL", "selected_categories");
m_cat.remove("GENERAL", "required_categories");
}
m_clearCats = true;
m_favorites = false;
if(m_cfg.getBool("GENERAL", "save_favorites_mode", false))
m_favorites = m_cfg.getBool(_domainFromView(), "favorites", false);
cf_domain = "_COVERFLOW";
if(!m_sourceflow && m_current_view == COVERFLOW_HOMEBREW && m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox", true))
cf_domain = "_SMALLFLOW";
if(m_sourceflow && m_cfg.getBool(SOURCEFLOW_DOMAIN, "smallbox", true))
cf_domain = "_SMALLFLOW";
if(m_current_view == COVERFLOW_PLUGIN && !m_sourceflow)
{
m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount);
if(enabledPluginsCount > 0)
{
int sdc = 0;
int shc = 0;
for(u8 i = 0; m_plugin.PluginExist(i); ++i)
{
if(m_plugin.GetEnableStatus(m_cfg, m_plugin.getPluginMagic(i)))
{
if(_sideCover(m_plugin.PluginMagicWord))
sdc++;
else if(_shortCover(m_plugin.PluginMagicWord))
shc++;
}
}
if(sdc == enabledPluginsCount)
cf_domain = "_SIDEFLOW";
else if(shc == enabledPluginsCount)
cf_domain = "_SHORTFLOW";
}
}
m_numCFVersions = min(max(1, m_coverflow.getInt(cf_domain, "number_of_modes", 1)), 15); m_numCFVersions = min(max(1, m_coverflow.getInt(cf_domain, "number_of_modes", 1)), 15);
_showMain();
/* filter list and start coverflow coverloader */
_initCF(); _initCF();
_loadCFLayout(min(max(1, m_cfg.getInt(_domainFromView(), "last_cf_mode", 1)), (int)m_numCFVersions)); _loadCFLayout(min(max(1, _getCFVersion()), (int)m_numCFVersions));
CoverFlow.applySettings(); CoverFlow.applySettings();
/* display game count unless sourceflow or homebrew */
if(m_sourceflow || m_current_view == COVERFLOW_HOMEBREW) if(m_sourceflow || m_current_view == COVERFLOW_HOMEBREW)
return; return;
@ -233,29 +198,13 @@ void CMenu::LoadView(void)
m_btnMgr.show(m_mainLblNotice); m_btnMgr.show(m_mainLblNotice);
} }
void CMenu::exitHandler(int ExitTo)
{
m_exit = true;
if(ExitTo == EXIT_TO_BOOTMII) //Bootmii, check that the files are there, or ios will hang.
{
struct stat dummy;
if(!DeviceHandle.IsInserted(SD) ||
stat("sd:/bootmii/armboot.bin", &dummy) != 0 ||
stat("sd:/bootmii/ppcboot.elf", &dummy) != 0)
ExitTo = EXIT_TO_HBC;
}
if(ExitTo != WIIFLOW_DEF)
Sys_ExitTo(ExitTo);
}
int CMenu::main(void) int CMenu::main(void)
{ {
wstringEx curLetter; wstringEx curLetter;
const char *prevTheme = m_cfg.getString("GENERAL", "theme", "default").c_str(); const char *prevTheme = m_cfg.getString("GENERAL", "theme", "default").c_str();
show_channel = !m_cfg.getBool(CHANNEL_DOMAIN, "disable", false); bool show_channel = !m_cfg.getBool(CHANNEL_DOMAIN, "disable", false);
show_plugin = !m_cfg.getBool(PLUGIN_DOMAIN, "disable", false); bool show_plugin = !m_cfg.getBool(PLUGIN_DOMAIN, "disable", false);
show_gamecube = !m_cfg.getBool(GC_DOMAIN, "disable", false); bool show_gamecube = !m_cfg.getBool(GC_DOMAIN, "disable", false);
m_allow_random = m_cfg.getBool("GENERAL", "allow_b_on_questionmark", true);
m_multisource = m_cfg.getBool("GENERAL", "multisource", false); m_multisource = m_cfg.getBool("GENERAL", "multisource", false);
bool m_source_on_start = m_cfg.getBool("GENERAL", "source_on_start", false); bool m_source_on_start = m_cfg.getBool("GENERAL", "source_on_start", false);
bool bheld = false; bool bheld = false;
@ -264,8 +213,6 @@ int CMenu::main(void)
m_reload = false; m_reload = false;
u32 disc_check = 0; u32 disc_check = 0;
SetupInput(true);
u8 sourceCount = 0; u8 sourceCount = 0;
if(m_cfg.getBool(WII_DOMAIN, "source", false)) if(m_cfg.getBool(WII_DOMAIN, "source", false))
{ {
@ -294,7 +241,6 @@ int CMenu::main(void)
} }
if(sourceCount > 1) if(sourceCount > 1)
{ {
m_combined_view = true;
m_current_view = COVERFLOW_MAX; m_current_view = COVERFLOW_MAX;
} }
if(sourceCount == 0 || m_current_view == COVERFLOW_HOMEBREW) if(sourceCount == 0 || m_current_view == COVERFLOW_HOMEBREW)
@ -309,8 +255,22 @@ int CMenu::main(void)
m_cfg.remove("GENERAL", "cat_startpage"); m_cfg.remove("GENERAL", "cat_startpage");
if(m_cfg.getBool("GENERAL", "update_cache", false)) if(m_cfg.getBool("GENERAL", "update_cache", false))
UpdateCache(); {
LoadView(); m_cfg.setBool("GENERAL", "update_cache", false);
fsop_deleteFolder(m_listCacheDir.c_str());
fsop_MakeFolder(m_listCacheDir.c_str());
}
m_vid.set2DViewport(m_cfg.getInt("GENERAL", "tv_width", 640), m_cfg.getInt("GENERAL", "tv_height", 480),
m_cfg.getInt("GENERAL", "tv_x", 0), m_cfg.getInt("GENERAL", "tv_y", 0));
m_refreshGameList = true;
_showMain();
if(show_mem)
{
m_btnMgr.show(m_mem1FreeSize);
m_btnMgr.show(m_mem2FreeSize);
}
SetupInput(true);
gprintf("start\n"); gprintf("start\n");
while(!m_exit) while(!m_exit)
@ -331,32 +291,29 @@ int CMenu::main(void)
if(m_sourceflow)//if exiting sourceflow via b button if(m_sourceflow)//if exiting sourceflow via b button
{ {
m_sourceflow = false; m_sourceflow = false;
LoadView(); _showCF(true);
continue; continue;
} }
if(m_current_view == COVERFLOW_HOMEBREW) if(m_current_view == COVERFLOW_HOMEBREW)
{ {
m_current_view = m_prev_view; m_current_view = m_prev_view;
LoadView(); _showCF(true);
continue; continue;
} }
if(m_use_source)//if source_menu enabled if(m_use_source)//if source_menu enabled
{ {
_hideMain(); _hideMain();
if(m_cfg.getBool("SOURCEFLOW", "enabled", false))//if sourceflow show it if(m_cfg.getBool(SOURCEFLOW_DOMAIN, "enabled", false))//if sourceflow show it
{ {
m_sourceflow = true; m_sourceflow = true;
LoadView(); _showCF(true);
} }
else //show source menu else //show source menu
{ {
bool newSource = _Source(); m_refreshGameList = _Source();
if(BTN_B_HELD) if(BTN_B_HELD)
bUsed = true; bUsed = true;
if(newSource) //if different source selected
LoadView();
else
_showMain(); _showMain();
} }
continue; continue;
@ -369,28 +326,30 @@ int CMenu::main(void)
if(m_sourceflow) if(m_sourceflow)
{ {
_CfgSrc(); _CfgSrc();
if(!m_cfg.getBool("SOURCEFLOW", "enabled"))
{
m_sourceflow = false;
LoadView();
continue;
}
if(BTN_B_HELD) if(BTN_B_HELD)
bUsed = true; bUsed = true;
if(m_load_view) if(!m_cfg.getBool(SOURCEFLOW_DOMAIN, "enabled"))
LoadView(); {
else m_sourceflow = false;
m_refreshGameList = true;
//_showMain();
//continue;
}
_showMain();
}
else if(m_current_view == COVERFLOW_HOMEBREW)
{
_CfgHB();
if(BTN_B_HELD)
bUsed = true;
_showMain(); _showMain();
} }
else else
{ {
if(_Home()) //exit wiiflow if(_Home()) //home menu
break; break;
if(BTN_B_HELD) if(BTN_B_HELD)
bUsed = true; bUsed = true;
if(m_load_view)
LoadView();
else
_showMain(); _showMain();
} }
} }
@ -400,16 +359,13 @@ int CMenu::main(void)
CoverFlow.pageUp(); CoverFlow.pageUp();
else if(m_btnMgr.selected(m_mainBtnNext)) else if(m_btnMgr.selected(m_mainBtnNext))
CoverFlow.pageDown(); CoverFlow.pageDown();
else if(m_btnMgr.selected(m_mainBtnQuit))//home button else if(m_btnMgr.selected(m_mainBtnHome))
{ {
_hideMain(); _hideMain();
if(_Home()) //home menu if(_Home()) //home menu
break; break;
if(BTN_B_HELD) if(BTN_B_HELD)
bUsed = true; bUsed = true;
if(m_load_view)
LoadView();
else
_showMain(); _showMain();
} }
else if(m_btnMgr.selected(m_mainBtnChannel) || m_btnMgr.selected(m_mainBtnWii) || m_btnMgr.selected(m_mainBtnGamecube) || m_btnMgr.selected(m_mainBtnPlugin)) else if(m_btnMgr.selected(m_mainBtnChannel) || m_btnMgr.selected(m_mainBtnWii) || m_btnMgr.selected(m_mainBtnGamecube) || m_btnMgr.selected(m_mainBtnPlugin))
@ -425,11 +381,10 @@ int CMenu::main(void)
_clearSources(); _clearSources();
m_cfg.setBool(_domainFromView(), "source", true); m_cfg.setBool(_domainFromView(), "source", true);
m_catStartPage = 1; m_catStartPage = 1;
m_combined_view = false;
if(m_current_view == COVERFLOW_CHANNEL if(m_current_view == COVERFLOW_CHANNEL
&& !m_cfg.getBool(CHANNEL_DOMAIN, "emu_nand") && !m_cfg.getBool(CHANNEL_DOMAIN, "real_nand")) && !m_cfg.getBool(CHANNEL_DOMAIN, "emu_nand") && !m_cfg.getBool(CHANNEL_DOMAIN, "real_nand"))
m_cfg.setBool(CHANNEL_DOMAIN, "real_nand", true); m_cfg.setBool(CHANNEL_DOMAIN, "real_nand", true);
LoadView(); _showCF(true);
} }
else if(m_btnMgr.selected(m_mainBtnConfig)) else if(m_btnMgr.selected(m_mainBtnConfig))
{ {
@ -442,16 +397,13 @@ int CMenu::main(void)
} }
if(BTN_B_HELD) if(BTN_B_HELD)
bUsed = true; bUsed = true;
if(m_load_view)
LoadView();
else
_showMain(); _showMain();
} }
else if(m_btnMgr.selected(m_mainBtnHomebrew) && (!m_locked || !m_cfg.getBool(HOMEBREW_DOMAIN, "parental", false))) else if(m_btnMgr.selected(m_mainBtnHomebrew) && (!m_locked || !m_cfg.getBool(HOMEBREW_DOMAIN, "parental", false)))
{ {
m_prev_view = m_current_view; m_prev_view = m_current_view;
m_current_view = COVERFLOW_HOMEBREW; m_current_view = COVERFLOW_HOMEBREW;
LoadView(); _showCF(true);
} }
else if(m_btnMgr.selected(m_mainBtnDVD)) else if(m_btnMgr.selected(m_mainBtnDVD))
{ {
@ -467,9 +419,9 @@ int CMenu::main(void)
memcpy(&hdr.id, "dvddvd", 6);//only the id is used for a disc and dvddvd is changed in _launchGame. memcpy(&hdr.id, "dvddvd", 6);//only the id is used for a disc and dvddvd is changed in _launchGame.
/* Boot the Disc */ /* Boot the Disc */
_launchGame(&hdr, true); _launchGame(&hdr, true);
_showMain();
if(BTN_B_HELD) if(BTN_B_HELD)
bUsed = true; bUsed = true;
_showCF(false);
} }
else if(m_btnMgr.selected(m_mainBtnFavoritesOn) || m_btnMgr.selected(m_mainBtnFavoritesOff)) else if(m_btnMgr.selected(m_mainBtnFavoritesOn) || m_btnMgr.selected(m_mainBtnFavoritesOff))
{ {
@ -477,13 +429,14 @@ int CMenu::main(void)
m_cfg.setBool(_domainFromView(), "favorites", m_favorites); m_cfg.setBool(_domainFromView(), "favorites", m_favorites);
_initCF(); _initCF();
} }
/* select game cover or sourceflow cover */
else if(!CoverFlow.empty() && CoverFlow.select()) else if(!CoverFlow.empty() && CoverFlow.select())
{ {
_hideMain(); _hideMain();
if(m_sourceflow) if(m_sourceflow)
{ {
_sourceFlow();// set the source selected _sourceFlow();// set the source selected
LoadView(); _showCF(true);
continue; continue;
} }
else else
@ -494,26 +447,26 @@ int CMenu::main(void)
if(BTN_B_HELD) if(BTN_B_HELD)
bUsed = true; bUsed = true;
CoverFlow.cancel(); CoverFlow.cancel();
if(m_load_view) if(m_refreshGameList)
LoadView(); _initCF();
else //_showMain(m_refreshGameList);
_showMain();
} }
} }
} }
else if(BTN_B_PRESSED) else if(BTN_B_PRESSED)
{ {
//Events to Show Categories /* Show Categories */
if(m_btnMgr.selected(m_mainBtnFavoritesOn) || m_btnMgr.selected(m_mainBtnFavoritesOff)) if(m_btnMgr.selected(m_mainBtnFavoritesOn) || m_btnMgr.selected(m_mainBtnFavoritesOff))
{ {
// Event handler to show categories for selection
_hideMain(); _hideMain();
_CategorySettings(); _CategorySettings();
if(BTN_B_HELD) if(BTN_B_HELD)
bUsed = true; bUsed = true;
_showMain(); _setBg(m_mainBg, m_mainBgLQ);
if(m_refreshGameList)
_initCF(); _initCF();
} }
/* switch channels type to show */
else if(m_btnMgr.selected(m_mainBtnConfig) && m_current_view == COVERFLOW_CHANNEL) else if(m_btnMgr.selected(m_mainBtnConfig) && m_current_view == COVERFLOW_CHANNEL)
{ {
bUsed = true; bUsed = true;
@ -529,7 +482,7 @@ int CMenu::main(void)
m_cfg.setBool(CHANNEL_DOMAIN, "real_nand", true); m_cfg.setBool(CHANNEL_DOMAIN, "real_nand", true);
m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", false);// show real m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", false);// show real
} }
LoadView(); _showCF(true);
} }
else if(m_btnMgr.selected(m_mainBtnNext) || m_btnMgr.selected(m_mainBtnPrev)) else if(m_btnMgr.selected(m_mainBtnNext) || m_btnMgr.selected(m_mainBtnPrev))
@ -561,19 +514,6 @@ int CMenu::main(void)
m_btnMgr.show(m_mainLblNotice); m_btnMgr.show(m_mainLblNotice);
} }
} }
else if(m_btnMgr.selected(m_mainBtnHomebrew) && m_allow_random && !CoverFlow.empty())
{
/* WiiFlow should boot a random game */
_hideMain();
srand(time(NULL));
u16 place = (rand() + rand() + rand()) % CoverFlow.size();
gprintf("Lets boot the random game number %u\n", place);
const dir_discHdr *gameHdr = CoverFlow.getSpecificHdr(place);
if(gameHdr != NULL)
_launch(gameHdr);
/* Shouldnt happen */
_showMain();
}
} }
else if(WROLL_LEFT) else if(WROLL_LEFT)
{ {
@ -597,19 +537,18 @@ int CMenu::main(void)
CoverFlow.left(); CoverFlow.left();
else if(BTN_1_PRESSED || BTN_2_PRESSED) else if(BTN_1_PRESSED || BTN_2_PRESSED)
{ {
const char *domain = _domainFromView();
s8 direction = BTN_1_PRESSED ? 1 : -1; s8 direction = BTN_1_PRESSED ? 1 : -1;
int cfVersion = 1+loopNum((m_cfg.getInt(domain, "last_cf_mode", 1)-1) + direction, m_numCFVersions); int cfVersion = 1 + loopNum((_getCFVersion() - 1) + direction, m_numCFVersions);
_setCFVersion(cfVersion);
_loadCFLayout(cfVersion); _loadCFLayout(cfVersion);
CoverFlow.applySettings(); CoverFlow.applySettings();
m_cfg.setInt(domain, "last_cf_mode", cfVersion);
} }
else if(BTN_MINUS_PRESSED) else if(BTN_MINUS_PRESSED)
CoverFlow.pageUp(); CoverFlow.pageUp();
else if(BTN_PLUS_PRESSED) else if(BTN_PLUS_PRESSED)
CoverFlow.pageDown(); CoverFlow.pageDown();
} }
else else // Button B Held
{ {
bheld = true; bheld = true;
const char *domain = _domainFromView(); const char *domain = _domainFromView();
@ -679,6 +618,19 @@ int CMenu::main(void)
m_btnMgr.setText(m_mainLblNotice, curSort); m_btnMgr.setText(m_mainLblNotice, curSort);
m_btnMgr.show(m_mainLblNotice); m_btnMgr.show(m_mainLblNotice);
} }
else if(BTN_MINUS_PRESSED && !CoverFlow.empty())
{
/* WiiFlow should boot a random game */
_hideMain();
srand(time(NULL));
u16 place = (rand() + rand() + rand()) % CoverFlow.size();
gprintf("Lets boot the random game number %u\n", place);
const dir_discHdr *gameHdr = CoverFlow.getSpecificHdr(place);
if(gameHdr != NULL)
_launch(gameHdr);
/* Shouldnt happen */
_showCF(false);
}
} }
/* Hide Notice or Letter if times up */ /* Hide Notice or Letter if times up */
if(m_showtimer > 0) if(m_showtimer > 0)
@ -694,17 +646,19 @@ int CMenu::main(void)
m_btnMgr.show(m_mainBtnPrev); m_btnMgr.show(m_mainBtnPrev);
else else
m_btnMgr.hide(m_mainBtnPrev); m_btnMgr.hide(m_mainBtnPrev);
if(!m_gameList.empty() && m_show_zone_next && !m_sourceflow && m_current_view != COVERFLOW_HOMEBREW) if(!m_gameList.empty() && m_show_zone_next && !m_sourceflow && m_current_view != COVERFLOW_HOMEBREW)
m_btnMgr.show(m_mainBtnNext); m_btnMgr.show(m_mainBtnNext);
else else
m_btnMgr.hide(m_mainBtnNext); m_btnMgr.hide(m_mainBtnNext);
if(m_show_zone_main && !m_sourceflow && m_current_view != COVERFLOW_HOMEBREW) if(m_show_zone_main && !m_sourceflow && m_current_view != COVERFLOW_HOMEBREW)
{ {
m_btnMgr.show(m_mainLblUser[0]); m_btnMgr.show(m_mainLblUser[0]);
m_btnMgr.show(m_mainLblUser[1]); m_btnMgr.show(m_mainLblUser[1]);
m_btnMgr.show(m_mainBtnHomebrew); m_btnMgr.show(m_mainBtnHomebrew);
m_btnMgr.show(m_mainBtnConfig); m_btnMgr.show(m_mainBtnConfig);
m_btnMgr.show(m_mainBtnQuit); m_btnMgr.show(m_mainBtnHome);
static bool change = m_favorites; static bool change = m_favorites;
m_btnMgr.show(m_favorites ? m_mainBtnFavoritesOn : m_mainBtnFavoritesOff, change != m_favorites); m_btnMgr.show(m_favorites ? m_mainBtnFavoritesOn : m_mainBtnFavoritesOff, change != m_favorites);
m_btnMgr.hide(m_favorites ? m_mainBtnFavoritesOff : m_mainBtnFavoritesOn, change != m_favorites); m_btnMgr.hide(m_favorites ? m_mainBtnFavoritesOff : m_mainBtnFavoritesOn, change != m_favorites);
@ -716,7 +670,7 @@ int CMenu::main(void)
m_btnMgr.hide(m_mainLblUser[1]); m_btnMgr.hide(m_mainLblUser[1]);
m_btnMgr.hide(m_mainBtnConfig); m_btnMgr.hide(m_mainBtnConfig);
m_btnMgr.hide(m_mainBtnHomebrew); m_btnMgr.hide(m_mainBtnHomebrew);
m_btnMgr.hide(m_mainBtnQuit); m_btnMgr.hide(m_mainBtnHome);
m_btnMgr.hide(m_mainBtnFavoritesOn); m_btnMgr.hide(m_mainBtnFavoritesOn);
m_btnMgr.hide(m_mainBtnFavoritesOff); m_btnMgr.hide(m_mainBtnFavoritesOff);
} }
@ -758,7 +712,6 @@ int CMenu::main(void)
} }
else else
{ {
m_btnMgr.hide(m_mainBtnHomebrew);
m_btnMgr.hide(m_mainBtnChannel); m_btnMgr.hide(m_mainBtnChannel);
m_btnMgr.hide(m_mainBtnWii); m_btnMgr.hide(m_mainBtnWii);
m_btnMgr.hide(m_mainBtnGamecube); m_btnMgr.hide(m_mainBtnGamecube);
@ -787,7 +740,7 @@ int CMenu::main(void)
} }
} }
ScanInput(); ScanInput();
if(m_reload || BTN_B_HELD) if(m_reload || BTN_B_HELD)// rebooting wiiflow
{ {
CoverFlow.clear(); CoverFlow.clear();
_showWaitMessage(); _showWaitMessage();
@ -807,21 +760,17 @@ int CMenu::main(void)
Sys_SetNeekPath(ReturnPath); Sys_SetNeekPath(ReturnPath);
} }
//gprintf("Saving configuration files\n"); //gprintf("Saving configuration files\n");
m_gcfg1.save(true);// save configs m_gcfg1.save(true);// save configs on power off or exit wiiflow
m_gcfg2.save(true); m_gcfg2.save(true);
m_cat.save(true); m_cat.save(true);
m_cfg.save(true); m_cfg.save(true);
//m_cfg.save();
//m_cat.save();
return 0; return 0;
} }
void CMenu::_initMainMenu() void CMenu::_initMainMenu()
{ {
TexData texQuit; TexData texHome;
TexData texQuitS; TexData texHomeS;
//TexData texInfo;
//TexData texInfoS;
TexData texConfig; TexData texConfig;
TexData texConfigS; TexData texConfigS;
TexData texGamecube; TexData texGamecube;
@ -851,10 +800,8 @@ void CMenu::_initMainMenu()
if(m_theme.loaded() && TexHandle.fromImageFile(bgLQ, fmt("%s/%s", m_themeDataDir.c_str(), m_theme.getString("MAIN/BG", "texture").c_str()), GX_TF_CMPR, 64, 64) == TE_OK) if(m_theme.loaded() && TexHandle.fromImageFile(bgLQ, fmt("%s/%s", m_themeDataDir.c_str(), m_theme.getString("MAIN/BG", "texture").c_str()), GX_TF_CMPR, 64, 64) == TE_OK)
m_mainBgLQ = bgLQ; m_mainBgLQ = bgLQ;
TexHandle.fromImageFile(texQuit, fmt("%s/btnquit.png", m_imgsDir.c_str())); TexHandle.fromImageFile(texHome, fmt("%s/btnquit.png", m_imgsDir.c_str()));
TexHandle.fromImageFile(texQuitS, fmt("%s/btnquits.png", m_imgsDir.c_str())); TexHandle.fromImageFile(texHomeS, fmt("%s/btnquits.png", m_imgsDir.c_str()));
//TexHandle.fromImageFile(texInfo, fmt("%s/btninfo.png", m_imgsDir.c_str()));
//TexHandle.fromImageFile(texInfoS, fmt("%s/btninfos.png", m_imgsDir.c_str()));
TexHandle.fromImageFile(texConfig, fmt("%s/btnconfig.png", m_imgsDir.c_str())); TexHandle.fromImageFile(texConfig, fmt("%s/btnconfig.png", m_imgsDir.c_str()));
TexHandle.fromImageFile(texConfigS, fmt("%s/btnconfigs.png", m_imgsDir.c_str())); TexHandle.fromImageFile(texConfigS, fmt("%s/btnconfigs.png", m_imgsDir.c_str()));
TexHandle.fromImageFile(texDVD, fmt("%s/btndvd.png", m_imgsDir.c_str())); TexHandle.fromImageFile(texDVD, fmt("%s/btndvd.png", m_imgsDir.c_str()));
@ -880,9 +827,8 @@ void CMenu::_initMainMenu()
_addUserLabels(m_mainLblUser, ARRAY_SIZE(m_mainLblUser), "MAIN"); _addUserLabels(m_mainLblUser, ARRAY_SIZE(m_mainLblUser), "MAIN");
//m_mainBtnInfo = _addPicButton("MAIN/INFO_BTN", texInfo, texInfoS, 20, 400, 48, 48);
m_mainBtnConfig = _addPicButton("MAIN/CONFIG_BTN", texConfig, texConfigS, 70, 400, 48, 48); m_mainBtnConfig = _addPicButton("MAIN/CONFIG_BTN", texConfig, texConfigS, 70, 400, 48, 48);
m_mainBtnQuit = _addPicButton("MAIN/QUIT_BTN", texQuit, texQuitS, 570, 400, 48, 48); m_mainBtnHome = _addPicButton("MAIN/QUIT_BTN", texHome, texHomeS, 570, 400, 48, 48);
m_mainBtnChannel = _addPicButton("MAIN/CHANNEL_BTN", texChannel, texChannels, 520, 400, 48, 48); m_mainBtnChannel = _addPicButton("MAIN/CHANNEL_BTN", texChannel, texChannels, 520, 400, 48, 48);
m_mainBtnHomebrew = _addPicButton("MAIN/HOMEBREW_BTN", texHomebrew, texHomebrews, 20, 400, 48, 48); m_mainBtnHomebrew = _addPicButton("MAIN/HOMEBREW_BTN", texHomebrew, texHomebrews, 20, 400, 48, 48);
m_mainBtnWii = _addPicButton("MAIN/USB_BTN", texWii, texWiis, 520, 400, 48, 48); m_mainBtnWii = _addPicButton("MAIN/USB_BTN", texWii, texWiis, 520, 400, 48, 48);
@ -891,18 +837,16 @@ void CMenu::_initMainMenu()
m_mainBtnDVD = _addPicButton("MAIN/DVD_BTN", texDVD, texDVDs, 470, 400, 48, 48); m_mainBtnDVD = _addPicButton("MAIN/DVD_BTN", texDVD, texDVDs, 470, 400, 48, 48);
m_mainBtnNext = _addPicButton("MAIN/NEXT_BTN", texNext, texNextS, 540, 146, 80, 80); m_mainBtnNext = _addPicButton("MAIN/NEXT_BTN", texNext, texNextS, 540, 146, 80, 80);
m_mainBtnPrev = _addPicButton("MAIN/PREV_BTN", texPrev, texPrevS, 20, 146, 80, 80); m_mainBtnPrev = _addPicButton("MAIN/PREV_BTN", texPrev, texPrevS, 20, 146, 80, 80);
m_mainBtnInstall = _addButton("MAIN/BIG_SETTINGS_BTN", theme.titleFont, L"", 72, 180, 496, 48, theme.titleFontColor);
m_mainBtnSelPart = _addButton("MAIN/BIG_SETTINGS_BTN2", theme.titleFont, L"", 72, 290, 496, 48, theme.titleFontColor);
m_mainLblMessage = _addLabel("MAIN/MESSAGE", theme.lblFont, L"", 40, 40, 560, 140, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_mainLblMessage = _addLabel("MAIN/MESSAGE", theme.lblFont, L"", 40, 40, 560, 140, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_mainBtnFavoritesOn = _addPicButton("MAIN/FAVORITES_ON", texFavOn, texFavOnS, 288, 400, 64, 64); m_mainBtnFavoritesOn = _addPicButton("MAIN/FAVORITES_ON", texFavOn, texFavOnS, 288, 400, 64, 64);
m_mainBtnFavoritesOff = _addPicButton("MAIN/FAVORITES_OFF", texFavOff, texFavOffS, 288, 400, 64, 64); m_mainBtnFavoritesOff = _addPicButton("MAIN/FAVORITES_OFF", texFavOff, texFavOffS, 288, 400, 64, 64);
m_mainLblLetter = _addLabel("MAIN/LETTER", theme.titleFont, L"", 540, 40, 80, 80, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, emptyTex); m_mainLblLetter = _addLabel("MAIN/LETTER", theme.titleFont, L"", 540, 40, 80, 80, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, emptyTex);
m_mainLblNotice = _addLabel("MAIN/NOTICE", theme.titleFont, L"", 340, 40, 280, 80, theme.titleFontColor, FTGX_JUSTIFY_RIGHT | FTGX_ALIGN_MIDDLE, emptyTex); m_mainLblNotice = _addLabel("MAIN/NOTICE", theme.titleFont, L"", 340, 40, 280, 80, theme.titleFontColor, FTGX_JUSTIFY_RIGHT | FTGX_ALIGN_MIDDLE, emptyTex);
m_mainLblCurMusic = _addLabel("MAIN/MUSIC", theme.btnFont, L"", 0, 20, 640, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC); m_mainLblCurMusic = _addLabel("MAIN/MUSIC", theme.btnFont, L"", 0, 20, 640, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC);
#ifdef SHOWMEM //#ifdef SHOWMEM
m_mem1FreeSize = _addLabel("MEM1", theme.btnFont, L"", 0, 300, 480, 56, theme.btnFontColor, FTGX_JUSTIFY_LEFT, emptyTex); m_mem1FreeSize = _addLabel("MEM1", theme.btnFont, L"", 40, 300, 480, 56, theme.btnFontColor, FTGX_JUSTIFY_LEFT, emptyTex);
m_mem2FreeSize = _addLabel("MEM2", theme.btnFont, L"", 0, 356, 480, 56, theme.btnFontColor, FTGX_JUSTIFY_LEFT, emptyTex); m_mem2FreeSize = _addLabel("MEM2", theme.btnFont, L"", 40, 356, 480, 56, theme.btnFontColor, FTGX_JUSTIFY_LEFT, emptyTex);
#endif //#endif
// //
m_mainPrevZone.x = m_theme.getInt("MAIN/ZONES", "prev_x", -32); m_mainPrevZone.x = m_theme.getInt("MAIN/ZONES", "prev_x", -32);
m_mainPrevZone.y = m_theme.getInt("MAIN/ZONES", "prev_y", -32); m_mainPrevZone.y = m_theme.getInt("MAIN/ZONES", "prev_y", -32);
@ -937,8 +881,7 @@ void CMenu::_initMainMenu()
_setHideAnim(m_mainBtnNext, "MAIN/NEXT_BTN", 0, 0, 0.f, 0.f); _setHideAnim(m_mainBtnNext, "MAIN/NEXT_BTN", 0, 0, 0.f, 0.f);
_setHideAnim(m_mainBtnPrev, "MAIN/PREV_BTN", 0, 0, 0.f, 0.f); _setHideAnim(m_mainBtnPrev, "MAIN/PREV_BTN", 0, 0, 0.f, 0.f);
_setHideAnim(m_mainBtnConfig, "MAIN/CONFIG_BTN", 0, 40, 0.f, 0.f); _setHideAnim(m_mainBtnConfig, "MAIN/CONFIG_BTN", 0, 40, 0.f, 0.f);
_setHideAnim(m_mainBtnInfo, "MAIN/INFO_BTN", 0, 40, 0.f, 0.f); _setHideAnim(m_mainBtnHome, "MAIN/QUIT_BTN", 0, 40, 0.f, 0.f);
_setHideAnim(m_mainBtnQuit, "MAIN/QUIT_BTN", 0, 40, 0.f, 0.f);
_setHideAnim(m_mainBtnChannel, "MAIN/CHANNEL_BTN", 0, 40, 0.f, 0.f); _setHideAnim(m_mainBtnChannel, "MAIN/CHANNEL_BTN", 0, 40, 0.f, 0.f);
_setHideAnim(m_mainBtnHomebrew, "MAIN/HOMEBREW_BTN", 0, 40, 0.f, 0.f); _setHideAnim(m_mainBtnHomebrew, "MAIN/HOMEBREW_BTN", 0, 40, 0.f, 0.f);
_setHideAnim(m_mainBtnWii, "MAIN/USB_BTN", 0, 40, 0.f, 0.f); _setHideAnim(m_mainBtnWii, "MAIN/USB_BTN", 0, 40, 0.f, 0.f);
@ -947,24 +890,15 @@ void CMenu::_initMainMenu()
_setHideAnim(m_mainBtnDVD, "MAIN/DVD_BTN", 0, 40, 0.f, 0.f); _setHideAnim(m_mainBtnDVD, "MAIN/DVD_BTN", 0, 40, 0.f, 0.f);
_setHideAnim(m_mainBtnFavoritesOn, "MAIN/FAVORITES_ON", 0, 40, 0.f, 0.f); _setHideAnim(m_mainBtnFavoritesOn, "MAIN/FAVORITES_ON", 0, 40, 0.f, 0.f);
_setHideAnim(m_mainBtnFavoritesOff, "MAIN/FAVORITES_OFF", 0, 40, 0.f, 0.f); _setHideAnim(m_mainBtnFavoritesOff, "MAIN/FAVORITES_OFF", 0, 40, 0.f, 0.f);
_setHideAnim(m_mainBtnInstall, "MAIN/BIG_SETTINGS_BTN", 0, 0, -2.f, 0.f);
_setHideAnim(m_mainBtnSelPart, "MAIN/BIG_SETTINGS_BTN2", 0, 0, -2.f, 0.f);
_setHideAnim(m_mainLblMessage, "MAIN/MESSAGE", 0, 0, 0.f, 0.f); _setHideAnim(m_mainLblMessage, "MAIN/MESSAGE", 0, 0, 0.f, 0.f);
_setHideAnim(m_mainLblLetter, "MAIN/LETTER", 0, 0, 0.f, 0.f); _setHideAnim(m_mainLblLetter, "MAIN/LETTER", 0, 0, 0.f, 0.f);
_setHideAnim(m_mainLblNotice, "MAIN/NOTICE", 0, 0, 0.f, 0.f); _setHideAnim(m_mainLblNotice, "MAIN/NOTICE", 0, 0, 0.f, 0.f);
_setHideAnim(m_mainLblCurMusic, "MAIN/MUSIC", 0, -100, 0.f, 0.f); _setHideAnim(m_mainLblCurMusic, "MAIN/MUSIC", 0, -100, 0.f, 0.f);
#ifdef SHOWMEM //#ifdef SHOWMEM
_setHideAnim(m_mem1FreeSize, "MEM1", 0, 0, 0.f, 0.f); _setHideAnim(m_mem1FreeSize, "MEM1", 0, 0, 0.f, 0.f);
_setHideAnim(m_mem2FreeSize, "MEM2", 0, 0, 0.f, 0.f); _setHideAnim(m_mem2FreeSize, "MEM2", 0, 0, 0.f, 0.f);
#endif //#endif
_hideMain(true); _hideMain(true);
_textMain();
}
void CMenu::_textMain(void)
{
m_btnMgr.setText(m_mainBtnInstall, _t("main1", L"Install Game"));
m_btnMgr.setText(m_mainBtnSelPart, _t("main3", L"Select Partition"));
} }
wstringEx CMenu::_getNoticeTranslation(int sorting, wstringEx curLetter) wstringEx CMenu::_getNoticeTranslation(int sorting, wstringEx curLetter)
@ -1084,3 +1018,55 @@ void CMenu::_setPartition(s8 direction)
(FS_Type != -1 && DeviceHandle.IsInserted(currentPartition))))) (FS_Type != -1 && DeviceHandle.IsInserted(currentPartition)))))
m_cfg.setInt(_domainFromView(), "partition", currentPartition); m_cfg.setInt(_domainFromView(), "partition", currentPartition);
} }
void CMenu::exitHandler(int ExitTo)
{
m_exit = true;
if(ExitTo == EXIT_TO_BOOTMII) //Bootmii, check that the files are there, or ios will hang.
{
struct stat dummy;
if(!DeviceHandle.IsInserted(SD) ||
stat("sd:/bootmii/armboot.bin", &dummy) != 0 ||
stat("sd:/bootmii/ppcboot.elf", &dummy) != 0)
ExitTo = EXIT_TO_HBC;
}
if(ExitTo != WIIFLOW_DEF)
Sys_ExitTo(ExitTo);
}
int CMenu::_getCFVersion()
{
if(m_current_view == COVERFLOW_PLUGIN && !m_sourceflow)
{
m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount);
if(enabledPluginsCount == 1)
{
for(u8 i = 0; m_plugin.PluginExist(i); ++i)
{
if(m_plugin.GetEnableStatus(m_cfg, m_plugin.getPluginMagic(i)))
return m_cfg.getInt("PLUGIN_CFVERSION", m_plugin.PluginMagicWord, 1);
}
}
}
return m_cfg.getInt(_domainFromView(), "last_cf_mode", 1);
}
void CMenu::_setCFVersion(int version)
{
if(m_current_view == COVERFLOW_PLUGIN && !m_sourceflow)
{
m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount);
if(enabledPluginsCount == 1)
{
for(u8 i = 0; m_plugin.PluginExist(i); ++i)
{
if(m_plugin.GetEnableStatus(m_cfg, m_plugin.getPluginMagic(i)))
{
m_cfg.setInt("PLUGIN_CFVERSION", m_plugin.PluginMagicWord, version);
return;
}
}
}
}
m_cfg.setInt(_domainFromView(), "last_cf_mode", version);
}

View File

@ -99,57 +99,49 @@ static void listEmuNands(const char * path, vector<string> &emuNands)
void CMenu::_checkEmuNandSettings(bool savesnand) void CMenu::_checkEmuNandSettings(bool savesnand)
{ {
string emuNand; /* make sure partition and directory are legal and legit */
const char *emuNand = NULL;
int emuPart; int emuPart;
if(!savesnand) if(savesnand)
{ {
emuNand = m_cfg.getString(CHANNEL_DOMAIN, "current_emunand", "default"); emuNand = m_cfg.getString(WII_DOMAIN, "current_save_emunand", "default").c_str();
emuPart = m_cfg.getInt(WII_DOMAIN, "savepartition", 0);
}
else
{
emuNand = m_cfg.getString(CHANNEL_DOMAIN, "current_emunand", "default").c_str();
emuPart = m_cfg.getInt(CHANNEL_DOMAIN, "partition", 0); emuPart = m_cfg.getInt(CHANNEL_DOMAIN, "partition", 0);
} }
else const char *tmpPath = fmt("/%s/%s", EMU_NANDS_DIR, emuNand);
/* check if partition is FAT && emuNAND directory exist*/
if(!DeviceHandle.PartitionUsableForNandEmu(emuPart) || !_TestEmuNand(emuPart, tmpPath, false))
{ {
emuNand = m_cfg.getString(WII_DOMAIN, "current_save_emunand", m_cfg.getString(CHANNEL_DOMAIN, "current_emunand", "default")); if(savesnand)
emuPart = m_cfg.getInt(WII_DOMAIN, "savepartition", m_cfg.getInt(CHANNEL_DOMAIN, "partition", 0));
}
/* check if partition is FAT */
if(!DeviceHandle.PartitionUsableForNandEmu(emuPart))// if not then find a FAT partition
{ {
for(emuPart = SD; emuPart <= USB8; emuPart++)
{
if(DeviceHandle.PartitionUsableForNandEmu(emuPart))
{
if(!savesnand)
m_cfg.setInt(CHANNEL_DOMAIN, "partition", emuPart);
else
m_cfg.setInt(WII_DOMAIN, "savepartition", emuPart);
break;
}
}
}
/* check directory */
const char *tmpPath = fmt("/%s/%s", EMU_NANDS_DIR, emuNand.c_str());
if(!_TestEmuNand(emuPart, tmpPath, false))// if doesn't exist set to default
{
if(!savesnand)
m_cfg.setString(CHANNEL_DOMAIN, "current_emunand", "default");
else
m_cfg.setString(WII_DOMAIN, "current_save_emunand", "default"); m_cfg.setString(WII_DOMAIN, "current_save_emunand", "default");
m_cfg.getInt(WII_DOMAIN, "savepartition", 0);
}
else
{
m_cfg.setString(CHANNEL_DOMAIN, "current_emunand", "default");
m_cfg.getInt(CHANNEL_DOMAIN, "partition", 0);
}
} }
} }
int CMenu::_FindEmuPart(string &emuPath, bool skipchecks, bool savesnand) int CMenu::_FindEmuPart(string &emuPath, bool skipchecks, bool savesnand)
{ {
int emuPart = -1; int emuPart;
const char *tmpPath = NULL; const char *tmpPath = NULL;
if(!savesnand) if(savesnand)
{ {
emuPart = m_cfg.getInt(CHANNEL_DOMAIN, "partition", 0); emuPart = m_cfg.getInt(WII_DOMAIN, "savepartition");
tmpPath = fmt("/%s/%s", EMU_NANDS_DIR, m_cfg.getString(CHANNEL_DOMAIN, "current_emunand", "default").c_str()); tmpPath = fmt("/%s/%s", EMU_NANDS_DIR, m_cfg.getString(WII_DOMAIN, "current_save_emunand").c_str());
} }
else else
{ {
emuPart = m_cfg.getInt(WII_DOMAIN, "savepartition", m_cfg.getInt(CHANNEL_DOMAIN, "partition", 0)); emuPart = m_cfg.getInt(CHANNEL_DOMAIN, "partition");
tmpPath = fmt("/%s/%s", EMU_NANDS_DIR, m_cfg.getString(WII_DOMAIN, "current_save_emunand", m_cfg.getString(CHANNEL_DOMAIN, "current_emunand", "default")).c_str()); tmpPath = fmt("/%s/%s", EMU_NANDS_DIR, m_cfg.getString(CHANNEL_DOMAIN, "current_emunand").c_str());
} }
if(!DeviceHandle.PartitionUsableForNandEmu(emuPart)) if(!DeviceHandle.PartitionUsableForNandEmu(emuPart))
return -1; return -1;
@ -216,8 +208,8 @@ bool CMenu::_checkSave(string id, bool nand)
} }
else else
{ {
int emuPartition = m_cfg.getInt(WII_DOMAIN, "savepartition", m_cfg.getInt(CHANNEL_DOMAIN, "partition", 0)); int emuPartition = m_cfg.getInt(WII_DOMAIN, "savepartition");
const char *emuPath = fmt("/%s/%s", EMU_NANDS_DIR, m_cfg.getString(WII_DOMAIN, "current_save_emunand", m_cfg.getString(CHANNEL_DOMAIN, "current_emunand", "default")).c_str()); const char *emuPath = fmt("/%s/%s", EMU_NANDS_DIR, m_cfg.getString(WII_DOMAIN, "current_save_emunand").c_str());
if(emuPartition < 0 || emuPath == NULL) if(emuPartition < 0 || emuPath == NULL)
return false; return false;
struct stat fstat; struct stat fstat;
@ -543,7 +535,10 @@ int CMenu::_NandEmuCfg(void)
m_btnMgr.setText(m_nandfileLblMessage, L""); m_btnMgr.setText(m_nandfileLblMessage, L"");
m_btnMgr.setText(m_nandemuLblDialog, _t("cfgne11", L"Overall Progress:")); m_btnMgr.setText(m_nandemuLblDialog, _t("cfgne11", L"Overall Progress:"));
if(m_fulldump) if(m_fulldump)
{
m_refreshGameList = true;
m_btnMgr.setText(m_nandemuLblTitle, _t("cfgne12", L"NAND Extractor")); m_btnMgr.setText(m_nandemuLblTitle, _t("cfgne12", L"NAND Extractor"));
}
else else
m_btnMgr.setText(m_nandemuLblTitle, _t("cfgne13", L"Game Save Extractor")); m_btnMgr.setText(m_nandemuLblTitle, _t("cfgne13", L"Game Save Extractor"));
m_thrdStop = false; m_thrdStop = false;
@ -601,17 +596,17 @@ int CMenu::_NandEmuCfg(void)
if(emuNand != m_cfg.getString(CHANNEL_DOMAIN, "current_emunand")) if(emuNand != m_cfg.getString(CHANNEL_DOMAIN, "current_emunand"))
{ {
m_cfg.setBool(CHANNEL_DOMAIN, "update_cache", true); m_cfg.setBool(CHANNEL_DOMAIN, "update_cache", true);
if(m_current_view == COVERFLOW_CHANNEL)// or source is set if(m_cfg.getBool(CHANNEL_DOMAIN, "source"))// or source is set - need to fix
m_load_view = true; m_refreshGameList = true;
} }
return 0; return 0;
} }
int CMenu::_FlashSave(string gameId) int CMenu::_FlashSave(string gameId)
{ {
int emuPartition = m_cfg.getInt(WII_DOMAIN, "savepartition", m_cfg.getInt(CHANNEL_DOMAIN, "partition", 0)); int emuPartition = m_cfg.getInt(WII_DOMAIN, "savepartition");
char basepath[MAX_FAT_PATH]; char basepath[MAX_FAT_PATH];
snprintf(basepath, sizeof(basepath), "%s:/%s/%s", DeviceName[emuPartition], EMU_NANDS_DIR, m_cfg.getString(WII_DOMAIN, "current_save_emunand", m_cfg.getString(CHANNEL_DOMAIN, "current_emunand", "default")).c_str()); snprintf(basepath, sizeof(basepath), "%s:/%s/%s", DeviceName[emuPartition], EMU_NANDS_DIR, m_cfg.getString(WII_DOMAIN, "current_save_emunand").c_str());
if(!_checkSave(gameId, false)) if(!_checkSave(gameId, false))
return 0; return 0;
@ -649,7 +644,6 @@ int CMenu::_FlashSave(string gameId)
} }
else if(BTN_A_PRESSED && (m_btnMgr.selected(m_nandemuBtnBack))) else if(BTN_A_PRESSED && (m_btnMgr.selected(m_nandemuBtnBack)))
{ {
m_cfg.save();
_hideNandEmu(); _hideNandEmu();
return 1; return 1;
} }
@ -684,12 +678,8 @@ int CMenu::_FlashSave(string gameId)
int CMenu::_AutoExtractSave(string gameId) int CMenu::_AutoExtractSave(string gameId)
{ {
string emuPath; if(!_checkSave(gameId, true))//if save not on real nand or emunand path no good
int emuPartition = _FindEmuPart(emuPath, false, true); return 0;
if(emuPartition < 0)
emuPartition = _FindEmuPart(emuPath, true, true);
if(!_checkSave(gameId, true))//if save not on real nand
return 1;
if(!m_forceext && _checkSave(gameId, false))//if not force extract and save is already on emunand if(!m_forceext && _checkSave(gameId, false))//if not force extract and save is already on emunand
return 1; return 1;
@ -740,8 +730,10 @@ int CMenu::_AutoExtractSave(string gameId)
} }
else if(BTN_A_PRESSED && (m_btnMgr.selected(m_nandemuBtnDisable)))//create new save else if(BTN_A_PRESSED && (m_btnMgr.selected(m_nandemuBtnDisable)))//create new save
{ {
int emuPart = m_cfg.getInt(WII_DOMAIN, "savepartition");
const char *emuPath = fmt("/%s/%s", EMU_NANDS_DIR, m_cfg.getString(WII_DOMAIN, "current_save_emunand").c_str());
char basepath[MAX_FAT_PATH]; char basepath[MAX_FAT_PATH];
snprintf(basepath, sizeof(basepath), "%s:%s", DeviceName[emuPartition], emuPath.c_str()); snprintf(basepath, sizeof(basepath), "%s:%s", DeviceName[emuPart], emuPath);
NandHandle.CreatePath("%s/import", basepath); NandHandle.CreatePath("%s/import", basepath);
NandHandle.CreatePath("%s/meta", basepath); NandHandle.CreatePath("%s/meta", basepath);
NandHandle.CreatePath("%s/shared1", basepath); NandHandle.CreatePath("%s/shared1", basepath);
@ -755,7 +747,6 @@ int CMenu::_AutoExtractSave(string gameId)
} }
else if(BTN_A_PRESSED && (m_btnMgr.selected(m_nandemuBtnBack))) else if(BTN_A_PRESSED && (m_btnMgr.selected(m_nandemuBtnBack)))
{ {
m_cfg.save();
_hideNandEmu(); _hideNandEmu();
return 1; return 1;
} }
@ -841,9 +832,13 @@ int CMenu::_NandDumper(void *obj)
if(emuPartition < 0) if(emuPartition < 0)
{ {
m.error(m._t("cfgne8", L"No valid FAT partition found for NAND Emulation!")); //m.error(m._t("cfgne8", L"No valid FAT partition found for NAND Emulation!"));
//probably should set m.m_thrdWorking = false; m.m_thrdWorking = false;
//and set bool error to true and then main thread will handle it LWP_MutexLock(m.m_mutex);
m_btnMgr.hide(m_nandfilePBar);
m_btnMgr.hide(m_nandfileLblMessage);
m._setDumpMsg(m._t("cfgne8", L"No valid FAT partition found for NAND Emulation!"), 1.f, 1.f);
LWP_MutexUnlock(m.m_mutex);
return 0; return 0;
} }
@ -935,13 +930,13 @@ void CMenu::_initNandEmuMenu()
m_nandemuBg = _texture("NANDEMU/BG", "texture", theme.bg, false); m_nandemuBg = _texture("NANDEMU/BG", "texture", theme.bg, false);
m_nandemuLblTitle = _addTitle("NANDEMU/TITLE", theme.titleFont, L"", 0, 10, 640, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE); m_nandemuLblTitle = _addTitle("NANDEMU/TITLE", theme.titleFont, L"", 0, 10, 640, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE);
m_nandfileLblMessage = _addLabel("NANDEMU/FMESSAGE", theme.lblFont, L"", 40, 230, 560, 100, theme.lblFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_TOP);
m_nandemuLblMessage = _addLabel("NANDEMU/MESSAGE", theme.lblFont, L"", 40, 350, 560, 100, theme.lblFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_TOP);
m_nandfileLblDialog = _addLabel("NANDEMU/FDIALOG", theme.lblFont, L"", 40, 60, 560, 200, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_nandfileLblDialog = _addLabel("NANDEMU/FDIALOG", theme.lblFont, L"", 40, 60, 560, 200, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_nandfinLblDialog = _addLabel("NANDEMU/FINDIALOG", theme.lblFont, L"", 40, 120, 560, 200, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_nandfinLblDialog = _addLabel("NANDEMU/FINDIALOG", theme.lblFont, L"", 40, 120, 560, 200, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_nandemuLblDialog = _addLabel("NANDEMU/DIALOG", theme.lblFont, L"", 40, 180, 560, 200, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_nandemuLblDialog = _addLabel("NANDEMU/DIALOG", theme.lblFont, L"", 40, 180, 560, 200, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_nandfilePBar = _addProgressBar("NANDEMU/FILEPROGRESS_BAR", 40, 200, 560, 20); m_nandfilePBar = _addProgressBar("NANDEMU/FILEPROGRESS_BAR", 40, 200, 560, 20);
m_nandemuPBar = _addProgressBar("NANDEMU/PROGRESS_BAR", 40, 200, 560, 20); m_nandemuPBar = _addProgressBar("NANDEMU/PROGRESS_BAR", 40, 200, 560, 20);
m_nandfileLblMessage = _addLabel("NANDEMU/FMESSAGE", theme.lblFont, L"", 40, 230, 560, 100, theme.lblFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_TOP);
m_nandemuLblMessage = _addLabel("NANDEMU/MESSAGE", theme.lblFont, L"", 40, 350, 560, 100, theme.lblFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_TOP);
m_nandemuLblNandSelect = _addLabel("NANDEMU/NAND_SELECT", theme.lblFont, L"", 20, 125, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_nandemuLblNandSelect = _addLabel("NANDEMU/NAND_SELECT", theme.lblFont, L"", 20, 125, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_nandemuLblNandSelectVal = _addLabel("NANDEMU/NAND_SELECT_BTN", theme.btnFont, L"", 468, 130, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC); m_nandemuLblNandSelectVal = _addLabel("NANDEMU/NAND_SELECT_BTN", theme.btnFont, L"", 468, 130, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC);

View File

@ -130,7 +130,8 @@ void CMenu::_Paths(void)
{ {
m_cfg.setString("GENERAL", "dir_box_covers", path); m_cfg.setString("GENERAL", "dir_box_covers", path);
m_boxPicDir = path; m_boxPicDir = path;
m_load_view = true; //user needs to do a reload cache or we should just delete cache folder
//m_refreshGameList = true;
} }
_showPaths(); _showPaths();
} }
@ -142,7 +143,7 @@ void CMenu::_Paths(void)
{ {
m_cfg.setString("GENERAL", "dir_flat_covers", path); m_cfg.setString("GENERAL", "dir_flat_covers", path);
m_picDir = path; m_picDir = path;
m_load_view = true; //m_refreshGameList = true;
} }
_showPaths(); _showPaths();
} }
@ -194,7 +195,7 @@ void CMenu::_Paths(void)
strncpy(wii_games_dir, tmpPath, 64); strncpy(wii_games_dir, tmpPath, 64);
m_cfg.setBool(WII_DOMAIN, "update_cache", true); m_cfg.setBool(WII_DOMAIN, "update_cache", true);
if(m_cfg.getBool(WII_DOMAIN, "source")) if(m_cfg.getBool(WII_DOMAIN, "source"))
m_load_view = true; m_refreshGameList = true;
} }
_showPaths(); _showPaths();
} }
@ -222,7 +223,7 @@ void CMenu::_Paths(void)
strncpy(gc_games_dir, tmpPath, 64); strncpy(gc_games_dir, tmpPath, 64);
m_cfg.setBool(GC_DOMAIN, "update_cache", true); m_cfg.setBool(GC_DOMAIN, "update_cache", true);
if(m_cfg.getBool(GC_DOMAIN, "source")) if(m_cfg.getBool(GC_DOMAIN, "source"))
m_load_view = true; m_refreshGameList = true;
} }
_showPaths(); _showPaths();
} }

View File

@ -29,10 +29,9 @@ void CMenu::_hidePluginSettings(bool instant)
m_btnMgr.hide(m_pluginBtnPageM, instant); m_btnMgr.hide(m_pluginBtnPageM, instant);
m_btnMgr.hide(m_pluginBtnPageP, instant); m_btnMgr.hide(m_pluginBtnPageP, instant);
for(u8 i = 0; i < ARRAY_SIZE(m_pluginLblUser); ++i) for(u8 i = 0; i < ARRAY_SIZE(m_pluginLblUser); ++i)
{
if(m_pluginLblUser[i] != -1) if(m_pluginLblUser[i] != -1)
m_btnMgr.hide(m_pluginLblUser[i], instant); m_btnMgr.hide(m_pluginLblUser[i], instant);
}
for(u8 i = 0; i < 11; ++i) for(u8 i = 0; i < 11; ++i)
{ {
m_btnMgr.hide(m_pluginLblCat[i]); m_btnMgr.hide(m_pluginLblCat[i]);
@ -44,10 +43,9 @@ void CMenu::_showPluginSettings(void)
{ {
_setBg(m_pluginBg, m_pluginBg); _setBg(m_pluginBg, m_pluginBg);
for(u8 i = 0; i < ARRAY_SIZE(m_pluginLblUser); ++i) for(u8 i = 0; i < ARRAY_SIZE(m_pluginLblUser); ++i)
{
if(m_pluginLblUser[i] != -1) if(m_pluginLblUser[i] != -1)
m_btnMgr.show(m_pluginLblUser[i]); m_btnMgr.show(m_pluginLblUser[i]);
}
m_btnMgr.show(m_pluginLblTitle); m_btnMgr.show(m_pluginLblTitle);
m_btnMgr.show(m_pluginBtnBack); m_btnMgr.show(m_pluginBtnBack);
_updatePluginCheckboxes(); _updatePluginCheckboxes();
@ -146,7 +144,7 @@ void CMenu::_PluginSettings()
{ {
if(m_btnMgr.selected(m_pluginBtn[i])) if(m_btnMgr.selected(m_pluginBtn[i]))
{ {
m_load_view = true; m_refreshGameList = true;
if(i == 0) if(i == 0)
{ {
m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount); m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount);
@ -163,7 +161,7 @@ void CMenu::_PluginSettings()
} }
_hidePluginSettings(); _hidePluginSettings();
m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount); m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount);
if(m_load_view || (m_current_view != COVERFLOW_PLUGIN && enabledPluginsCount > 0)) if(m_refreshGameList || (m_current_view != COVERFLOW_PLUGIN && enabledPluginsCount > 0))
{ {
m_current_view = COVERFLOW_PLUGIN; m_current_view = COVERFLOW_PLUGIN;
_clearSources(); _clearSources();

View File

@ -1,11 +1,10 @@
#include <dirent.h> #include <dirent.h>
#include <unistd.h> #include <unistd.h>
#include "menu.hpp" #include "menu.hpp"
#include "defines.h" #include "defines.h"
// Source menu // Source menu
s16 m_sourceLblNotice;
s16 m_sourceLblPage; s16 m_sourceLblPage;
s16 m_sourceBtnPageM; s16 m_sourceBtnPageM;
s16 m_sourceBtnPageP; s16 m_sourceBtnPageP;
@ -32,16 +31,17 @@ char current_btn[16];
void CMenu::_sourceFlow() void CMenu::_sourceFlow()
{ {
const dir_discHdr *hdr = CoverFlow.getHdr(); const dir_discHdr *hdr = CoverFlow.getHdr();
if(m_cfg.getBool("SOURCEFLOW", "remember_last_item", true)) if(m_cfg.getBool(SOURCEFLOW_DOMAIN, "remember_last_item", true))
m_cfg.setString("SOURCEFLOW", "current_item", strrchr(hdr->path, '/') + 1); m_cfg.setString(SOURCEFLOW_DOMAIN, "current_item", strrchr(hdr->path, '/') + 1);
else else
m_cfg.remove("SOURCEFLOW", "current_item"); m_cfg.remove(SOURCEFLOW_DOMAIN, "current_item");
memset(btn_selected, 0, 16); memset(btn_selected, 0, 16);
strncpy(btn_selected, fmt("BUTTON_%i", hdr->settings[0]), 15); strncpy(btn_selected, fmt("BUTTON_%i", hdr->settings[0]), 15);
source = m_source.getString(btn_selected, "source", ""); source = m_source.getString(btn_selected, "source", "");
cf_domain = "_COVERFLOW"; cf_domain = "_COVERFLOW";
_clearSources();// may have to move this _clearSources();
//this was my attempt or idea at making sourceflow multi-select
/*if(source == "wii") /*if(source == "wii")
{ {
m_cfg.setBool(WII_DOMAIN, "source", true); m_cfg.setBool(WII_DOMAIN, "source", true);
@ -76,12 +76,21 @@ void CMenu::_sourceFlow()
m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", false); m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", false);
} }
else if(source == "homebrew") else if(source == "homebrew")
{
if(m_locked && m_cfg.getBool(HOMEBREW_DOMAIN, "parental", false))
{
error(_t("errsource1", L"Homebrew locked!"));
m_current_view = COVERFLOW_WII;
m_cfg.setBool(WII_DOMAIN, "source", true);
}
else
{ {
m_current_view = COVERFLOW_HOMEBREW; m_current_view = COVERFLOW_HOMEBREW;
m_cfg.setBool(HOMEBREW_DOMAIN, "source", true); m_cfg.setBool(HOMEBREW_DOMAIN, "source", true);
if(m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox", true)) if(m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox", true))
cf_domain = "_SMALLFLOW"; cf_domain = "_SMALLFLOW";
} }
}
else if(source == "allplugins") else if(source == "allplugins")
{ {
m_current_view = COVERFLOW_PLUGIN; m_current_view = COVERFLOW_PLUGIN;
@ -115,7 +124,6 @@ void CMenu::_sourceFlow()
void CMenu::_hideSource(bool instant) void CMenu::_hideSource(bool instant)
{ {
m_btnMgr.hide(m_sourceLblTitle, instant); m_btnMgr.hide(m_sourceLblTitle, instant);
m_btnMgr.hide(m_sourceLblNotice, instant);
m_btnMgr.hide(m_sourceLblPage, instant); m_btnMgr.hide(m_sourceLblPage, instant);
m_btnMgr.hide(m_sourceBtnPageM, instant); m_btnMgr.hide(m_sourceBtnPageM, instant);
m_btnMgr.hide(m_sourceBtnPageP, instant); m_btnMgr.hide(m_sourceBtnPageP, instant);
@ -123,10 +131,8 @@ void CMenu::_hideSource(bool instant)
m_btnMgr.hide(m_sourceBtnClear, instant); m_btnMgr.hide(m_sourceBtnClear, instant);
for(i = 0; i < ARRAY_SIZE(m_sourceLblUser); ++i) for(i = 0; i < ARRAY_SIZE(m_sourceLblUser); ++i)
{
if(m_sourceLblUser[i] != -1) if(m_sourceLblUser[i] != -1)
m_btnMgr.hide(m_sourceLblUser[i], instant); m_btnMgr.hide(m_sourceLblUser[i], instant);
}
for(i = 0; i < 12; ++i) for(i = 0; i < 12; ++i)
{ {
@ -140,10 +146,8 @@ void CMenu::_showSource(void)
_setBg(m_sourceBg, m_sourceBg); _setBg(m_sourceBg, m_sourceBg);
for(i = 0; i < ARRAY_SIZE(m_sourceLblUser); ++i) for(i = 0; i < ARRAY_SIZE(m_sourceLblUser); ++i)
{
if(m_sourceLblUser[i] != -1) if(m_sourceLblUser[i] != -1)
m_btnMgr.show(m_sourceLblUser[i]); m_btnMgr.show(m_sourceLblUser[i]);
}
m_btnMgr.show(m_sourceLblTitle); m_btnMgr.show(m_sourceLblTitle);
m_btnMgr.show(m_sourceBtnBack); m_btnMgr.show(m_sourceBtnBack);
@ -166,8 +170,6 @@ void CMenu::_updateSourceBtns(void)
selectedBtns = 0; selectedBtns = 0;
for(i = 0; i < ((numPages - 1) * 12 + 12); ++i) for(i = 0; i < ((numPages - 1) * 12 + 12); ++i)
{ {
//if(i < 12)
// m_btnMgr.hide(m_sourceBtnSource[i], true);
memset(current_btn, 0, 16); memset(current_btn, 0, 16);
strncpy(current_btn, fmt("BUTTON_%i", i), 15); strncpy(current_btn, fmt("BUTTON_%i", i), 15);
string btnSource = m_source.getString(current_btn, "source", ""); string btnSource = m_source.getString(current_btn, "source", "");
@ -243,35 +245,16 @@ void CMenu::_updateSourceBtns(void)
} }
} }
void CMenu::_showSourceNotice(void)
{
m_showtimer = 90;
m_btnMgr.show(m_sourceLblNotice);
exitSource = false;
}
bool CMenu::_Source() bool CMenu::_Source()
{ {
bool newSource = false; bool newSource = false;
bool updateSource = false; bool updateSource = false;
exitSource = false; exitSource = false;
m_showtimer = 0;
curPage = 1; curPage = 1;
numPages = 1; numPages = (m_max_source_btn / 12) + 1;
SetupInput(); SetupInput();
_showSource(); _showSource();
//set number of pages based on highest source btn number used
for(i = m_cfg.getInt("GENERAL", "max_source_buttons", 71); i > 11; --i)
{
string source = m_source.getString(fmt("BUTTON_%i", i), "source", "");
if(!source.empty())
{
numPages = (i / 12) + 1;
break;
}
}
_updateSourceBtns(); _updateSourceBtns();
while(!m_exit) while(!m_exit)
@ -282,7 +265,7 @@ bool CMenu::_Source()
{ {
_hideSource(); _hideSource();
_CfgSrc(); _CfgSrc();
if(m_cfg.getBool("SOURCEFLOW", "enabled")) if(m_cfg.getBool(SOURCEFLOW_DOMAIN, "enabled"))
return true; return true;
if(m_multisource) if(m_multisource)
newSource = true; newSource = true;
@ -293,7 +276,6 @@ bool CMenu::_Source()
{ {
if(!m_multisource) break; if(!m_multisource) break;
cf_domain = "_COVERFLOW"; cf_domain = "_COVERFLOW";
m_combined_view = false;
if(selectedBtns == 0) if(selectedBtns == 0)
{ {
m_cfg.setBool(WII_DOMAIN, "source", true); m_cfg.setBool(WII_DOMAIN, "source", true);
@ -307,6 +289,7 @@ bool CMenu::_Source()
_setSrcOptions(); _setSrcOptions();
//break; //break;
} }
u8 sourceCount = 0; u8 sourceCount = 0;
if(m_cfg.getBool(WII_DOMAIN, "source", false)) if(m_cfg.getBool(WII_DOMAIN, "source", false))
{ {
@ -335,7 +318,6 @@ bool CMenu::_Source()
} }
if(sourceCount > 1) if(sourceCount > 1)
{ {
m_combined_view = true;
m_current_view = COVERFLOW_MAX; m_current_view = COVERFLOW_MAX;
} }
break; break;
@ -392,21 +374,12 @@ bool CMenu::_Source()
exitSource = true; exitSource = true;
m_catStartPage = 1; m_catStartPage = 1;
if(source == "dml") if(source == "dml")
{
if(!show_gamecube)
_showSourceNotice();
else
{ {
m_cfg.setBool(GC_DOMAIN, "source", true); m_cfg.setBool(GC_DOMAIN, "source", true);
m_current_view = COVERFLOW_GAMECUBE; m_current_view = COVERFLOW_GAMECUBE;
_setSrcOptions(); _setSrcOptions();
} }
}
else if(source == "emunand" || source == "realnand") else if(source == "emunand" || source == "realnand")
{
if(!show_channel)
_showSourceNotice();
else
{ {
if(source == "emunand") if(source == "emunand")
{ {
@ -425,11 +398,10 @@ bool CMenu::_Source()
m_current_view = COVERFLOW_CHANNEL; m_current_view = COVERFLOW_CHANNEL;
_setSrcOptions(); _setSrcOptions();
} }
}
else if(source == "homebrew") else if(source == "homebrew")
{ {
if((m_locked || m_cfg.getBool(HOMEBREW_DOMAIN, "parental", false))) if(m_locked && m_cfg.getBool(HOMEBREW_DOMAIN, "parental", false))
_showSourceNotice(); error(_t("errsource1", L"Homebrew locked!"));
else else
{ {
m_cfg.setBool(HOMEBREW_DOMAIN, "source", true); m_cfg.setBool(HOMEBREW_DOMAIN, "source", true);
@ -438,10 +410,6 @@ bool CMenu::_Source()
} }
} }
else if(source == "allplugins") else if(source == "allplugins")
{
if(!show_plugin)
_showSourceNotice();
else
{ {
m_cfg.setBool(PLUGIN_DOMAIN, "source", true); m_cfg.setBool(PLUGIN_DOMAIN, "source", true);
m_current_view = COVERFLOW_PLUGIN; m_current_view = COVERFLOW_PLUGIN;
@ -449,12 +417,7 @@ bool CMenu::_Source()
m_plugin.SetEnablePlugin(m_cfg, k, 2); /* force enable */ m_plugin.SetEnablePlugin(m_cfg, k, 2); /* force enable */
_setSrcOptions(); _setSrcOptions();
} }
}
else if(source == "plugin") else if(source == "plugin")
{
if(!show_plugin)
_showSourceNotice();
else
{ {
m_cfg.setBool(PLUGIN_DOMAIN, "source", true); m_cfg.setBool(PLUGIN_DOMAIN, "source", true);
m_current_view = COVERFLOW_PLUGIN; m_current_view = COVERFLOW_PLUGIN;
@ -473,10 +436,9 @@ bool CMenu::_Source()
} }
} }
m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount); m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount);
if(enabledPluginsCount == 0) // zero magic #'s or invalid ones so default to first plugin in list if(enabledPluginsCount == 0) // no magic #'s or invalid ones so default to first plugin in list
m_plugin.SetEnablePlugin(m_cfg, 0, 2); m_plugin.SetEnablePlugin(m_cfg, 0, 2);
} }
}
else //if(source == "wii") or source is invalid or empty default to wii else //if(source == "wii") or source is invalid or empty default to wii
{ {
m_cfg.setBool(WII_DOMAIN, "source", true); m_cfg.setBool(WII_DOMAIN, "source", true);
@ -493,12 +455,9 @@ bool CMenu::_Source()
} }
else if(source == "dml") else if(source == "dml")
{ {
if(show_gamecube)
m_cfg.setBool(GC_DOMAIN, "source", !m_cfg.getBool(GC_DOMAIN, "source")); m_cfg.setBool(GC_DOMAIN, "source", !m_cfg.getBool(GC_DOMAIN, "source"));
} }
else if(source == "emunand" || source == "realnand") else if(source == "emunand" || source == "realnand")
{
if(show_channel)
{ {
if(source == "realnand") if(source == "realnand")
{ {
@ -525,25 +484,18 @@ bool CMenu::_Source()
else else
m_cfg.setBool(CHANNEL_DOMAIN, "source", false); m_cfg.setBool(CHANNEL_DOMAIN, "source", false);
} }
}
else if(source == "homebrew") else if(source == "homebrew")
{ {
if((!m_locked || !m_cfg.getBool(HOMEBREW_DOMAIN, "parental", false))) error(_t("errsource2", L"Homebrew and multisource not allowed!"));
m_cfg.setBool(HOMEBREW_DOMAIN, "source", !m_cfg.getBool(HOMEBREW_DOMAIN, "source"));
} }
else if(source == "allplugins") else if(source == "allplugins")
{
if(show_plugin)
{ {
m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount); m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount);
for(j = 0; m_plugin.PluginExist(j); ++j) /* opposite */ for(j = 0; m_plugin.PluginExist(j); ++j) /* opposite */
m_plugin.SetEnablePlugin(m_cfg, j, (enabledPluginsCount == 0) ? 2 : 1); m_plugin.SetEnablePlugin(m_cfg, j, (enabledPluginsCount == 0) ? 2 : 1);
m_cfg.setBool(PLUGIN_DOMAIN, "source", (enabledPluginsCount == 0) ? true : false); m_cfg.setBool(PLUGIN_DOMAIN, "source", (enabledPluginsCount == 0) ? true : false);
} }
}
else if(source == "plugin") else if(source == "plugin")
{
if(show_plugin)
{ {
if(!m_cfg.getBool(PLUGIN_DOMAIN, "source")) if(!m_cfg.getBool(PLUGIN_DOMAIN, "source"))
{ {
@ -570,10 +522,8 @@ bool CMenu::_Source()
} }
} }
} }
}
if(exitSource) if(exitSource)
{ {
m_combined_view = false;
newSource = true; newSource = true;
break; break;
} }
@ -582,11 +532,6 @@ bool CMenu::_Source()
newSource = true; newSource = true;
_updateSourceBtns(); _updateSourceBtns();
} }
if(m_showtimer > 0)
{
if(--m_showtimer == 0)
m_btnMgr.hide(m_sourceLblNotice);
}
} }
_hideSource(true); _hideSource(true);
return newSource; return newSource;
@ -641,7 +586,7 @@ bool CMenu::_shortCover(const char *magic)
void CMenu::_setSrcOptions(void) void CMenu::_setSrcOptions(void)
{ {
m_catStartPage = m_source.getInt(btn_selected, "cat_page", 1); m_catStartPage = m_source.getInt(btn_selected, "cat_page", 1);
int category = m_source.getInt(btn_selected, "category", 0); u8 category = m_source.getInt(btn_selected, "category", 0);
if(category > 0) if(category > 0)
{ {
m_cat.remove("GENERAL", "selected_categories"); m_cat.remove("GENERAL", "selected_categories");
@ -713,11 +658,25 @@ void CMenu::_initSourceMenu()
m_sourceDir = fmt("%s/%s", m_sourceDir.c_str(), themeName); m_sourceDir = fmt("%s/%s", m_sourceDir.c_str(), themeName);
m_use_source = true; m_use_source = true;
/* get max source button # */
m_max_source_btn = 0;
const char *srcDomain = m_source.firstDomain().c_str();
while(1)
{
if(strlen(srcDomain) < 2)
break;
if(strrchr(srcDomain, '_') != NULL)
{
int srcBtnNumber = atoi(strrchr(srcDomain, '_') + 1);
if(srcBtnNumber > m_max_source_btn)
m_max_source_btn = srcBtnNumber;
}
srcDomain = m_source.nextDomain().c_str();
}
_addUserLabels(m_sourceLblUser, ARRAY_SIZE(m_sourceLblUser), "SOURCE"); _addUserLabels(m_sourceLblUser, ARRAY_SIZE(m_sourceLblUser), "SOURCE");
m_sourceBg = _texture("SOURCE/BG", "texture", theme.bg, false); m_sourceBg = _texture("SOURCE/BG", "texture", theme.bg, false);
m_sourceLblTitle = _addTitle("SOURCE/TITLE", theme.titleFont, L"", 0, 10, 640, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE); m_sourceLblTitle = _addTitle("SOURCE/TITLE", theme.titleFont, L"", 0, 10, 640, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE);
m_sourceLblNotice = _addLabel("SOURCE/NOTICE", theme.btnFont, L"", 20, 400, 600, 56, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_TOP);
m_sourceLblPage = _addLabel("SOURCE/PAGE_BTN", theme.btnFont, L"", 68, 400, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC); m_sourceLblPage = _addLabel("SOURCE/PAGE_BTN", theme.btnFont, L"", 68, 400, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC);
m_sourceBtnPageM = _addPicButton("SOURCE/PAGE_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 20, 400, 48, 48); m_sourceBtnPageM = _addPicButton("SOURCE/PAGE_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 20, 400, 48, 48);
m_sourceBtnPageP = _addPicButton("SOURCE/PAGE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 172, 400, 48, 48); m_sourceBtnPageP = _addPicButton("SOURCE/PAGE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 172, 400, 48, 48);
@ -751,7 +710,6 @@ void CMenu::_initSourceMenu()
_setHideAnim(m_sourceBtnSource[i], fmt("SOURCE/SOURCE_BTN_%i", i), 0, 0, -2.f, 0.f); _setHideAnim(m_sourceBtnSource[i], fmt("SOURCE/SOURCE_BTN_%i", i), 0, 0, -2.f, 0.f);
} }
_setHideAnim(m_sourceLblTitle, "SOURCE/TITLE", 0, 0, -2.f, 0.f); _setHideAnim(m_sourceLblTitle, "SOURCE/TITLE", 0, 0, -2.f, 0.f);
_setHideAnim(m_sourceLblNotice, "SOURCE/NOTICE", 0, 0, 1.f, 0.f);
_setHideAnim(m_sourceLblPage, "SOURCE/PAGE_BTN", 0, 0, 1.f, -1.f); _setHideAnim(m_sourceLblPage, "SOURCE/PAGE_BTN", 0, 0, 1.f, -1.f);
_setHideAnim(m_sourceBtnPageM, "SOURCE/PAGE_MINUS", 0, 0, 1.f, -1.f); _setHideAnim(m_sourceBtnPageM, "SOURCE/PAGE_MINUS", 0, 0, 1.f, -1.f);
_setHideAnim(m_sourceBtnPageP, "SOURCE/PAGE_PLUS", 0, 0, 1.f, -1.f); _setHideAnim(m_sourceBtnPageP, "SOURCE/PAGE_PLUS", 0, 0, 1.f, -1.f);
@ -765,7 +723,6 @@ void CMenu::_initSourceMenu()
void CMenu::_textSource(void) void CMenu::_textSource(void)
{ {
m_btnMgr.setText(m_sourceLblTitle, _t("stup1", L"Select Source")); m_btnMgr.setText(m_sourceLblTitle, _t("stup1", L"Select Source"));
m_btnMgr.setText(m_sourceLblNotice, _t("stup2", L"** DISABLED **"));
m_btnMgr.setText(m_sourceBtnBack, _t("cfg10", L"Back")); m_btnMgr.setText(m_sourceBtnBack, _t("cfg10", L"Back"));
m_btnMgr.setText(m_sourceBtnClear, _t("cat2", L"Clear")); m_btnMgr.setText(m_sourceBtnClear, _t("cat2", L"Clear"));
} }

View File

@ -493,14 +493,18 @@ bool CMenu::_wbfsOp(CMenu::WBFS_OP op)
m_cfg.setString(GC_DOMAIN, "current_item", cfPos); m_cfg.setString(GC_DOMAIN, "current_item", cfPos);
} }
if(upd_gc) if(upd_gc)
UpdateCache(COVERFLOW_GAMECUBE); //UpdateCache(COVERFLOW_GAMECUBE);
m_cfg.setBool(GC_DOMAIN, "update_cache", true);
if(upd_wii) if(upd_wii)
UpdateCache(COVERFLOW_WII); //UpdateCache(COVERFLOW_WII);
m_cfg.setBool(WII_DOMAIN, "update_cache", true);
if(upd_plgin) if(upd_plgin)
UpdateCache(COVERFLOW_PLUGIN); //UpdateCache(COVERFLOW_PLUGIN);
m_cfg.setBool(PLUGIN_DOMAIN, "update_cache", true);
if(upd_chan) if(upd_chan)
UpdateCache(COVERFLOW_CHANNEL); //UpdateCache(COVERFLOW_CHANNEL);
m_load_view = true; m_cfg.setBool(CHANNEL_DOMAIN, "update_cache", true);
m_refreshGameList = true;
/* restart inputs to resolve an issue */ /* restart inputs to resolve an issue */
Close_Inputs(); Close_Inputs();
Open_Inputs(); Open_Inputs();

View File

@ -70,46 +70,61 @@ cfgc5=Go
cfgc6=Horizontal offset cfgc6=Horizontal offset
cfgc7=Vertical offset cfgc7=Vertical offset
cfgc8=Startup Settings cfgc8=Startup Settings
cfgc9=Manage Languages cfgc9=WiiFlow Language
cfgd4=Path Manager cfgd4=Path Manager
cfgd5=Save favorite mode state cfgd5=Save favorite mode state
cfgd7=Show categories on boot cfgd7=Show categories on boot
cfgg1=Settings cfgg1=Settings
cfgg10=IOS cfgg10=IOS
cfgg12=Download cover cfgg11=
cfgg13=Download cfgg12=
cfgg13=
cfgg14=Patch video modes cfgg14=Patch video modes
cfgg15=Cheat Codes cfgg15=Cheat Codes
cfgg16=Select cfgg16=Select
cfgg17=Categories cfgg17=Categories
cfgg18=Hook Type cfgg18=Hook Type
cfgg19=
cfgg2=Video mode cfgg2=Video mode
cfgg20=
cfgg21=Return To Channel cfgg21=Return To Channel
cfgg22=Debugger cfgg22=Debugger
cfgg23=Downloading cheat file.... cfgg23=Downloading cheat file....
cfgg24=NAND Emulation cfgg24=NAND Emulation
cfgg25=Password incorrect cfgg25=Password incorrect
cfgg26=Disable IOS Reload block cfgg26=
cfgg27=Aspect Ratio cfgg27=Aspect Ratio
cfgg28=NMM cfgg28=
cfgg29=No DVD Patch cfgg29=
cfgg3=Language cfgg3=Language
cfgg30=Extract Save from NAND cfgg30=Extract Save from NAND
cfgg31=Extract cfgg31=Extract
cfgg32=Flash Save to NAND cfgg32=Flash Save to NAND
cfgg33=Flash cfgg33=Flash
cfgg34=Devolution Memcard Emulator cfgg34=
cfgg35=GameCube Loader cfgg35=GameCube Loader
cfgg36=Widescreen Patch cfgg36=Widescreen Patch
cfgg37=Boot Apploader cfgg37=Boot Apploader
cfgg38=Activity LED cfgg38=Activity LED
cfgg39=DM Screenshot Feature cfgg39=
cfgg40=Manage Cover and Banner cfgg40=Manage Cover and Banner
cfgg41=Manage cfgg41=Manage
cfgg42=USB-HID Controller
cfgg43=Native Control
cfgg44=Video Deflicker
cfgg45=Private Server
cfgg46=WiiU Widescreen
cfgg47=Emulated MemCard
cfgg48=EmuNAND not on USB1!
cfgg49=Neek2o Not Found!
cfgg50=No save to extract!
cfgg51=No save to flash to real NAND!
cfgg4=Patch country strings cfgg4=Patch country strings
cfgg5=Ocarina cfgg5=Ocarina
cfgg6=
cfgg7=Vipatch cfgg7=Vipatch
cfgg8=Back cfgg8=Back
cfgg9=
cfglng1=Manage Languages cfglng1=Manage Languages
cfglng2=Get Languages cfglng2=Get Languages
cfglng3=Select File cfglng3=Select File
@ -134,8 +149,9 @@ cfgne17=Total size: %uKB (%d blocks)
cfgne18=Listing game saves to extract... cfgne18=Listing game saves to extract...
cfgne19=Extraction finished! cfgne19=Extraction finished!
cfgne20=Extraction failed! cfgne20=Extraction failed!
cfgne22=Disable NAND Emulation cfgne21=
cfgne23=Welcome to WiiFlow. I have not found a valid NAND for NAND Emulation. Click Extract to extract your NAND, or click disable to disable NAND Emulation. cfgne22=
cfgne23=
cfgne24=Extract save cfgne24=Extract save
cfgne25=Create new save cfgne25=Create new save
cfgne26=A save file for this game was created on real NAND. Extract existing save file from real NAND or create new file for NAND Emulation? cfgne26=A save file for this game was created on real NAND. Extract existing save file from real NAND or create new file for NAND Emulation?
@ -143,7 +159,7 @@ cfgne27=Calculating space needed for extraction...
cfgne28=Game Save Flasher cfgne28=Game Save Flasher
cfgne29=Flashed: %d saves / %d files / %d folders cfgne29=Flashed: %d saves / %d files / %d folders
cfgne30=Flashing save files finished! cfgne30=Flashing save files finished!
cfgne31=Select Partition cfgne31=
cfgne32=Select Saves NAND cfgne32=Select Saves NAND
cfgne33=Saves NAND Emulation cfgne33=Saves NAND Emulation
cfgne34=Set cfgne34=Set
@ -166,12 +182,12 @@ cfgs2=GUI sound volume
cfgs3=Coverflow sound volume cfgs3=Coverflow sound volume
cfgs4=Game sound volume cfgs4=Game sound volume
cfgsm1=Source Menu Settings cfgsm1=Source Menu Settings
cfgsm2=Enable B To Source Menu
cfgsm3=Enable Sourceflow cfgsm3=Enable Sourceflow
cfgsm4=Sourceflow Smallbox cfgsm4=Sourceflow Smallbox
cfgsm5=Clear Sourceflow Cache cfgsm5=Clear Sourceflow Cache
cfgsm6=B On Mode To Source cfghb1=Homebrew Settings
cfgsm7=Manage Source Menu cfghb2=Coverflow Smallbox
cfghb3=Homebrew Partition
cheat1=Back cheat1=Back
cheat2=Apply cheat2=Apply
cheat3=Cheat file for game not found. cheat3=Cheat file for game not found.
@ -241,7 +257,7 @@ DMLprogP=PAL 480p
errboot1=No cIOS found!\ncIOS d2x 249 base 56 and 250 base 57 are enough for all your games. errboot1=No cIOS found!\ncIOS d2x 249 base 56 and 250 base 57 are enough for all your games.
errboot2=Could not find a device to save configuration files on! errboot2=Could not find a device to save configuration files on!
errboot3=Could not initialize the DIP module! errboot3=Could not initialize the DIP module!
errboot4=No available partitions found! errboot4=No apps/wiiflow directory found!
errboot5=data_on_usb=yes and no available usb partitions for data!\nUsing SD. errboot5=data_on_usb=yes and no available usb partitions for data!\nUsing SD.
errboot6=No available usb partitions for data and no SD inserted!\nExiting. errboot6=No available usb partitions for data and no SD inserted!\nExiting.
errgame1=Cannot find the game with ID: %s errgame1=Cannot find the game with ID: %s
@ -252,11 +268,13 @@ errgame6=Enabling emu after reload failed!
errgame7=WDVDGetCoverStatus Failed! errgame7=WDVDGetCoverStatus Failed!
errgame8=Please insert a game disc. errgame8=Please insert a game disc.
errgame9=This is not a Wii or GC disc errgame9=This is not a Wii or GC disc
errgame10=Set USB failed: %d
errgame11=GameCube Loader not found! Can't launch game. errgame11=GameCube Loader not found! Can't launch game.
errgame12=Nintendont not found! Can't launch GC Disc. errgame12=Nintendont not found! Can't launch GC Disc.
errgame13=EmuNAND for gamesave not found! Using real NAND. errgame13=EmuNAND for gamesave not found! Using real NAND.
errgame14=app_booter.bin not found!
errneek1=Cannot launch neek2o. Verify your neek2o setup errneek1=Cannot launch neek2o. Verify your neek2o setup
errsource1=Homebrew locked!
errsource2=Homebrew and multisource not allowed!
exit_to=Exit To exit_to=Exit To
ftp1=Start ftp1=Start
ftp2=Stop ftp2=Stop