2012-01-21 21:57:41 +01:00
|
|
|
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <fstream>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
|
2012-08-05 15:48:15 +02:00
|
|
|
#include "menu.hpp"
|
|
|
|
#include "channel/nand.hpp"
|
|
|
|
#include "devicemounter/DeviceHandler.hpp"
|
2012-01-27 20:38:52 +01:00
|
|
|
#include "loader/alt_ios.h"
|
2012-08-05 15:48:15 +02:00
|
|
|
#include "loader/cios.h"
|
|
|
|
#include "loader/disc.h"
|
2012-08-11 14:27:38 +02:00
|
|
|
#include "loader/nk.h"
|
2012-08-05 15:48:15 +02:00
|
|
|
#include "loader/wbfs.h"
|
|
|
|
#include "loader/wdvd.h"
|
|
|
|
#include "network/gcard.h"
|
2012-01-21 21:57:41 +01:00
|
|
|
|
|
|
|
static inline int loopNum(int i, int s)
|
|
|
|
{
|
2016-04-03 02:51:40 +02:00
|
|
|
return (i + s) % s;
|
2012-01-21 21:57:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void CMenu::_hideMain(bool instant)
|
|
|
|
{
|
|
|
|
m_btnMgr.hide(m_mainBtnNext, instant);
|
|
|
|
m_btnMgr.hide(m_mainBtnPrev, instant);
|
2019-03-04 21:29:46 +01:00
|
|
|
m_btnMgr.hide(m_mainBtnCategories, instant);
|
2019-10-30 17:46:30 +01:00
|
|
|
m_btnMgr.hide(m_mainBtnConfig, instant);
|
2016-11-07 16:06:00 +01:00
|
|
|
m_btnMgr.hide(m_mainBtnHome, instant);
|
2012-01-21 21:57:41 +01:00
|
|
|
m_btnMgr.hide(m_mainBtnHomebrew, instant);
|
|
|
|
m_btnMgr.hide(m_mainBtnChannel, instant);
|
2016-04-03 02:31:02 +02:00
|
|
|
m_btnMgr.hide(m_mainBtnWii, instant);
|
|
|
|
m_btnMgr.hide(m_mainBtnGamecube, instant);
|
|
|
|
m_btnMgr.hide(m_mainBtnPlugin, instant);
|
2012-01-21 21:57:41 +01:00
|
|
|
m_btnMgr.hide(m_mainBtnDVD, instant);
|
2016-04-03 02:51:40 +02:00
|
|
|
m_btnMgr.hide(m_mainLblMessage, instant);
|
2012-01-21 21:57:41 +01:00
|
|
|
m_btnMgr.hide(m_mainBtnFavoritesOn, instant);
|
|
|
|
m_btnMgr.hide(m_mainBtnFavoritesOff, instant);
|
|
|
|
m_btnMgr.hide(m_mainLblLetter, instant);
|
|
|
|
m_btnMgr.hide(m_mainLblNotice, instant);
|
2012-07-05 15:15:23 +02:00
|
|
|
for(u8 i = 0; i < ARRAY_SIZE(m_mainLblUser); ++i)
|
2012-09-13 16:54:17 +02:00
|
|
|
if(m_mainLblUser[i] != -1)
|
2012-01-21 21:57:41 +01:00
|
|
|
m_btnMgr.hide(m_mainLblUser[i], instant);
|
|
|
|
}
|
|
|
|
|
2019-11-24 00:54:38 +01:00
|
|
|
void CMenu::_getCustomBgTex()
|
2019-01-23 01:18:13 +01:00
|
|
|
{
|
2019-02-04 19:08:18 +01:00
|
|
|
if(m_sourceflow)
|
2020-02-02 21:25:05 +01:00
|
|
|
_getSFlowBgTex();
|
2019-02-04 19:08:18 +01:00
|
|
|
else
|
2019-01-23 01:18:13 +01:00
|
|
|
{
|
2020-02-02 21:25:05 +01:00
|
|
|
curCustBg = loopNum(curCustBg + 1, 2);
|
2019-04-09 17:39:03 +02:00
|
|
|
string fn = "";
|
|
|
|
if(m_platform.loaded())
|
|
|
|
{
|
2020-07-17 22:23:42 +02:00
|
|
|
m_plugin.PluginMagicWord[0] = '\0';
|
|
|
|
u8 i = 0;
|
2019-04-09 17:39:03 +02:00
|
|
|
switch(m_current_view)
|
|
|
|
{
|
|
|
|
case COVERFLOW_CHANNEL:
|
2019-10-22 23:01:34 +02:00
|
|
|
if(m_cfg.getInt(CHANNEL_DOMAIN, "channels_type") & CHANNELS_REAL)
|
2019-10-18 00:27:54 +02:00
|
|
|
strncpy(m_plugin.PluginMagicWord, "4E414E44", 9);
|
2019-10-22 23:01:34 +02:00
|
|
|
else
|
|
|
|
strncpy(m_plugin.PluginMagicWord, "454E414E", 9);
|
2019-04-09 17:39:03 +02:00
|
|
|
break;
|
|
|
|
case COVERFLOW_HOMEBREW:
|
|
|
|
strncpy(m_plugin.PluginMagicWord, "48425257", 9);
|
|
|
|
break;
|
|
|
|
case COVERFLOW_GAMECUBE:
|
|
|
|
strncpy(m_plugin.PluginMagicWord, "4E47434D", 9);
|
|
|
|
break;
|
|
|
|
case COVERFLOW_PLUGIN:
|
2020-07-17 22:23:42 +02:00
|
|
|
while(m_plugin.PluginExist(i) && !m_plugin.GetEnabledStatus(i)) { ++i; }
|
|
|
|
if(m_plugin.PluginExist(i))
|
|
|
|
strncpy(m_plugin.PluginMagicWord, fmt("%08x", m_plugin.GetPluginMagic(i)), 8);
|
2019-04-09 17:39:03 +02:00
|
|
|
break;
|
|
|
|
default:// wii
|
|
|
|
strncpy(m_plugin.PluginMagicWord, "4E574949", 9);
|
|
|
|
}
|
2020-07-17 22:23:42 +02:00
|
|
|
if(strlen(m_plugin.PluginMagicWord) == 8)
|
|
|
|
fn = m_platform.getString("PLUGINS", m_plugin.PluginMagicWord, "");
|
2019-04-09 17:39:03 +02:00
|
|
|
}
|
2019-02-04 19:08:18 +01:00
|
|
|
if(fn.length() > 0)
|
|
|
|
{
|
2019-11-24 00:54:38 +01:00
|
|
|
if(TexHandle.fromImageFile(m_mainCustomBg[curCustBg], fmt("%s/%s/%s.png", m_bckgrndsDir.c_str(), m_themeName.c_str(), fn.c_str())) != TE_OK)
|
2019-02-04 19:08:18 +01:00
|
|
|
{
|
2019-11-24 00:54:38 +01:00
|
|
|
if(TexHandle.fromImageFile(m_mainCustomBg[curCustBg], fmt("%s/%s/%s.jpg", m_bckgrndsDir.c_str(), m_themeName.c_str(), fn.c_str())) != TE_OK)
|
2019-02-04 19:08:18 +01:00
|
|
|
{
|
2019-11-24 00:54:38 +01:00
|
|
|
if(TexHandle.fromImageFile(m_mainCustomBg[curCustBg], fmt("%s/%s.png", m_bckgrndsDir.c_str(), fn.c_str())) != TE_OK)
|
2019-04-09 17:39:03 +02:00
|
|
|
{
|
2019-11-24 00:54:38 +01:00
|
|
|
if(TexHandle.fromImageFile(m_mainCustomBg[curCustBg], fmt("%s/%s.jpg", m_bckgrndsDir.c_str(), fn.c_str())) != TE_OK)
|
2019-04-09 17:39:03 +02:00
|
|
|
{
|
2020-02-02 21:25:05 +01:00
|
|
|
curCustBg = loopNum(curCustBg + 1, 2);// reset it
|
2019-11-24 00:54:38 +01:00
|
|
|
customBg = false;
|
2019-04-09 17:39:03 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2019-02-04 19:08:18 +01:00
|
|
|
}
|
|
|
|
}
|
2019-11-24 00:54:38 +01:00
|
|
|
customBg = true;
|
2019-02-04 19:08:18 +01:00
|
|
|
}
|
2019-01-23 01:18:13 +01:00
|
|
|
else
|
2020-02-02 21:25:05 +01:00
|
|
|
{
|
|
|
|
curCustBg = loopNum(curCustBg + 1, 2);// reset it
|
2019-11-24 00:54:38 +01:00
|
|
|
customBg = false;
|
2020-02-02 21:25:05 +01:00
|
|
|
}
|
2019-01-23 01:18:13 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-24 00:54:38 +01:00
|
|
|
void CMenu::_setMainBg()
|
|
|
|
{
|
|
|
|
if(customBg)
|
|
|
|
_setBg(m_mainCustomBg[curCustBg], m_mainCustomBg[curCustBg]);
|
|
|
|
else
|
|
|
|
_setBg(m_mainBg, m_mainBgLQ);
|
|
|
|
}
|
|
|
|
|
2016-11-07 16:06:00 +01:00
|
|
|
void CMenu::_showMain()
|
2012-01-21 21:57:41 +01:00
|
|
|
{
|
2019-01-23 01:18:13 +01:00
|
|
|
_setMainBg();
|
2016-11-07 16:06:00 +01:00
|
|
|
if(m_refreshGameList)
|
|
|
|
_showCF(m_refreshGameList);
|
|
|
|
}
|
|
|
|
|
2022-07-16 14:08:50 +02:00
|
|
|
void CMenu::_showTotalGames(const int numberOfGames)
|
|
|
|
{
|
|
|
|
m_showtimer = 240;
|
|
|
|
m_btnMgr.setText(m_mainLblNotice, wfmt(_fmt("main7", L"Total Games: %i"), numberOfGames));
|
|
|
|
m_btnMgr.show(m_mainLblNotice);
|
|
|
|
}
|
|
|
|
|
2016-11-07 16:06:00 +01:00
|
|
|
void CMenu::_showCF(bool refreshList)
|
|
|
|
{
|
|
|
|
m_refreshGameList = false;
|
|
|
|
_hideMain(true);
|
2012-01-21 21:57:41 +01:00
|
|
|
|
2016-11-07 16:06:00 +01:00
|
|
|
if(refreshList)
|
2012-01-21 21:57:41 +01:00
|
|
|
{
|
2016-11-07 16:06:00 +01:00
|
|
|
if(!m_vid.showingWaitMessage())
|
|
|
|
_showWaitMessage();
|
|
|
|
|
2018-09-26 20:26:01 +02:00
|
|
|
/* create gameList based on sources selected */
|
2016-11-07 16:06:00 +01:00
|
|
|
_loadList();
|
2012-01-21 21:57:41 +01:00
|
|
|
|
2018-09-26 20:26:01 +02:00
|
|
|
_hideWaitMessage();
|
|
|
|
|
|
|
|
/* if game list is empty display message letting user know */
|
|
|
|
wstringEx Msg;
|
2020-10-15 21:46:28 +02:00
|
|
|
string Pth;
|
2018-09-26 20:26:01 +02:00
|
|
|
if(m_gameList.empty())
|
|
|
|
{
|
2019-04-29 15:26:06 +02:00
|
|
|
cacheCovers = false;
|
2018-09-26 20:26:01 +02:00
|
|
|
if(m_source_cnt > 1)
|
|
|
|
{
|
2022-04-10 03:53:57 +02:00
|
|
|
Msg = _t("main1", L"Game list empty!");
|
2018-09-26 20:26:01 +02:00
|
|
|
Pth = "";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
switch(m_current_view)
|
|
|
|
{
|
|
|
|
case COVERFLOW_WII:
|
2020-10-15 21:46:28 +02:00
|
|
|
Msg = _t("main2", L"No games found in");
|
|
|
|
Pth = sfmt(wii_games_dir, DeviceName[currentPartition]);
|
2018-09-26 20:26:01 +02:00
|
|
|
break;
|
|
|
|
case COVERFLOW_GAMECUBE:
|
2020-10-15 21:46:28 +02:00
|
|
|
Msg = _t("main2", L"No games found in");
|
|
|
|
Pth = sfmt(gc_games_dir, DeviceName[currentPartition]);
|
2018-09-26 20:26:01 +02:00
|
|
|
break;
|
|
|
|
case COVERFLOW_CHANNEL:
|
2020-10-15 21:46:28 +02:00
|
|
|
Msg = _t("main3", L"No titles found in");
|
|
|
|
Pth = sfmt("%s:/%s/%s", DeviceName[currentPartition], emu_nands_dir, m_cfg.getString(CHANNEL_DOMAIN, "current_emunand").c_str());
|
2018-09-26 20:26:01 +02:00
|
|
|
break;
|
|
|
|
case COVERFLOW_HOMEBREW:
|
2020-10-15 21:46:28 +02:00
|
|
|
Msg = _t("main4", L"No apps found in");
|
|
|
|
Pth = sfmt(HOMEBREW_DIR, DeviceName[currentPartition]);
|
2018-09-26 20:26:01 +02:00
|
|
|
break;
|
|
|
|
case COVERFLOW_PLUGIN:
|
2020-04-13 01:24:26 +02:00
|
|
|
Pth = "";
|
2018-09-26 20:26:01 +02:00
|
|
|
if(enabledPluginsCount == 0)
|
|
|
|
Msg = _t("main6", L"No plugins selected.");
|
2020-04-13 01:24:26 +02:00
|
|
|
else if(enabledPluginsCount > 1)
|
2018-09-26 20:26:01 +02:00
|
|
|
Msg = _t("main5", L"No roms/items found.");
|
2020-04-13 01:24:26 +02:00
|
|
|
else
|
|
|
|
{
|
2020-10-15 21:46:28 +02:00
|
|
|
Msg = _t("main2", L"No games found in");
|
2020-07-17 22:23:42 +02:00
|
|
|
u8 i = 0;
|
|
|
|
while(m_plugin.PluginExist(i) && !m_plugin.GetEnabledStatus(i)){ ++i; }
|
|
|
|
int romsPartition = m_plugin.GetRomPartition(i);
|
|
|
|
if(romsPartition < 0)
|
|
|
|
romsPartition = m_cfg.getInt(PLUGIN_DOMAIN, "partition", 0);
|
2021-09-15 18:45:06 +02:00
|
|
|
const char *romDir = m_plugin.GetRomDir(i);
|
|
|
|
if(strstr(romDir, "scummvm.ini") != NULL && strchr(romDir, ':') != NULL)
|
|
|
|
Pth = sfmt("%s", romDir);
|
|
|
|
else
|
|
|
|
Pth = sfmt("%s:/%s", DeviceName[romsPartition], m_plugin.GetRomDir(i));
|
2020-04-13 01:24:26 +02:00
|
|
|
}
|
2018-09-26 20:26:01 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2020-10-15 21:46:28 +02:00
|
|
|
Msg.append(wstringEx(' ' + Pth));
|
2018-09-26 20:26:01 +02:00
|
|
|
m_btnMgr.setText(m_mainLblMessage, Msg);
|
|
|
|
m_btnMgr.show(m_mainLblMessage);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* if source menu button set to autoboot */
|
2016-11-07 16:06:00 +01:00
|
|
|
if(m_source_autoboot == true)
|
2018-09-26 20:26:01 +02:00
|
|
|
{ /* search game list for the requested title */
|
2016-11-07 16:06:00 +01:00
|
|
|
bool game_found = false;
|
|
|
|
for(vector<dir_discHdr>::iterator element = m_gameList.begin(); element != m_gameList.end(); ++element)
|
|
|
|
{
|
|
|
|
switch(m_autoboot_hdr.type)
|
|
|
|
{
|
|
|
|
case TYPE_CHANNEL:
|
|
|
|
case TYPE_WII_GAME:
|
|
|
|
case TYPE_GC_GAME:
|
|
|
|
if(strcmp(m_autoboot_hdr.id, element->id) == 0)
|
|
|
|
game_found = true;
|
|
|
|
break;
|
|
|
|
case TYPE_HOMEBREW:
|
|
|
|
case TYPE_PLUGIN:
|
|
|
|
if(wcsncmp(m_autoboot_hdr.title, element->title, 63) == 0)
|
|
|
|
game_found = true;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if(game_found == true)
|
|
|
|
{
|
|
|
|
memcpy(&m_autoboot_hdr, &(*(element)), sizeof(dir_discHdr));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2018-09-26 20:26:01 +02:00
|
|
|
/* title found - launch it */
|
|
|
|
if(game_found == true)
|
2016-11-07 16:06:00 +01:00
|
|
|
{
|
|
|
|
gprintf("Game found, autobooting...\n");
|
|
|
|
_launch(&m_autoboot_hdr);
|
|
|
|
}
|
|
|
|
/* fail */
|
|
|
|
m_source_autoboot = false;
|
|
|
|
}
|
2018-11-05 20:57:01 +01:00
|
|
|
if(cacheCovers)
|
|
|
|
{
|
|
|
|
cacheCovers = false;
|
2020-04-29 01:03:24 +02:00
|
|
|
if(!m_sourceflow || _sfCacheCoversNeeded() > 0)
|
2018-11-05 20:57:01 +01:00
|
|
|
{
|
2022-08-25 00:26:36 +02:00
|
|
|
m_btnMgr.setProgress(m_downloadPBar, 0.f, true);
|
|
|
|
m_btnMgr.setText(m_downloadLblMessage, L"0%");
|
|
|
|
m_btnMgr.setText(m_downloadLblDialog, L"");
|
|
|
|
m_btnMgr.show(m_downloadPBar);
|
|
|
|
m_btnMgr.show(m_downloadLblMessage);
|
|
|
|
m_btnMgr.show(m_downloadLblDialog);
|
2020-04-29 01:03:24 +02:00
|
|
|
|
|
|
|
_start_pThread();
|
|
|
|
_cacheCovers();
|
|
|
|
_stop_pThread();
|
2022-08-25 00:26:36 +02:00
|
|
|
m_btnMgr.setText(m_downloadLblDialog, _t("dlmsg14", L"Done."));
|
2020-04-29 01:03:24 +02:00
|
|
|
u8 pause = 150;
|
|
|
|
if(m_sourceflow)
|
|
|
|
pause = 1;
|
|
|
|
do
|
2018-11-05 20:57:01 +01:00
|
|
|
{
|
2020-04-29 01:03:24 +02:00
|
|
|
_mainLoopCommon();
|
|
|
|
pause--;
|
|
|
|
if(pause == 0)
|
|
|
|
{
|
2022-08-25 00:26:36 +02:00
|
|
|
m_btnMgr.hide(m_downloadPBar);
|
|
|
|
m_btnMgr.hide(m_downloadLblMessage);
|
|
|
|
m_btnMgr.hide(m_downloadLblDialog);
|
2020-04-29 01:03:24 +02:00
|
|
|
}
|
|
|
|
}while(!m_exit && pause > 0);
|
2018-11-05 20:57:01 +01:00
|
|
|
}
|
|
|
|
}
|
2019-10-10 01:00:54 +02:00
|
|
|
/* setup categories and favorites for filtering the game list below */
|
|
|
|
if(m_clearCats)// false on boot up and if a source menu button selects a category
|
|
|
|
{
|
2019-12-18 16:39:27 +01:00
|
|
|
if(m_autoboot_hdr.type == TYPE_PLUGIN && m_cat.hasDomain("PLUGINS"))
|
|
|
|
{
|
|
|
|
m_cat.remove("PLUGINS", "selected_categories");
|
|
|
|
m_cat.remove("PLUGINS", "required_categories");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// do not clear hidden categories to keep games hidden
|
|
|
|
m_cat.remove("GENERAL", "selected_categories");
|
|
|
|
m_cat.remove("GENERAL", "required_categories");
|
|
|
|
}
|
2019-10-10 01:00:54 +02:00
|
|
|
}
|
|
|
|
m_clearCats = true;// set to true for next source
|
|
|
|
|
|
|
|
m_favorites = false;
|
|
|
|
if(m_getFavs || m_cfg.getBool("GENERAL", "save_favorites_mode", false))
|
|
|
|
m_favorites = m_cfg.getBool(_domainFromView(), "favorites", false);
|
|
|
|
else
|
|
|
|
m_cfg.setBool(_domainFromView(), "favorites", false);
|
|
|
|
m_getFavs = false;
|
2012-01-21 21:57:41 +01:00
|
|
|
}
|
2016-11-07 16:06:00 +01:00
|
|
|
|
2019-03-18 19:39:28 +01:00
|
|
|
strcpy(cf_domain, "_COVERFLOW");
|
2016-11-07 16:06:00 +01:00
|
|
|
if(!m_sourceflow && m_current_view == COVERFLOW_HOMEBREW && m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox", true))
|
2019-03-18 19:39:28 +01:00
|
|
|
strcpy(cf_domain, "_SMALLFLOW");
|
2016-11-07 16:06:00 +01:00
|
|
|
if(m_sourceflow && m_cfg.getBool(SOURCEFLOW_DOMAIN, "smallbox", true))
|
2019-03-18 19:39:28 +01:00
|
|
|
strcpy(cf_domain, "_SMALLFLOW");
|
2016-06-22 21:34:58 +02:00
|
|
|
if(m_current_view == COVERFLOW_PLUGIN && !m_sourceflow)
|
- PHASE 2 (finally!)
- New Coverflow theme format. no more emuflow, coverflow, brewflow. now we have coverflow, shortflow, sideflow, and smallflow.
- coverflow is the normal coverflow.
- shortflow is automatically used for plugins if all selected plugins require a short CD style cover such as GB, GBC, GBA, and playstation. if there's more let me know and i can add them.
- sideflow is automatically used for plugins if all selected plugins require a cover on its side such as SNES and Nintendo 64.
- smallflow is used if smallbox is set for homebrew and sourceflow.
- no more need for emuflow= with a source btn in the source menu. it is done automatically now using the plugins magic#
- each flow has its own number of modes/layouts. so now coveflow can have 8, smallfow 1, sideflow, 6, and shortflow 4 or whatever you want.
- adjust coverflow works with no problems. just choose the view first before entering the adjust coverflow menu.
- other minor code changes here and there.
- remember themes are now in themes_lite and the coverflow part is seperated and put in the coverflows folder with the same name as the theme or you can use a default coverflow named default.ini for all themes.
2016-05-11 19:58:36 +02:00
|
|
|
{
|
2019-03-18 19:39:28 +01:00
|
|
|
/* check if homebrew plugin */
|
2020-07-17 22:23:42 +02:00
|
|
|
if(enabledPluginsCount == 1 && m_plugin.GetEnabledStatus(m_plugin.GetPluginPosition(strtoul("48425257", NULL, 16))) && m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox"))
|
2019-03-18 19:39:28 +01:00
|
|
|
strcpy(cf_domain, "_SMALLFLOW");
|
2020-07-17 22:23:42 +02:00
|
|
|
else if(enabledPluginsCount > 0 && m_platform.loaded())
|
- PHASE 2 (finally!)
- New Coverflow theme format. no more emuflow, coverflow, brewflow. now we have coverflow, shortflow, sideflow, and smallflow.
- coverflow is the normal coverflow.
- shortflow is automatically used for plugins if all selected plugins require a short CD style cover such as GB, GBC, GBA, and playstation. if there's more let me know and i can add them.
- sideflow is automatically used for plugins if all selected plugins require a cover on its side such as SNES and Nintendo 64.
- smallflow is used if smallbox is set for homebrew and sourceflow.
- no more need for emuflow= with a source btn in the source menu. it is done automatically now using the plugins magic#
- each flow has its own number of modes/layouts. so now coveflow can have 8, smallfow 1, sideflow, 6, and shortflow 4 or whatever you want.
- adjust coverflow works with no problems. just choose the view first before entering the adjust coverflow menu.
- other minor code changes here and there.
- remember themes are now in themes_lite and the coverflow part is seperated and put in the coverflows folder with the same name as the theme or you can use a default coverflow named default.ini for all themes.
2016-05-11 19:58:36 +02:00
|
|
|
{
|
2020-07-17 22:23:42 +02:00
|
|
|
/* get first plugin flow domain */
|
|
|
|
u8 i = 0;
|
|
|
|
while(m_plugin.PluginExist(i) && !m_plugin.GetEnabledStatus(i)){ ++i; }
|
|
|
|
string flow_domain = m_platform.getString("FLOWS", m_platform.getString("PLUGINS", sfmt("%08x", m_plugin.GetPluginMagic(i)), ""), "_COVERFLOW");
|
|
|
|
|
|
|
|
/* check if all plugin flow domains match */
|
|
|
|
bool match = true;
|
|
|
|
i++;
|
|
|
|
while(m_plugin.PluginExist(i))
|
- PHASE 2 (finally!)
- New Coverflow theme format. no more emuflow, coverflow, brewflow. now we have coverflow, shortflow, sideflow, and smallflow.
- coverflow is the normal coverflow.
- shortflow is automatically used for plugins if all selected plugins require a short CD style cover such as GB, GBC, GBA, and playstation. if there's more let me know and i can add them.
- sideflow is automatically used for plugins if all selected plugins require a cover on its side such as SNES and Nintendo 64.
- smallflow is used if smallbox is set for homebrew and sourceflow.
- no more need for emuflow= with a source btn in the source menu. it is done automatically now using the plugins magic#
- each flow has its own number of modes/layouts. so now coveflow can have 8, smallfow 1, sideflow, 6, and shortflow 4 or whatever you want.
- adjust coverflow works with no problems. just choose the view first before entering the adjust coverflow menu.
- other minor code changes here and there.
- remember themes are now in themes_lite and the coverflow part is seperated and put in the coverflows folder with the same name as the theme or you can use a default coverflow named default.ini for all themes.
2016-05-11 19:58:36 +02:00
|
|
|
{
|
2020-07-17 22:23:42 +02:00
|
|
|
if(m_plugin.GetEnabledStatus(i) &&
|
|
|
|
flow_domain != m_platform.getString("FLOWS", m_platform.getString("PLUGINS", sfmt("%08x", m_plugin.GetPluginMagic(i)), ""), "_COVERFLOW"))
|
2019-03-18 19:39:28 +01:00
|
|
|
{
|
2020-07-17 22:23:42 +02:00
|
|
|
match = false;
|
|
|
|
break;
|
2019-03-18 19:39:28 +01:00
|
|
|
}
|
2020-07-17 22:23:42 +02:00
|
|
|
i++;
|
- PHASE 2 (finally!)
- New Coverflow theme format. no more emuflow, coverflow, brewflow. now we have coverflow, shortflow, sideflow, and smallflow.
- coverflow is the normal coverflow.
- shortflow is automatically used for plugins if all selected plugins require a short CD style cover such as GB, GBC, GBA, and playstation. if there's more let me know and i can add them.
- sideflow is automatically used for plugins if all selected plugins require a cover on its side such as SNES and Nintendo 64.
- smallflow is used if smallbox is set for homebrew and sourceflow.
- no more need for emuflow= with a source btn in the source menu. it is done automatically now using the plugins magic#
- each flow has its own number of modes/layouts. so now coveflow can have 8, smallfow 1, sideflow, 6, and shortflow 4 or whatever you want.
- adjust coverflow works with no problems. just choose the view first before entering the adjust coverflow menu.
- other minor code changes here and there.
- remember themes are now in themes_lite and the coverflow part is seperated and put in the coverflows folder with the same name as the theme or you can use a default coverflow named default.ini for all themes.
2016-05-11 19:58:36 +02:00
|
|
|
}
|
2020-07-17 22:23:42 +02:00
|
|
|
|
|
|
|
/* if all match we use that flow domain */
|
|
|
|
if(match)
|
|
|
|
snprintf(cf_domain, sizeof(cf_domain), "%s", flow_domain.c_str());
|
- PHASE 2 (finally!)
- New Coverflow theme format. no more emuflow, coverflow, brewflow. now we have coverflow, shortflow, sideflow, and smallflow.
- coverflow is the normal coverflow.
- shortflow is automatically used for plugins if all selected plugins require a short CD style cover such as GB, GBC, GBA, and playstation. if there's more let me know and i can add them.
- sideflow is automatically used for plugins if all selected plugins require a cover on its side such as SNES and Nintendo 64.
- smallflow is used if smallbox is set for homebrew and sourceflow.
- no more need for emuflow= with a source btn in the source menu. it is done automatically now using the plugins magic#
- each flow has its own number of modes/layouts. so now coveflow can have 8, smallfow 1, sideflow, 6, and shortflow 4 or whatever you want.
- adjust coverflow works with no problems. just choose the view first before entering the adjust coverflow menu.
- other minor code changes here and there.
- remember themes are now in themes_lite and the coverflow part is seperated and put in the coverflows folder with the same name as the theme or you can use a default coverflow named default.ini for all themes.
2016-05-11 19:58:36 +02:00
|
|
|
}
|
|
|
|
}
|
2016-06-20 23:03:40 +02:00
|
|
|
|
2018-09-26 20:26:01 +02:00
|
|
|
/* get the number of layouts (modes) for the CoverFlow domain */
|
|
|
|
m_numCFVersions = min(max(1, m_coverflow.getInt(cf_domain, "number_of_modes", 1)), 15);// max layouts is 15
|
2016-11-07 16:06:00 +01:00
|
|
|
|
2018-09-26 20:26:01 +02:00
|
|
|
/* get the current cf layout number and use it to load the data used for that layout */
|
2016-11-07 16:06:00 +01:00
|
|
|
_loadCFLayout(min(max(1, _getCFVersion()), (int)m_numCFVersions));
|
2018-09-26 20:26:01 +02:00
|
|
|
|
|
|
|
/* filter game list to create the cf cover list and start coverflow coverloader */
|
2017-09-22 00:03:41 +02:00
|
|
|
_initCF();
|
2018-09-26 20:26:01 +02:00
|
|
|
|
|
|
|
/* set the covers and titles to the positions and angles based on the cf layout */
|
2012-11-11 19:28:03 +01:00
|
|
|
CoverFlow.applySettings();
|
2012-01-21 21:57:41 +01:00
|
|
|
|
2018-12-24 14:42:31 +01:00
|
|
|
gprintf("Displaying covers\n");
|
|
|
|
|
2018-09-26 20:26:01 +02:00
|
|
|
/* display game count if not sourceflow or homebrew */
|
2016-06-20 23:03:40 +02:00
|
|
|
if(m_sourceflow || m_current_view == COVERFLOW_HOMEBREW)
|
2013-09-12 15:04:50 +02:00
|
|
|
return;
|
2012-01-21 21:57:41 +01:00
|
|
|
|
2022-07-16 14:08:50 +02:00
|
|
|
_showTotalGames(CoverFlow.size());
|
2012-01-21 21:57:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int CMenu::main(void)
|
|
|
|
{
|
|
|
|
wstringEx curLetter;
|
2019-07-24 19:35:51 +02:00
|
|
|
string prevTheme = m_themeName;
|
2016-11-07 16:06:00 +01:00
|
|
|
bool show_channel = !m_cfg.getBool(CHANNEL_DOMAIN, "disable", false);
|
|
|
|
bool show_plugin = !m_cfg.getBool(PLUGIN_DOMAIN, "disable", false);
|
|
|
|
bool show_gamecube = !m_cfg.getBool(GC_DOMAIN, "disable", false);
|
2019-03-04 21:29:46 +01:00
|
|
|
bool show_homebrew = !m_cfg.getBool(HOMEBREW_DOMAIN, "disable", false);
|
2016-06-11 01:52:22 +02:00
|
|
|
bool m_source_on_start = m_cfg.getBool("GENERAL", "source_on_start", false);
|
2018-10-03 19:51:57 +02:00
|
|
|
bool bheld = false;// bheld to indicate btn b was pressed or held
|
|
|
|
bool bUsed = false;// bused to indicate that it was actually used for something
|
2012-01-21 21:57:41 +01:00
|
|
|
m_reload = false;
|
2019-03-06 19:52:12 +01:00
|
|
|
CFLocked = m_cfg.getBool("GENERAL", "cf_locked", false);
|
2019-07-10 13:59:30 +02:00
|
|
|
Auto_hide_icons = m_cfg.getBool("GENERAL", "auto_hide_icons", true);
|
2012-08-26 14:05:04 +02:00
|
|
|
u32 disc_check = 0;
|
2012-01-21 21:57:41 +01:00
|
|
|
|
2018-10-03 19:51:57 +02:00
|
|
|
m_prev_view = 0;
|
2016-12-01 01:05:39 +01:00
|
|
|
m_current_view = m_cfg.getUInt("GENERAL", "sources", COVERFLOW_WII);
|
|
|
|
m_source_cnt = 0;
|
2019-03-04 21:29:46 +01:00
|
|
|
for(u8 i = 1; i < 32; i <<= 1)
|
2016-12-01 01:05:39 +01:00
|
|
|
if(m_current_view & i)
|
|
|
|
m_source_cnt++;
|
|
|
|
|
2020-03-19 23:38:32 +01:00
|
|
|
if(m_source_cnt == 0)
|
2013-08-13 15:12:40 +02:00
|
|
|
{
|
2016-05-19 01:15:19 +02:00
|
|
|
m_current_view = COVERFLOW_WII;
|
2016-12-01 01:05:39 +01:00
|
|
|
m_cfg.setUInt("GENERAL", "sources", m_current_view);
|
|
|
|
m_source_cnt++;
|
2013-08-13 15:12:40 +02:00
|
|
|
}
|
-updating wiiflow lite to beta 4.3.0
-fixed using categories to hide GC disc 2's. Apparently this has never really worked right for some time or ever.
-fixed deleting the cached cover texture file for plugin games. Delete cover for plugins only deletes the cached texture file (.wfc)
-fixed favorites and adultonly (parental lock) for plugin games. Apparently I may have broke this a few revisions back.
-favorites and adultonly for plugin games now have their own domains in gamecfg1- [FAVORITES_PLUGINS] and [ADULTONLY_PLUGINS]. just makes it more organized.
-only wii, GC, channels are added to [PLAYCOUNT] and [LAST_PLAYED] in gamecfg1.
-now loading gamecfg1 at startup and leaving it loaded till exit. no more loading it and unloading all the time.
-fixed scrolling for game_info synopsis, credits, and help text.
-made source menu buttons wider for wiiflow default. old 80x80, now 100x80. looks better.
-display music info now defaults to off
-screensaver_disabled now defaults to yes
-show GC view button is now on by default no matter what. the only way it is disabled is if you edit wiiflow.ini manually. this is how all the view buttons work.
-removed hiding homebrew button but if wiiflow locked it won't work or in sourceflow it won't show.
-dump_list is now under [GENERAL] instead of each view. Also only works for Wii, GC, and channels.
-sorting only works for Wii, GC, and Channels now. disabled for sourceflow, plugins, homebrew, and combined view.
-now if no games are found a message is shown with the current path so you can see where wiiflow is looking. (except for plugins)
-removed auto create emuNAND for emuNAND view if gamelist is empty. just go to settings>NAND settings if you want to extract or disable it.
-now when no games are found all buttons at bottom are still accessible allowing you to change the view or go to settings and change current partition or path and even extract your NAND to create a EmuNAND. Or go to Home Menu and Install a Wii or GC game.
-removed auto extract NAND to emuNAND when launching a Wii game with EmuNAND save. Now a message is diplayed saying 'emuNAND for saves not found - using real NAND'.
-made the speed at which cover titles fade in/out almost instantly.
-removed update button from Home Menu. online update code is still there but not used and probably won't be used any more as there just isn't a need for it now.
-removed ftp button from Home Menu and all code for the FTP server. I just use WiiXplorer's FTP server. it seems to work better for me.
-disabled keep USB Alive thread for now. i think there's a possibilty it might be the cause of my SD/USB files getting corrupted.
-removed Btn B and - combo to switch partitions. didn't seem useful anymore.
-redid nand emulation settings menu. looks like this now:
pg1
Select EmuNAND
EmuNAND Enulation
Select SaveNAND
SaveNAND Emulation
pg2
Extract Saves All
Missing
Extract NAND
Select Saves Partition
-no longer blocking Select Plugin menu and View icons when using source menu combined view
-now Select Plugins Menu is like switching to plugin view but you get to choose the plugins first
-now [PLUGIN] partition= is the default partition for all plugins. to change individual plugins add 'romPartition=x' to the plugin ini. x is the partition number 0 thru 8 with SD being 0. this is how my usbloadergx plugin mod works.
2016-10-05 01:44:13 +02:00
|
|
|
|
2013-10-30 14:07:59 +01:00
|
|
|
m_catStartPage = m_cfg.getInt("GENERAL", "cat_startpage", 1);
|
-updating wiiflow lite to beta 4.3.0
-fixed using categories to hide GC disc 2's. Apparently this has never really worked right for some time or ever.
-fixed deleting the cached cover texture file for plugin games. Delete cover for plugins only deletes the cached texture file (.wfc)
-fixed favorites and adultonly (parental lock) for plugin games. Apparently I may have broke this a few revisions back.
-favorites and adultonly for plugin games now have their own domains in gamecfg1- [FAVORITES_PLUGINS] and [ADULTONLY_PLUGINS]. just makes it more organized.
-only wii, GC, channels are added to [PLAYCOUNT] and [LAST_PLAYED] in gamecfg1.
-now loading gamecfg1 at startup and leaving it loaded till exit. no more loading it and unloading all the time.
-fixed scrolling for game_info synopsis, credits, and help text.
-made source menu buttons wider for wiiflow default. old 80x80, now 100x80. looks better.
-display music info now defaults to off
-screensaver_disabled now defaults to yes
-show GC view button is now on by default no matter what. the only way it is disabled is if you edit wiiflow.ini manually. this is how all the view buttons work.
-removed hiding homebrew button but if wiiflow locked it won't work or in sourceflow it won't show.
-dump_list is now under [GENERAL] instead of each view. Also only works for Wii, GC, and channels.
-sorting only works for Wii, GC, and Channels now. disabled for sourceflow, plugins, homebrew, and combined view.
-now if no games are found a message is shown with the current path so you can see where wiiflow is looking. (except for plugins)
-removed auto create emuNAND for emuNAND view if gamelist is empty. just go to settings>NAND settings if you want to extract or disable it.
-now when no games are found all buttons at bottom are still accessible allowing you to change the view or go to settings and change current partition or path and even extract your NAND to create a EmuNAND. Or go to Home Menu and Install a Wii or GC game.
-removed auto extract NAND to emuNAND when launching a Wii game with EmuNAND save. Now a message is diplayed saying 'emuNAND for saves not found - using real NAND'.
-made the speed at which cover titles fade in/out almost instantly.
-removed update button from Home Menu. online update code is still there but not used and probably won't be used any more as there just isn't a need for it now.
-removed ftp button from Home Menu and all code for the FTP server. I just use WiiXplorer's FTP server. it seems to work better for me.
-disabled keep USB Alive thread for now. i think there's a possibilty it might be the cause of my SD/USB files getting corrupted.
-removed Btn B and - combo to switch partitions. didn't seem useful anymore.
-redid nand emulation settings menu. looks like this now:
pg1
Select EmuNAND
EmuNAND Enulation
Select SaveNAND
SaveNAND Emulation
pg2
Extract Saves All
Missing
Extract NAND
Select Saves Partition
-no longer blocking Select Plugin menu and View icons when using source menu combined view
-now Select Plugins Menu is like switching to plugin view but you get to choose the plugins first
-now [PLUGIN] partition= is the default partition for all plugins. to change individual plugins add 'romPartition=x' to the plugin ini. x is the partition number 0 thru 8 with SD being 0. this is how my usbloadergx plugin mod works.
2016-10-05 01:44:13 +02:00
|
|
|
|
2012-09-16 11:55:32 +02:00
|
|
|
if(m_cfg.getBool("GENERAL", "update_cache", false))
|
2016-11-07 16:06:00 +01:00
|
|
|
{
|
|
|
|
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));
|
|
|
|
|
2018-12-24 14:42:31 +01:00
|
|
|
gprintf("Bootup completed!\n");
|
|
|
|
|
2020-05-02 00:32:23 +02:00
|
|
|
if(!m_use_source || !m_source_on_start)
|
2020-02-02 21:25:05 +01:00
|
|
|
{
|
2020-05-02 00:32:23 +02:00
|
|
|
m_source_on_start = false;
|
2020-02-02 21:25:05 +01:00
|
|
|
_getCustomBgTex();
|
|
|
|
_setMainBg();
|
|
|
|
_showCF(true);
|
|
|
|
}
|
2020-04-29 01:03:24 +02:00
|
|
|
|
2016-11-07 16:06:00 +01:00
|
|
|
if(show_mem)
|
|
|
|
{
|
|
|
|
m_btnMgr.show(m_mem1FreeSize);
|
|
|
|
m_btnMgr.show(m_mem2FreeSize);
|
|
|
|
}
|
|
|
|
SetupInput(true);
|
2016-04-02 19:08:54 +02:00
|
|
|
|
2012-09-09 20:35:15 +02:00
|
|
|
while(!m_exit)
|
2012-01-21 21:57:41 +01:00
|
|
|
{
|
2012-08-26 14:05:04 +02:00
|
|
|
/* IMPORTANT check if a disc is inserted */
|
|
|
|
WDVD_GetCoverStatus(&disc_check);
|
|
|
|
/* Main Loop */
|
2020-05-04 13:31:25 +02:00
|
|
|
if(!m_source_on_start)
|
|
|
|
_mainLoopCommon(true);
|
2016-04-03 02:31:02 +02:00
|
|
|
//this will make the source menu/flow display. what happens when a sourceflow cover is selected is taken care of later.
|
2020-05-04 13:31:25 +02:00
|
|
|
if(m_source_on_start || (bheld && !BTN_B_HELD))//if button b was held and now released
|
2012-08-17 16:16:58 +02:00
|
|
|
{
|
|
|
|
bheld = false;
|
2016-04-02 19:08:54 +02:00
|
|
|
if(bUsed)//if b button used for something don't show souce menu or sourceflow
|
2012-08-21 16:30:42 +02:00
|
|
|
bUsed = false;
|
|
|
|
else
|
|
|
|
{
|
2019-05-19 22:33:21 +02:00
|
|
|
if(m_sourceflow)//back a tier or exit sourceflow
|
2013-09-12 15:04:50 +02:00
|
|
|
{
|
2020-02-02 21:25:05 +01:00
|
|
|
if(!_srcTierBack(false))// not back a tier - exit sourceflow and return to coverflow
|
2019-05-19 22:33:21 +02:00
|
|
|
{
|
2019-12-23 15:51:43 +01:00
|
|
|
_restoreSrcTiers();
|
2020-02-02 21:25:05 +01:00
|
|
|
m_sourceflow = false;
|
2019-05-19 22:33:21 +02:00
|
|
|
}
|
2019-12-02 20:43:19 +01:00
|
|
|
_getCustomBgTex();
|
2020-02-02 21:25:05 +01:00
|
|
|
_setMainBg();
|
|
|
|
_showCF(true);//refresh coverflow or sourceflow list
|
2013-09-12 15:04:50 +02:00
|
|
|
continue;
|
|
|
|
}
|
2019-11-20 19:45:17 +01:00
|
|
|
else if(m_use_source)//if source_menu enabled
|
2013-01-19 22:41:05 +01:00
|
|
|
{
|
2013-09-13 17:38:23 +02:00
|
|
|
_hideMain();
|
2016-11-07 16:06:00 +01:00
|
|
|
if(m_cfg.getBool(SOURCEFLOW_DOMAIN, "enabled", false))//if sourceflow show it
|
2013-09-13 17:38:23 +02:00
|
|
|
{
|
2019-11-20 19:45:17 +01:00
|
|
|
sm_numbers_backup = m_cfg.getString(SOURCEFLOW_DOMAIN, "numbers");//backup for possible restore later
|
|
|
|
sm_tiers_backup = m_cfg.getString(SOURCEFLOW_DOMAIN, "tiers");
|
2013-09-13 17:38:23 +02:00
|
|
|
m_sourceflow = true;
|
2019-11-24 00:54:38 +01:00
|
|
|
_getCustomBgTex();
|
2020-02-02 21:25:05 +01:00
|
|
|
_setMainBg();
|
|
|
|
_showCF(true);//refresh sourceflow list
|
2013-09-13 17:38:23 +02:00
|
|
|
}
|
2016-04-02 19:08:54 +02:00
|
|
|
else //show source menu
|
2013-09-12 15:04:50 +02:00
|
|
|
{
|
2016-11-07 16:06:00 +01:00
|
|
|
m_refreshGameList = _Source();
|
2016-06-20 23:03:40 +02:00
|
|
|
if(BTN_B_HELD)
|
|
|
|
bUsed = true;
|
2019-12-02 20:43:19 +01:00
|
|
|
_getCustomBgTex();
|
2020-02-02 21:25:05 +01:00
|
|
|
_setMainBg();
|
2020-04-08 19:06:21 +02:00
|
|
|
_showCF(m_refreshGameList || m_source_on_start);//refresh coverflow list if new source selected
|
2013-09-12 15:04:50 +02:00
|
|
|
}
|
2020-04-08 19:06:21 +02:00
|
|
|
m_source_on_start = false;
|
2013-09-13 17:38:23 +02:00
|
|
|
continue;
|
2013-01-19 22:41:05 +01:00
|
|
|
}
|
2012-08-21 16:30:42 +02:00
|
|
|
}
|
2012-08-17 16:16:58 +02:00
|
|
|
}
|
2019-10-21 15:38:26 +02:00
|
|
|
if(BTN_HOME_PRESSED || (BTN_A_PRESSED && m_btnMgr.selected(m_mainBtnHome)))
|
2012-06-21 14:25:47 +02:00
|
|
|
{
|
2022-07-02 00:36:03 +02:00
|
|
|
if(m_sourceflow && !m_locked)// open Source Menu Editor Menu
|
2019-10-21 15:38:26 +02:00
|
|
|
{
|
2020-08-25 00:58:09 +02:00
|
|
|
_hideMain();
|
|
|
|
_SM_Editor();
|
|
|
|
if(BTN_B_HELD)
|
|
|
|
{
|
|
|
|
bheld = true;
|
|
|
|
bUsed = true;
|
|
|
|
}
|
|
|
|
_setMainBg();
|
|
|
|
_showCF(true);
|
2019-10-21 15:38:26 +02:00
|
|
|
}
|
2022-02-28 19:48:37 +01:00
|
|
|
else // open Home Menu
|
2016-04-02 19:08:54 +02:00
|
|
|
{
|
2019-10-23 16:06:39 +02:00
|
|
|
_hideMain();
|
|
|
|
if(_Home())
|
2022-02-28 19:48:37 +01:00
|
|
|
break;// if exit or shutdown option was selected then exit wiiflow
|
2019-10-23 16:06:39 +02:00
|
|
|
if(prevTheme != m_themeName)
|
|
|
|
{
|
|
|
|
/* new theme - exit wiiflow and reload */
|
|
|
|
fsop_deleteFolder(fmt("%s/sourceflow", m_cacheDir.c_str()));
|
2019-11-04 00:49:19 +01:00
|
|
|
m_cfg.remove(SOURCEFLOW_DOMAIN, "numbers");
|
|
|
|
m_cfg.remove(SOURCEFLOW_DOMAIN, "tiers");
|
2022-02-28 19:48:37 +01:00
|
|
|
m_reload = true;// reload for new theme
|
2019-10-23 16:06:39 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
if(BTN_B_HELD)
|
|
|
|
{
|
|
|
|
bheld = true;
|
|
|
|
bUsed = true;
|
|
|
|
}
|
|
|
|
show_channel = !m_cfg.getBool(CHANNEL_DOMAIN, "disable", false);
|
|
|
|
show_plugin = !m_cfg.getBool(PLUGIN_DOMAIN, "disable", false);
|
|
|
|
show_gamecube = !m_cfg.getBool(GC_DOMAIN, "disable", false);
|
|
|
|
show_homebrew = !m_cfg.getBool(HOMEBREW_DOMAIN, "disable", false);
|
2020-09-01 01:23:52 +02:00
|
|
|
if(m_refreshGameList)
|
|
|
|
_getCustomBgTex();
|
2019-10-23 16:06:39 +02:00
|
|
|
_showMain();
|
2016-04-02 19:08:54 +02:00
|
|
|
}
|
2012-06-21 14:25:47 +02:00
|
|
|
}
|
|
|
|
else if(BTN_A_PRESSED)
|
2012-01-21 21:57:41 +01:00
|
|
|
{
|
2012-06-21 14:25:47 +02:00
|
|
|
if(m_btnMgr.selected(m_mainBtnPrev))
|
2012-11-11 19:28:03 +01:00
|
|
|
CoverFlow.pageUp();
|
2012-06-21 14:25:47 +02:00
|
|
|
else if(m_btnMgr.selected(m_mainBtnNext))
|
2012-11-11 19:28:03 +01:00
|
|
|
CoverFlow.pageDown();
|
2019-03-04 21:29:46 +01:00
|
|
|
else if(m_btnMgr.selected(m_mainBtnChannel) || m_btnMgr.selected(m_mainBtnWii) || m_btnMgr.selected(m_mainBtnGamecube)
|
|
|
|
|| m_btnMgr.selected(m_mainBtnPlugin) || m_btnMgr.selected(m_mainBtnHomebrew))
|
2012-06-21 14:25:47 +02:00
|
|
|
{
|
2017-05-15 19:50:24 +02:00
|
|
|
/* change source via view button on main menu */
|
2016-04-02 18:00:47 +02:00
|
|
|
if(m_current_view == COVERFLOW_WII)
|
2019-03-04 21:29:46 +01:00
|
|
|
m_current_view = show_gamecube ? COVERFLOW_GAMECUBE : (show_channel ? COVERFLOW_CHANNEL :
|
|
|
|
(show_plugin ? COVERFLOW_PLUGIN : (show_homebrew ? COVERFLOW_HOMEBREW : COVERFLOW_WII)));
|
2016-04-02 18:00:47 +02:00
|
|
|
else if(m_current_view == COVERFLOW_GAMECUBE)
|
2019-03-04 21:29:46 +01:00
|
|
|
m_current_view = show_channel ? COVERFLOW_CHANNEL : (show_plugin ? COVERFLOW_PLUGIN : (show_homebrew ? COVERFLOW_HOMEBREW : COVERFLOW_WII));
|
2012-06-21 14:25:47 +02:00
|
|
|
else if(m_current_view == COVERFLOW_CHANNEL)
|
2019-03-04 21:29:46 +01:00
|
|
|
m_current_view = show_plugin ? COVERFLOW_PLUGIN : (show_homebrew ? COVERFLOW_HOMEBREW : COVERFLOW_WII);
|
|
|
|
else if(m_current_view == COVERFLOW_PLUGIN)
|
|
|
|
m_current_view = show_homebrew ? COVERFLOW_HOMEBREW : COVERFLOW_WII;
|
|
|
|
else if(m_current_view == COVERFLOW_HOMEBREW || m_source_cnt > 1)
|
2016-06-06 15:52:57 +02:00
|
|
|
m_current_view = COVERFLOW_WII;
|
2020-04-20 17:37:47 +02:00
|
|
|
if(m_use_source)
|
|
|
|
{
|
|
|
|
sm_numbers_backup = "0";
|
|
|
|
sm_tiers_backup = SOURCE_FILENAME;
|
|
|
|
_restoreSrcTiers();
|
|
|
|
}
|
2016-12-01 01:05:39 +01:00
|
|
|
m_source_cnt = 1;
|
|
|
|
m_cfg.setUInt("GENERAL", "sources", m_current_view);
|
2013-07-29 23:06:50 +02:00
|
|
|
m_catStartPage = 1;
|
2019-11-24 00:54:38 +01:00
|
|
|
_getCustomBgTex();
|
2019-01-23 01:18:13 +01:00
|
|
|
_setMainBg();
|
2016-11-07 16:06:00 +01:00
|
|
|
_showCF(true);
|
2012-06-21 14:25:47 +02:00
|
|
|
}
|
2019-10-30 17:46:30 +01:00
|
|
|
else if(m_btnMgr.selected(m_mainBtnConfig))
|
2012-06-21 14:25:47 +02:00
|
|
|
{
|
2019-10-30 17:46:30 +01:00
|
|
|
// main menu global settings
|
2012-06-21 14:25:47 +02:00
|
|
|
_hideMain();
|
2022-06-01 00:33:27 +02:00
|
|
|
_configMain();
|
2019-07-24 19:35:51 +02:00
|
|
|
if(prevTheme != m_themeName)
|
2012-06-21 14:25:47 +02:00
|
|
|
{
|
2019-10-30 17:46:30 +01:00
|
|
|
// new theme - exit wiiflow and reload
|
2018-11-23 22:31:04 +01:00
|
|
|
fsop_deleteFolder(fmt("%s/sourceflow", m_cacheDir.c_str()));
|
2019-11-04 00:49:19 +01:00
|
|
|
m_cfg.remove(SOURCEFLOW_DOMAIN, "numbers");
|
|
|
|
m_cfg.remove(SOURCEFLOW_DOMAIN, "tiers");
|
2022-02-28 19:48:37 +01:00
|
|
|
m_reload = true;// reload for new theme
|
2012-06-21 14:25:47 +02:00
|
|
|
break;
|
|
|
|
}
|
2012-08-21 16:30:42 +02:00
|
|
|
if(BTN_B_HELD)
|
2018-10-03 19:51:57 +02:00
|
|
|
{
|
|
|
|
bheld = true;
|
2012-08-21 16:30:42 +02:00
|
|
|
bUsed = true;
|
2018-10-03 19:51:57 +02:00
|
|
|
}
|
2018-10-31 20:51:15 +01:00
|
|
|
show_channel = !m_cfg.getBool(CHANNEL_DOMAIN, "disable", false);
|
|
|
|
show_plugin = !m_cfg.getBool(PLUGIN_DOMAIN, "disable", false);
|
|
|
|
show_gamecube = !m_cfg.getBool(GC_DOMAIN, "disable", false);
|
2019-04-29 15:14:54 +02:00
|
|
|
show_homebrew = !m_cfg.getBool(HOMEBREW_DOMAIN, "disable", false);
|
2016-11-07 16:06:00 +01:00
|
|
|
_showMain();
|
2019-10-30 17:46:30 +01:00
|
|
|
}
|
2019-03-04 21:29:46 +01:00
|
|
|
else if(m_btnMgr.selected(m_mainBtnCategories))
|
2012-06-21 14:25:47 +02:00
|
|
|
{
|
2019-03-04 21:29:46 +01:00
|
|
|
_hideMain();
|
|
|
|
_CategorySettings();
|
|
|
|
if(BTN_B_HELD)// returned using the b btn
|
2016-12-01 01:05:39 +01:00
|
|
|
{
|
2019-03-04 21:29:46 +01:00
|
|
|
bheld = true;
|
|
|
|
bUsed = true;
|
|
|
|
}
|
|
|
|
_setMainBg();
|
|
|
|
if(m_refreshGameList)
|
|
|
|
{
|
|
|
|
m_refreshGameList = false;
|
|
|
|
_initCF();
|
2022-07-16 14:08:50 +02:00
|
|
|
_showTotalGames(CoverFlow.size());
|
2019-03-04 21:29:46 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(m_btnMgr.selected(m_mainBtnDVD))
|
|
|
|
{
|
|
|
|
if(disc_check & 0x2)
|
|
|
|
{
|
|
|
|
/* Boot DVD in drive */
|
|
|
|
_hideMain(true);
|
|
|
|
/* Create Fake Header */
|
|
|
|
dir_discHdr hdr;
|
|
|
|
memset(&hdr, 0, sizeof(dir_discHdr));
|
|
|
|
memcpy(&hdr.id, "dvddvd", 6);//this must be set for neek2o
|
|
|
|
/* Boot the Disc */
|
2019-05-27 18:04:46 +02:00
|
|
|
_launchWii(&hdr, true, BTN_B_HELD);
|
2018-10-03 19:51:57 +02:00
|
|
|
if(BTN_B_HELD)
|
|
|
|
{
|
|
|
|
bheld = true;
|
|
|
|
bUsed = true;
|
|
|
|
}
|
2019-03-04 21:29:46 +01:00
|
|
|
_showCF(false);
|
2016-12-01 01:05:39 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-07-14 00:11:44 +02:00
|
|
|
_error(_t("main8", L"No disc in drive!"));
|
2019-03-04 21:29:46 +01:00
|
|
|
if(BTN_B_HELD)
|
|
|
|
{
|
|
|
|
bheld = true;
|
|
|
|
bUsed = true;
|
|
|
|
}
|
|
|
|
_showMain();
|
2018-10-03 19:51:57 +02:00
|
|
|
}
|
2012-06-21 14:25:47 +02:00
|
|
|
}
|
|
|
|
else if(m_btnMgr.selected(m_mainBtnFavoritesOn) || m_btnMgr.selected(m_mainBtnFavoritesOff))
|
|
|
|
{
|
2017-05-15 19:50:24 +02:00
|
|
|
/* switch favorite games only on/off */
|
2012-06-21 14:25:47 +02:00
|
|
|
m_favorites = !m_favorites;
|
2012-09-11 14:01:07 +02:00
|
|
|
m_cfg.setBool(_domainFromView(), "favorites", m_favorites);
|
2012-06-21 14:25:47 +02:00
|
|
|
_initCF();
|
2022-07-16 14:08:50 +02:00
|
|
|
_showTotalGames(CoverFlow.size());
|
2012-06-21 14:25:47 +02:00
|
|
|
}
|
2012-11-11 19:28:03 +01:00
|
|
|
else if(!CoverFlow.empty() && CoverFlow.select())
|
2012-06-21 14:25:47 +02:00
|
|
|
{
|
2017-05-15 19:50:24 +02:00
|
|
|
/* select game cover or sourceflow cover */
|
2012-06-21 14:25:47 +02:00
|
|
|
_hideMain();
|
2013-09-12 15:04:50 +02:00
|
|
|
if(m_sourceflow)
|
|
|
|
{
|
2020-02-02 21:25:05 +01:00
|
|
|
_sourceFlow();// set the source selected or new source tier
|
2019-11-24 00:54:38 +01:00
|
|
|
_getCustomBgTex();
|
2020-02-02 21:25:05 +01:00
|
|
|
_setMainBg();
|
|
|
|
_showCF(true);// refresh coverflow or sourceflow list
|
2013-09-12 15:04:50 +02:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-03-04 21:29:46 +01:00
|
|
|
_game(BTN_B_HELD);
|
2013-09-12 15:04:50 +02:00
|
|
|
if(m_exit)
|
|
|
|
break;
|
|
|
|
if(BTN_B_HELD)
|
2018-10-03 19:51:57 +02:00
|
|
|
{
|
|
|
|
bheld = true;
|
2013-09-12 15:04:50 +02:00
|
|
|
bUsed = true;
|
2018-10-03 19:51:57 +02:00
|
|
|
}
|
2019-01-23 01:18:13 +01:00
|
|
|
_setMainBg();
|
2020-02-02 21:25:05 +01:00
|
|
|
if(m_refreshGameList)// if changes were made to favorites, parental lock, or categories
|
2017-05-15 19:50:24 +02:00
|
|
|
{
|
|
|
|
m_refreshGameList = false;
|
2020-02-02 21:25:05 +01:00
|
|
|
_initCF();
|
2022-07-16 14:08:50 +02:00
|
|
|
_showTotalGames(CoverFlow.size());
|
2017-05-15 19:50:24 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
CoverFlow.cancel();
|
2013-09-12 15:04:50 +02:00
|
|
|
}
|
2012-01-21 21:57:41 +01:00
|
|
|
}
|
|
|
|
}
|
2012-06-21 14:25:47 +02:00
|
|
|
else if(BTN_B_PRESSED)
|
2012-02-15 18:57:34 +01:00
|
|
|
{
|
2018-10-03 19:51:57 +02:00
|
|
|
bheld = true;
|
2019-03-04 21:29:46 +01:00
|
|
|
if(m_btnMgr.selected(m_mainBtnNext) || m_btnMgr.selected(m_mainBtnPrev))
|
2012-06-21 14:25:47 +02:00
|
|
|
{
|
2012-08-21 16:30:42 +02:00
|
|
|
bUsed = true;
|
2012-06-21 14:25:47 +02:00
|
|
|
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)
|
|
|
|
{
|
2012-11-11 19:28:03 +01:00
|
|
|
CoverFlow.setSorting((Sorting)SORT_ALPHA);
|
2012-06-21 14:25:47 +02:00
|
|
|
m_cfg.setInt(domain, "sort", SORT_ALPHA);
|
2013-09-19 20:37:41 +02:00
|
|
|
sorting = SORT_ALPHA;
|
2012-06-21 14:25:47 +02:00
|
|
|
}
|
|
|
|
wchar_t c[2] = {0, 0};
|
2012-11-11 19:28:03 +01:00
|
|
|
m_btnMgr.selected(m_mainBtnPrev) ? CoverFlow.prevLetter(c) : CoverFlow.nextLetter(c);
|
2013-01-06 22:17:30 +01:00
|
|
|
m_showtimer = 120;
|
2012-06-21 14:25:47 +02:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
2012-02-15 18:57:34 +01:00
|
|
|
}
|
2012-06-21 21:06:29 +02:00
|
|
|
else if(WROLL_LEFT)
|
2012-08-17 16:42:37 +02:00
|
|
|
{
|
2012-11-11 19:28:03 +01:00
|
|
|
CoverFlow.left();
|
2012-08-17 16:42:37 +02:00
|
|
|
}
|
2012-06-21 21:06:29 +02:00
|
|
|
else if(WROLL_RIGHT)
|
2012-08-17 16:42:37 +02:00
|
|
|
{
|
2012-11-11 19:28:03 +01:00
|
|
|
CoverFlow.right();
|
2012-08-17 16:42:37 +02:00
|
|
|
}
|
2012-06-21 14:25:47 +02:00
|
|
|
if(!BTN_B_HELD)
|
2012-01-21 21:57:41 +01:00
|
|
|
{
|
2018-10-01 23:01:43 +02:00
|
|
|
/* move coverflow */
|
2012-06-21 14:25:47 +02:00
|
|
|
if(BTN_UP_REPEAT || RIGHT_STICK_UP)
|
2012-11-11 19:28:03 +01:00
|
|
|
CoverFlow.up();
|
2012-08-17 16:42:37 +02:00
|
|
|
else if(BTN_RIGHT_REPEAT || RIGHT_STICK_RIGHT)
|
2012-11-11 19:28:03 +01:00
|
|
|
CoverFlow.right();
|
2012-06-21 14:25:47 +02:00
|
|
|
else if(BTN_DOWN_REPEAT || RIGHT_STICK_DOWN)
|
2012-11-11 19:28:03 +01:00
|
|
|
CoverFlow.down();
|
2012-08-17 16:42:37 +02:00
|
|
|
else if(BTN_LEFT_REPEAT || RIGHT_STICK_LEFT)
|
2012-11-11 19:28:03 +01:00
|
|
|
CoverFlow.left();
|
2018-10-01 23:01:43 +02:00
|
|
|
else if(BTN_MINUS_PRESSED)
|
2019-10-23 16:06:39 +02:00
|
|
|
CoverFlow.pageUp();
|
2018-10-01 23:01:43 +02:00
|
|
|
else if(BTN_PLUS_PRESSED)
|
2019-10-23 16:06:39 +02:00
|
|
|
CoverFlow.pageDown();
|
2018-10-01 23:01:43 +02:00
|
|
|
|
|
|
|
/* change coverflow layout/mode */
|
2020-04-08 19:06:21 +02:00
|
|
|
else if((BTN_1_PRESSED || BTN_2_PRESSED) && !CFLocked && !CoverFlow.empty())
|
2012-01-21 21:57:41 +01:00
|
|
|
{
|
2019-02-18 21:40:07 +01:00
|
|
|
u32 curPos = CoverFlow._currentPos();
|
2016-04-03 02:51:40 +02:00
|
|
|
s8 direction = BTN_1_PRESSED ? 1 : -1;
|
2016-11-07 16:06:00 +01:00
|
|
|
int cfVersion = 1 + loopNum((_getCFVersion() - 1) + direction, m_numCFVersions);
|
|
|
|
_setCFVersion(cfVersion);
|
2016-04-03 02:51:40 +02:00
|
|
|
_loadCFLayout(cfVersion);
|
2019-02-18 21:40:07 +01:00
|
|
|
CoverFlow._setCurPos(curPos);
|
2016-04-03 02:51:40 +02:00
|
|
|
CoverFlow.applySettings();
|
2012-06-21 14:25:47 +02:00
|
|
|
}
|
2012-01-21 21:57:41 +01:00
|
|
|
}
|
2016-11-07 16:06:00 +01:00
|
|
|
else // Button B Held
|
2012-01-21 21:57:41 +01:00
|
|
|
{
|
2012-08-21 16:30:42 +02:00
|
|
|
bheld = true;
|
2012-01-21 21:57:41 +01:00
|
|
|
const char *domain = _domainFromView();
|
2018-10-01 23:01:43 +02:00
|
|
|
|
|
|
|
/* b+down or up = move to previous or next cover in sort order */
|
2020-04-08 19:06:21 +02:00
|
|
|
if(!CoverFlow.empty() && (BTN_DOWN_PRESSED || BTN_UP_PRESSED))
|
2012-01-21 21:57:41 +01:00
|
|
|
{
|
2012-08-21 16:30:42 +02:00
|
|
|
bUsed = true;
|
2012-01-21 21:57:41 +01:00
|
|
|
int sorting = m_cfg.getInt(domain, "sort", SORT_ALPHA);
|
2018-10-01 23:01:43 +02:00
|
|
|
/* if for some reason domain sort value is not legal set it to alpha */
|
2012-06-21 14:25:47 +02:00
|
|
|
if(sorting != SORT_ALPHA && sorting != SORT_PLAYERS && sorting != SORT_WIFIPLAYERS && sorting != SORT_GAMEID)
|
2012-01-21 21:57:41 +01:00
|
|
|
{
|
2012-11-11 19:28:03 +01:00
|
|
|
CoverFlow.setSorting((Sorting)SORT_ALPHA);
|
2012-01-21 21:57:41 +01:00
|
|
|
m_cfg.setInt(domain, "sort", SORT_ALPHA);
|
2013-09-19 20:37:41 +02:00
|
|
|
sorting = SORT_ALPHA;
|
2012-01-21 21:57:41 +01:00
|
|
|
}
|
2018-10-01 23:01:43 +02:00
|
|
|
/* move coverflow */
|
2012-01-21 21:57:41 +01:00
|
|
|
wchar_t c[2] = {0, 0};
|
2012-11-11 19:28:03 +01:00
|
|
|
BTN_UP_PRESSED ? CoverFlow.prevLetter(c) : CoverFlow.nextLetter(c);
|
2012-01-21 21:57:41 +01:00
|
|
|
|
2018-10-01 23:01:43 +02:00
|
|
|
/* set sort text and display it */
|
2012-01-21 21:57:41 +01:00
|
|
|
curLetter.clear();
|
|
|
|
curLetter = wstringEx(c);
|
2013-01-06 22:17:30 +01:00
|
|
|
m_showtimer = 120;
|
2012-01-21 21:57:41 +01:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
2018-10-01 23:01:43 +02:00
|
|
|
else if(BTN_LEFT_PRESSED)// b+left = previous song
|
2012-01-21 21:57:41 +01:00
|
|
|
{
|
2012-08-21 16:30:42 +02:00
|
|
|
bUsed = true;
|
2016-04-02 18:38:11 +02:00
|
|
|
MusicPlayer.Previous();
|
2012-06-21 14:25:47 +02:00
|
|
|
}
|
2018-10-01 23:01:43 +02:00
|
|
|
else if(BTN_RIGHT_PRESSED)// b+right = next song
|
2012-06-21 14:25:47 +02:00
|
|
|
{
|
2012-08-21 16:30:42 +02:00
|
|
|
bUsed = true;
|
2016-04-02 18:38:11 +02:00
|
|
|
MusicPlayer.Next();
|
2012-06-21 14:25:47 +02:00
|
|
|
}
|
2018-10-01 23:01:43 +02:00
|
|
|
/* b+plus = change sort mode */
|
2020-04-08 19:06:21 +02:00
|
|
|
else if(!CoverFlow.empty() && BTN_PLUS_PRESSED && !m_locked && (m_current_view < 8 || m_sourceflow))// <8 excludes plugins and homebrew
|
2012-06-21 14:25:47 +02:00
|
|
|
{
|
2012-08-21 16:30:42 +02:00
|
|
|
bUsed = true;
|
2018-10-01 13:48:52 +02:00
|
|
|
u8 sort = 0;
|
2018-10-01 23:01:43 +02:00
|
|
|
if(m_sourceflow)// change sourceflow sort mode
|
2018-10-01 13:48:52 +02:00
|
|
|
{
|
|
|
|
sort = m_cfg.getInt(SOURCEFLOW_DOMAIN, "sort", SORT_ALPHA);
|
|
|
|
if(sort == SORT_ALPHA)
|
|
|
|
sort = SORT_BTN_NUMBERS;
|
|
|
|
else
|
|
|
|
sort = SORT_ALPHA;
|
|
|
|
}
|
2018-10-01 23:01:43 +02:00
|
|
|
else // change all other coverflow sort mode
|
2018-10-01 13:48:52 +02:00
|
|
|
sort = loopNum((m_cfg.getInt(domain, "sort", 0)) + 1, SORT_MAX);
|
2012-01-21 21:57:41 +01:00
|
|
|
m_cfg.setInt(domain, "sort", sort);
|
2018-10-01 23:01:43 +02:00
|
|
|
|
2018-10-01 13:48:52 +02:00
|
|
|
/* set coverflow to new sorting */
|
2013-09-19 20:37:41 +02:00
|
|
|
_initCF();
|
2018-10-01 23:01:43 +02:00
|
|
|
/* set sort mode text and display it */
|
2012-01-21 21:57:41 +01:00
|
|
|
wstringEx curSort ;
|
2012-06-21 14:25:47 +02:00
|
|
|
if(sort == SORT_ALPHA)
|
2012-01-21 21:57:41 +01:00
|
|
|
curSort = m_loc.getWString(m_curLanguage, "alphabetically", L"Alphabetically");
|
2012-06-21 14:25:47 +02:00
|
|
|
else if(sort == SORT_PLAYCOUNT)
|
2012-01-21 21:57:41 +01:00
|
|
|
curSort = m_loc.getWString(m_curLanguage, "byplaycount", L"By Play Count");
|
2012-06-21 14:25:47 +02:00
|
|
|
else if(sort == SORT_LASTPLAYED)
|
2012-01-21 21:57:41 +01:00
|
|
|
curSort = m_loc.getWString(m_curLanguage, "bylastplayed", L"By Last Played");
|
2012-06-21 14:25:47 +02:00
|
|
|
else if(sort == SORT_GAMEID)
|
2012-01-21 21:57:41 +01:00
|
|
|
curSort = m_loc.getWString(m_curLanguage, "bygameid", L"By Game I.D.");
|
2012-06-21 14:25:47 +02:00
|
|
|
else if(sort == SORT_WIFIPLAYERS)
|
2012-01-21 21:57:41 +01:00
|
|
|
curSort = m_loc.getWString(m_curLanguage, "bywifiplayers", L"By Wifi Players");
|
2012-06-21 14:25:47 +02:00
|
|
|
else if(sort == SORT_PLAYERS)
|
2012-01-21 21:57:41 +01:00
|
|
|
curSort = m_loc.getWString(m_curLanguage, "byplayers", L"By Players");
|
2018-10-01 13:48:52 +02:00
|
|
|
else if(sort == SORT_BTN_NUMBERS)
|
|
|
|
curSort = m_loc.getWString(m_curLanguage, "bybtnnumbers", L"By Button Numbers");
|
2013-01-06 22:17:30 +01:00
|
|
|
m_showtimer = 120;
|
2012-01-21 21:57:41 +01:00
|
|
|
m_btnMgr.setText(m_mainLblNotice, curSort);
|
|
|
|
m_btnMgr.show(m_mainLblNotice);
|
|
|
|
}
|
2018-10-01 23:01:43 +02:00
|
|
|
/* b+minus = select random game or boot random game */
|
2016-11-07 16:06:00 +01:00
|
|
|
else if(BTN_MINUS_PRESSED && !CoverFlow.empty())
|
|
|
|
{
|
|
|
|
_hideMain();
|
|
|
|
srand(time(NULL));
|
|
|
|
u16 place = (rand() + rand() + rand()) % CoverFlow.size();
|
2018-10-01 23:01:43 +02:00
|
|
|
|
|
|
|
if(m_cfg.getBool("GENERAL", "random_select", false))// random select a game
|
2017-09-22 00:03:41 +02:00
|
|
|
{
|
|
|
|
CoverFlow.setSelected(place);
|
|
|
|
_game(false);
|
|
|
|
if(m_exit)
|
|
|
|
break;
|
|
|
|
if(BTN_B_HELD)
|
2018-10-03 19:51:57 +02:00
|
|
|
{
|
|
|
|
bheld = true;
|
2017-09-22 00:03:41 +02:00
|
|
|
bUsed = true;
|
2018-10-03 19:51:57 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
bheld = false;
|
2017-09-22 00:03:41 +02:00
|
|
|
if(m_refreshGameList)
|
|
|
|
{
|
|
|
|
/* if changes were made to favorites, parental lock, or categories */
|
|
|
|
_initCF();
|
|
|
|
m_refreshGameList = false;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
CoverFlow.cancel();
|
|
|
|
}
|
2018-10-01 23:01:43 +02:00
|
|
|
else // boot a random game
|
2017-09-22 00:03:41 +02:00
|
|
|
{
|
|
|
|
gprintf("Lets boot the random game number %u\n", place);
|
|
|
|
const dir_discHdr *gameHdr = CoverFlow.getSpecificHdr(place);
|
|
|
|
if(gameHdr != NULL)
|
|
|
|
_launch(gameHdr);
|
2018-10-01 23:01:43 +02:00
|
|
|
_showCF(false);// this shouldn't happen
|
2017-09-22 00:03:41 +02:00
|
|
|
}
|
2016-11-07 16:06:00 +01:00
|
|
|
}
|
2012-01-21 21:57:41 +01:00
|
|
|
}
|
2016-07-22 01:40:12 +02:00
|
|
|
/* Hide Notice or Letter if times up */
|
2012-06-21 14:25:47 +02:00
|
|
|
if(m_showtimer > 0)
|
2012-01-21 21:57:41 +01:00
|
|
|
{
|
2012-06-21 14:25:47 +02:00
|
|
|
if(--m_showtimer == 0)
|
2012-01-21 21:57:41 +01:00
|
|
|
{
|
|
|
|
m_btnMgr.hide(m_mainLblLetter);
|
|
|
|
m_btnMgr.hide(m_mainLblNotice);
|
|
|
|
}
|
2012-06-21 14:25:47 +02:00
|
|
|
}
|
2016-07-22 01:40:12 +02:00
|
|
|
/*zones, showing and hiding buttons */
|
2019-03-04 21:29:46 +01:00
|
|
|
if(!m_gameList.empty() && m_show_zone_prev && !m_sourceflow)
|
2012-01-21 21:57:41 +01:00
|
|
|
m_btnMgr.show(m_mainBtnPrev);
|
|
|
|
else
|
|
|
|
m_btnMgr.hide(m_mainBtnPrev);
|
2016-11-07 16:06:00 +01:00
|
|
|
|
2019-03-04 21:29:46 +01:00
|
|
|
if(!m_gameList.empty() && m_show_zone_next && !m_sourceflow)
|
2012-01-21 21:57:41 +01:00
|
|
|
m_btnMgr.show(m_mainBtnNext);
|
|
|
|
else
|
|
|
|
m_btnMgr.hide(m_mainBtnNext);
|
2016-11-07 16:06:00 +01:00
|
|
|
|
2019-07-10 13:59:30 +02:00
|
|
|
if((!Auto_hide_icons || m_show_zone_main) && !m_sourceflow)
|
2012-01-21 21:57:41 +01:00
|
|
|
{
|
|
|
|
m_btnMgr.show(m_mainLblUser[0]);
|
|
|
|
m_btnMgr.show(m_mainLblUser[1]);
|
2019-03-04 21:29:46 +01:00
|
|
|
m_btnMgr.show(m_mainBtnCategories);
|
2019-10-30 17:46:30 +01:00
|
|
|
m_btnMgr.show(m_mainBtnConfig);
|
2016-11-07 16:06:00 +01:00
|
|
|
m_btnMgr.show(m_mainBtnHome);
|
2019-10-20 01:45:51 +02:00
|
|
|
m_btnMgr.show(m_favorites ? m_mainBtnFavoritesOn : m_mainBtnFavoritesOff);
|
|
|
|
m_btnMgr.hide(m_favorites ? m_mainBtnFavoritesOff : m_mainBtnFavoritesOn);
|
2012-01-21 21:57:41 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_btnMgr.hide(m_mainLblUser[0]);
|
|
|
|
m_btnMgr.hide(m_mainLblUser[1]);
|
2019-10-30 17:46:30 +01:00
|
|
|
m_btnMgr.hide(m_mainBtnConfig);
|
2019-03-04 21:29:46 +01:00
|
|
|
m_btnMgr.hide(m_mainBtnCategories);
|
2016-11-07 16:06:00 +01:00
|
|
|
m_btnMgr.hide(m_mainBtnHome);
|
2012-01-21 21:57:41 +01:00
|
|
|
m_btnMgr.hide(m_mainBtnFavoritesOn);
|
|
|
|
m_btnMgr.hide(m_mainBtnFavoritesOff);
|
|
|
|
}
|
2019-07-10 13:59:30 +02:00
|
|
|
if(!m_cfg.getBool("GENERAL", "hideviews", false) && (!Auto_hide_icons || m_show_zone_main2) && !m_sourceflow)
|
2012-02-13 18:09:26 +01:00
|
|
|
{
|
2012-06-21 14:25:47 +02:00
|
|
|
switch(m_current_view)
|
|
|
|
{
|
2016-12-01 01:05:39 +01:00
|
|
|
case COVERFLOW_WII:
|
|
|
|
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);
|
2019-03-04 21:29:46 +01:00
|
|
|
else if(show_homebrew)
|
|
|
|
m_btnMgr.show(m_mainBtnHomebrew);
|
2016-12-01 01:05:39 +01:00
|
|
|
else
|
|
|
|
m_btnMgr.show(m_mainBtnWii);
|
|
|
|
break;
|
2016-04-02 18:00:47 +02:00
|
|
|
case COVERFLOW_GAMECUBE:
|
2012-06-21 14:25:47 +02:00
|
|
|
if(show_channel)
|
|
|
|
m_btnMgr.show(m_mainBtnChannel);
|
2016-04-03 02:51:40 +02:00
|
|
|
else if(show_plugin)
|
2016-04-03 02:31:02 +02:00
|
|
|
m_btnMgr.show(m_mainBtnPlugin);
|
2019-03-04 21:29:46 +01:00
|
|
|
else if(show_homebrew)
|
|
|
|
m_btnMgr.show(m_mainBtnHomebrew);
|
2012-06-21 14:25:47 +02:00
|
|
|
else
|
2016-04-03 02:31:02 +02:00
|
|
|
m_btnMgr.show(m_mainBtnWii);
|
2012-06-21 14:25:47 +02:00
|
|
|
break;
|
|
|
|
case COVERFLOW_CHANNEL:
|
2016-04-03 02:51:40 +02:00
|
|
|
if(show_plugin)
|
2016-04-03 02:31:02 +02:00
|
|
|
m_btnMgr.show(m_mainBtnPlugin);
|
2019-03-04 21:29:46 +01:00
|
|
|
else if(show_homebrew)
|
|
|
|
m_btnMgr.show(m_mainBtnHomebrew);
|
|
|
|
else
|
|
|
|
m_btnMgr.show(m_mainBtnWii);
|
|
|
|
break;
|
|
|
|
case COVERFLOW_PLUGIN:
|
|
|
|
if(show_homebrew)
|
|
|
|
m_btnMgr.show(m_mainBtnHomebrew);
|
2012-06-21 14:25:47 +02:00
|
|
|
else
|
2016-04-03 02:31:02 +02:00
|
|
|
m_btnMgr.show(m_mainBtnWii);
|
2012-06-21 14:25:47 +02:00
|
|
|
break;
|
2016-12-01 01:05:39 +01:00
|
|
|
default:
|
2016-04-03 02:31:02 +02:00
|
|
|
m_btnMgr.show(m_mainBtnWii);
|
2012-06-21 14:25:47 +02:00
|
|
|
break;
|
|
|
|
}
|
2012-01-21 21:57:41 +01:00
|
|
|
m_btnMgr.show(m_mainLblUser[2]);
|
|
|
|
m_btnMgr.show(m_mainLblUser[3]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_btnMgr.hide(m_mainBtnChannel);
|
2016-04-03 02:31:02 +02:00
|
|
|
m_btnMgr.hide(m_mainBtnWii);
|
|
|
|
m_btnMgr.hide(m_mainBtnGamecube);
|
|
|
|
m_btnMgr.hide(m_mainBtnPlugin);
|
2019-03-04 21:29:46 +01:00
|
|
|
m_btnMgr.hide(m_mainBtnHomebrew);
|
2012-01-21 21:57:41 +01:00
|
|
|
m_btnMgr.hide(m_mainLblUser[2]);
|
|
|
|
m_btnMgr.hide(m_mainLblUser[3]);
|
|
|
|
}
|
2019-07-10 13:59:30 +02:00
|
|
|
if((!Auto_hide_icons || m_show_zone_main3) && !m_sourceflow)
|
2012-01-21 21:57:41 +01:00
|
|
|
{
|
|
|
|
m_btnMgr.show(m_mainBtnDVD);
|
|
|
|
m_btnMgr.show(m_mainLblUser[4]);
|
|
|
|
m_btnMgr.show(m_mainLblUser[5]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_btnMgr.hide(m_mainBtnDVD);
|
|
|
|
m_btnMgr.hide(m_mainLblUser[4]);
|
|
|
|
m_btnMgr.hide(m_mainLblUser[5]);
|
|
|
|
}
|
|
|
|
for(int chan = WPAD_MAX_WIIMOTES-1; chan >= 0; chan--)
|
2012-05-13 17:13:33 +02:00
|
|
|
{
|
2012-06-21 14:25:47 +02:00
|
|
|
if(WPadIR_Valid(chan) || (m_show_pointer[chan] && !WPadIR_Valid(chan)))
|
2012-11-11 19:28:03 +01:00
|
|
|
CoverFlow.mouse(chan, m_cursor[chan].x(), m_cursor[chan].y());
|
2012-01-21 21:57:41 +01:00
|
|
|
else
|
2012-11-11 19:28:03 +01:00
|
|
|
CoverFlow.mouse(chan, -1, -1);
|
2012-05-13 17:13:33 +02:00
|
|
|
}
|
2012-01-21 21:57:41 +01:00
|
|
|
}
|
2022-02-28 19:48:37 +01:00
|
|
|
if(m_reload)// rebooting wiiflow (forced in Home Menu or new theme)
|
2012-08-13 18:30:34 +02:00
|
|
|
{
|
2018-06-27 14:47:03 +02:00
|
|
|
vector<string> arguments = _getMetaXML(fmt("%s/boot.dol", m_appDir.c_str()));
|
|
|
|
_launchHomebrew(fmt("%s/boot.dol", m_appDir.c_str()), arguments);
|
2012-08-13 18:30:34 +02:00
|
|
|
return 0;
|
|
|
|
}
|
2017-05-15 19:50:24 +02:00
|
|
|
cleanup();
|
2012-11-03 20:16:03 +01:00
|
|
|
//gprintf("Saving configuration files\n");
|
2016-11-07 16:06:00 +01:00
|
|
|
m_gcfg1.save(true);// save configs on power off or exit wiiflow
|
-updating wiiflow lite to beta 4.3.0
-fixed using categories to hide GC disc 2's. Apparently this has never really worked right for some time or ever.
-fixed deleting the cached cover texture file for plugin games. Delete cover for plugins only deletes the cached texture file (.wfc)
-fixed favorites and adultonly (parental lock) for plugin games. Apparently I may have broke this a few revisions back.
-favorites and adultonly for plugin games now have their own domains in gamecfg1- [FAVORITES_PLUGINS] and [ADULTONLY_PLUGINS]. just makes it more organized.
-only wii, GC, channels are added to [PLAYCOUNT] and [LAST_PLAYED] in gamecfg1.
-now loading gamecfg1 at startup and leaving it loaded till exit. no more loading it and unloading all the time.
-fixed scrolling for game_info synopsis, credits, and help text.
-made source menu buttons wider for wiiflow default. old 80x80, now 100x80. looks better.
-display music info now defaults to off
-screensaver_disabled now defaults to yes
-show GC view button is now on by default no matter what. the only way it is disabled is if you edit wiiflow.ini manually. this is how all the view buttons work.
-removed hiding homebrew button but if wiiflow locked it won't work or in sourceflow it won't show.
-dump_list is now under [GENERAL] instead of each view. Also only works for Wii, GC, and channels.
-sorting only works for Wii, GC, and Channels now. disabled for sourceflow, plugins, homebrew, and combined view.
-now if no games are found a message is shown with the current path so you can see where wiiflow is looking. (except for plugins)
-removed auto create emuNAND for emuNAND view if gamelist is empty. just go to settings>NAND settings if you want to extract or disable it.
-now when no games are found all buttons at bottom are still accessible allowing you to change the view or go to settings and change current partition or path and even extract your NAND to create a EmuNAND. Or go to Home Menu and Install a Wii or GC game.
-removed auto extract NAND to emuNAND when launching a Wii game with EmuNAND save. Now a message is diplayed saying 'emuNAND for saves not found - using real NAND'.
-made the speed at which cover titles fade in/out almost instantly.
-removed update button from Home Menu. online update code is still there but not used and probably won't be used any more as there just isn't a need for it now.
-removed ftp button from Home Menu and all code for the FTP server. I just use WiiXplorer's FTP server. it seems to work better for me.
-disabled keep USB Alive thread for now. i think there's a possibilty it might be the cause of my SD/USB files getting corrupted.
-removed Btn B and - combo to switch partitions. didn't seem useful anymore.
-redid nand emulation settings menu. looks like this now:
pg1
Select EmuNAND
EmuNAND Enulation
Select SaveNAND
SaveNAND Emulation
pg2
Extract Saves All
Missing
Extract NAND
Select Saves Partition
-no longer blocking Select Plugin menu and View icons when using source menu combined view
-now Select Plugins Menu is like switching to plugin view but you get to choose the plugins first
-now [PLUGIN] partition= is the default partition for all plugins. to change individual plugins add 'romPartition=x' to the plugin ini. x is the partition number 0 thru 8 with SD being 0. this is how my usbloadergx plugin mod works.
2016-10-05 01:44:13 +02:00
|
|
|
m_gcfg2.save(true);
|
|
|
|
m_cat.save(true);
|
|
|
|
m_cfg.save(true);
|
2012-08-13 18:30:34 +02:00
|
|
|
return 0;
|
2012-01-21 21:57:41 +01:00
|
|
|
}
|
|
|
|
|
2012-11-03 20:16:03 +01:00
|
|
|
void CMenu::_initMainMenu()
|
2012-01-21 21:57:41 +01:00
|
|
|
{
|
2019-03-04 21:29:46 +01:00
|
|
|
TexData texCategories;
|
|
|
|
TexData texCategoriesS;
|
2016-11-07 16:06:00 +01:00
|
|
|
TexData texHome;
|
|
|
|
TexData texHomeS;
|
2019-10-30 17:46:30 +01:00
|
|
|
TexData texConfig;
|
|
|
|
TexData texConfigS;
|
2016-04-03 02:31:02 +02:00
|
|
|
TexData texGamecube;
|
|
|
|
TexData texGamecubes;
|
|
|
|
TexData texPlugin;
|
|
|
|
TexData texPlugins;
|
2012-12-28 15:19:40 +01:00
|
|
|
TexData texDVD;
|
|
|
|
TexData texDVDs;
|
2016-04-03 02:31:02 +02:00
|
|
|
TexData texWii;
|
|
|
|
TexData texWiis;
|
2012-12-28 15:19:40 +01:00
|
|
|
TexData texChannel;
|
|
|
|
TexData texChannels;
|
|
|
|
TexData texHomebrew;
|
|
|
|
TexData texHomebrews;
|
|
|
|
TexData texPrev;
|
|
|
|
TexData texPrevS;
|
|
|
|
TexData texNext;
|
|
|
|
TexData texNextS;
|
|
|
|
TexData texFavOn;
|
|
|
|
TexData texFavOnS;
|
|
|
|
TexData texFavOff;
|
|
|
|
TexData texFavOffS;
|
|
|
|
TexData bgLQ;
|
|
|
|
TexData emptyTex;
|
2022-07-02 00:36:03 +02:00
|
|
|
//TexData texUser1;
|
2012-01-21 21:57:41 +01:00
|
|
|
|
2012-11-03 20:16:03 +01:00
|
|
|
m_mainBg = _texture("MAIN/BG", "texture", theme.bg, false);
|
2012-12-28 15:19:40 +01:00
|
|
|
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)
|
2012-01-21 21:57:41 +01:00
|
|
|
m_mainBgLQ = bgLQ;
|
|
|
|
|
2019-03-04 21:29:46 +01:00
|
|
|
TexHandle.fromImageFile(texCategories, fmt("%s/btncat.png", m_imgsDir.c_str()));
|
|
|
|
TexHandle.fromImageFile(texCategoriesS, fmt("%s/btncats.png", m_imgsDir.c_str()));
|
2019-10-30 17:46:30 +01:00
|
|
|
TexHandle.fromImageFile(texHome, fmt("%s/btnquit.png", m_imgsDir.c_str()));// home button
|
|
|
|
TexHandle.fromImageFile(texHomeS, fmt("%s/btnquits.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()));
|
2013-11-19 16:27:52 +01:00
|
|
|
TexHandle.fromImageFile(texDVD, fmt("%s/btndvd.png", m_imgsDir.c_str()));
|
|
|
|
TexHandle.fromImageFile(texDVDs, fmt("%s/btndvds.png", m_imgsDir.c_str()));
|
2016-04-03 02:31:02 +02:00
|
|
|
TexHandle.fromImageFile(texWii, fmt("%s/btnusb.png", m_imgsDir.c_str()));
|
|
|
|
TexHandle.fromImageFile(texWiis, fmt("%s/btnusbs.png", m_imgsDir.c_str()));
|
|
|
|
TexHandle.fromImageFile(texGamecube, fmt("%s/btndml.png", m_imgsDir.c_str()));
|
|
|
|
TexHandle.fromImageFile(texGamecubes, fmt("%s/btndmls.png", m_imgsDir.c_str()));
|
|
|
|
TexHandle.fromImageFile(texPlugin, fmt("%s/btnemu.png", m_imgsDir.c_str()));
|
|
|
|
TexHandle.fromImageFile(texPlugins, fmt("%s/btnemus.png", m_imgsDir.c_str()));
|
2013-11-19 16:27:52 +01:00
|
|
|
TexHandle.fromImageFile(texChannel, fmt("%s/btnchannel.png", m_imgsDir.c_str()));
|
|
|
|
TexHandle.fromImageFile(texChannels, fmt("%s/btnchannels.png", m_imgsDir.c_str()));
|
|
|
|
TexHandle.fromImageFile(texHomebrew, fmt("%s/btnhomebrew.png", m_imgsDir.c_str()));
|
|
|
|
TexHandle.fromImageFile(texHomebrews, fmt("%s/btnhomebrews.png", m_imgsDir.c_str()));
|
|
|
|
TexHandle.fromImageFile(texPrev, fmt("%s/btnprev.png", m_imgsDir.c_str()));
|
|
|
|
TexHandle.fromImageFile(texPrevS, fmt("%s/btnprevs.png", m_imgsDir.c_str()));
|
|
|
|
TexHandle.fromImageFile(texNext, fmt("%s/btnnext.png", m_imgsDir.c_str()));
|
|
|
|
TexHandle.fromImageFile(texNextS, fmt("%s/btnnexts.png", m_imgsDir.c_str()));
|
2019-03-04 21:29:46 +01:00
|
|
|
TexHandle.fromImageFile(texFavOn, fmt("%s/gamefavon.png", m_imgsDir.c_str()));
|
|
|
|
TexHandle.fromImageFile(texFavOnS, fmt("%s/gamefavons.png", m_imgsDir.c_str()));
|
|
|
|
TexHandle.fromImageFile(texFavOff, fmt("%s/gamefavoff.png", m_imgsDir.c_str()));
|
|
|
|
TexHandle.fromImageFile(texFavOffS, fmt("%s/gamefavoffs.png", m_imgsDir.c_str()));
|
2022-07-02 00:36:03 +02:00
|
|
|
//TexHandle.fromImageFile(texUser1, fmt("%s/mainUser1.png", m_imgsDir.c_str()));
|
2012-01-21 21:57:41 +01:00
|
|
|
|
2012-11-03 20:16:03 +01:00
|
|
|
_addUserLabels(m_mainLblUser, ARRAY_SIZE(m_mainLblUser), "MAIN");
|
|
|
|
|
2019-10-30 17:46:30 +01:00
|
|
|
m_mainBtnCategories = _addPicButton("MAIN/CATEGORIES_BTN", texCategories, texCategoriesS, 126, 400, 48, 48);
|
|
|
|
m_mainBtnFavoritesOn = _addPicButton("MAIN/FAVORITES_ON", texFavOn, texFavOnS, 194, 400, 48, 48);
|
|
|
|
m_mainBtnFavoritesOff = _addPicButton("MAIN/FAVORITES_OFF", texFavOff, texFavOffS, 194, 400, 48, 48);
|
|
|
|
m_mainBtnConfig = _addPicButton("MAIN/CONFIG_BTN", texConfig, texConfigS, 262, 400, 48, 48);
|
|
|
|
m_mainBtnHome = _addPicButton("MAIN/QUIT_BTN", texHome, texHomeS, 330, 400, 48, 48);
|
|
|
|
m_mainBtnChannel = _addPicButton("MAIN/CHANNEL_BTN", texChannel, texChannels, 398, 400, 48, 48);
|
|
|
|
m_mainBtnHomebrew = _addPicButton("MAIN/HOMEBREW_BTN", texHomebrew, texHomebrews, 398, 400, 48, 48);
|
|
|
|
m_mainBtnWii = _addPicButton("MAIN/USB_BTN", texWii, texWiis, 398, 400, 48, 48);
|
|
|
|
m_mainBtnGamecube = _addPicButton("MAIN/DML_BTN", texGamecube, texGamecubes, 398, 400, 48, 48);
|
|
|
|
m_mainBtnPlugin = _addPicButton("MAIN/EMU_BTN", texPlugin, texPlugins, 398, 400, 48, 48);
|
|
|
|
m_mainBtnDVD = _addPicButton("MAIN/DVD_BTN", texDVD, texDVDs, 466, 400, 48, 48);
|
2019-03-04 21:29:46 +01:00
|
|
|
|
2012-11-03 20:16:03 +01:00
|
|
|
m_mainBtnNext = _addPicButton("MAIN/NEXT_BTN", texNext, texNextS, 540, 146, 80, 80);
|
|
|
|
m_mainBtnPrev = _addPicButton("MAIN/PREV_BTN", texPrev, texPrevS, 20, 146, 80, 80);
|
2019-03-04 21:29:46 +01:00
|
|
|
|
2018-12-28 01:47:00 +01:00
|
|
|
m_mainLblMessage = _addLabel("MAIN/MESSAGE", theme.lblFont, L"", 40, 40, 560, 140, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
|
2012-11-03 20:16:03 +01:00
|
|
|
m_mainLblLetter = _addLabel("MAIN/LETTER", theme.titleFont, L"", 540, 40, 80, 80, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, emptyTex);
|
2018-12-28 01:47:00 +01:00
|
|
|
m_mainLblNotice = _addLabel("MAIN/NOTICE", theme.txtFont, L"", 340, 40, 280, 80, theme.titleFontColor, FTGX_JUSTIFY_RIGHT | FTGX_ALIGN_MIDDLE);
|
2019-03-04 21:29:46 +01:00
|
|
|
m_mainLblCurMusic = _addLabel("MAIN/MUSIC", theme.txtFont, L"", 0, 10, 640, 32, theme.txtFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC);
|
2019-10-30 17:46:30 +01:00
|
|
|
|
2016-11-07 16:06:00 +01:00
|
|
|
m_mem1FreeSize = _addLabel("MEM1", theme.btnFont, L"", 40, 300, 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);
|
2012-01-21 21:57:41 +01:00
|
|
|
//
|
|
|
|
m_mainPrevZone.x = m_theme.getInt("MAIN/ZONES", "prev_x", -32);
|
|
|
|
m_mainPrevZone.y = m_theme.getInt("MAIN/ZONES", "prev_y", -32);
|
|
|
|
m_mainPrevZone.w = m_theme.getInt("MAIN/ZONES", "prev_w", 182);
|
|
|
|
m_mainPrevZone.h = m_theme.getInt("MAIN/ZONES", "prev_h", 382);
|
|
|
|
m_mainPrevZone.hide = m_theme.getBool("MAIN/ZONES", "prev_hide", true);
|
|
|
|
|
|
|
|
m_mainNextZone.x = m_theme.getInt("MAIN/ZONES", "next_x", 490);
|
|
|
|
m_mainNextZone.y = m_theme.getInt("MAIN/ZONES", "next_y", -32);
|
|
|
|
m_mainNextZone.w = m_theme.getInt("MAIN/ZONES", "next_w", 182);
|
|
|
|
m_mainNextZone.h = m_theme.getInt("MAIN/ZONES", "next_h", 382);
|
|
|
|
m_mainNextZone.hide = m_theme.getBool("MAIN/ZONES", "next_hide", true);
|
|
|
|
|
|
|
|
m_mainButtonsZone.x = m_theme.getInt("MAIN/ZONES", "buttons_x", -32);
|
|
|
|
m_mainButtonsZone.y = m_theme.getInt("MAIN/ZONES", "buttons_y", 350);
|
|
|
|
m_mainButtonsZone.w = m_theme.getInt("MAIN/ZONES", "buttons_w", 704);
|
|
|
|
m_mainButtonsZone.h = m_theme.getInt("MAIN/ZONES", "buttons_h", 162);
|
|
|
|
m_mainButtonsZone.hide = m_theme.getBool("MAIN/ZONES", "buttons_hide", true);
|
|
|
|
|
|
|
|
m_mainButtonsZone2.x = m_theme.getInt("MAIN/ZONES", "buttons2_x", -32);
|
|
|
|
m_mainButtonsZone2.y = m_theme.getInt("MAIN/ZONES", "buttons2_y", 350);
|
|
|
|
m_mainButtonsZone2.w = m_theme.getInt("MAIN/ZONES", "buttons2_w", 704);
|
|
|
|
m_mainButtonsZone2.h = m_theme.getInt("MAIN/ZONES", "buttons2_h", 162);
|
|
|
|
m_mainButtonsZone2.hide = m_theme.getBool("MAIN/ZONES", "buttons2_hide", true);
|
|
|
|
|
|
|
|
m_mainButtonsZone3.x = m_theme.getInt("MAIN/ZONES", "buttons3_x", -32);
|
|
|
|
m_mainButtonsZone3.y = m_theme.getInt("MAIN/ZONES", "buttons3_y", 350);
|
|
|
|
m_mainButtonsZone3.w = m_theme.getInt("MAIN/ZONES", "buttons3_w", 704);
|
|
|
|
m_mainButtonsZone3.h = m_theme.getInt("MAIN/ZONES", "buttons3_h", 162);
|
|
|
|
m_mainButtonsZone3.hide = m_theme.getBool("MAIN/ZONES", "buttons3_hide", true);
|
|
|
|
//
|
|
|
|
_setHideAnim(m_mainBtnNext, "MAIN/NEXT_BTN", 0, 0, 0.f, 0.f);
|
|
|
|
_setHideAnim(m_mainBtnPrev, "MAIN/PREV_BTN", 0, 0, 0.f, 0.f);
|
2019-03-04 21:29:46 +01:00
|
|
|
_setHideAnim(m_mainBtnCategories, "MAIN/CATEGORIES_BTN", 0, 40, 0.f, 0.f);
|
2019-10-30 17:46:30 +01:00
|
|
|
_setHideAnim(m_mainBtnConfig, "MAIN/CONFIG_BTN", 0, 40, 0.f, 0.f);
|
2016-11-07 16:06:00 +01:00
|
|
|
_setHideAnim(m_mainBtnHome, "MAIN/QUIT_BTN", 0, 40, 0.f, 0.f);
|
2012-01-21 21:57:41 +01:00
|
|
|
_setHideAnim(m_mainBtnChannel, "MAIN/CHANNEL_BTN", 0, 40, 0.f, 0.f);
|
|
|
|
_setHideAnim(m_mainBtnHomebrew, "MAIN/HOMEBREW_BTN", 0, 40, 0.f, 0.f);
|
2016-04-03 02:31:02 +02:00
|
|
|
_setHideAnim(m_mainBtnWii, "MAIN/USB_BTN", 0, 40, 0.f, 0.f);
|
|
|
|
_setHideAnim(m_mainBtnGamecube, "MAIN/DML_BTN", 0, 40, 0.f, 0.f);
|
|
|
|
_setHideAnim(m_mainBtnPlugin, "MAIN/EMU_BTN", 0, 40, 0.f, 0.f);
|
2012-01-21 21:57:41 +01:00
|
|
|
_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_mainBtnFavoritesOff, "MAIN/FAVORITES_OFF", 0, 40, 0.f, 0.f);
|
2016-04-03 02:51:40 +02:00
|
|
|
_setHideAnim(m_mainLblMessage, "MAIN/MESSAGE", 0, 0, 0.f, 0.f);
|
2012-01-21 21:57:41 +01:00
|
|
|
_setHideAnim(m_mainLblLetter, "MAIN/LETTER", 0, 0, 0.f, 0.f);
|
|
|
|
_setHideAnim(m_mainLblNotice, "MAIN/NOTICE", 0, 0, 0.f, 0.f);
|
2012-09-16 15:41:31 +02:00
|
|
|
_setHideAnim(m_mainLblCurMusic, "MAIN/MUSIC", 0, -100, 0.f, 0.f);
|
2016-11-07 16:06:00 +01:00
|
|
|
//#ifdef SHOWMEM
|
2013-01-21 00:30:28 +01:00
|
|
|
_setHideAnim(m_mem1FreeSize, "MEM1", 0, 0, 0.f, 0.f);
|
2012-01-21 21:57:41 +01:00
|
|
|
_setHideAnim(m_mem2FreeSize, "MEM2", 0, 0, 0.f, 0.f);
|
2016-11-07 16:06:00 +01:00
|
|
|
//#endif
|
2012-01-21 21:57:41 +01:00
|
|
|
_hideMain(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
wstringEx CMenu::_getNoticeTranslation(int sorting, wstringEx curLetter)
|
|
|
|
{
|
|
|
|
if(sorting == SORT_PLAYERS)
|
|
|
|
curLetter += m_loc.getWString(m_curLanguage, "players", L" Players");
|
|
|
|
else if(sorting == SORT_WIFIPLAYERS)
|
|
|
|
curLetter += m_loc.getWString(m_curLanguage, "wifiplayers", L" Wifi Players");
|
|
|
|
else if(sorting == SORT_GAMEID)
|
|
|
|
{
|
|
|
|
switch(curLetter[0])
|
|
|
|
{
|
|
|
|
case L'C':
|
|
|
|
{
|
|
|
|
if(m_current_view != COVERFLOW_CHANNEL)
|
|
|
|
curLetter = m_loc.getWString(m_curLanguage, "custom", L"Custom");
|
|
|
|
else
|
|
|
|
curLetter = m_loc.getWString(m_curLanguage, "commodore", L"Commodore 64");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case L'E':
|
|
|
|
{
|
|
|
|
curLetter = m_loc.getWString(m_curLanguage, "neogeo", L"Neo-Geo");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case L'F':
|
|
|
|
{
|
|
|
|
curLetter = m_loc.getWString(m_curLanguage, "nes", L"Nintendo");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case L'J':
|
|
|
|
{
|
|
|
|
curLetter = m_loc.getWString(m_curLanguage, "snes", L"Super Nintendo");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case L'L':
|
|
|
|
{
|
|
|
|
curLetter = m_loc.getWString(m_curLanguage, "mastersystem", L"Sega Master System");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case L'M':
|
|
|
|
{
|
|
|
|
curLetter = m_loc.getWString(m_curLanguage, "genesis", L"Sega Genesis");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case L'N':
|
|
|
|
{
|
|
|
|
curLetter = m_loc.getWString(m_curLanguage, "nintendo64", L"Nintendo64");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case L'P':
|
|
|
|
{
|
|
|
|
curLetter = m_loc.getWString(m_curLanguage, "turbografx16", L"TurboGrafx-16");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case L'Q':
|
|
|
|
{
|
|
|
|
curLetter = m_loc.getWString(m_curLanguage, "turbografxcd", L"TurboGrafx-CD");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case L'W':
|
|
|
|
{
|
|
|
|
curLetter = m_loc.getWString(m_curLanguage, "wiiware", L"WiiWare");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case L'H':
|
|
|
|
{
|
|
|
|
curLetter = m_loc.getWString(m_curLanguage, "wiichannels", L"Offical Wii Channels");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case L'R':
|
|
|
|
case L'S':
|
|
|
|
{
|
|
|
|
curLetter = m_loc.getWString(m_curLanguage, "wii", L"Wii");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case L'D':
|
|
|
|
{
|
|
|
|
curLetter = m_loc.getWString(m_curLanguage, "homebrew", L"Homebrew");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
{
|
|
|
|
curLetter = m_loc.getWString(m_curLanguage, "unknown", L"Unknown");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return curLetter;
|
|
|
|
}
|
2012-11-24 14:49:32 +01:00
|
|
|
|
2022-11-29 22:39:12 +01:00
|
|
|
void CMenu::_setPartition(s8 direction, u8 partition, u8 coverflow)// COVERFLOW_NONE is for emu saves nand
|
2012-11-24 14:49:32 +01:00
|
|
|
{
|
2022-11-29 22:39:12 +01:00
|
|
|
if(m_source_cnt > 1 && coverflow > 0)// changing partition not allowed when more than one source is selected
|
2012-11-24 14:49:32 +01:00
|
|
|
return;
|
2022-11-29 22:39:12 +01:00
|
|
|
|
|
|
|
currentPartition = partition;
|
|
|
|
u8 prev_view = m_current_view;
|
|
|
|
m_current_view = coverflow;
|
2013-10-04 01:26:22 +02:00
|
|
|
int FS_Type = 0;
|
2022-11-29 22:39:12 +01:00
|
|
|
bool NeedFAT = m_current_view == COVERFLOW_CHANNEL || m_current_view == COVERFLOW_GAMECUBE || m_current_view == COVERFLOW_NONE;
|
|
|
|
u8 limiter = 0;
|
|
|
|
|
|
|
|
if(direction != 0)// change partition if direction is not zero
|
2012-11-24 14:49:32 +01:00
|
|
|
{
|
2013-04-08 23:45:13 +02:00
|
|
|
do
|
2012-11-24 14:49:32 +01:00
|
|
|
{
|
2016-06-20 23:03:40 +02:00
|
|
|
currentPartition = loopNum(currentPartition + direction, 9);
|
2012-11-24 14:49:32 +01:00
|
|
|
FS_Type = DeviceHandle.GetFSType(currentPartition);
|
|
|
|
limiter++;
|
|
|
|
}
|
2016-06-20 23:03:40 +02:00
|
|
|
while(limiter < 9 && (!DeviceHandle.IsInserted(currentPartition) ||
|
2016-04-02 18:00:47 +02:00
|
|
|
(m_current_view != COVERFLOW_WII && FS_Type == PART_FS_WBFS) ||
|
2013-04-08 23:45:13 +02:00
|
|
|
(NeedFAT && FS_Type != PART_FS_FAT)));
|
2012-11-24 14:49:32 +01:00
|
|
|
}
|
2022-11-29 22:39:12 +01:00
|
|
|
|
2016-06-20 23:03:40 +02:00
|
|
|
/* set partition to currentPartition */
|
2022-11-29 22:39:12 +01:00
|
|
|
if(limiter < 9)
|
|
|
|
{
|
|
|
|
if(coverflow == COVERFLOW_NONE)// saves emu nand
|
|
|
|
m_cfg.setInt(WII_DOMAIN, "savepartition", currentPartition);
|
|
|
|
else if(m_current_view != COVERFLOW_CHANNEL || (FS_Type != -1 && DeviceHandle.IsInserted(currentPartition)))
|
|
|
|
m_cfg.setInt(_domainFromView(), "partition", currentPartition);
|
|
|
|
}
|
|
|
|
m_current_view = prev_view;
|
2012-11-24 14:49:32 +01:00
|
|
|
}
|
2016-11-07 16:06:00 +01:00
|
|
|
|
|
|
|
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;
|
2018-07-09 16:53:35 +02:00
|
|
|
if(!DeviceHandle.IsInserted(SD) || stat("sd:/bootmii/armboot.bin", &dummy) != 0 || stat("sd:/bootmii/ppcboot.elf", &dummy) != 0)
|
2016-11-07 16:06:00 +01:00
|
|
|
ExitTo = EXIT_TO_HBC;
|
|
|
|
}
|
2018-07-09 16:53:35 +02:00
|
|
|
if(ExitTo != WIIFLOW_DEF)// if not using wiiflows exit option then go ahead and set the exit to
|
2016-11-07 16:06:00 +01:00
|
|
|
Sys_ExitTo(ExitTo);
|
|
|
|
}
|
|
|
|
|
|
|
|
int CMenu::_getCFVersion()
|
|
|
|
{
|
2018-10-01 23:01:43 +02:00
|
|
|
if(m_sourceflow)
|
|
|
|
return _getSrcFlow();
|
|
|
|
else if(m_current_view == COVERFLOW_PLUGIN)
|
2016-11-07 16:06:00 +01:00
|
|
|
{
|
2019-09-09 22:17:52 +02:00
|
|
|
int first = 0;
|
|
|
|
for(u8 i = 0; m_plugin.PluginExist(i); ++i)
|
2016-11-07 16:06:00 +01:00
|
|
|
{
|
2020-07-17 22:23:42 +02:00
|
|
|
if(m_plugin.GetEnabledStatus(i))
|
2016-11-07 16:06:00 +01:00
|
|
|
{
|
2020-07-17 22:23:42 +02:00
|
|
|
string magic = sfmt("%08x", m_plugin.GetPluginMagic(i));
|
|
|
|
if(m_cfg.has("PLUGIN_CFVERSION", magic))
|
|
|
|
{
|
|
|
|
if(first > 0 && m_cfg.getInt("PLUGIN_CFVERSION", magic, 1) != first)
|
|
|
|
return m_cfg.getInt(_domainFromView(), "last_cf_mode", 1);
|
|
|
|
else if(first == 0)
|
|
|
|
first = m_cfg.getInt("PLUGIN_CFVERSION", magic, 1);
|
|
|
|
}
|
2016-11-07 16:06:00 +01:00
|
|
|
}
|
|
|
|
}
|
2019-09-09 22:17:52 +02:00
|
|
|
if(first == 0)
|
|
|
|
first++;
|
|
|
|
return first;
|
2016-11-07 16:06:00 +01:00
|
|
|
}
|
|
|
|
return m_cfg.getInt(_domainFromView(), "last_cf_mode", 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CMenu::_setCFVersion(int version)
|
|
|
|
{
|
2018-10-01 23:01:43 +02:00
|
|
|
if(m_sourceflow)
|
|
|
|
_setSrcFlow(version);
|
|
|
|
else if(m_current_view == COVERFLOW_PLUGIN)
|
2016-11-07 16:06:00 +01:00
|
|
|
{
|
2019-09-09 22:17:52 +02:00
|
|
|
int first = 0;
|
|
|
|
for(u8 i = 0; m_plugin.PluginExist(i); ++i)
|
2016-11-07 16:06:00 +01:00
|
|
|
{
|
2020-07-17 22:23:42 +02:00
|
|
|
if(m_plugin.GetEnabledStatus(i))
|
2016-11-07 16:06:00 +01:00
|
|
|
{
|
2020-07-17 22:23:42 +02:00
|
|
|
string magic = sfmt("%08x", m_plugin.GetPluginMagic(i));
|
|
|
|
if(m_cfg.has("PLUGIN_CFVERSION", magic))
|
2019-09-09 22:17:52 +02:00
|
|
|
{
|
2020-07-17 22:23:42 +02:00
|
|
|
if(first > 0 && m_cfg.getInt("PLUGIN_CFVERSION", magic, 1) != first)
|
|
|
|
{
|
|
|
|
m_cfg.setInt(_domainFromView(), "last_cf_mode", version);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else if(first == 0)
|
|
|
|
first = m_cfg.getInt("PLUGIN_CFVERSION", magic, 1);
|
2019-09-09 22:17:52 +02:00
|
|
|
}
|
2016-11-07 16:06:00 +01:00
|
|
|
}
|
|
|
|
}
|
2019-09-09 22:17:52 +02:00
|
|
|
for(u8 i = 0; m_plugin.PluginExist(i); ++i)
|
|
|
|
{
|
2020-07-17 22:23:42 +02:00
|
|
|
if(m_plugin.GetEnabledStatus(i))
|
|
|
|
m_cfg.setInt("PLUGIN_CFVERSION", sfmt("%08x", m_plugin.GetPluginMagic(i)), version);
|
2019-09-09 22:17:52 +02:00
|
|
|
}
|
2016-11-07 16:06:00 +01:00
|
|
|
}
|
2018-10-01 23:01:43 +02:00
|
|
|
else
|
|
|
|
m_cfg.setInt(_domainFromView(), "last_cf_mode", version);
|
2016-11-07 16:06:00 +01:00
|
|
|
}
|