mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2025-01-25 18:21:11 +01:00
-if you hold the b button for 3 seconds, it will now open up
the source menu -removed pressing b button on home icon to open source menu
This commit is contained in:
parent
3c826ad6e4
commit
149b4fb685
@ -44,6 +44,7 @@ public:
|
||||
~CMenu(void) {cleanup();}
|
||||
void init(void);
|
||||
void error(const wstringEx &msg);
|
||||
void exitHandler(void);
|
||||
int main(void);
|
||||
void cleanup(bool ios_reload = false);
|
||||
u32 m_current_view;
|
||||
@ -963,7 +964,7 @@ private:
|
||||
void _gameinfo(void);
|
||||
void _gameSettings(void);
|
||||
void _CheatSettings();
|
||||
void _Source();
|
||||
bool _Source();
|
||||
void _PluginSettings();
|
||||
void _CategorySettings(bool fromGameSet=false);
|
||||
//
|
||||
|
@ -212,6 +212,43 @@ void CMenu::LoadView(void)
|
||||
m_btnMgr.show(m_mainLblNotice);
|
||||
}
|
||||
|
||||
void CMenu::exitHandler(void)
|
||||
{
|
||||
gprintf("Exit WiiFlow called\n");
|
||||
bool exitSet = false;
|
||||
if(!m_locked && !m_disable_exit)
|
||||
{
|
||||
exitSet = true;
|
||||
if(BTN_PLUS_HELD)
|
||||
Sys_ExitTo(EXIT_TO_HBC);
|
||||
else if(BTN_MINUS_HELD)
|
||||
Sys_ExitTo(EXIT_TO_MENU);
|
||||
else if(BTN_1_HELD)
|
||||
Sys_ExitTo(EXIT_TO_PRIILOADER);
|
||||
else if(BTN_2_HELD) //Check that the files are there, or ios will hang.
|
||||
{
|
||||
struct stat dummy;
|
||||
if(DeviceHandler::Instance()->IsInserted(SD) &&
|
||||
stat(fmt("%s:/bootmii/armboot.bin", DeviceName[SD]), &dummy) == 0 &&
|
||||
stat(fmt("%s:/bootmii/ppcboot.elf", DeviceName[SD]), &dummy) == 0)
|
||||
{
|
||||
Sys_ExitTo(EXIT_TO_BOOTMII);
|
||||
}
|
||||
else
|
||||
Sys_ExitTo(EXIT_TO_HBC);
|
||||
}
|
||||
else
|
||||
exitSet = false;
|
||||
}
|
||||
m_reload = (BTN_B_HELD || m_disable_exit);
|
||||
if(!exitSet && !m_reload)
|
||||
{
|
||||
// Mark exiting to prevent soundhandler from restarting
|
||||
extern bool exiting;
|
||||
exiting = true;
|
||||
}
|
||||
}
|
||||
|
||||
int CMenu::main(void)
|
||||
{
|
||||
wstringEx curLetter;
|
||||
@ -271,10 +308,12 @@ int CMenu::main(void)
|
||||
unsigned int stack_size = (unsigned int)32768;
|
||||
SmartBuf coverstatus_stack = smartMem2Alloc(stack_size);
|
||||
LWP_CreateThread(&coverStatus, (void *(*)(void *))CMenu::GetCoverStatusAsync, (void *)this, coverstatus_stack.get(), stack_size, 40);
|
||||
|
||||
time_t SourceMenuTimeout = 0;
|
||||
|
||||
while(true)
|
||||
{
|
||||
_mainLoopCommon(true);
|
||||
|
||||
if(m_initialCoverStatusComplete)
|
||||
{
|
||||
LWP_JoinThread(coverStatus, NULL);
|
||||
@ -283,42 +322,7 @@ int CMenu::main(void)
|
||||
coverstatus_stack.release();
|
||||
WDVD_GetCoverStatus(&disc_check);
|
||||
}
|
||||
|
||||
//Check for exit or reload request
|
||||
if (BTN_HOME_PRESSED)
|
||||
{
|
||||
gprintf("Home pressed, quit\n");
|
||||
bool exitSet = false;
|
||||
if(!m_locked && !m_disable_exit)
|
||||
{
|
||||
exitSet = true;
|
||||
|
||||
if(BTN_PLUS_HELD) Sys_ExitTo(EXIT_TO_HBC);
|
||||
else if(BTN_MINUS_HELD) Sys_ExitTo(EXIT_TO_MENU);
|
||||
else if(BTN_1_HELD) Sys_ExitTo(EXIT_TO_PRIILOADER);
|
||||
else if(BTN_2_HELD) //Check that the files are there, or ios will hang.
|
||||
{
|
||||
struct stat dummy;
|
||||
if(DeviceHandler::Instance()->IsInserted(SD) &&
|
||||
stat(fmt("%s:/bootmii/armboot.bin", DeviceName[SD]), &dummy) == 0 &&
|
||||
stat(fmt("%s:/bootmii/ppcboot.elf", DeviceName[SD]), &dummy) == 0)
|
||||
Sys_ExitTo(EXIT_TO_BOOTMII);
|
||||
else Sys_ExitTo(EXIT_TO_HBC);
|
||||
}
|
||||
else
|
||||
exitSet = false;
|
||||
}
|
||||
m_reload = (BTN_B_HELD || m_disable_exit);
|
||||
if (!exitSet && !m_reload)
|
||||
{
|
||||
// Mark exiting to prevent soundhandler from restarting
|
||||
extern bool exiting;
|
||||
exiting = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ((BTN_UP_PRESSED || BTN_DOWN_PRESSED || BTN_LEFT_PRESSED || BTN_RIGHT_PRESSED) && dpad_mode && (m_btnMgr.selected(m_mainBtnChannel) || m_btnMgr.selected(m_mainBtnUsb) || m_btnMgr.selected(m_mainBtnDML) || m_btnMgr.selected(m_mainBtnHomebrew) || m_btnMgr.selected(m_mainBtnEmu)))
|
||||
if(dpad_mode && (BTN_UP_PRESSED || BTN_DOWN_PRESSED || BTN_LEFT_PRESSED || BTN_RIGHT_PRESSED) && (m_btnMgr.selected(m_mainBtnChannel) || m_btnMgr.selected(m_mainBtnUsb) || m_btnMgr.selected(m_mainBtnDML) || m_btnMgr.selected(m_mainBtnHomebrew) || m_btnMgr.selected(m_mainBtnEmu)))
|
||||
{
|
||||
u32 lastView = m_current_view;
|
||||
if(BTN_UP_PRESSED)
|
||||
@ -330,240 +334,15 @@ int CMenu::main(void)
|
||||
else if(BTN_RIGHT_PRESSED && show_channel)
|
||||
m_current_view = COVERFLOW_CHANNEL;
|
||||
if(lastView == m_current_view)
|
||||
{
|
||||
m_current_view = COVERFLOW_HOMEBREW;
|
||||
}
|
||||
LoadView();
|
||||
continue;
|
||||
}
|
||||
m_btnMgr.noClick(true);
|
||||
if (!BTN_B_HELD && (BTN_UP_REPEAT || RIGHT_STICK_UP))
|
||||
m_cf.up();
|
||||
if ((!BTN_B_HELD && (BTN_RIGHT_REPEAT || RIGHT_STICK_RIGHT)) || WROLL_RIGHT)
|
||||
m_cf.right();
|
||||
if (!BTN_B_HELD && (BTN_DOWN_REPEAT || RIGHT_STICK_DOWN))
|
||||
m_cf.down();
|
||||
if ((!BTN_B_HELD && (BTN_LEFT_REPEAT || RIGHT_STICK_LEFT)) || WROLL_LEFT)
|
||||
m_cf.left();
|
||||
m_btnMgr.noClick(false);
|
||||
//CF Layout select
|
||||
if (!BTN_B_HELD && (BTN_1_PRESSED || BTN_2_PRESSED))
|
||||
if(BTN_HOME_PRESSED)
|
||||
{
|
||||
m_btnMgr.noClick(true);
|
||||
if (!m_btnMgr.selected(m_mainBtnQuit))
|
||||
{
|
||||
const char *domain = _domainFromView();
|
||||
s8 direction = BTN_1_PRESSED ? 1 : -1;
|
||||
int cfVersion = 1+loopNum((m_cfg.getInt(domain, "last_cf_mode", 1)-1) + direction, m_numCFVersions);
|
||||
_loadCFLayout(cfVersion);
|
||||
m_cf.applySettings();
|
||||
m_cfg.setInt(domain, "last_cf_mode", cfVersion);
|
||||
exitHandler();
|
||||
break;
|
||||
}
|
||||
m_btnMgr.noClick(false);
|
||||
}
|
||||
//Change Songs or search by pages
|
||||
else if (!BTN_B_HELD && BTN_MINUS_PRESSED && b_lr_mode) MusicPlayer::Instance()->Previous();
|
||||
else if (!BTN_B_HELD && BTN_MINUS_PRESSED && !b_lr_mode) m_cf.pageUp();
|
||||
else if (!BTN_B_HELD && BTN_PLUS_PRESSED && b_lr_mode) MusicPlayer::Instance()->Next();
|
||||
else if (!BTN_B_HELD && BTN_PLUS_PRESSED && !b_lr_mode) m_cf.pageDown();
|
||||
else if (BTN_B_HELD)
|
||||
{
|
||||
const char *domain = _domainFromView();
|
||||
|
||||
//Search by Alphabet
|
||||
if (BTN_DOWN_PRESSED || BTN_UP_PRESSED)
|
||||
{
|
||||
int sorting = m_cfg.getInt(domain, "sort", SORT_ALPHA);
|
||||
if (sorting != SORT_ALPHA && sorting != SORT_PLAYERS && sorting != SORT_WIFIPLAYERS && sorting != SORT_GAMEID)
|
||||
{
|
||||
m_cf.setSorting((Sorting)SORT_ALPHA);
|
||||
m_cfg.setInt(domain, "sort", SORT_ALPHA);
|
||||
}
|
||||
wchar_t c[2] = {0, 0};
|
||||
BTN_UP_PRESSED ? m_cf.prevLetter(c) : m_cf.nextLetter(c);
|
||||
|
||||
curLetter.clear();
|
||||
curLetter = wstringEx(c);
|
||||
|
||||
m_showtimer = 60;
|
||||
if(sorting == SORT_ALPHA)
|
||||
{
|
||||
m_btnMgr.setText(m_mainLblLetter, curLetter);
|
||||
m_btnMgr.show(m_mainLblLetter);
|
||||
}
|
||||
else
|
||||
{
|
||||
curLetter = _getNoticeTranslation(sorting, curLetter);
|
||||
|
||||
m_btnMgr.setText(m_mainLblNotice, curLetter);
|
||||
m_btnMgr.show(m_mainLblNotice);
|
||||
}
|
||||
}
|
||||
//Search by pages or change songs
|
||||
else if (BTN_LEFT_PRESSED && b_lr_mode) m_cf.pageUp();
|
||||
else if (BTN_LEFT_PRESSED && !b_lr_mode) MusicPlayer::Instance()->Previous();
|
||||
else if (BTN_RIGHT_PRESSED && b_lr_mode) m_cf.pageDown();
|
||||
else if (BTN_RIGHT_PRESSED && !b_lr_mode) MusicPlayer::Instance()->Next();
|
||||
//Sorting Selection
|
||||
else if (BTN_PLUS_PRESSED && !m_locked)
|
||||
{
|
||||
u32 sort = 0;
|
||||
sort = loopNum((m_cfg.getInt(domain, "sort", 0)) + 1, SORT_MAX - 1);
|
||||
m_cf.setSorting((Sorting)sort);
|
||||
m_cfg.setInt(domain, "sort", sort);
|
||||
wstringEx curSort ;
|
||||
if (sort == SORT_ALPHA)
|
||||
curSort = m_loc.getWString(m_curLanguage, "alphabetically", L"Alphabetically");
|
||||
else if (sort == SORT_PLAYCOUNT)
|
||||
curSort = m_loc.getWString(m_curLanguage, "byplaycount", L"By Play Count");
|
||||
else if (sort == SORT_LASTPLAYED)
|
||||
curSort = m_loc.getWString(m_curLanguage, "bylastplayed", L"By Last Played");
|
||||
else if (sort == SORT_GAMEID)
|
||||
curSort = m_loc.getWString(m_curLanguage, "bygameid", L"By Game I.D.");
|
||||
else if (sort == SORT_ESRB)
|
||||
curSort = m_loc.getWString(m_curLanguage, "byesrb", L"By ESRB");
|
||||
else if (sort == SORT_WIFIPLAYERS)
|
||||
curSort = m_loc.getWString(m_curLanguage, "bywifiplayers", L"By Wifi Players");
|
||||
else if (sort == SORT_PLAYERS)
|
||||
curSort = m_loc.getWString(m_curLanguage, "byplayers", L"By Players");
|
||||
else if (sort == SORT_CONTROLLERS)
|
||||
curSort = m_loc.getWString(m_curLanguage, "bycontrollers", L"By Controllers");
|
||||
|
||||
m_showtimer=60;
|
||||
m_btnMgr.setText(m_mainLblNotice, curSort);
|
||||
m_btnMgr.show(m_mainLblNotice);
|
||||
}
|
||||
//Partition Selection
|
||||
else if (BTN_MINUS_PRESSED && !m_locked)
|
||||
{
|
||||
bool block = m_current_view == COVERFLOW_CHANNEL && m_cfg.getBool("NAND", "disable", true);
|
||||
char *partition;
|
||||
if(!block)
|
||||
{
|
||||
_showWaitMessage();
|
||||
_hideMain();
|
||||
|
||||
Nand::Instance()->Disable_Emu();
|
||||
bool isD2XnewerThanV6 = false;
|
||||
iosinfo_t * iosInfo = cIOSInfo::GetInfo(mainIOS);
|
||||
if (iosInfo->version > 6)
|
||||
isD2XnewerThanV6 = true;
|
||||
if(m_current_view == COVERFLOW_CHANNEL && m_cfg.getInt("NAND", "emulation", 0) > 0)
|
||||
Nand::Instance()->Enable_Emu();
|
||||
u8 limiter = 0;
|
||||
currentPartition = loopNum(currentPartition + 1, (int)USB8);
|
||||
while(!DeviceHandler::Instance()->IsInserted(currentPartition) ||
|
||||
((m_current_view == COVERFLOW_CHANNEL || m_current_view == COVERFLOW_EMU) && (DeviceHandler::Instance()->GetFSType(currentPartition) != PART_FS_FAT ||
|
||||
(!isD2XnewerThanV6 && DeviceHandler::Instance()->PathToDriveType(m_appDir.c_str()) == currentPartition) ||
|
||||
(!isD2XnewerThanV6 && DeviceHandler::Instance()->PathToDriveType(m_dataDir.c_str()) == currentPartition))) ||
|
||||
((m_current_view == COVERFLOW_HOMEBREW || m_current_view == COVERFLOW_DML) && DeviceHandler::Instance()->GetFSType(currentPartition) == PART_FS_WBFS))
|
||||
{
|
||||
currentPartition = loopNum(currentPartition + 1, (int)USB8);
|
||||
if(limiter > 10) break;
|
||||
limiter++;
|
||||
}
|
||||
|
||||
partition = (char *)DeviceName[currentPartition];
|
||||
gprintf("Setting Emu NAND to Partition: %i\n",currentPartition);
|
||||
m_cfg.setInt(_domainFromView(), "partition", currentPartition);
|
||||
|
||||
}
|
||||
else
|
||||
partition = (char *)"NAND";
|
||||
|
||||
for(u8 i = 0; strncmp((const char *)&partition[i], "\0", 1) != 0; i++)
|
||||
partition[i] = toupper(partition[i]);
|
||||
|
||||
gprintf("Next item: %s\n", partition);
|
||||
|
||||
m_showtimer=60;
|
||||
char gui_name[20];
|
||||
snprintf(gui_name, sizeof(gui_name), "%s [%s]", _domainFromView(),partition);
|
||||
m_btnMgr.setText(m_mainLblNotice, (string)gui_name);
|
||||
m_btnMgr.show(m_mainLblNotice);
|
||||
|
||||
if(!block)
|
||||
{
|
||||
_loadList();
|
||||
_showMain();
|
||||
_initCF();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (BTN_B_PRESSED)
|
||||
{
|
||||
if (m_btnMgr.selected(m_mainBtnQuit))
|
||||
{
|
||||
_hideMain(true);
|
||||
_Source();
|
||||
LoadView();
|
||||
continue;
|
||||
}
|
||||
//Events to Show Categories
|
||||
if (m_btnMgr.selected(m_mainBtnFavoritesOn) || m_btnMgr.selected(m_mainBtnFavoritesOff))
|
||||
{
|
||||
// Event handler to show categories for selection
|
||||
_hideMain();
|
||||
_CategorySettings();
|
||||
_showMain();
|
||||
_initCF();
|
||||
}
|
||||
//Events to Switch off/on nand emu
|
||||
else if (m_btnMgr.selected(m_mainBtnChannel) || m_btnMgr.selected(m_mainBtnUsb) || m_btnMgr.selected(m_mainBtnDML)|| m_btnMgr.selected(m_mainBtnEmu) || m_btnMgr.selected(m_mainBtnHomebrew))
|
||||
{
|
||||
m_cfg.setBool("NAND", "disable", !m_cfg.getBool("NAND", "disable", true));
|
||||
gprintf("EmuNand is %s\n", m_cfg.getBool("NAND", "disable", true) ? "Disabled" : "Enabled");
|
||||
m_current_view = COVERFLOW_CHANNEL;
|
||||
LoadView();
|
||||
}
|
||||
else if (m_btnMgr.selected(m_mainBtnNext) || m_btnMgr.selected(m_mainBtnPrev))
|
||||
{
|
||||
const char *domain = _domainFromView();
|
||||
int sorting = m_cfg.getInt(domain, "sort", SORT_ALPHA);
|
||||
if (sorting != SORT_ALPHA && sorting != SORT_PLAYERS && sorting != SORT_WIFIPLAYERS && sorting != SORT_GAMEID)
|
||||
{
|
||||
m_cf.setSorting((Sorting)SORT_ALPHA);
|
||||
m_cfg.setInt(domain, "sort", SORT_ALPHA);
|
||||
}
|
||||
wchar_t c[2] = {0, 0};
|
||||
m_btnMgr.selected(m_mainBtnPrev) ? m_cf.prevLetter(c) : m_cf.nextLetter(c);
|
||||
m_showtimer = 60;
|
||||
|
||||
curLetter.clear();
|
||||
curLetter = wstringEx(c);
|
||||
|
||||
if(sorting == SORT_ALPHA)
|
||||
{
|
||||
m_btnMgr.setText(m_mainLblLetter, curLetter);
|
||||
m_btnMgr.show(m_mainLblLetter);
|
||||
}
|
||||
else
|
||||
{
|
||||
curLetter = _getNoticeTranslation(sorting, curLetter);
|
||||
|
||||
m_btnMgr.setText(m_mainLblNotice, curLetter);
|
||||
m_btnMgr.show(m_mainLblNotice);
|
||||
}
|
||||
}
|
||||
else if(m_btnMgr.selected(m_mainBtnConfig))
|
||||
{
|
||||
m_gameList.SetLanguage(m_loc.getString(m_curLanguage, "gametdb_code", "EN").c_str());
|
||||
|
||||
UpdateCache(m_current_view);
|
||||
LoadView();
|
||||
}
|
||||
}
|
||||
else if (done==0 && m_cat.getBool("GENERAL", "category_on_start", false))
|
||||
{
|
||||
done = 1; //set done so it doesnt keep doing it
|
||||
// show categories menu
|
||||
_hideMain();
|
||||
_CategorySettings();
|
||||
_showMain();
|
||||
m_curGameId = m_cf.getId();
|
||||
_initCF();
|
||||
}
|
||||
//Handling input when other gui buttons are selected
|
||||
else if(BTN_A_PRESSED)
|
||||
{
|
||||
if(m_btnMgr.selected(m_mainBtnPrev))
|
||||
@ -572,22 +351,7 @@ int CMenu::main(void)
|
||||
m_cf.pageDown();
|
||||
else if(m_btnMgr.selected(m_mainBtnQuit))
|
||||
{
|
||||
if(!m_locked && !m_disable_exit)
|
||||
{
|
||||
struct stat dummy;
|
||||
if(BTN_PLUS_HELD) Sys_ExitTo(EXIT_TO_HBC);
|
||||
else if(BTN_MINUS_HELD) Sys_ExitTo(EXIT_TO_MENU);
|
||||
else if(BTN_1_HELD) Sys_ExitTo(EXIT_TO_PRIILOADER);
|
||||
else if(BTN_2_HELD) //Check that the files are there, or ios will hang.
|
||||
{
|
||||
if(DeviceHandler::Instance()->IsInserted(SD) &&
|
||||
stat(fmt("%s:/bootmii/armboot.bin", DeviceName[SD]), &dummy) == 0 &&
|
||||
stat(fmt("%s:/bootmii/ppcboot.elf", DeviceName[SD]), &dummy) == 0)
|
||||
Sys_ExitTo(EXIT_TO_BOOTMII);
|
||||
else Sys_ExitTo(EXIT_TO_HBC);
|
||||
}
|
||||
}
|
||||
m_reload = (BTN_B_HELD || m_disable_exit);
|
||||
exitHandler();
|
||||
break;
|
||||
}
|
||||
else if(m_btnMgr.selected(m_mainBtnChannel) || m_btnMgr.selected(m_mainBtnUsb) || m_btnMgr.selected(m_mainBtnDML) || m_btnMgr.selected(m_mainBtnHomebrew) || m_btnMgr.selected(m_mainBtnEmu))
|
||||
@ -665,26 +429,273 @@ int CMenu::main(void)
|
||||
m_curGameId = m_cf.getId();
|
||||
_initCF();
|
||||
}
|
||||
else if (!m_cf.empty())
|
||||
{
|
||||
if (m_cf.select())
|
||||
else if(!m_cf.empty() && m_cf.select())
|
||||
{
|
||||
_hideMain();
|
||||
_game(BTN_B_HELD);
|
||||
if(m_exit) break;
|
||||
if(m_exit)
|
||||
break;
|
||||
m_cf.cancel();
|
||||
_showMain();
|
||||
}
|
||||
}
|
||||
else if(BTN_B_PRESSED)
|
||||
{
|
||||
//Events to Show Categories
|
||||
if(m_btnMgr.selected(m_mainBtnFavoritesOn) || m_btnMgr.selected(m_mainBtnFavoritesOff))
|
||||
{
|
||||
// Event handler to show categories for selection
|
||||
_hideMain();
|
||||
_CategorySettings();
|
||||
_showMain();
|
||||
_initCF();
|
||||
}
|
||||
if(use_grab) _getGrabStatus();
|
||||
//Events to Switch off/on nand emu
|
||||
else if(m_btnMgr.selected(m_mainBtnChannel) || m_btnMgr.selected(m_mainBtnUsb) || m_btnMgr.selected(m_mainBtnDML)|| m_btnMgr.selected(m_mainBtnEmu) || m_btnMgr.selected(m_mainBtnHomebrew))
|
||||
{
|
||||
m_cfg.setBool("NAND", "disable", !m_cfg.getBool("NAND", "disable", true));
|
||||
gprintf("EmuNand is %s\n", m_cfg.getBool("NAND", "disable", true) ? "Disabled" : "Enabled");
|
||||
m_current_view = COVERFLOW_CHANNEL;
|
||||
LoadView();
|
||||
}
|
||||
else if(m_btnMgr.selected(m_mainBtnNext) || m_btnMgr.selected(m_mainBtnPrev))
|
||||
{
|
||||
const char *domain = _domainFromView();
|
||||
int sorting = m_cfg.getInt(domain, "sort", SORT_ALPHA);
|
||||
if (sorting != SORT_ALPHA && sorting != SORT_PLAYERS && sorting != SORT_WIFIPLAYERS && sorting != SORT_GAMEID)
|
||||
{
|
||||
m_cf.setSorting((Sorting)SORT_ALPHA);
|
||||
m_cfg.setInt(domain, "sort", SORT_ALPHA);
|
||||
}
|
||||
wchar_t c[2] = {0, 0};
|
||||
m_btnMgr.selected(m_mainBtnPrev) ? m_cf.prevLetter(c) : m_cf.nextLetter(c);
|
||||
m_showtimer = 60;
|
||||
curLetter.clear();
|
||||
curLetter = wstringEx(c);
|
||||
|
||||
if(sorting == SORT_ALPHA)
|
||||
{
|
||||
m_btnMgr.setText(m_mainLblLetter, curLetter);
|
||||
m_btnMgr.show(m_mainLblLetter);
|
||||
}
|
||||
else
|
||||
{
|
||||
curLetter = _getNoticeTranslation(sorting, curLetter);
|
||||
m_btnMgr.setText(m_mainLblNotice, curLetter);
|
||||
m_btnMgr.show(m_mainLblNotice);
|
||||
}
|
||||
}
|
||||
else if(m_btnMgr.selected(m_mainBtnConfig))
|
||||
{
|
||||
m_gameList.SetLanguage(m_loc.getString(m_curLanguage, "gametdb_code", "EN").c_str());
|
||||
UpdateCache(m_current_view);
|
||||
LoadView();
|
||||
}
|
||||
}
|
||||
|
||||
if(!BTN_B_HELD)
|
||||
{
|
||||
SourceMenuTimeout = 0;
|
||||
if(BTN_UP_REPEAT || RIGHT_STICK_UP)
|
||||
m_cf.up();
|
||||
else if((BTN_RIGHT_REPEAT || RIGHT_STICK_RIGHT) || WROLL_RIGHT)
|
||||
m_cf.right();
|
||||
else if(BTN_DOWN_REPEAT || RIGHT_STICK_DOWN)
|
||||
m_cf.down();
|
||||
else if((BTN_LEFT_REPEAT || RIGHT_STICK_LEFT) || WROLL_LEFT)
|
||||
m_cf.left();
|
||||
else if(BTN_1_PRESSED || BTN_2_PRESSED)
|
||||
{
|
||||
if (!m_btnMgr.selected(m_mainBtnQuit))
|
||||
{
|
||||
const char *domain = _domainFromView();
|
||||
s8 direction = BTN_1_PRESSED ? 1 : -1;
|
||||
int cfVersion = 1+loopNum((m_cfg.getInt(domain, "last_cf_mode", 1)-1) + direction, m_numCFVersions);
|
||||
_loadCFLayout(cfVersion);
|
||||
m_cf.applySettings();
|
||||
m_cfg.setInt(domain, "last_cf_mode", cfVersion);
|
||||
}
|
||||
}
|
||||
else if(BTN_MINUS_PRESSED)
|
||||
{
|
||||
if(b_lr_mode)
|
||||
MusicPlayer::Instance()->Previous();
|
||||
else
|
||||
m_cf.pageUp();
|
||||
}
|
||||
else if(BTN_PLUS_PRESSED)
|
||||
{
|
||||
if(b_lr_mode)
|
||||
MusicPlayer::Instance()->Next();
|
||||
else
|
||||
m_cf.pageDown();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *domain = _domainFromView();
|
||||
//Search by Alphabet
|
||||
if(BTN_DOWN_PRESSED || BTN_UP_PRESSED)
|
||||
{
|
||||
SourceMenuTimeout = 0;
|
||||
int sorting = m_cfg.getInt(domain, "sort", SORT_ALPHA);
|
||||
if(sorting != SORT_ALPHA && sorting != SORT_PLAYERS && sorting != SORT_WIFIPLAYERS && sorting != SORT_GAMEID)
|
||||
{
|
||||
m_cf.setSorting((Sorting)SORT_ALPHA);
|
||||
m_cfg.setInt(domain, "sort", SORT_ALPHA);
|
||||
}
|
||||
wchar_t c[2] = {0, 0};
|
||||
BTN_UP_PRESSED ? m_cf.prevLetter(c) : m_cf.nextLetter(c);
|
||||
|
||||
curLetter.clear();
|
||||
curLetter = wstringEx(c);
|
||||
|
||||
m_showtimer = 60;
|
||||
if(sorting == SORT_ALPHA)
|
||||
{
|
||||
m_btnMgr.setText(m_mainLblLetter, curLetter);
|
||||
m_btnMgr.show(m_mainLblLetter);
|
||||
}
|
||||
else
|
||||
{
|
||||
curLetter = _getNoticeTranslation(sorting, curLetter);
|
||||
m_btnMgr.setText(m_mainLblNotice, curLetter);
|
||||
m_btnMgr.show(m_mainLblNotice);
|
||||
}
|
||||
}
|
||||
else if(BTN_LEFT_PRESSED)
|
||||
{
|
||||
SourceMenuTimeout = 0;
|
||||
if(b_lr_mode)
|
||||
m_cf.pageUp();
|
||||
else
|
||||
MusicPlayer::Instance()->Previous();
|
||||
}
|
||||
else if(BTN_RIGHT_PRESSED)
|
||||
{
|
||||
SourceMenuTimeout = 0;
|
||||
if(b_lr_mode)
|
||||
m_cf.pageDown();
|
||||
else
|
||||
MusicPlayer::Instance()->Next();
|
||||
}
|
||||
else if(BTN_PLUS_PRESSED && !m_locked)
|
||||
{
|
||||
SourceMenuTimeout = 0;
|
||||
u32 sort = 0;
|
||||
sort = loopNum((m_cfg.getInt(domain, "sort", 0)) + 1, SORT_MAX - 1);
|
||||
m_cf.setSorting((Sorting)sort);
|
||||
m_cfg.setInt(domain, "sort", sort);
|
||||
wstringEx curSort ;
|
||||
if(sort == SORT_ALPHA)
|
||||
curSort = m_loc.getWString(m_curLanguage, "alphabetically", L"Alphabetically");
|
||||
else if(sort == SORT_PLAYCOUNT)
|
||||
curSort = m_loc.getWString(m_curLanguage, "byplaycount", L"By Play Count");
|
||||
else if(sort == SORT_LASTPLAYED)
|
||||
curSort = m_loc.getWString(m_curLanguage, "bylastplayed", L"By Last Played");
|
||||
else if(sort == SORT_GAMEID)
|
||||
curSort = m_loc.getWString(m_curLanguage, "bygameid", L"By Game I.D.");
|
||||
else if(sort == SORT_ESRB)
|
||||
curSort = m_loc.getWString(m_curLanguage, "byesrb", L"By ESRB");
|
||||
else if(sort == SORT_WIFIPLAYERS)
|
||||
curSort = m_loc.getWString(m_curLanguage, "bywifiplayers", L"By Wifi Players");
|
||||
else if(sort == SORT_PLAYERS)
|
||||
curSort = m_loc.getWString(m_curLanguage, "byplayers", L"By Players");
|
||||
else if(sort == SORT_CONTROLLERS)
|
||||
curSort = m_loc.getWString(m_curLanguage, "bycontrollers", L"By Controllers");
|
||||
m_showtimer=60;
|
||||
m_btnMgr.setText(m_mainLblNotice, curSort);
|
||||
m_btnMgr.show(m_mainLblNotice);
|
||||
}
|
||||
else if(BTN_MINUS_PRESSED && !m_locked)
|
||||
{
|
||||
SourceMenuTimeout = 0;
|
||||
bool block = m_current_view == COVERFLOW_CHANNEL && m_cfg.getBool("NAND", "disable", true);
|
||||
char *partition;
|
||||
if(!block)
|
||||
{
|
||||
_showWaitMessage();
|
||||
_hideMain();
|
||||
Nand::Instance()->Disable_Emu();
|
||||
bool isD2XnewerThanV6 = false;
|
||||
iosinfo_t * iosInfo = cIOSInfo::GetInfo(mainIOS);
|
||||
if (iosInfo->version > 6)
|
||||
isD2XnewerThanV6 = true;
|
||||
if(m_current_view == COVERFLOW_CHANNEL && m_cfg.getInt("NAND", "emulation", 0))
|
||||
Nand::Instance()->Enable_Emu();
|
||||
u8 limiter = 0;
|
||||
currentPartition = loopNum(currentPartition + 1, (int)USB8);
|
||||
while(!DeviceHandler::Instance()->IsInserted(currentPartition) ||
|
||||
((m_current_view == COVERFLOW_CHANNEL || m_current_view == COVERFLOW_EMU) && (DeviceHandler::Instance()->GetFSType(currentPartition) != PART_FS_FAT ||
|
||||
(!isD2XnewerThanV6 && DeviceHandler::Instance()->PathToDriveType(m_appDir.c_str()) == currentPartition) ||
|
||||
(!isD2XnewerThanV6 && DeviceHandler::Instance()->PathToDriveType(m_dataDir.c_str()) == currentPartition))) ||
|
||||
((m_current_view == COVERFLOW_HOMEBREW || m_current_view == COVERFLOW_DML) && DeviceHandler::Instance()->GetFSType(currentPartition) == PART_FS_WBFS))
|
||||
{
|
||||
currentPartition = loopNum(currentPartition + 1, (int)USB8);
|
||||
if(limiter > 10) break;
|
||||
limiter++;
|
||||
}
|
||||
partition = (char *)DeviceName[currentPartition];
|
||||
gprintf("Setting Emu NAND to Partition: %i\n",currentPartition);
|
||||
m_cfg.setInt(_domainFromView(), "partition", currentPartition);
|
||||
}
|
||||
else
|
||||
partition = (char *)"NAND";
|
||||
|
||||
for(u8 i = 0; strncmp((const char *)&partition[i], "\0", 1) != 0; i++)
|
||||
partition[i] = toupper(partition[i]);
|
||||
|
||||
gprintf("Next item: %s\n", partition);
|
||||
|
||||
m_showtimer=60;
|
||||
char gui_name[20];
|
||||
snprintf(gui_name, sizeof(gui_name), "%s [%s]", _domainFromView(),partition);
|
||||
m_btnMgr.setText(m_mainLblNotice, (string)gui_name);
|
||||
m_btnMgr.show(m_mainLblNotice);
|
||||
if(!block)
|
||||
{
|
||||
_loadList();
|
||||
_showMain();
|
||||
_initCF();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!SourceMenuTimeout)
|
||||
SourceMenuTimeout = time(0);
|
||||
else if(time(0) - SourceMenuTimeout > 1) //Source Menu requested
|
||||
{
|
||||
SourceMenuTimeout = 0;
|
||||
_hideMain();
|
||||
if(!_Source()) //Different source selected
|
||||
LoadView();
|
||||
else
|
||||
_showMain();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(done==0 && m_cat.getBool("GENERAL", "category_on_start", false))
|
||||
{
|
||||
done = 1; //set done so it doesnt keep doing it
|
||||
// show categories menu
|
||||
_hideMain();
|
||||
_CategorySettings();
|
||||
_showMain();
|
||||
m_curGameId = m_cf.getId();
|
||||
_initCF();
|
||||
}
|
||||
if(use_grab)
|
||||
_getGrabStatus();
|
||||
if(m_showtimer > 0)
|
||||
{
|
||||
if(--m_showtimer == 0)
|
||||
{
|
||||
m_btnMgr.hide(m_mainLblLetter);
|
||||
m_btnMgr.hide(m_mainLblNotice);
|
||||
}
|
||||
}
|
||||
//zones, showing and hiding buttons
|
||||
if(!m_gameList.empty() && m_show_zone_prev)
|
||||
m_btnMgr.show(m_mainBtnPrev);
|
||||
@ -793,6 +804,7 @@ int CMenu::main(void)
|
||||
m_cf.mouse(m_vid, chan, -1, -1);
|
||||
}
|
||||
}
|
||||
|
||||
gprintf("Saving configuration files\n");
|
||||
m_cfg.save();
|
||||
m_cat.save();
|
||||
|
@ -94,7 +94,7 @@ void CMenu::_showSourceNotice(void)
|
||||
m_btnMgr.show(m_sourceLblNotice);
|
||||
}
|
||||
|
||||
void CMenu::_Source()
|
||||
bool CMenu::_Source()
|
||||
{
|
||||
DIR *pdir;
|
||||
struct dirent *pent;
|
||||
@ -104,6 +104,7 @@ void CMenu::_Source()
|
||||
pdir = opendir(m_pluginsDir.c_str());
|
||||
Config m_plugin_cfg;
|
||||
u8 i = 0;
|
||||
bool back = false;
|
||||
|
||||
while((pent = readdir(pdir)) != NULL)
|
||||
{
|
||||
@ -142,6 +143,7 @@ void CMenu::_Source()
|
||||
_mainLoopCommon();
|
||||
if (BTN_HOME_PRESSED || BTN_B_PRESSED)
|
||||
{
|
||||
back = true;
|
||||
break;
|
||||
}
|
||||
else if(BTN_UP_PRESSED)
|
||||
@ -165,7 +167,10 @@ void CMenu::_Source()
|
||||
if(BTN_A_PRESSED)
|
||||
{
|
||||
if(m_btnMgr.selected(m_sourceBtnBack))
|
||||
{
|
||||
back = true;
|
||||
break;
|
||||
}
|
||||
for(int i = 0; i < 36; ++i)
|
||||
{
|
||||
if(m_btnMgr.selected(m_sourceBtnSource[i]))
|
||||
@ -266,15 +271,16 @@ void CMenu::_Source()
|
||||
}
|
||||
}
|
||||
if(imgSelected)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(m_showtimer > 0)
|
||||
{
|
||||
if(--m_showtimer == 0)
|
||||
m_btnMgr.hide(m_sourceLblNotice);
|
||||
}
|
||||
}
|
||||
_hideSource(true);
|
||||
return back;
|
||||
}
|
||||
|
||||
void CMenu::_initSourceMenu(CMenu::SThemeData &theme)
|
||||
|
Loading…
x
Reference in New Issue
Block a user