2012-10-03 23:34:37 +02:00
|
|
|
#include <dirent.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
2012-05-11 16:17:39 +02:00
|
|
|
#include "menu.hpp"
|
2012-05-19 23:55:58 +02:00
|
|
|
#include "defines.h"
|
|
|
|
|
2012-06-22 15:09:31 +02:00
|
|
|
extern const u8 btnchannel_png[];
|
|
|
|
extern const u8 btnchannels_png[];
|
|
|
|
extern const u8 btnusb_png[];
|
|
|
|
extern const u8 btnusbs_png[];
|
|
|
|
extern const u8 btndml_png[];
|
|
|
|
extern const u8 btndmls_png[];
|
|
|
|
extern const u8 btnemu_png[];
|
|
|
|
extern const u8 btnemus_png[];
|
|
|
|
extern const u8 btnhomebrew_png[];
|
|
|
|
extern const u8 btnhomebrews_png[];
|
2012-08-06 15:48:57 +02:00
|
|
|
extern const u8 favoriteson_png[];
|
|
|
|
extern const u8 favoritesons_png[];
|
2012-06-22 15:09:31 +02:00
|
|
|
|
2012-05-25 16:21:43 +02:00
|
|
|
int Source_curPage;
|
|
|
|
int pages;
|
2012-05-11 16:17:39 +02:00
|
|
|
u8 numPlugins;
|
2012-11-01 19:38:22 +01:00
|
|
|
u8 maxBtns = 71;
|
2012-05-25 16:21:43 +02:00
|
|
|
string m_sourceDir;
|
|
|
|
Config m_source;
|
2012-05-11 16:17:39 +02:00
|
|
|
|
2012-05-25 16:21:43 +02:00
|
|
|
// Source menu
|
2012-09-13 16:54:17 +02:00
|
|
|
s16 m_sourceLblNotice;
|
|
|
|
s16 m_sourceLblPage;
|
|
|
|
s16 m_sourceBtnPageM;
|
|
|
|
s16 m_sourceBtnPageP;
|
|
|
|
s16 m_sourceLblTitle;
|
|
|
|
s16 m_sourceBtnSource[12];
|
|
|
|
s16 m_sourceLblUser[4];
|
2012-05-25 16:21:43 +02:00
|
|
|
STexture m_sourceBg;
|
2012-09-13 16:54:17 +02:00
|
|
|
s16 m_sourceBtnDML;
|
|
|
|
s16 m_sourceBtnEmu;
|
|
|
|
s16 m_sourceBtnUsb;
|
|
|
|
s16 m_sourceBtnChannel;
|
|
|
|
s16 m_sourceBtnHomebrew;
|
2012-05-11 16:17:39 +02:00
|
|
|
|
2012-05-25 16:21:43 +02:00
|
|
|
void CMenu::_hideSource(bool instant)
|
2012-05-11 16:17:39 +02:00
|
|
|
{
|
2012-05-25 16:21:43 +02:00
|
|
|
m_btnMgr.hide(m_sourceLblTitle, instant);
|
|
|
|
m_btnMgr.hide(m_sourceLblNotice, instant);
|
|
|
|
m_btnMgr.hide(m_sourceLblPage, instant);
|
|
|
|
m_btnMgr.hide(m_sourceBtnPageM, instant);
|
|
|
|
m_btnMgr.hide(m_sourceBtnPageP, instant);
|
2012-06-22 15:09:31 +02:00
|
|
|
m_btnMgr.hide(m_sourceBtnHomebrew, instant);
|
|
|
|
m_btnMgr.hide(m_sourceBtnChannel, instant);
|
|
|
|
m_btnMgr.hide(m_sourceBtnUsb, instant);
|
|
|
|
m_btnMgr.hide(m_sourceBtnDML, instant);
|
|
|
|
m_btnMgr.hide(m_sourceBtnEmu, instant);
|
|
|
|
|
2012-07-05 15:15:23 +02:00
|
|
|
u8 i = 0;
|
|
|
|
for(i = 0; i < ARRAY_SIZE(m_sourceLblUser); ++i)
|
2012-05-11 16:17:39 +02:00
|
|
|
{
|
2012-09-13 16:54:17 +02:00
|
|
|
if(m_sourceLblUser[i] != -1)
|
2012-05-25 16:21:43 +02:00
|
|
|
m_btnMgr.hide(m_sourceLblUser[i], instant);
|
2012-05-11 16:17:39 +02:00
|
|
|
}
|
|
|
|
|
2012-08-06 15:48:57 +02:00
|
|
|
for(i = 0; i < 12; ++i)
|
2012-08-21 16:30:42 +02:00
|
|
|
m_btnMgr.hide(m_sourceBtnSource[i], instant);
|
2012-05-11 16:17:39 +02:00
|
|
|
}
|
|
|
|
|
2012-05-25 16:21:43 +02:00
|
|
|
void CMenu::_showSource(void)
|
2012-05-11 16:17:39 +02:00
|
|
|
{
|
2012-05-25 16:21:43 +02:00
|
|
|
_setBg(m_sourceBg, m_sourceBg);
|
2012-07-05 15:15:23 +02:00
|
|
|
|
|
|
|
u8 i = 0;
|
|
|
|
for(i = 0; i < ARRAY_SIZE(m_sourceLblUser); ++i)
|
2012-05-11 16:17:39 +02:00
|
|
|
{
|
2012-09-13 16:54:17 +02:00
|
|
|
if(m_sourceLblUser[i] != -1)
|
2012-05-25 16:21:43 +02:00
|
|
|
m_btnMgr.show(m_sourceLblUser[i]);
|
2012-05-11 16:17:39 +02:00
|
|
|
}
|
|
|
|
|
2012-05-25 16:21:43 +02:00
|
|
|
m_btnMgr.show(m_sourceLblTitle);
|
|
|
|
|
2012-10-18 16:44:41 +02:00
|
|
|
for(i = maxBtns; i > 11; --i)
|
2012-05-25 16:21:43 +02:00
|
|
|
{
|
|
|
|
string source = m_source.getString(fmt("BUTTON_%i", i), "source", "");
|
|
|
|
if (!source.empty())
|
|
|
|
{
|
2012-05-27 15:25:22 +02:00
|
|
|
pages = (i / 12) + 1;
|
2012-10-18 16:44:41 +02:00
|
|
|
break;
|
2012-05-25 16:21:43 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-05-11 16:17:39 +02:00
|
|
|
}
|
|
|
|
|
2012-05-25 16:21:43 +02:00
|
|
|
void CMenu::_updateSourceBtns(void)
|
2012-05-11 16:17:39 +02:00
|
|
|
{
|
2012-05-25 16:21:43 +02:00
|
|
|
if (pages > 1)
|
2012-05-11 16:17:39 +02:00
|
|
|
{
|
2012-05-27 15:25:22 +02:00
|
|
|
m_btnMgr.setText(m_sourceLblPage, wfmt(L"%i / %i", Source_curPage, pages));
|
2012-05-25 16:21:43 +02:00
|
|
|
m_btnMgr.show(m_sourceLblPage);
|
|
|
|
m_btnMgr.show(m_sourceBtnPageM);
|
|
|
|
m_btnMgr.show(m_sourceBtnPageP);
|
2012-05-11 16:17:39 +02:00
|
|
|
}
|
2012-08-06 15:48:57 +02:00
|
|
|
for (u8 i = 0; i < 12; ++i)
|
|
|
|
m_btnMgr.hide(m_sourceBtnSource[i], true);
|
2012-05-18 18:02:36 +02:00
|
|
|
|
2012-08-06 15:48:57 +02:00
|
|
|
string ImgName;
|
2012-07-05 15:15:23 +02:00
|
|
|
u8 j = (Source_curPage - 1) * 12;
|
2012-05-27 15:25:22 +02:00
|
|
|
|
2012-11-11 19:28:03 +01:00
|
|
|
for(u8 i = 0; i < 12; ++i)
|
2012-08-06 15:48:57 +02:00
|
|
|
{
|
|
|
|
STexture texConsoleImg;
|
|
|
|
STexture texConsoleImgs;
|
|
|
|
|
|
|
|
ImgName = m_source.getString(fmt("BUTTON_%i", i + j),"image", "");
|
2012-11-11 19:28:03 +01:00
|
|
|
if(texConsoleImg.fromImageFile(fmt("%s/%s", m_themeDataDir.c_str(), ImgName.c_str())) != TE_OK)
|
2012-08-06 15:48:57 +02:00
|
|
|
{
|
2012-11-11 19:28:03 +01:00
|
|
|
if(texConsoleImg.fromImageFile(fmt("%s/%s", m_sourceDir.c_str(), ImgName.c_str())) != TE_OK)
|
2012-08-06 15:48:57 +02:00
|
|
|
texConsoleImg.fromPNG(favoriteson_png);
|
|
|
|
}
|
|
|
|
ImgName = m_source.getString(fmt("BUTTON_%i", i + j),"image_s", "");
|
2012-11-11 19:28:03 +01:00
|
|
|
if(texConsoleImgs.fromImageFile(fmt("%s/%s", m_themeDataDir.c_str(), ImgName.c_str())) != TE_OK)
|
2012-08-06 15:48:57 +02:00
|
|
|
{
|
2012-11-11 19:28:03 +01:00
|
|
|
if(texConsoleImgs.fromImageFile(fmt("%s/%s", m_sourceDir.c_str(), ImgName.c_str())) != TE_OK)
|
2012-08-06 15:48:57 +02:00
|
|
|
texConsoleImgs.fromPNG(favoritesons_png);
|
|
|
|
}
|
|
|
|
m_btnMgr.setBtnTexture(m_sourceBtnSource[i], texConsoleImg, texConsoleImgs);
|
|
|
|
|
|
|
|
string source = m_source.getString(fmt("BUTTON_%i", i + j), "source", "");
|
2012-05-27 15:25:22 +02:00
|
|
|
if (!source.empty())
|
|
|
|
m_btnMgr.show(m_sourceBtnSource[i]);
|
2012-08-06 15:48:57 +02:00
|
|
|
}
|
2012-05-11 16:17:39 +02:00
|
|
|
}
|
|
|
|
|
2012-05-25 16:21:43 +02:00
|
|
|
void CMenu::_showSourceNotice(void)
|
2012-05-11 16:17:39 +02:00
|
|
|
{
|
|
|
|
m_showtimer = 90;
|
2012-05-25 16:21:43 +02:00
|
|
|
m_btnMgr.show(m_sourceLblNotice);
|
2012-05-11 16:17:39 +02:00
|
|
|
}
|
|
|
|
|
2012-06-21 14:25:47 +02:00
|
|
|
bool CMenu::_Source()
|
2012-05-11 16:17:39 +02:00
|
|
|
{
|
|
|
|
DIR *pdir;
|
|
|
|
struct dirent *pent;
|
2012-05-25 16:21:43 +02:00
|
|
|
if(!m_source.loaded())
|
|
|
|
m_source.load(fmt("%s/%s", m_sourceDir.c_str(), SOURCE_FILENAME));
|
2012-05-11 16:17:39 +02:00
|
|
|
|
|
|
|
pdir = opendir(m_pluginsDir.c_str());
|
|
|
|
Config m_plugin_cfg;
|
2012-10-18 16:44:41 +02:00
|
|
|
u8 numPlugins = 0;
|
2012-06-21 14:25:47 +02:00
|
|
|
bool back = false;
|
|
|
|
|
|
|
|
while((pent = readdir(pdir)) != NULL)
|
2012-05-11 16:17:39 +02:00
|
|
|
{
|
2012-06-21 14:25:47 +02:00
|
|
|
if(strcmp(pent->d_name, ".") == 0 || strcmp(pent->d_name, "..") == 0
|
2012-05-11 16:17:39 +02:00
|
|
|
|| strcasecmp(pent->d_name, "plugins.ini") == 0 || strcasecmp(pent->d_name, "scummvm.ini") == 0)
|
|
|
|
continue;
|
2012-06-21 14:25:47 +02:00
|
|
|
if(strcasestr(pent->d_name, ".ini") != NULL)
|
2012-05-11 16:17:39 +02:00
|
|
|
{
|
|
|
|
m_plugin_cfg.load(fmt("%s/%s", m_pluginsDir.c_str(), pent->d_name));
|
|
|
|
if (m_plugin_cfg.loaded())
|
|
|
|
{
|
2012-10-18 16:44:41 +02:00
|
|
|
numPlugins++;
|
2012-05-11 16:17:39 +02:00
|
|
|
m_plugin.AddPlugin(m_plugin_cfg);
|
|
|
|
}
|
2012-06-21 14:25:47 +02:00
|
|
|
m_plugin_cfg.unload();
|
2012-05-11 16:17:39 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
closedir(pdir);
|
|
|
|
m_plugin.EndAdd();
|
2012-05-18 18:02:36 +02:00
|
|
|
|
2012-05-11 16:17:39 +02:00
|
|
|
SetupInput();
|
2012-11-04 20:22:02 +01:00
|
|
|
bool show_homebrew = !m_cfg.getBool(HOMEBREW_DOMAIN, "disable", false);
|
2012-05-11 16:17:39 +02:00
|
|
|
bool show_channel = !m_cfg.getBool("GENERAL", "hidechannel", false);
|
2012-11-04 20:22:02 +01:00
|
|
|
bool show_emu = !m_cfg.getBool(PLUGIN_DOMAIN, "disable", false);
|
|
|
|
bool parental_homebrew = m_cfg.getBool(HOMEBREW_DOMAIN, "parental", false);
|
2012-05-25 16:21:43 +02:00
|
|
|
bool imgSelected = false;
|
2012-05-11 16:17:39 +02:00
|
|
|
m_showtimer = 0;
|
2012-05-25 16:21:43 +02:00
|
|
|
Source_curPage = 1;
|
|
|
|
pages = 1;
|
2012-06-22 15:09:31 +02:00
|
|
|
|
2012-05-25 16:21:43 +02:00
|
|
|
_showSource();
|
2012-06-22 15:09:31 +02:00
|
|
|
if(!m_source.loaded())
|
|
|
|
{
|
|
|
|
m_btnMgr.show(m_sourceBtnHomebrew);
|
|
|
|
m_btnMgr.show(m_sourceBtnChannel);
|
|
|
|
m_btnMgr.show(m_sourceBtnUsb);
|
|
|
|
m_btnMgr.show(m_sourceBtnDML);
|
|
|
|
m_btnMgr.show(m_sourceBtnEmu);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
_updateSourceBtns();
|
2012-09-09 20:35:15 +02:00
|
|
|
|
|
|
|
while(!m_exit)
|
2012-05-11 16:17:39 +02:00
|
|
|
{
|
|
|
|
_mainLoopCommon();
|
2012-09-09 20:35:15 +02:00
|
|
|
if(BTN_HOME_PRESSED || BTN_B_PRESSED)
|
2012-05-25 16:21:43 +02:00
|
|
|
{
|
2012-06-21 14:25:47 +02:00
|
|
|
back = true;
|
2012-05-11 16:17:39 +02:00
|
|
|
break;
|
2012-05-25 16:21:43 +02:00
|
|
|
}
|
2012-05-11 16:17:39 +02:00
|
|
|
else if(BTN_UP_PRESSED)
|
|
|
|
m_btnMgr.up();
|
|
|
|
else if(BTN_DOWN_PRESSED)
|
|
|
|
m_btnMgr.down();
|
2012-05-25 16:21:43 +02:00
|
|
|
if(((BTN_MINUS_PRESSED || BTN_LEFT_PRESSED) && pages > 1) || (BTN_A_PRESSED && m_btnMgr.selected(m_sourceBtnPageM)))
|
2012-05-11 16:17:39 +02:00
|
|
|
{
|
2012-10-18 16:44:41 +02:00
|
|
|
Source_curPage--;
|
|
|
|
if(Source_curPage < 1)
|
|
|
|
Source_curPage = pages;
|
2012-05-11 16:17:39 +02:00
|
|
|
if(BTN_LEFT_PRESSED || BTN_MINUS_PRESSED)
|
2012-05-25 16:21:43 +02:00
|
|
|
m_btnMgr.click(m_sourceBtnPageM);
|
|
|
|
_updateSourceBtns();
|
2012-05-11 16:17:39 +02:00
|
|
|
}
|
2012-05-25 16:21:43 +02:00
|
|
|
else if(((BTN_PLUS_PRESSED || BTN_RIGHT_PRESSED) && pages > 1) || (BTN_A_PRESSED && m_btnMgr.selected(m_sourceBtnPageP)))
|
2012-05-11 16:17:39 +02:00
|
|
|
{
|
2012-10-18 16:44:41 +02:00
|
|
|
Source_curPage++;
|
|
|
|
if(Source_curPage > pages)
|
|
|
|
Source_curPage = 1;
|
2012-05-11 16:17:39 +02:00
|
|
|
if (BTN_RIGHT_PRESSED || BTN_PLUS_PRESSED)
|
2012-05-25 16:21:43 +02:00
|
|
|
m_btnMgr.click(m_sourceBtnPageP);
|
|
|
|
_updateSourceBtns();
|
2012-05-11 16:17:39 +02:00
|
|
|
}
|
2012-06-21 14:25:47 +02:00
|
|
|
if(BTN_A_PRESSED)
|
2012-05-11 16:17:39 +02:00
|
|
|
{
|
2012-06-22 15:09:31 +02:00
|
|
|
if(m_btnMgr.selected(m_sourceBtnUsb))
|
|
|
|
{
|
|
|
|
m_current_view = COVERFLOW_USB;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if(m_btnMgr.selected(m_sourceBtnDML))
|
|
|
|
{
|
2012-07-12 17:53:04 +02:00
|
|
|
if (!m_show_dml && !m_devo_installed) _showSourceNotice();
|
2012-06-22 15:09:31 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
m_current_view = COVERFLOW_DML;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(m_btnMgr.selected(m_sourceBtnChannel))
|
|
|
|
{
|
|
|
|
if (!show_channel) _showSourceNotice();
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_current_view = COVERFLOW_CHANNEL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(m_btnMgr.selected(m_sourceBtnHomebrew))
|
|
|
|
{
|
|
|
|
if (!show_homebrew || (!parental_homebrew && m_locked)) _showSourceNotice();
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_current_view = COVERFLOW_HOMEBREW;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(m_btnMgr.selected(m_sourceBtnEmu))
|
|
|
|
{
|
|
|
|
if (!show_emu) _showSourceNotice();
|
|
|
|
else
|
|
|
|
{
|
2012-10-03 23:34:37 +02:00
|
|
|
m_current_view = COVERFLOW_PLUGIN;
|
2012-06-22 15:09:31 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2012-08-06 15:48:57 +02:00
|
|
|
u8 j = (Source_curPage - 1) * 12;
|
|
|
|
for(int i = 0; i < 12; ++i)
|
2012-05-18 18:02:36 +02:00
|
|
|
{
|
2012-06-21 14:25:47 +02:00
|
|
|
if(m_btnMgr.selected(m_sourceBtnSource[i]))
|
2012-05-11 16:17:39 +02:00
|
|
|
{
|
2012-08-06 15:48:57 +02:00
|
|
|
string source = m_source.getString(fmt("BUTTON_%i", i + j), "source", "");
|
2012-05-25 16:21:43 +02:00
|
|
|
if (source == "wii")
|
2012-05-11 16:17:39 +02:00
|
|
|
{
|
2012-05-25 16:21:43 +02:00
|
|
|
m_current_view = COVERFLOW_USB;
|
|
|
|
imgSelected = true;
|
2012-05-18 18:02:36 +02:00
|
|
|
break;
|
2012-05-11 16:17:39 +02:00
|
|
|
}
|
2012-05-25 16:21:43 +02:00
|
|
|
if (source == "dml")
|
|
|
|
{
|
2012-07-12 17:53:04 +02:00
|
|
|
if (!m_show_dml && !m_devo_installed) _showSourceNotice();
|
2012-05-25 16:21:43 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
m_current_view = COVERFLOW_DML;
|
|
|
|
imgSelected = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (source == "emunand")
|
|
|
|
{
|
|
|
|
if (!show_channel) _showSourceNotice();
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_current_view = COVERFLOW_CHANNEL;
|
2012-11-04 20:22:02 +01:00
|
|
|
m_cfg.setBool(CHANNEL_DOMAIN, "disable", false);
|
2012-05-25 16:21:43 +02:00
|
|
|
imgSelected = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (source == "realnand")
|
|
|
|
{
|
|
|
|
if (!show_channel) _showSourceNotice();
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_current_view = COVERFLOW_CHANNEL;
|
2012-11-04 20:22:02 +01:00
|
|
|
m_cfg.setBool(CHANNEL_DOMAIN, "disable", true);
|
2012-05-25 16:21:43 +02:00
|
|
|
imgSelected = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (source == "homebrew")
|
|
|
|
{
|
|
|
|
if (!show_homebrew || (!parental_homebrew && m_locked)) _showSourceNotice();
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_current_view = COVERFLOW_HOMEBREW;
|
|
|
|
imgSelected = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (source == "allplugins")
|
|
|
|
{
|
|
|
|
if (!show_emu) _showSourceNotice();
|
|
|
|
else
|
|
|
|
{
|
2012-10-03 23:34:37 +02:00
|
|
|
m_current_view = COVERFLOW_PLUGIN;
|
2012-05-25 16:21:43 +02:00
|
|
|
imgSelected = true;
|
|
|
|
|
|
|
|
for (u8 j = 0; j < numPlugins; ++j)
|
|
|
|
{
|
|
|
|
m_plugin.SetEnablePlugin(m_cfg, j, 2);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (source == "plugin")
|
|
|
|
{
|
2012-10-01 21:55:55 +02:00
|
|
|
if(!show_emu)
|
|
|
|
_showSourceNotice();
|
2012-05-25 16:21:43 +02:00
|
|
|
else
|
|
|
|
{
|
2012-10-03 23:34:37 +02:00
|
|
|
m_current_view = COVERFLOW_PLUGIN;
|
2012-05-25 16:21:43 +02:00
|
|
|
imgSelected = true;
|
2012-10-18 16:44:41 +02:00
|
|
|
vector<string> magicNums = m_source.getStrings(fmt("BUTTON_%i", i + j), "magic", ',');
|
|
|
|
if (magicNums.size() > 0)
|
2012-05-25 16:21:43 +02:00
|
|
|
{
|
2012-10-18 16:44:41 +02:00
|
|
|
for (u8 k = 0; k < numPlugins; ++k)
|
2012-08-06 15:48:57 +02:00
|
|
|
m_plugin.SetEnablePlugin(m_cfg, k, 1);
|
2012-10-18 16:44:41 +02:00
|
|
|
for (vector<string>::iterator itr = magicNums.begin(); itr != magicNums.end(); itr++)
|
|
|
|
{
|
|
|
|
string magic = *itr;
|
|
|
|
u32 sourceMagic = strtoul(magic.c_str(), NULL, 16);
|
|
|
|
for (u8 k = 0; k < numPlugins; ++k)
|
|
|
|
{
|
|
|
|
if (sourceMagic == m_plugin.getPluginMagic(k))
|
|
|
|
m_plugin.SetEnablePlugin(m_cfg, k, 2);
|
|
|
|
}
|
2012-05-25 16:21:43 +02:00
|
|
|
}
|
|
|
|
}
|
2012-08-06 15:48:57 +02:00
|
|
|
int layout = m_source.getInt(fmt("BUTTON_%i", i + j), "emuflow", 0);
|
2012-06-21 14:25:47 +02:00
|
|
|
if(layout != 0)
|
2012-11-04 20:22:02 +01:00
|
|
|
m_cfg.setInt(PLUGIN_DOMAIN, "last_cf_mode", layout);
|
2012-05-25 16:21:43 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2012-05-11 16:17:39 +02:00
|
|
|
}
|
|
|
|
}
|
2012-06-21 14:25:47 +02:00
|
|
|
if(imgSelected)
|
2012-05-11 16:17:39 +02:00
|
|
|
break;
|
|
|
|
}
|
2012-06-21 14:25:47 +02:00
|
|
|
if(m_showtimer > 0)
|
|
|
|
{
|
|
|
|
if(--m_showtimer == 0)
|
|
|
|
m_btnMgr.hide(m_sourceLblNotice);
|
|
|
|
}
|
2012-05-11 16:17:39 +02:00
|
|
|
}
|
2012-05-25 16:21:43 +02:00
|
|
|
_hideSource(true);
|
2012-06-21 14:25:47 +02:00
|
|
|
return back;
|
2012-05-11 16:17:39 +02:00
|
|
|
}
|
|
|
|
|
2012-11-03 20:16:03 +01:00
|
|
|
void CMenu::_initSourceMenu()
|
2012-05-11 16:17:39 +02:00
|
|
|
{
|
2012-06-22 15:09:31 +02:00
|
|
|
STexture texDML;
|
|
|
|
STexture texDMLs;
|
|
|
|
STexture texEmu;
|
|
|
|
STexture texEmus;
|
|
|
|
STexture texUsb;
|
|
|
|
STexture texUsbs;
|
|
|
|
STexture texChannel;
|
|
|
|
STexture texChannels;
|
|
|
|
STexture texHomebrew;
|
|
|
|
STexture texHomebrews;
|
|
|
|
|
|
|
|
texUsb.fromPNG(btnusb_png);
|
|
|
|
texUsbs.fromPNG(btnusbs_png);
|
|
|
|
texDML.fromPNG(btndml_png);
|
|
|
|
texDMLs.fromPNG(btndmls_png);
|
|
|
|
texEmu.fromPNG(btnemu_png);
|
|
|
|
texEmus.fromPNG(btnemus_png);
|
|
|
|
texChannel.fromPNG(btnchannel_png);
|
|
|
|
texChannels.fromPNG(btnchannels_png);
|
|
|
|
texHomebrew.fromPNG(btnhomebrew_png);
|
|
|
|
texHomebrews.fromPNG(btnhomebrews_png);
|
|
|
|
|
2012-11-03 20:16:03 +01:00
|
|
|
m_sourceBtnChannel = _addPicButton("SOURCE/CHANNEL_BTN", texChannel, texChannels, 265, 260, 48, 48);
|
|
|
|
m_sourceBtnHomebrew = _addPicButton("SOURCE/HOMEBREW_BTN", texHomebrew, texHomebrews, 325, 260, 48, 48);
|
|
|
|
m_sourceBtnUsb = _addPicButton("SOURCE/USB_BTN", texUsb, texUsbs, 235, 200, 48, 48);
|
|
|
|
m_sourceBtnDML = _addPicButton("SOURCE/DML_BTN", texDML, texDMLs, 295, 200, 48, 48);
|
|
|
|
m_sourceBtnEmu = _addPicButton("SOURCE/EMU_BTN", texEmu, texEmus, 355, 200, 48, 48);
|
2012-06-22 15:09:31 +02:00
|
|
|
|
2012-11-03 20:16:03 +01:00
|
|
|
_addUserLabels(m_sourceLblUser, ARRAY_SIZE(m_sourceLblUser), "SOURCE");
|
|
|
|
m_sourceBg = _texture("SOURCE/BG", "texture", theme.bg, false);
|
|
|
|
m_sourceLblTitle = _addTitle("SOURCE/TITLE", theme.titleFont, L"", 20, 20, 600, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE);
|
|
|
|
m_sourceLblNotice = _addLabel("SOURCE/NOTICE", theme.btnFont, L"", 20, 400, 600, 56, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_TOP);
|
|
|
|
m_sourceLblPage = _addLabel("SOURCE/PAGE_BTN", theme.btnFont, L"", 62, 400, 98, 56, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC);
|
|
|
|
m_sourceBtnPageM = _addPicButton("SOURCE/PAGE_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 10, 400, 52, 56);
|
|
|
|
m_sourceBtnPageP = _addPicButton("SOURCE/PAGE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 160, 400, 52, 56);
|
2012-06-22 15:09:31 +02:00
|
|
|
|
2012-05-25 16:21:43 +02:00
|
|
|
m_sourceDir = m_cfg.getString("GENERAL", "dir_Source", sfmt("%s/source_menu", m_dataDir.c_str()));
|
2012-05-18 18:02:36 +02:00
|
|
|
|
2012-05-25 16:21:43 +02:00
|
|
|
if(!m_source.loaded())
|
|
|
|
m_source.load(fmt("%s/%s", m_sourceDir.c_str(), SOURCE_FILENAME));
|
2012-08-06 15:48:57 +02:00
|
|
|
|
2012-05-18 18:02:36 +02:00
|
|
|
int row;
|
|
|
|
int col;
|
2012-05-25 16:21:43 +02:00
|
|
|
string ImgName;
|
2012-05-18 18:02:36 +02:00
|
|
|
|
2012-11-11 19:28:03 +01:00
|
|
|
for(u8 i = 0; i < 12; ++i)
|
2012-05-11 16:17:39 +02:00
|
|
|
{
|
2012-05-25 16:21:43 +02:00
|
|
|
STexture texConsoleImg;
|
|
|
|
STexture texConsoleImgs;
|
|
|
|
|
2012-08-06 15:48:57 +02:00
|
|
|
ImgName = m_source.getString(fmt("BUTTON_%i", i),"image", "");
|
2012-11-11 19:28:03 +01:00
|
|
|
if(texConsoleImg.fromImageFile(fmt("%s/%s", m_themeDataDir.c_str(), ImgName.c_str())) != TE_OK)
|
2012-08-06 15:48:57 +02:00
|
|
|
{
|
2012-11-11 19:28:03 +01:00
|
|
|
if(texConsoleImg.fromImageFile(fmt("%s/%s", m_sourceDir.c_str(), ImgName.c_str())) != TE_OK)
|
2012-08-06 15:48:57 +02:00
|
|
|
texConsoleImg.fromPNG(favoriteson_png);
|
|
|
|
}
|
|
|
|
ImgName = m_source.getString(fmt("BUTTON_%i", i),"image_s", "");
|
2012-11-11 19:28:03 +01:00
|
|
|
if(texConsoleImgs.fromImageFile(fmt("%s/%s", m_themeDataDir.c_str(), ImgName.c_str())) != TE_OK)
|
2012-08-06 15:48:57 +02:00
|
|
|
{
|
2012-11-11 19:28:03 +01:00
|
|
|
if(texConsoleImgs.fromImageFile(fmt("%s/%s", m_sourceDir.c_str(), ImgName.c_str())) != TE_OK)
|
2012-08-06 15:48:57 +02:00
|
|
|
texConsoleImgs.fromPNG(favoritesons_png);
|
|
|
|
}
|
2012-05-25 16:21:43 +02:00
|
|
|
|
2012-08-06 15:48:57 +02:00
|
|
|
row = i / 4;
|
|
|
|
col = i - (row * 4);
|
2012-11-03 20:16:03 +01:00
|
|
|
m_sourceBtnSource[i] = _addPicButton(fmt("SOURCE/SOURCE_BTN_%i", i), texConsoleImg, texConsoleImgs, (30 + 150 * col), (90 + 100 * row), 120, 90);
|
2012-05-11 16:17:39 +02:00
|
|
|
}
|
2012-06-22 15:09:31 +02:00
|
|
|
_setHideAnim(m_sourceBtnChannel, "SOURCE/CHANNEL_BTN", 0, 40, 0.f, 0.f);
|
|
|
|
_setHideAnim(m_sourceBtnHomebrew, "SOURCE/HOMEBREW_BTN", 0, 40, 0.f, 0.f);
|
|
|
|
_setHideAnim(m_sourceBtnUsb, "SOURCE/USB_BTN", 0, 40, 0.f, 0.f);
|
|
|
|
_setHideAnim(m_sourceBtnDML, "SOURCE/DML_BTN", 0, 40, 0.f, 0.f);
|
|
|
|
_setHideAnim(m_sourceBtnEmu, "SOURCE/EMU_BTN", 0, 40, 0.f, 0.f);
|
- Categories update.
- now you can have as many categories as you want.
- copied the idea of selected, hidden, and required categories from USB Loader GX. Thanks Cyan. Checkmark = selected, X = Hidden, and + = Required.
- redid categories.ini layout and renamed it categories_v4.ini so you can copy and paste settings from the old one to the new one. Each view (USB,DML,EMU,NAND,HOMEBREW) has it's own numcategories, category names, and category settings. All games are now seperated based on the view. Don't forget to add 1 to numcategories for the show All mode.
- Replaced All checkbox with CLEAR button which clears all checkboxes so no category is selected and all games will be shown.
- Added features to the Game Selected Categories Menu. Now the title is the title of the current game. You can now press plus(+) and minus(-) on wiimote to go to the next or previous games without going back to previous screen making it easier to setup categories for your games.
- note: all changes will not be saved in categories_v4.ini unless you exit wiiflow or launch a game.
2012-08-31 19:51:49 +02:00
|
|
|
_setHideAnim(m_sourceLblTitle, "SOURCE/TITLE", 0, 0, -2.f, 0.f);
|
2012-05-25 16:21:43 +02:00
|
|
|
_setHideAnim(m_sourceLblNotice, "SOURCE/NOTICE", 0, 0, 1.f, 0.f);
|
- Categories update.
- now you can have as many categories as you want.
- copied the idea of selected, hidden, and required categories from USB Loader GX. Thanks Cyan. Checkmark = selected, X = Hidden, and + = Required.
- redid categories.ini layout and renamed it categories_v4.ini so you can copy and paste settings from the old one to the new one. Each view (USB,DML,EMU,NAND,HOMEBREW) has it's own numcategories, category names, and category settings. All games are now seperated based on the view. Don't forget to add 1 to numcategories for the show All mode.
- Replaced All checkbox with CLEAR button which clears all checkboxes so no category is selected and all games will be shown.
- Added features to the Game Selected Categories Menu. Now the title is the title of the current game. You can now press plus(+) and minus(-) on wiimote to go to the next or previous games without going back to previous screen making it easier to setup categories for your games.
- note: all changes will not be saved in categories_v4.ini unless you exit wiiflow or launch a game.
2012-08-31 19:51:49 +02:00
|
|
|
_setHideAnim(m_sourceLblPage, "SOURCE/PAGE_BTN", 0, 0, -1.f, 1.f);
|
|
|
|
_setHideAnim(m_sourceBtnPageM, "SOURCE/PAGE_MINUS", 0, 0, -1.f, 1.f);
|
|
|
|
_setHideAnim(m_sourceBtnPageP, "SOURCE/PAGE_PLUS", 0, 0, -1.f, 1.f);
|
2012-05-18 18:02:36 +02:00
|
|
|
|
2012-08-06 15:48:57 +02:00
|
|
|
for(int i = 0; i < 12; ++i)
|
2012-05-11 16:17:39 +02:00
|
|
|
{
|
2012-05-25 16:21:43 +02:00
|
|
|
_setHideAnim(m_sourceBtnSource[i], fmt("SOURCE/SOURCE_BTN_%i", i), 0, 0, 1.f, 0.f);
|
2012-05-11 16:17:39 +02:00
|
|
|
}
|
2012-05-25 16:21:43 +02:00
|
|
|
_textSource();
|
|
|
|
_hideSource(true);
|
2012-05-11 16:17:39 +02:00
|
|
|
}
|
|
|
|
|
2012-05-25 16:21:43 +02:00
|
|
|
void CMenu::_textSource(void)
|
2012-05-11 16:17:39 +02:00
|
|
|
{
|
2012-06-18 00:12:03 +02:00
|
|
|
m_btnMgr.setText(m_sourceLblTitle, _t("stup1", L"Select Source"));
|
2012-05-30 13:57:22 +02:00
|
|
|
m_btnMgr.setText(m_sourceLblNotice, _t("NMMOff", L"** DISABLED **"));
|
2012-05-11 16:17:39 +02:00
|
|
|
}
|