- changed source select menu to use images for buttons.

download this rar  http://www.mediafire.com/?2y3cwxakb92napo and put the folder inside in your wiiflow folder. It contains a text file with setup instructions.
This commit is contained in:
fledge68 2012-05-25 14:21:43 +00:00
parent 6a64e8cb86
commit e93bb49651
5 changed files with 249 additions and 193 deletions

View File

@ -11,7 +11,7 @@
#define CFG_FILENAME "wiiflow.ini" #define CFG_FILENAME "wiiflow.ini"
#define LANG_FILENAME "languages.ini" #define LANG_FILENAME "languages.ini"
#define CAT_FILENAME "categories.ini" #define CAT_FILENAME "categories.ini"
#define STARTUP_FILENAME "startup_menu.ini" #define SOURCE_FILENAME "source_menu.ini"
#define TITLES_FILENAME "titles.ini" #define TITLES_FILENAME "titles.ini"
#define CTITLES_FILENAME "custom_titles.ini" #define CTITLES_FILENAME "custom_titles.ini"
#define AGE_LOCK_FILENAME "age_lock.ini" #define AGE_LOCK_FILENAME "age_lock.ini"

View File

@ -296,7 +296,7 @@ void CMenu::init(void)
m_wipDir = m_cfg.getString("GENERAL", "dir_wip", sfmt("%s/wip", m_txtCheatDir.c_str())); m_wipDir = m_cfg.getString("GENERAL", "dir_wip", sfmt("%s/wip", m_txtCheatDir.c_str()));
m_listCacheDir = m_cfg.getString("GENERAL", "dir_list_cache", sfmt("%s/lists", m_cacheDir.c_str())); m_listCacheDir = m_cfg.getString("GENERAL", "dir_list_cache", sfmt("%s/lists", m_cacheDir.c_str()));
m_helpDir = m_cfg.getString("GENERAL", "dir_help", sfmt("%s/help", m_dataDir.c_str())); m_helpDir = m_cfg.getString("GENERAL", "dir_help", sfmt("%s/help", m_dataDir.c_str()));
DeviceHandler::SetWatchdog(m_cfg.getUInt("GENERAL", "watchdog_timeout", 10)); DeviceHandler::SetWatchdog(m_cfg.getUInt("GENERAL", "watchdog_timeout", 10));
const char *domain = _domainFromView(); const char *domain = _domainFromView();
@ -1054,7 +1054,7 @@ void CMenu::_buildMenus(void)
_initCFThemeMenu(theme); _initCFThemeMenu(theme);
_initGameSettingsMenu(theme); _initGameSettingsMenu(theme);
_initCheatSettingsMenu(theme); _initCheatSettingsMenu(theme);
_initStartupMenu(theme); _initSourceMenu(theme);
_initPluginSettingsMenu(theme); _initPluginSettingsMenu(theme);
_initCategorySettingsMenu(theme); _initCategorySettingsMenu(theme);
_initSystemMenu(theme); _initSystemMenu(theme);
@ -1238,17 +1238,14 @@ u16 CMenu::_textStyle(const char *domain, const char *key, u16 def)
return textStyle; return textStyle;
} }
u32 CMenu::_addButton(CMenu::SThemeData &theme, const char *domain, SFont font, const wstringEx &text, int x, int y, u32 width, u32 height, const CColor &color, bool skipTheme) u32 CMenu::_addButton(CMenu::SThemeData &theme, const char *domain, SFont font, const wstringEx &text, int x, int y, u32 width, u32 height, const CColor &color)
{ {
SButtonTextureSet btnTexSet; SButtonTextureSet btnTexSet;
CColor c(color); CColor c(color);
c = m_theme.getColor(domain, "color", c); c = m_theme.getColor(domain, "color", c);
if (!skipTheme) x = m_theme.getInt(domain, "x", x);
{ y = m_theme.getInt(domain, "y", y);
x = m_theme.getInt(domain, "x", x);
y = m_theme.getInt(domain, "y", y);
}
width = m_theme.getInt(domain, "width", width); width = m_theme.getInt(domain, "width", width);
height = m_theme.getInt(domain, "height", height); height = m_theme.getInt(domain, "height", height);
btnTexSet.left = _texture(theme.texSet, domain, "texture_left", theme.btnTexL); btnTexSet.left = _texture(theme.texSet, domain, "texture_left", theme.btnTexL);

View File

@ -109,6 +109,7 @@ private:
string m_listCacheDir; string m_listCacheDir;
string m_DMLgameDir; string m_DMLgameDir;
string m_helpDir; string m_helpDir;
/* Updates */ /* Updates */
char m_app_update_drive[6]; char m_app_update_drive[6];
const char* m_app_update_url; const char* m_app_update_url;
@ -867,14 +868,14 @@ private:
void _initGameSettingsMenu(SThemeData &theme); void _initGameSettingsMenu(SThemeData &theme);
void _initCheatSettingsMenu(SThemeData &theme); void _initCheatSettingsMenu(SThemeData &theme);
void _initCheatButtons(); void _initCheatButtons();
void _initStartupMenu(SThemeData &theme); void _initSourceMenu(SThemeData &theme);
void _initPluginSettingsMenu(SThemeData &theme); void _initPluginSettingsMenu(SThemeData &theme);
void _initCategorySettingsMenu(SThemeData &theme); void _initCategorySettingsMenu(SThemeData &theme);
void _initSystemMenu(SThemeData &theme); void _initSystemMenu(SThemeData &theme);
void _initGameInfoMenu(SThemeData &theme); void _initGameInfoMenu(SThemeData &theme);
void _initNandEmuMenu(CMenu::SThemeData &theme); void _initNandEmuMenu(CMenu::SThemeData &theme);
// //
void _textStartup(void); void _textSource(void);
void _textPluginSettings(void); void _textPluginSettings(void);
void _textCategorySettings(void); void _textCategorySettings(void);
void _textCheatSettings(void); void _textCheatSettings(void);
@ -915,7 +916,7 @@ private:
void _hideWBFS(bool instant = false); void _hideWBFS(bool instant = false);
void _hideCFTheme(bool instant = false); void _hideCFTheme(bool instant = false);
void _hideGameSettings(bool instant = false); void _hideGameSettings(bool instant = false);
void _hideStartup(bool instant = false); void _hideSource(bool instant = false);
void _hidePluginSettings(bool instant = false); void _hidePluginSettings(bool instant = false);
void _hideCategorySettings(bool instant = false); void _hideCategorySettings(bool instant = false);
void _hideSystem(bool instant = false); void _hideSystem(bool instant = false);
@ -938,8 +939,8 @@ private:
void _showSettings(); void _showSettings();
void _showCode(void); void _showCode(void);
void _showAbout(void); void _showAbout(void);
void _showStartup(void); void _showSource(void);
void _showStartupNotice(void); void _showSourceNotice(void);
void _showPluginSettings(void); void _showPluginSettings(void);
void _showCategorySettings(void); void _showCategorySettings(void);
void _showCheatSettings(void); void _showCheatSettings(void);
@ -949,7 +950,7 @@ private:
void _showCFTheme(u32 curParam, int version, bool wide); void _showCFTheme(u32 curParam, int version, bool wide);
void _showGameSettings(void); void _showGameSettings(void);
void _showCheatDownload(void); void _showCheatDownload(void);
void _updateStartupBtns(void); void _updateSourceBtns(void);
void _updatePluginCheckboxes(void); void _updatePluginCheckboxes(void);
void _updateCheckboxes(void); void _updateCheckboxes(void);
void _setBg(const STexture &tex, const STexture &lqTex); void _setBg(const STexture &tex, const STexture &lqTex);
@ -988,7 +989,7 @@ private:
void _gameinfo(void); void _gameinfo(void);
void _gameSettings(void); void _gameSettings(void);
void _CheatSettings(); void _CheatSettings();
void _Startup(); void _Source();
void _PluginSettings(); void _PluginSettings();
void _CategorySettings(bool fromGameSet=false); void _CategorySettings(bool fromGameSet=false);
// //
@ -1036,7 +1037,7 @@ private:
SmartGuiSound _sound(CMenu::SoundSet &soundSet, const char *domain, const char *key, const u8 * snd, u32 len, string name, bool isAllocated); SmartGuiSound _sound(CMenu::SoundSet &soundSet, const char *domain, const char *key, const u8 * snd, u32 len, string name, bool isAllocated);
SmartGuiSound _sound(CMenu::SoundSet &soundSet, const char *domain, const char *key, string name); SmartGuiSound _sound(CMenu::SoundSet &soundSet, const char *domain, const char *key, string name);
u16 _textStyle(const char *domain, const char *key, u16 def); u16 _textStyle(const char *domain, const char *key, u16 def);
u32 _addButton(SThemeData &theme, const char *domain, SFont font, const wstringEx &text, int x, int y, u32 width, u32 height, const CColor &color, bool skipTheme = false); u32 _addButton(SThemeData &theme, const char *domain, SFont font, const wstringEx &text, int x, int y, u32 width, u32 height, const CColor &color);
u32 _addSelButton(SThemeData &theme, const char *domain, SFont font, const wstringEx &text, int x, int y, u32 width, u32 height, const CColor &color); u32 _addSelButton(SThemeData &theme, const char *domain, SFont font, const wstringEx &text, int x, int y, u32 width, u32 height, const CColor &color);
u32 _addPicButton(SThemeData &theme, const char *domain, STexture &texNormal, STexture &texSelected, int x, int y, u32 width, u32 height); u32 _addPicButton(SThemeData &theme, const char *domain, STexture &texNormal, STexture &texSelected, int x, int y, u32 width, u32 height);
u32 _addTitle(SThemeData &theme, const char *domain, SFont font, const wstringEx &text, int x, int y, u32 width, u32 height, const CColor &color, u16 style); u32 _addTitle(SThemeData &theme, const char *domain, SFont font, const wstringEx &text, int x, int y, u32 width, u32 height, const CColor &color, u16 style);

View File

@ -248,7 +248,7 @@ int CMenu::main(void)
if (m_cfg.getBool("GENERAL", "startup_menu", false)) if (m_cfg.getBool("GENERAL", "startup_menu", false))
{ {
m_vid.hideWaitMessage(); m_vid.hideWaitMessage();
_Startup(); _Source();
} }
if (m_cfg.getBool("GENERAL", "update_cache", false)) if (m_cfg.getBool("GENERAL", "update_cache", false))
{ {
@ -320,7 +320,7 @@ int CMenu::main(void)
if (BTN_PLUS_PRESSED && (m_btnMgr.selected(m_mainBtnChannel) || m_btnMgr.selected(m_mainBtnUsb) || m_btnMgr.selected(m_mainBtnDML) || m_btnMgr.selected(m_mainBtnHomebrew) || m_btnMgr.selected(m_mainBtnEmu))) if (BTN_PLUS_PRESSED && (m_btnMgr.selected(m_mainBtnChannel) || m_btnMgr.selected(m_mainBtnUsb) || m_btnMgr.selected(m_mainBtnDML) || m_btnMgr.selected(m_mainBtnHomebrew) || m_btnMgr.selected(m_mainBtnEmu)))
{ {
_hideMain(true); _hideMain(true);
_Startup(); _Source();
LoadView(); LoadView();
continue; continue;
} }

View File

@ -5,87 +5,112 @@
#include "defines.h" #include "defines.h"
int Startup_curPage; int Source_curPage;
int pages;
u8 numPlugins; u8 numPlugins;
string m_sourceDir;
Config m_source;
// Startup menu // Source menu
u32 m_startupLblNotice; u32 m_sourceLblNotice;
u32 m_startupLblPage; u32 m_sourceLblPage;
u32 m_startupBtnPageM; u32 m_sourceBtnPageM;
u32 m_startupBtnPageP; u32 m_sourceBtnPageP;
u32 m_startupBtnBack; u32 m_sourceBtnBack;
u32 m_startupLblTitle; u32 m_sourceLblTitle;
u32 m_startupBtnSource[20]; u32 m_sourceBtnSource[24];
u32 m_startupLblUser[4]; u32 m_sourceLblUser[4];
STexture m_startupBg; STexture m_sourceBg;
Config m_startup;
void CMenu::_hideStartup(bool instant) void CMenu::_hideSource(bool instant)
{ {
m_btnMgr.hide(m_startupLblTitle, instant); m_btnMgr.hide(m_sourceLblTitle, instant);
m_btnMgr.hide(m_startupBtnBack, instant); m_btnMgr.hide(m_sourceBtnBack, instant);
m_btnMgr.hide(m_startupLblNotice, instant); m_btnMgr.hide(m_sourceLblNotice, instant);
m_btnMgr.hide(m_startupLblPage, instant); m_btnMgr.hide(m_sourceLblPage, instant);
m_btnMgr.hide(m_startupBtnPageM, instant); m_btnMgr.hide(m_sourceBtnPageM, instant);
m_btnMgr.hide(m_startupBtnPageP, instant); m_btnMgr.hide(m_sourceBtnPageP, instant);
for (u32 i = 0; i < ARRAY_SIZE(m_startupLblUser); ++i) for (u32 i = 0; i < ARRAY_SIZE(m_sourceLblUser); ++i)
{ {
if (m_startupLblUser[i] != -1u) if (m_sourceLblUser[i] != -1u)
m_btnMgr.hide(m_startupLblUser[i], instant); m_btnMgr.hide(m_sourceLblUser[i], instant);
} }
for (int i = 0; i < 20; ++i) for (int i = 0; i < 24; ++i)
{ {
m_btnMgr.hide(m_startupBtnSource[i]); m_btnMgr.hide(m_sourceBtnSource[i]);
} }
} }
void CMenu::_showStartup(void) void CMenu::_showSource(void)
{ {
_setBg(m_startupBg, m_startupBg); _setBg(m_sourceBg, m_sourceBg);
for (u32 i = 0; i < ARRAY_SIZE(m_startupLblUser); ++i) for (u32 i = 0; i < ARRAY_SIZE(m_sourceLblUser); ++i)
{ {
if (m_startupLblUser[i] != -1u) if (m_sourceLblUser[i] != -1u)
m_btnMgr.show(m_startupLblUser[i]); m_btnMgr.show(m_sourceLblUser[i]);
} }
m_btnMgr.show(m_startupLblTitle); m_btnMgr.show(m_sourceLblTitle);
m_btnMgr.show(m_startupBtnBack); m_btnMgr.show(m_sourceBtnBack);
for (int i = 12; i <24; ++i)
{
string source = m_source.getString(fmt("BUTTON_%i", i), "source", "");
if (!source.empty())
{
pages++;
break;
}
}
} }
void CMenu::_updateStartupBtns(void) void CMenu::_updateSourceBtns(void)
{ {
if (numPlugins > 6) if (pages > 1)
{ {
m_btnMgr.setText(m_startupLblPage, wfmt(L"%i / 2", Startup_curPage)); m_btnMgr.setText(m_sourceLblPage, wfmt(L"%i / 2", Source_curPage));
m_btnMgr.show(m_startupLblPage); m_btnMgr.show(m_sourceLblPage);
m_btnMgr.show(m_startupBtnPageM); m_btnMgr.show(m_sourceBtnPageM);
m_btnMgr.show(m_startupBtnPageP); m_btnMgr.show(m_sourceBtnPageP);
} }
for (int i = 0; i < 20; ++i) for (int i = 0; i < 24; ++i)
m_btnMgr.hide(m_startupBtnSource[i]); m_btnMgr.hide(m_sourceBtnSource[i]);
for (int i = 0; i < (numPlugins + 4); ++i) if (Source_curPage == 1)
{ {
int page = m_startup.getInt("BUTTONS", fmt("button_%i_page", i), (i < 10 ? 1 : 2)); for (int i = 0; i < 12; ++i)
if (page == Startup_curPage) {
m_btnMgr.show(m_startupBtnSource[i]); string source = m_source.getString(fmt("BUTTON_%i", i), "source", "");
} if (!source.empty())
m_btnMgr.show(m_sourceBtnSource[i]);
}
}
else
{
for (int i = 12; i < 24; ++i)
{
string source = m_source.getString(fmt("BUTTON_%i", i), "source", "");
if (!source.empty())
m_btnMgr.show(m_sourceBtnSource[i]);
}
}
} }
void CMenu::_showStartupNotice(void) void CMenu::_showSourceNotice(void)
{ {
m_showtimer = 90; m_showtimer = 90;
m_btnMgr.show(m_startupLblNotice); m_btnMgr.show(m_sourceLblNotice);
} }
void CMenu::_Startup() void CMenu::_Source()
{ {
DIR *pdir; DIR *pdir;
struct dirent *pent; struct dirent *pent;
if(!m_startup.loaded()) if(!m_source.loaded())
m_startup.load(fmt("%s/%s", m_settingsDir.c_str(), STARTUP_FILENAME)); m_source.load(fmt("%s/%s", m_sourceDir.c_str(), SOURCE_FILENAME));
pdir = opendir(m_pluginsDir.c_str()); pdir = opendir(m_pluginsDir.c_str());
Config m_plugin_cfg; Config m_plugin_cfg;
@ -116,177 +141,210 @@ void CMenu::_Startup()
bool show_channel = !m_cfg.getBool("GENERAL", "hidechannel", false); bool show_channel = !m_cfg.getBool("GENERAL", "hidechannel", false);
bool show_emu = !m_cfg.getBool("EMULATOR", "disable", false); bool show_emu = !m_cfg.getBool("EMULATOR", "disable", false);
bool parental_homebrew = m_cfg.getBool("HOMEBREW", "parental", false); bool parental_homebrew = m_cfg.getBool("HOMEBREW", "parental", false);
bool pluginSelected = false; bool imgSelected = false;
m_showtimer = 0; m_showtimer = 0;
Startup_curPage = 1; Source_curPage = 1;
_textStartup(); pages = 1;
_showStartup(); _showSource();
_updateStartupBtns(); _updateSourceBtns();
while(true) while(true)
{ {
_mainLoopCommon(); _mainLoopCommon();
if (BTN_B_PRESSED && m_btnMgr.selected(m_startupBtnSource[1]))
{
if (!show_channel) _showStartupNotice();
else
{
m_current_view = COVERFLOW_CHANNEL;
m_cfg.setBool("NAND", "disable", true);
break;
}
}
if (BTN_HOME_PRESSED || BTN_B_PRESSED) if (BTN_HOME_PRESSED || BTN_B_PRESSED)
{
break; break;
}
else if(BTN_UP_PRESSED) else if(BTN_UP_PRESSED)
m_btnMgr.up(); m_btnMgr.up();
else if(BTN_DOWN_PRESSED) else if(BTN_DOWN_PRESSED)
m_btnMgr.down(); m_btnMgr.down();
if(((BTN_MINUS_PRESSED || BTN_LEFT_PRESSED) && (numPlugins + 4) > 10) || (BTN_A_PRESSED && m_btnMgr.selected(m_startupBtnPageM))) if(((BTN_MINUS_PRESSED || BTN_LEFT_PRESSED) && pages > 1) || (BTN_A_PRESSED && m_btnMgr.selected(m_sourceBtnPageM)))
{ {
Startup_curPage = Startup_curPage == 1 ? 2 : 1; Source_curPage = Source_curPage == 1 ? 2 : 1;
if(BTN_LEFT_PRESSED || BTN_MINUS_PRESSED) if(BTN_LEFT_PRESSED || BTN_MINUS_PRESSED)
m_btnMgr.click(m_startupBtnPageM); m_btnMgr.click(m_sourceBtnPageM);
_updateStartupBtns(); _updateSourceBtns();
} }
else if(((BTN_PLUS_PRESSED || BTN_RIGHT_PRESSED) && (numPlugins + 4) > 10) || (BTN_A_PRESSED && m_btnMgr.selected(m_startupBtnPageP))) else if(((BTN_PLUS_PRESSED || BTN_RIGHT_PRESSED) && pages > 1) || (BTN_A_PRESSED && m_btnMgr.selected(m_sourceBtnPageP)))
{ {
Startup_curPage = Startup_curPage == 1 ? 2 : 1; Source_curPage = Source_curPage == 1 ? 2 : 1;
if (BTN_RIGHT_PRESSED || BTN_PLUS_PRESSED) if (BTN_RIGHT_PRESSED || BTN_PLUS_PRESSED)
m_btnMgr.click(m_startupBtnPageP); m_btnMgr.click(m_sourceBtnPageP);
_updateStartupBtns(); _updateSourceBtns();
} }
if (BTN_A_PRESSED) if (BTN_A_PRESSED)
{ {
if (m_btnMgr.selected(m_startupBtnBack)) if (m_btnMgr.selected(m_sourceBtnBack))
break; break;
if (m_btnMgr.selected(m_startupBtnSource[0])) for (int i = 0; i < 24; ++i)
{ {
m_current_view = COVERFLOW_USB; if (m_btnMgr.selected(m_sourceBtnSource[i]))
break;
}
if (m_btnMgr.selected(m_startupBtnSource[2]))
{
if (!m_show_dml) _showStartupNotice();
else
{ {
m_current_view = COVERFLOW_DML; string source = m_source.getString(fmt("BUTTON_%i", i), "source", "");
break; if (source == "wii")
}
}
if (m_btnMgr.selected(m_startupBtnSource[1]))
{
if (!show_channel) _showStartupNotice();
else
{
m_current_view = COVERFLOW_CHANNEL;
m_cfg.setBool("NAND", "disable", false);
break;
}
}
if (m_btnMgr.selected(m_startupBtnSource[3]))
{
if (!show_homebrew || (!parental_homebrew && m_locked)) _showStartupNotice();
else
{
m_current_view = COVERFLOW_HOMEBREW;
break;
}
}
for (u8 i = 0; i < numPlugins; ++i)
{
if (m_btnMgr.selected(m_startupBtnSource[i + 4]))
{
if (!show_emu) _showStartupNotice();
else
{ {
m_current_view = COVERFLOW_EMU; m_current_view = COVERFLOW_USB;
pluginSelected = true; imgSelected = true;
for (u8 j = 0; j < numPlugins; ++j)
m_plugin.SetEnablePlugin(m_cfg, j, 1);
m_plugin.SetEnablePlugin(m_cfg, i, 2);
string domain = m_plugin.GetDolName(m_plugin.getPluginMagic(i));
domain.erase(domain.end() - 4, domain.end());
int layout = m_startup.getInt(domain, m_cfg.getString("GENERAL", "theme", "default"), 0);
if (layout != 0)
m_cfg.setInt("EMULATOR", "last_cf_mode", layout);
break; break;
} }
if (source == "dml")
{
if (!m_show_dml) _showSourceNotice();
else
{
m_current_view = COVERFLOW_DML;
imgSelected = true;
break;
}
}
if (source == "emunand")
{
if (!show_channel) _showSourceNotice();
else
{
m_current_view = COVERFLOW_CHANNEL;
m_cfg.setBool("NAND", "disable", false);
imgSelected = true;
break;
}
}
if (source == "realnand")
{
if (!show_channel) _showSourceNotice();
else
{
m_current_view = COVERFLOW_CHANNEL;
m_cfg.setBool("NAND", "disable", true);
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
{
m_current_view = COVERFLOW_EMU;
imgSelected = true;
for (u8 j = 0; j < numPlugins; ++j)
{
m_plugin.SetEnablePlugin(m_cfg, j, 2);
}
break;
}
}
if (source == "plugin")
{
if (!show_emu) _showSourceNotice();
else
{
m_current_view = COVERFLOW_EMU;
imgSelected = true;
u32 sourceMagic;
sscanf(m_source.getString(fmt("BUTTON_%i", i), "magic","").c_str(), "%08x", &sourceMagic);
for (u8 j = 0; j < numPlugins; ++j)
{
if (sourceMagic == m_plugin.getPluginMagic(j))
{
m_plugin.SetEnablePlugin(m_cfg, j, 2);
}
else
{
m_plugin.SetEnablePlugin(m_cfg, j, 1);
}
}
string domain = m_plugin.GetDolName(sourceMagic);
domain.erase(domain.end() - 4, domain.end());
int layout = m_source.getInt(domain, m_cfg.getString("GENERAL", "theme", "default"), 0);
if (layout != 0)
m_cfg.setInt("EMULATOR", "last_cf_mode", layout);
break;
}
}
} }
} }
if (pluginSelected) if (imgSelected)
{ {
break; break;
} }
} }
if (m_showtimer > 0) if (m_showtimer > 0)
if (--m_showtimer == 0) if (--m_showtimer == 0)
m_btnMgr.hide(m_startupLblNotice); m_btnMgr.hide(m_sourceLblNotice);
} }
_hideStartup(true); _hideSource(true);
} }
void CMenu::_initStartupMenu(CMenu::SThemeData &theme) void CMenu::_initSourceMenu(CMenu::SThemeData &theme)
{ {
_addUserLabels(theme, m_startupLblUser, ARRAY_SIZE(m_startupLblUser), "STARTUP"); _addUserLabels(theme, m_sourceLblUser, ARRAY_SIZE(m_sourceLblUser), "SOURCE");
m_startupBg = _texture(theme.texSet, "STARTUP/BG", "texture", theme.bg); m_sourceBg = _texture(theme.texSet, "SOURCE/BG", "texture", theme.bg);
m_startupLblTitle = _addTitle(theme, "STARTUP/TITLE", theme.titleFont, L"", 20, 30, 600, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE); m_sourceLblTitle = _addTitle(theme, "SOURCE/TITLE", theme.titleFont, L"", 20, 20, 600, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE);
m_startupBtnBack = _addButton(theme, "STARTUP/BACK_BTN", theme.btnFont, L"", 424, 400, 210, 56, theme.btnFontColor); m_sourceBtnBack = _addButton(theme, "SOURCE/BACK_BTN", theme.btnFont, L"", 424, 400, 210, 56, theme.btnFontColor);
m_startupLblNotice = _addLabel(theme, "STARTUP/NOTICE", theme.btnFont, L"", 20, 400, 600, 56, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_TOP); m_sourceLblNotice = _addLabel(theme, "SOURCE/NOTICE", theme.btnFont, L"", 20, 400, 600, 56, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_TOP);
m_startupLblPage = _addLabel(theme, "STARTUP/PAGE_BTN", theme.btnFont, L"", 62, 400, 98, 56, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC); m_sourceLblPage = _addLabel(theme, "SOURCE/PAGE_BTN", theme.btnFont, L"", 62, 400, 98, 56, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC);
m_startupBtnPageM = _addPicButton(theme, "STARTUP/PAGE_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 10, 400, 52, 56); m_sourceBtnPageM = _addPicButton(theme, "SOURCE/PAGE_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 10, 400, 52, 56);
m_startupBtnPageP = _addPicButton(theme, "STARTUP/PAGE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 160, 400, 52, 56); m_sourceBtnPageP = _addPicButton(theme, "SOURCE/PAGE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 160, 400, 52, 56);
m_sourceDir = m_cfg.getString("GENERAL", "dir_Source", sfmt("%s/source_menu", m_dataDir.c_str()));
if(!m_source.loaded())
m_source.load(fmt("%s/%s", m_sourceDir.c_str(), SOURCE_FILENAME));
int page;
int row; int row;
int col; int col;
string ImgName;
int i = 0; for ( int i = 0; i < 24; ++i)
while (i < 10)
{ {
row = m_startup.getInt("BUTTONS", fmt("button_%i_row", i), i / 2); STexture texConsoleImg;
col = m_startup.getInt("BUTTONS", fmt("button_%i_col", i), 0); STexture texConsoleImgs;
m_startupBtnSource[i] = _addButton(theme, fmt("STARTUP/SOURCE_BTN_%i", i), theme.btnFont, L"", (30 + 300 * col), (100 + 58 * row), 280, 56, theme.btnFontColor);
row = m_startup.getInt("BUTTONS", fmt("button_%i_row", i + 10), i / 2); ImgName = m_source.getString(fmt("BUTTON_%i", i),"image", "default.png");
col = m_startup.getInt("BUTTONS", fmt("button_%i_col", i + 10), 0); texConsoleImg.fromPNGFile(fmt("%s/%s", m_sourceDir.c_str(), ImgName.c_str()), GX_TF_RGBA8, ALLOC_MEM2);
m_startupBtnSource[i + 10] = _addButton(theme, fmt("STARTUP/SOURCE_BTN_%i", i + 10), theme.btnFont, L"", (30 + 300 * col), (100 + 58 * row), 280, 56, theme.btnFontColor); ImgName = m_source.getString(fmt("BUTTON_%i", i),"image_s", "default.png");
i++; texConsoleImgs.fromPNGFile(fmt("%s/%s", m_sourceDir.c_str(), ImgName.c_str()), GX_TF_RGBA8, ALLOC_MEM2);
row = m_startup.getInt("BUTTONS", fmt("button_%i_row", i), (i - 1) / 2);
col = m_startup.getInt("BUTTONS", fmt("button_%i_col", i), 1); page = i / 12;
m_startupBtnSource[i] = _addButton(theme, fmt("STARTUP/SOURCE_BTN_%i", i), theme.btnFont, L"", (30 + 300 * col), (100 + 58 * row), 280, 56, theme.btnFontColor); row = (i / 4 ) - (page * 3);
row = m_startup.getInt("BUTTONS", fmt("button_%i_row", i + 10), (i - 1) /2); col = (i - (page * 12)) - (row * 4);
col = m_startup.getInt("BUTTONS", fmt("button_%i_col", i + 10), 1); m_sourceBtnSource[i] = _addPicButton(theme, fmt("SOURCE/SOURCE_BTN_%i", i), texConsoleImg, texConsoleImgs, (30 + 150 * col), (90 + 100 * row), 90, 90);
m_startupBtnSource[i + 10] = _addButton(theme, fmt("STARTUP/SOURCE_BTN_%i", i + 10), theme.btnFont, L"", (30 + 300 * col), (100 + 58 * row), 280, 56, theme.btnFontColor);
i++;
} }
_setHideAnim(m_sourceLblTitle, "SOURCE/TITLE", 0, -200, 0.f, 1.f);
_setHideAnim(m_sourceLblNotice, "SOURCE/NOTICE", 0, 0, 1.f, 0.f);
_setHideAnim(m_sourceLblPage, "SOURCE/PAGE_BTN", 0, 200, 1.f, 0.f);
_setHideAnim(m_sourceBtnPageM, "SOURCE/PAGE_MINUS", 0, 200, 1.f, 0.f);
_setHideAnim(m_sourceBtnPageP, "SOURCE/PAGE_PLUS", 0, 200, 1.f, 0.f);
_setHideAnim(m_sourceBtnBack, "SOURCE/BACK_BTN", 0, 200, 1.f, 0.f);
_setHideAnim(m_startupLblTitle, "STARTUP/TITLE", 0, -200, 0.f, 1.f); for(int i = 0; i < 24; ++i)
_setHideAnim(m_startupLblNotice, "STARTUP/NOTICE", 0, 0, 1.f, 0.f);
_setHideAnim(m_startupLblPage, "STARTUP/PAGE_BTN", 0, 200, 1.f, 0.f);
_setHideAnim(m_startupBtnPageM, "STARTUP/PAGE_MINUS", 0, 200, 1.f, 0.f);
_setHideAnim(m_startupBtnPageP, "STARTUP/PAGE_PLUS", 0, 200, 1.f, 0.f);
_setHideAnim(m_startupBtnBack, "STARTUP/BACK_BTN", 0, 200, 1.f, 0.f);
for(int i = 0; i < 20; ++i)
{ {
_setHideAnim(m_startupBtnSource[i], fmt("STARTUP/SOURCE_BTN_%i", i), 0, 0, 1.f, 0.f); _setHideAnim(m_sourceBtnSource[i], fmt("SOURCE/SOURCE_BTN_%i", i), 0, 0, 1.f, 0.f);
} }
_hideStartup(true); _textSource();
_hideSource(true);
} }
void CMenu::_textStartup(void) void CMenu::_textSource(void)
{ {
m_btnMgr.setText(m_startupLblTitle, _t("", L"Select Source")); m_btnMgr.setText(m_sourceLblTitle, _t("", L"Select Source"));
m_btnMgr.setText(m_startupBtnBack, _t("", L"Exit")); m_btnMgr.setText(m_sourceBtnBack, _t("", L"Exit"));
m_btnMgr.setText(m_startupLblNotice, _t("", L"** DISABLED **")); m_btnMgr.setText(m_sourceLblNotice, _t("", L"** DISABLED **"));
m_btnMgr.setText(m_startupBtnSource[0], _t("", L"Wii Games"));
m_btnMgr.setText(m_startupBtnSource[1], _t("", L"VC/WiiWare"));
m_btnMgr.setText(m_startupBtnSource[2], _t("", L"GC Games"));
m_btnMgr.setText(m_startupBtnSource[3], _t("", L"Homebrew"));
if (numPlugins != 0)
{
for(u8 i = 0; i < numPlugins; ++i)
m_btnMgr.setText(m_startupBtnSource[i + 4], m_plugin.GetPluginName(i));
}
} }