-removed source menu settings from startup settings.

-access source menu setting via home button when viewing source menu or sourceflow.
-source menu is now automatically enabled if a source_menu.ini is found.
-removed five source view icons if no source_menu.ini found.
-other minor source menu code cleanup
This commit is contained in:
fledge68 2016-04-26 00:43:09 +00:00
parent eaad76ec83
commit d390563d5a
6 changed files with 84 additions and 283 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 MiB

After

Width:  |  Height:  |  Size: 3.1 MiB

View File

@ -36,15 +36,9 @@ s16 m_bootLblCIOSrevP;
s16 m_bootLblUSBPort; s16 m_bootLblUSBPort;
s16 m_bootBtnUSBPort; s16 m_bootBtnUSBPort;
s16 m_bootLblManageSM;
s16 m_bootBtnManageSM;
s16 m_bootLblAsyncNet; s16 m_bootLblAsyncNet;
s16 m_bootBtnAsyncNet; s16 m_bootBtnAsyncNet;
s16 m_bootLblCategoryOnBoot;
s16 m_bootBtnCategoryOnBoot;
s16 m_bootLblFtpOnBoot; s16 m_bootLblFtpOnBoot;
s16 m_bootBtnFtpOnBoot; s16 m_bootBtnFtpOnBoot;
@ -88,15 +82,10 @@ static void hideBoot(bool instant, bool common)
m_btnMgr.hide(m_bootLblUSBPort, instant); m_btnMgr.hide(m_bootLblUSBPort, instant);
m_btnMgr.hide(m_bootBtnUSBPort, instant); m_btnMgr.hide(m_bootBtnUSBPort, instant);
m_btnMgr.hide(m_bootLblManageSM, instant);
m_btnMgr.hide(m_bootBtnManageSM, instant);
/* page 2 */ /* page 2 */
m_btnMgr.hide(m_bootLblAsyncNet, instant); m_btnMgr.hide(m_bootLblAsyncNet, instant);
m_btnMgr.hide(m_bootBtnAsyncNet, instant); m_btnMgr.hide(m_bootBtnAsyncNet, instant);
m_btnMgr.hide(m_bootLblCategoryOnBoot, instant);
m_btnMgr.hide(m_bootBtnCategoryOnBoot, instant);
m_btnMgr.hide(m_bootLblFtpOnBoot, instant); m_btnMgr.hide(m_bootLblFtpOnBoot, instant);
m_btnMgr.hide(m_bootBtnFtpOnBoot, instant); m_btnMgr.hide(m_bootBtnFtpOnBoot, instant);
} }
@ -172,23 +161,11 @@ bool CMenu::_Boot(void)
set_port = !set_port; set_port = !set_port;
m_btnMgr.setText(m_bootBtnUSBPort, wfmt(L"%i", set_port)); m_btnMgr.setText(m_bootBtnUSBPort, wfmt(L"%i", set_port));
} }
else if (m_btnMgr.selected(m_bootBtnManageSM))
{
hideBoot(true, true);
_CfgSrc();
showBoot();
_refreshBoot();
}
else if (m_btnMgr.selected(m_bootBtnAsyncNet)) else if (m_btnMgr.selected(m_bootBtnAsyncNet))
{ {
m_cfg.setBool("GENERAL", "async_network", !m_cfg.getBool("GENERAL", "async_network", false)); m_cfg.setBool("GENERAL", "async_network", !m_cfg.getBool("GENERAL", "async_network", false));
m_btnMgr.setText(m_bootBtnAsyncNet, m_cfg.getBool("GENERAL", "async_network", false) ? _t("on", L"On") : _t("off", L"Off")); m_btnMgr.setText(m_bootBtnAsyncNet, m_cfg.getBool("GENERAL", "async_network", false) ? _t("on", L"On") : _t("off", L"Off"));
} }
else if (m_btnMgr.selected(m_bootBtnCategoryOnBoot))
{
m_cfg.setBool("GENERAL", "category_on_start", !m_cfg.getBool("GENERAL", "category_on_start", false));
m_btnMgr.setText(m_bootBtnCategoryOnBoot, m_cfg.getBool("GENERAL", "category_on_start") ? _t("on", L"On") : _t("off", L"Off"));
}
else if (m_btnMgr.selected(m_bootBtnFtpOnBoot)) else if (m_btnMgr.selected(m_bootBtnFtpOnBoot))
{ {
m_cfg.setBool(FTP_DOMAIN, "auto_start", !m_cfg.getBool(FTP_DOMAIN, "auto_start", false)); m_cfg.setBool(FTP_DOMAIN, "auto_start", !m_cfg.getBool(FTP_DOMAIN, "auto_start", false));
@ -234,22 +211,15 @@ void CMenu::_refreshBoot()
m_btnMgr.show(m_bootLblUSBPort); m_btnMgr.show(m_bootLblUSBPort);
m_btnMgr.show(m_bootBtnUSBPort); m_btnMgr.show(m_bootBtnUSBPort);
m_btnMgr.show(m_bootLblManageSM);
m_btnMgr.show(m_bootBtnManageSM);
} }
else else
{ {
m_btnMgr.setText(m_bootBtnAsyncNet, m_cfg.getBool("GENERAL", "async_network", false) ? _t("on", L"On") : _t("off", L"Off")); m_btnMgr.setText(m_bootBtnAsyncNet, m_cfg.getBool("GENERAL", "async_network", false) ? _t("on", L"On") : _t("off", L"Off"));
m_btnMgr.setText(m_bootBtnCategoryOnBoot, m_cfg.getBool("GENERAL", "category_on_start") ? _t("on", L"On") : _t("off", L"Off"));
m_btnMgr.setText(m_bootBtnFtpOnBoot, m_cfg.getBool(FTP_DOMAIN, "auto_start") ? _t("on", L"On") : _t("off", L"Off")); m_btnMgr.setText(m_bootBtnFtpOnBoot, m_cfg.getBool(FTP_DOMAIN, "auto_start") ? _t("on", L"On") : _t("off", L"Off"));
m_btnMgr.show(m_bootLblAsyncNet); m_btnMgr.show(m_bootLblAsyncNet);
m_btnMgr.show(m_bootBtnAsyncNet); m_btnMgr.show(m_bootBtnAsyncNet);
m_btnMgr.show(m_bootLblCategoryOnBoot);
m_btnMgr.show(m_bootBtnCategoryOnBoot);
m_btnMgr.show(m_bootLblFtpOnBoot); m_btnMgr.show(m_bootLblFtpOnBoot);
m_btnMgr.show(m_bootBtnFtpOnBoot); m_btnMgr.show(m_bootBtnFtpOnBoot);
} }
@ -261,10 +231,7 @@ void CMenu::_textBoot(void)
m_btnMgr.setText(m_bootLblLoadCIOS, _t("cfgbt2", L"Force Load cIOS")); m_btnMgr.setText(m_bootLblLoadCIOS, _t("cfgbt2", L"Force Load cIOS"));
m_btnMgr.setText(m_bootLblCIOSrev, _t("cfgbt3", L"Force cIOS Revision")); m_btnMgr.setText(m_bootLblCIOSrev, _t("cfgbt3", L"Force cIOS Revision"));
m_btnMgr.setText(m_bootLblUSBPort, _t("cfgbt4", L"USB Port")); m_btnMgr.setText(m_bootLblUSBPort, _t("cfgbt4", L"USB Port"));
m_btnMgr.setText(m_bootLblManageSM, _t("cfgsm7", L"Manage Source Menu"));
m_btnMgr.setText(m_bootBtnManageSM, _t("cfgc5", L"Go"));
m_btnMgr.setText(m_bootLblAsyncNet, _t("cfgp3", L"Init network on boot")); m_btnMgr.setText(m_bootLblAsyncNet, _t("cfgp3", L"Init network on boot"));
m_btnMgr.setText(m_bootLblCategoryOnBoot, _t("cfgd7", L"Show categories on boot"));
m_btnMgr.setText(m_bootLblFtpOnBoot, _t("cfgbt7", L"Start FTP Server on boot")); m_btnMgr.setText(m_bootLblFtpOnBoot, _t("cfgbt7", L"Start FTP Server on boot"));
m_btnMgr.setText(m_bootBtnBack, _t("cfg10", L"Back")); m_btnMgr.setText(m_bootBtnBack, _t("cfg10", L"Back"));
} }
@ -290,15 +257,10 @@ void CMenu::_initBoot(void)
m_bootLblUSBPort = _addLabel("BOOT/USB_PORT", theme.lblFont, L"", 20, 245, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_bootLblUSBPort = _addLabel("BOOT/USB_PORT", theme.lblFont, L"", 20, 245, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_bootBtnUSBPort = _addButton("BOOT/USB_PORT_BTN", theme.btnFont, L"", 420, 250, 200, 48, theme.btnFontColor); m_bootBtnUSBPort = _addButton("BOOT/USB_PORT_BTN", theme.btnFont, L"", 420, 250, 200, 48, theme.btnFontColor);
m_bootLblManageSM = _addLabel("BOOT/MANAGE_SOURCE", theme.lblFont, L"", 20, 305, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_bootBtnManageSM = _addButton("BOOT/MANAGE_SOURCE_BTN", theme.btnFont, L"", 420, 310, 200, 48, theme.btnFontColor);
/* page 2 */ /* page 2 */
m_bootLblAsyncNet = _addLabel("BOOT/ASYNCNET", theme.lblFont, L"", 20, 305, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_bootLblAsyncNet = _addLabel("BOOT/ASYNCNET", theme.lblFont, L"", 20, 305, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_bootBtnAsyncNet = _addButton("BOOT/ASYNCNET_BTN", theme.btnFont, L"", 420, 310, 200, 48, theme.btnFontColor); m_bootBtnAsyncNet = _addButton("BOOT/ASYNCNET_BTN", theme.btnFont, L"", 420, 310, 200, 48, theme.btnFontColor);
m_bootLblCategoryOnBoot = _addLabel("BOOT/CAT_ON_START", theme.lblFont, L"", 20, 125, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_bootBtnCategoryOnBoot = _addButton("BOOT/CAT_ON_START_BTN", theme.btnFont, L"", 420, 130, 200, 48, theme.btnFontColor);
m_bootLblFtpOnBoot = _addLabel("BOOT/FTP", theme.lblFont, L"", 20, 245, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_bootLblFtpOnBoot = _addLabel("BOOT/FTP", theme.lblFont, L"", 20, 245, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_bootBtnFtpOnBoot = _addButton("BOOT/FTP_BTN", theme.btnFont, L"", 420, 250, 200, 48, theme.btnFontColor); m_bootBtnFtpOnBoot = _addButton("BOOT/FTP_BTN", theme.btnFont, L"", 420, 250, 200, 48, theme.btnFontColor);
@ -319,15 +281,9 @@ void CMenu::_initBoot(void)
_setHideAnim(m_bootLblUSBPort, "BOOT/USB_PORT", 50, 0, -2.f, 0.f); _setHideAnim(m_bootLblUSBPort, "BOOT/USB_PORT", 50, 0, -2.f, 0.f);
_setHideAnim(m_bootBtnUSBPort, "BOOT/USB_PORT_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_bootBtnUSBPort, "BOOT/USB_PORT_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_bootLblManageSM, "BOOT/MANAGE_SOURCE", 50, 0, -2.f, 0.f);
_setHideAnim(m_bootBtnManageSM, "BOOT/MANAGE_SOURCE_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_bootLblAsyncNet, "BOOT/ASYNCNET", 50, 0, -2.f, 0.f); _setHideAnim(m_bootLblAsyncNet, "BOOT/ASYNCNET", 50, 0, -2.f, 0.f);
_setHideAnim(m_bootBtnAsyncNet, "BOOT/ASYNCNET_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_bootBtnAsyncNet, "BOOT/ASYNCNET_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_bootLblCategoryOnBoot, "BOOT/CAT_ON_START", 50, 0, -2.f, 0.f);
_setHideAnim(m_bootBtnCategoryOnBoot, "BOOT/CAT_ON_START_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_bootLblFtpOnBoot, "BOOT/FTP", 50, 0, -2.f, 0.f); _setHideAnim(m_bootLblFtpOnBoot, "BOOT/FTP", 50, 0, -2.f, 0.f);
_setHideAnim(m_bootBtnFtpOnBoot, "BOOT/FTP_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_bootBtnFtpOnBoot, "BOOT/FTP_BTN", -50, 0, 1.f, 0.f);

View File

@ -23,12 +23,6 @@ s16 m_cfgsrcBtnPageM;
s16 m_cfgsrcBtnPageP; s16 m_cfgsrcBtnPageP;
s16 m_cfgsrcLblUser[4]; s16 m_cfgsrcLblUser[4];
s16 m_cfgsrcLblEnableSM;
s16 m_cfgsrcBtnEnableSM;
s16 m_cfgsrcLblSourceOnBoot;
s16 m_cfgsrcBtnSourceOnBoot;
s16 m_cfgsrcLblEnableSF; s16 m_cfgsrcLblEnableSF;
s16 m_cfgsrcBtnEnableSF; s16 m_cfgsrcBtnEnableSF;
@ -42,7 +36,7 @@ s16 m_cfgsrcLblMultisource;
s16 m_cfgsrcBtnMultisource; s16 m_cfgsrcBtnMultisource;
u8 cfgsrc_curPage = 1; u8 cfgsrc_curPage = 1;
u8 cfgsrc_Pages = 2; u8 cfgsrc_Pages = 1;
static void showCfgSrc(void) static void showCfgSrc(void)
{ {
@ -69,18 +63,13 @@ static void hideCfgSrc(bool instant, bool common)
if(m_cfgsrcLblUser[i] != -1) if(m_cfgsrcLblUser[i] != -1)
m_btnMgr.hide(m_cfgsrcLblUser[i], instant); m_btnMgr.hide(m_cfgsrcLblUser[i], instant);
} }
m_btnMgr.hide(m_cfgsrcLblEnableSM, instant);
m_btnMgr.hide(m_cfgsrcBtnEnableSM, instant);
m_btnMgr.hide(m_cfgsrcLblSourceOnBoot, instant);
m_btnMgr.hide(m_cfgsrcBtnSourceOnBoot, instant);
m_btnMgr.hide(m_cfgsrcLblEnableSF, instant); m_btnMgr.hide(m_cfgsrcLblEnableSF, instant);
m_btnMgr.hide(m_cfgsrcBtnEnableSF, instant); m_btnMgr.hide(m_cfgsrcBtnEnableSF, instant);
m_btnMgr.hide(m_cfgsrcLblSmallbox, instant); m_btnMgr.hide(m_cfgsrcLblSmallbox, instant);
m_btnMgr.hide(m_cfgsrcBtnSmallbox, instant); m_btnMgr.hide(m_cfgsrcBtnSmallbox, instant);
/* page 2 */
m_btnMgr.hide(m_cfgsrcLblClearSF, instant); m_btnMgr.hide(m_cfgsrcLblClearSF, instant);
m_btnMgr.hide(m_cfgsrcBtnClearSF, instant); m_btnMgr.hide(m_cfgsrcBtnClearSF, instant);
@ -124,30 +113,19 @@ void CMenu::_CfgSrc(void)
{ {
if(m_btnMgr.selected(m_cfgsrcBtnBack)) if(m_btnMgr.selected(m_cfgsrcBtnBack))
break; break;
else if (m_btnMgr.selected(m_cfgsrcBtnEnableSM) && !m_sourceflow) else if (m_btnMgr.selected(m_cfgsrcBtnEnableSF))
{
m_cfg.setBool("GENERAL", "use_source", !m_cfg.getBool("GENERAL", "use_source", true));
m_btnMgr.setText(m_cfgsrcBtnEnableSM, m_cfg.getBool("GENERAL", "use_source", true) ? _t("on", L"On") : _t("off", L"Off"));
m_use_source = m_cfg.getBool("GENERAL", "use_source", true);
}
else if (m_btnMgr.selected(m_cfgsrcBtnSourceOnBoot) && !m_sourceflow)
{
m_cfg.setBool("GENERAL", "source_on_start", !m_cfg.getBool("GENERAL", "source_on_start", false));
m_btnMgr.setText(m_cfgsrcBtnSourceOnBoot, m_cfg.getBool("GENERAL", "source_on_start") ? _t("on", L"On") : _t("off", L"Off"));
}
else if (m_btnMgr.selected(m_cfgsrcBtnEnableSF) && !m_sourceflow)
{ {
m_cfg.setBool("SOURCEFLOW", "enabled", !m_cfg.getBool("SOURCEFLOW", "enabled", false)); m_cfg.setBool("SOURCEFLOW", "enabled", !m_cfg.getBool("SOURCEFLOW", "enabled", false));
m_btnMgr.setText(m_cfgsrcBtnEnableSF, m_cfg.getBool("SOURCEFLOW", "enabled") ? _t("on", L"On") : _t("off", L"Off")); m_btnMgr.setText(m_cfgsrcBtnEnableSF, m_cfg.getBool("SOURCEFLOW", "enabled") ? _t("on", L"On") : _t("off", L"Off"));
} }
else if (m_btnMgr.selected(m_cfgsrcBtnSmallbox)) else if (m_btnMgr.selected(m_cfgsrcBtnSmallbox) && m_sourceflow)
{ {
m_load_view = true; m_load_view = true;
fsop_deleteFolder(fmt("%s/sourceflow", m_cacheDir.c_str())); fsop_deleteFolder(fmt("%s/sourceflow", m_cacheDir.c_str()));
m_cfg.setBool("SOURCEFLOW", "smallbox", !m_cfg.getBool("SOURCEFLOW", "smallbox", false)); m_cfg.setBool("SOURCEFLOW", "smallbox", !m_cfg.getBool("SOURCEFLOW", "smallbox", false));
m_btnMgr.setText(m_cfgsrcBtnSmallbox, m_cfg.getBool("SOURCEFLOW", "smallbox") ? _t("on", L"On") : _t("off", L"Off")); m_btnMgr.setText(m_cfgsrcBtnSmallbox, m_cfg.getBool("SOURCEFLOW", "smallbox") ? _t("on", L"On") : _t("off", L"Off"));
} }
else if (m_btnMgr.selected(m_cfgsrcBtnClearSF)) else if (m_btnMgr.selected(m_cfgsrcBtnClearSF) && m_sourceflow)
{ {
m_cfg.setBool("SOURCEFLOW", "update_cache", true); m_cfg.setBool("SOURCEFLOW", "update_cache", true);
m_load_view = true; m_load_view = true;
@ -169,26 +147,15 @@ void CMenu::_refreshCfgSrc()
m_btnMgr.setText(m_cfgsrcLblPage, wfmt(L"%i / %i", cfgsrc_curPage, cfgsrc_Pages)); m_btnMgr.setText(m_cfgsrcLblPage, wfmt(L"%i / %i", cfgsrc_curPage, cfgsrc_Pages));
if(cfgsrc_curPage == 1) if(cfgsrc_curPage == 1)
{ {
m_btnMgr.setText(m_cfgsrcBtnEnableSM, m_cfg.getBool("GENERAL", "use_source") ? _t("on", L"On") : _t("off", L"Off"));
m_btnMgr.setText(m_cfgsrcBtnSourceOnBoot, m_cfg.getBool("GENERAL", "source_on_start") ? _t("on", L"On") : _t("off", L"Off"));
m_btnMgr.setText(m_cfgsrcBtnEnableSF, m_cfg.getBool("SOURCEFLOW", "enabled") ? _t("on", L"On") : _t("off", L"Off")); m_btnMgr.setText(m_cfgsrcBtnEnableSF, m_cfg.getBool("SOURCEFLOW", "enabled") ? _t("on", L"On") : _t("off", L"Off"));
m_btnMgr.setText(m_cfgsrcBtnSmallbox, m_cfg.getBool("SOURCEFLOW", "smallbox") ? _t("on", L"On") : _t("off", L"Off")); m_btnMgr.setText(m_cfgsrcBtnSmallbox, m_cfg.getBool("SOURCEFLOW", "smallbox") ? _t("on", L"On") : _t("off", L"Off"));
m_btnMgr.setText(m_cfgsrcBtnMultisource, m_cfg.getBool("GENERAL", "multisource") ? _t("on", L"On") : _t("off", L"Off"));
m_btnMgr.show(m_cfgsrcLblEnableSM);
m_btnMgr.show(m_cfgsrcBtnEnableSM);
m_btnMgr.show(m_cfgsrcLblSourceOnBoot);
m_btnMgr.show(m_cfgsrcBtnSourceOnBoot);
m_btnMgr.show(m_cfgsrcLblEnableSF); m_btnMgr.show(m_cfgsrcLblEnableSF);
m_btnMgr.show(m_cfgsrcBtnEnableSF); m_btnMgr.show(m_cfgsrcBtnEnableSF);
m_btnMgr.show(m_cfgsrcLblSmallbox); m_btnMgr.show(m_cfgsrcLblSmallbox);
m_btnMgr.show(m_cfgsrcBtnSmallbox); m_btnMgr.show(m_cfgsrcBtnSmallbox);
}
else
{
m_btnMgr.setText(m_cfgsrcBtnMultisource, m_cfg.getBool("GENERAL", "multisource") ? _t("on", L"On") : _t("off", L"Off"));
m_btnMgr.show(m_cfgsrcLblClearSF); m_btnMgr.show(m_cfgsrcLblClearSF);
m_btnMgr.show(m_cfgsrcBtnClearSF); m_btnMgr.show(m_cfgsrcBtnClearSF);
@ -201,8 +168,6 @@ void CMenu::_refreshCfgSrc()
void CMenu::_textCfgSrc(void) void CMenu::_textCfgSrc(void)
{ {
m_btnMgr.setText(m_cfgsrcLblTitle, _t("cfgsm1", L"Source Menu Settings")); m_btnMgr.setText(m_cfgsrcLblTitle, _t("cfgsm1", L"Source Menu Settings"));
m_btnMgr.setText(m_cfgsrcLblEnableSM, _t("cfgsm2", L"Enable B To Source Menu"));
m_btnMgr.setText(m_cfgsrcLblSourceOnBoot, _t("cfgbt5", L"Show source menu on boot"));
m_btnMgr.setText(m_cfgsrcLblEnableSF, _t("cfgsm3", L"Enable Sourceflow")); m_btnMgr.setText(m_cfgsrcLblEnableSF, _t("cfgsm3", L"Enable Sourceflow"));
m_btnMgr.setText(m_cfgsrcLblSmallbox, _t("cfgsm4", L"Sourceflow Smallbox")); m_btnMgr.setText(m_cfgsrcLblSmallbox, _t("cfgsm4", L"Sourceflow Smallbox"));
m_btnMgr.setText(m_cfgsrcLblClearSF, _t("cfgsm5", L"Clear Sourceflow Cache")); m_btnMgr.setText(m_cfgsrcLblClearSF, _t("cfgsm5", L"Clear Sourceflow Cache"));
@ -221,23 +186,17 @@ void CMenu::_initCfgSrc(void)
m_cfgsrcBtnPageM = _addPicButton("CFG_SRC/PAGE_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 20, 400, 48, 48); m_cfgsrcBtnPageM = _addPicButton("CFG_SRC/PAGE_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 20, 400, 48, 48);
m_cfgsrcBtnPageP = _addPicButton("CFG_SRC/PAGE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 172, 400, 48, 48); m_cfgsrcBtnPageP = _addPicButton("CFG_SRC/PAGE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 172, 400, 48, 48);
m_cfgsrcLblEnableSM = _addLabel("CFG_SRC/ENABLE_SM", theme.lblFont, L"", 20, 125, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_cfgsrcLblEnableSF = _addLabel("CFG_SRC/ENABLE_SF", theme.lblFont, L"", 20, 125, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_cfgsrcBtnEnableSM = _addButton("CFG_SRC/ENABLE_SM_BTN", theme.btnFont, L"", 420, 130, 200, 48, theme.btnFontColor); m_cfgsrcBtnEnableSF = _addButton("CFG_SRC/ENABLE_SF_BTN", theme.btnFont, L"", 420, 130, 200, 48, theme.btnFontColor);
m_cfgsrcLblSourceOnBoot = _addLabel("CFG_SRC/SOURCE_ON_START", theme.lblFont, L"", 20, 185, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_cfgsrcLblSmallbox = _addLabel("CFG_SRC/SF_SMALLBOX", theme.lblFont, L"", 20, 185, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_cfgsrcBtnSourceOnBoot = _addButton("CFG_SRC/SOURCE_ON_START_BTN", theme.btnFont, L"", 420, 190, 200, 48, theme.btnFontColor); m_cfgsrcBtnSmallbox = _addButton("CFG_SRC/SF_SMALLBOX_BTN", theme.btnFont, L"", 420, 190, 200, 48, theme.btnFontColor);
m_cfgsrcLblEnableSF = _addLabel("CFG_SRC/ENABLE_SF", theme.lblFont, L"", 20, 245, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_cfgsrcLblClearSF = _addLabel("CFG_SRC/CLEAR_SF", theme.lblFont, L"", 20, 245, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_cfgsrcBtnEnableSF = _addButton("CFG_SRC/ENABLE_SF_BTN", theme.btnFont, L"", 420, 250, 200, 48, theme.btnFontColor); m_cfgsrcBtnClearSF = _addButton("CFG_SRC/CLEAR_SF_BTN", theme.btnFont, L"", 420, 250, 200, 48, theme.btnFontColor);
m_cfgsrcLblSmallbox = _addLabel("CFG_SRC/SF_SMALLBOX", theme.lblFont, L"", 20, 305, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_cfgsrcLblMultisource = _addLabel("CFG_SRC/MULTISOURCE", theme.lblFont, L"", 20, 305, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_cfgsrcBtnSmallbox = _addButton("CFG_SRC/SF_SMALLBOX_BTN", theme.btnFont, L"", 420, 310, 200, 48, theme.btnFontColor); m_cfgsrcBtnMultisource = _addButton("CFG_SRC/MULTISOURCE_BTN", theme.btnFont, L"", 420, 310, 200, 48, theme.btnFontColor);
/* page 2 */
m_cfgsrcLblClearSF = _addLabel("CFG_SRC/CLEAR_SF", theme.lblFont, L"", 20, 125, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_cfgsrcBtnClearSF = _addButton("CFG_SRC/CLEAR_SF_BTN", theme.btnFont, L"", 420, 130, 200, 48, theme.btnFontColor);
m_cfgsrcLblMultisource = _addLabel("CFG_SRC/MULTISOURCE", theme.lblFont, L"", 20, 185, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_cfgsrcBtnMultisource = _addButton("CFG_SRC/MULTISOURCE_BTN", theme.btnFont, L"", 420, 190, 200, 48, theme.btnFontColor);
_setHideAnim(m_cfgsrcLblTitle, "CFG_SRC/TITLE", 0, 0, -2.f, 0.f); _setHideAnim(m_cfgsrcLblTitle, "CFG_SRC/TITLE", 0, 0, -2.f, 0.f);
_setHideAnim(m_cfgsrcBtnBack, "CFG_SRC/BACK_BTN", 0, 0, 1.f, -1.f); _setHideAnim(m_cfgsrcBtnBack, "CFG_SRC/BACK_BTN", 0, 0, 1.f, -1.f);
@ -245,12 +204,6 @@ void CMenu::_initCfgSrc(void)
_setHideAnim(m_cfgsrcBtnPageM, "CFG_SRC/PAGE_MINUS", 0, 0, 1.f, -1.f); _setHideAnim(m_cfgsrcBtnPageM, "CFG_SRC/PAGE_MINUS", 0, 0, 1.f, -1.f);
_setHideAnim(m_cfgsrcBtnPageP, "CFG_SRC/PAGE_PLUS", 0, 0, 1.f, -1.f); _setHideAnim(m_cfgsrcBtnPageP, "CFG_SRC/PAGE_PLUS", 0, 0, 1.f, -1.f);
_setHideAnim(m_cfgsrcLblEnableSM, "CFG_SRC/ENABLE_SM", -50, 0, -2.f, 0.f);
_setHideAnim(m_cfgsrcBtnEnableSM, "CFG_SRC/ENABLE_SM_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_cfgsrcLblSourceOnBoot, "CFG_SRC/SOURCE_ON_START", -50, 0, -2.f, 0.f);
_setHideAnim(m_cfgsrcBtnSourceOnBoot, "CFG_SRC/SOURCE_ON_START_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_cfgsrcLblEnableSF, "CFG_SRC/ENABLE_SF", -50, 0, -2.f, 0.f); _setHideAnim(m_cfgsrcLblEnableSF, "CFG_SRC/ENABLE_SF", -50, 0, -2.f, 0.f);
_setHideAnim(m_cfgsrcBtnEnableSF, "CFG_SRC/ENABLE_SF_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_cfgsrcBtnEnableSF, "CFG_SRC/ENABLE_SF_BTN", -50, 0, 1.f, 0.f);

View File

@ -1326,11 +1326,12 @@ void CMenu::_launchGame(dir_discHdr *hdr, bool dvd)
m_gcfg2.setInt(id, "emulate_save", 1); m_gcfg2.setInt(id, "emulate_save", 1);
break; break;
} }
emuPartition = m_cfg.getInt(WII_DOMAIN, "savepartition");
if(emulate_mode == 3)//full if(emulate_mode == 3)//full
{ {
if(_TestEmuNand(m_cfg.getInt(WII_DOMAIN, "savepartition"), emuPath.c_str(), true)) if(_TestEmuNand(m_cfg.getInt(WII_DOMAIN, "savepartition"), emuPath.c_str(), true))
{ {
emuPartition = m_cfg.getInt(WII_DOMAIN, "savepartition"); //emuPartition = m_cfg.getInt(WII_DOMAIN, "savepartition");
break; break;
} }
} }

View File

@ -20,6 +20,12 @@ static inline int loopNum(int i, int s)
return (i + s) % s; return (i + s) % s;
} }
static bool show_homebrew = true;
static bool parental_homebrew = false;
static bool show_channel = true;
static bool show_plugin = true;
static bool show_gamecube = true;
void CMenu::_hideMain(bool instant) void CMenu::_hideMain(bool instant)
{ {
m_btnMgr.hide(m_mainBtnNext, instant); m_btnMgr.hide(m_mainBtnNext, instant);
@ -45,12 +51,6 @@ void CMenu::_hideMain(bool instant)
m_btnMgr.hide(m_mainLblUser[i], instant); m_btnMgr.hide(m_mainLblUser[i], instant);
} }
static bool show_homebrew = true;
static bool parental_homebrew = false;
static bool show_channel = true;
static bool show_plugin = true;
static bool show_gamecube = true;
void CMenu::_showMain(void) void CMenu::_showMain(void)
{ {
start_main: start_main:
@ -60,7 +60,7 @@ start_main:
m_btnMgr.show(m_mem2FreeSize); m_btnMgr.show(m_mem2FreeSize);
#endif #endif
m_vid.set2DViewport(m_cfg.getInt("GENERAL", "tv_width", 640), m_cfg.getInt("GENERAL", "tv_height", 480), m_vid.set2DViewport(m_cfg.getInt("GENERAL", "tv_width", 640), m_cfg.getInt("GENERAL", "tv_height", 480),
m_cfg.getInt("GENERAL", "tv_x", 0), m_cfg.getInt("GENERAL", "tv_y", 0)); m_cfg.getInt("GENERAL", "tv_x", 0), m_cfg.getInt("GENERAL", "tv_y", 0));
_setBg(m_mainBg, m_mainBgLQ); _setBg(m_mainBg, m_mainBgLQ);
m_btnMgr.show(m_mainBtnInfo); m_btnMgr.show(m_mainBtnInfo);
m_btnMgr.show(m_mainBtnConfig); m_btnMgr.show(m_mainBtnConfig);
@ -121,7 +121,6 @@ start_main:
case COVERFLOW_WII: case COVERFLOW_WII:
case COVERFLOW_GAMECUBE: case COVERFLOW_GAMECUBE:
m_btnMgr.setText(m_mainLblMessage, _t("main2", L"No games found! Please select partition to change the device/partition or click Install to install a game.")); m_btnMgr.setText(m_mainLblMessage, _t("main2", L"No games found! Please select partition to change the device/partition or click Install to install a game."));
// m_btnMgr.setText(m_mainLblMessage, _t("main2", L"Welcome to WiiFlow. I have not found any games. Click Install to install games, or Select partition to select your partition type."));
m_btnMgr.show(m_mainBtnInstall); m_btnMgr.show(m_mainBtnInstall);
m_btnMgr.show(m_mainBtnSelPart); m_btnMgr.show(m_mainBtnSelPart);
m_btnMgr.show(m_mainLblMessage); m_btnMgr.show(m_mainLblMessage);
@ -141,13 +140,11 @@ start_main:
break; break;
case COVERFLOW_HOMEBREW: case COVERFLOW_HOMEBREW:
m_btnMgr.setText(m_mainLblMessage, _t("main4", L"No homebrew apps found! Try changing the partition to select the correct device/partition.")); m_btnMgr.setText(m_mainLblMessage, _t("main4", L"No homebrew apps found! Try changing the partition to select the correct device/partition."));
// m_btnMgr.setText(m_mainLblMessage, _t("main4", L"Welcome to WiiFlow. I have not found any homebrew apps. Select partition to select your partition type."));
m_btnMgr.show(m_mainBtnSelPart); m_btnMgr.show(m_mainBtnSelPart);
m_btnMgr.show(m_mainLblMessage); m_btnMgr.show(m_mainLblMessage);
break; break;
case COVERFLOW_PLUGIN: case COVERFLOW_PLUGIN:
m_btnMgr.setText(m_mainLblMessage, _t("main5", L"No roms/items for your plugin found! Try changing the partition to select the correct device/partition.")); m_btnMgr.setText(m_mainLblMessage, _t("main5", L"No roms/items for your plugin found! Try changing the partition to select the correct device/partition."));
// m_btnMgr.setText(m_mainLblMessage, _t("main5", L"Welcome to WiiFlow. I have not found any plugins. Select partition to select your partition type."));
m_btnMgr.show(m_mainBtnSelPart); m_btnMgr.show(m_mainBtnSelPart);
m_btnMgr.show(m_mainLblMessage); m_btnMgr.show(m_mainLblMessage);
break; break;
@ -162,15 +159,18 @@ void CMenu::LoadView(void)
CoverFlow.clear(); CoverFlow.clear();
if(!m_vid.showingWaitMessage()) if(!m_vid.showingWaitMessage())
_showWaitMessage(); _showWaitMessage();
if(m_clearCats)// clear categories unless a source menu btn has selected one if(m_clearCats)// clear categories unless a source menu btn has selected one
{ {
m_cat.remove("GENERAL", "selected_categories"); m_cat.remove("GENERAL", "selected_categories");
m_cat.remove("GENERAL", "required_categories"); m_cat.remove("GENERAL", "required_categories");
} }
m_clearCats = true; m_clearCats = true;
m_favorites = false; m_favorites = false;
if(m_cfg.getBool("GENERAL", "save_favorites_mode", false)) if(m_cfg.getBool("GENERAL", "save_favorites_mode", false))
m_favorites = m_cfg.getBool(_domainFromView(), "favorites", false); m_favorites = m_cfg.getBool(_domainFromView(), "favorites", false);
if(m_sourceflow) if(m_sourceflow)
{ {
m_gameList.clear(); m_gameList.clear();
@ -259,7 +259,6 @@ int CMenu::main(void)
show_gamecube = m_show_gc; show_gamecube = m_show_gc;
m_allow_random = m_cfg.getBool("GENERAL", "allow_b_on_questionmark", true); m_allow_random = m_cfg.getBool("GENERAL", "allow_b_on_questionmark", true);
m_multisource = m_cfg.getBool("GENERAL", "multisource", false); m_multisource = m_cfg.getBool("GENERAL", "multisource", false);
m_use_source = m_cfg.getBool("GENERAL", "use_source", true);
bool bheld = false; bool bheld = false;
bool bUsed = false; bool bUsed = false;
m_emuSaveNand = false; m_emuSaveNand = false;
@ -317,7 +316,7 @@ int CMenu::main(void)
LoadView(); LoadView();
continue; continue;
} }
if(m_use_source)//if source_menu enabled via b button if(m_use_source)//if source_menu enabled
{ {
_hideMain(); _hideMain();
if(m_cfg.getBool("SOURCEFLOW", "enabled", false))//if sourceflow show it if(m_cfg.getBool("SOURCEFLOW", "enabled", false))//if sourceflow show it
@ -346,7 +345,13 @@ int CMenu::main(void)
if(m_sourceflow) if(m_sourceflow)
{ {
_CfgSrc(); _CfgSrc();
_showMain(); if(!m_cfg.getBool("SOURCEFLOW", "enabled"))
{
m_sourceflow = false;
LoadView();
continue;
}
//_showMain();
if(BTN_B_HELD) if(BTN_B_HELD)
bUsed = true; bUsed = true;
if(m_load_view) if(m_load_view)
@ -504,32 +509,6 @@ int CMenu::main(void)
_showMain(); _showMain();
_initCF(); _initCF();
} }
//Events to show source menu or sourceflow if B on mode icon
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))
{
if(!m_use_source)//only use if B to source menu not enabled
{
_hideMain();
if(m_cfg.getBool("SOURCEFLOW", "enabled", false))//if sourceflow show it
{
m_sourceflow = true;
LoadView();
}
else //show source menu
{
if(!_Source()) //if different source selected load it
LoadView();
else
{
if(BTN_B_HELD)
bUsed = true;
_showMain();
}
}
continue;
}
}
else if(m_btnMgr.selected(m_mainBtnNext) || m_btnMgr.selected(m_mainBtnPrev)) else if(m_btnMgr.selected(m_mainBtnNext) || m_btnMgr.selected(m_mainBtnPrev))
{ {
bUsed = true; bUsed = true;

View File

@ -13,14 +13,15 @@ s16 m_sourceBtnBack;
s16 m_sourceLblTitle; s16 m_sourceLblTitle;
s16 m_sourceBtnSource[12]; s16 m_sourceBtnSource[12];
s16 m_sourceLblUser[4]; s16 m_sourceLblUser[4];
s16 m_sourceBtnGamecube;
s16 m_sourceBtnPlugin;
s16 m_sourceBtnWii;
s16 m_sourceBtnChannel;
s16 m_sourceBtnHomebrew;
TexData m_sourceBg; TexData m_sourceBg;
static bool show_homebrew = true;
static bool parental_homebrew = false;
static bool show_channel = true;
static bool show_plugin = true;
static bool show_gamecube = true;
bool exitSource = false; bool exitSource = false;
u8 sourceBtn; u8 sourceBtn;
u8 selectedBtns; u8 selectedBtns;
@ -38,11 +39,6 @@ void CMenu::_hideSource(bool instant)
m_btnMgr.hide(m_sourceBtnPageM, instant); m_btnMgr.hide(m_sourceBtnPageM, instant);
m_btnMgr.hide(m_sourceBtnPageP, instant); m_btnMgr.hide(m_sourceBtnPageP, instant);
m_btnMgr.hide(m_sourceBtnBack, instant); m_btnMgr.hide(m_sourceBtnBack, instant);
m_btnMgr.hide(m_sourceBtnHomebrew, instant);
m_btnMgr.hide(m_sourceBtnChannel, instant);
m_btnMgr.hide(m_sourceBtnWii, instant);
m_btnMgr.hide(m_sourceBtnGamecube, instant);
m_btnMgr.hide(m_sourceBtnPlugin, instant);
u8 i; u8 i;
for(i = 0; i < ARRAY_SIZE(m_sourceLblUser); ++i) for(i = 0; i < ARRAY_SIZE(m_sourceLblUser); ++i)
@ -320,12 +316,12 @@ void CMenu::_sourceFlow()
bool CMenu::_Source() bool CMenu::_Source()
{ {
CoverFlow.clear();
u8 i, j, k; u8 i, j, k;
bool show_homebrew = !m_cfg.getBool(HOMEBREW_DOMAIN, "disable", false); parental_homebrew = m_cfg.getBool(HOMEBREW_DOMAIN, "parental", false);
bool show_channel = !m_cfg.getBool(CHANNEL_DOMAIN, "disable", false); show_homebrew = (!m_cfg.getBool(HOMEBREW_DOMAIN, "disable", false) && (parental_homebrew || !m_locked));
bool show_emu = !m_cfg.getBool(PLUGIN_DOMAIN, "disable", false); show_channel = !m_cfg.getBool(CHANNEL_DOMAIN, "disable", false);
bool parental_homebrew = m_cfg.getBool(HOMEBREW_DOMAIN, "parental", false); show_plugin = !m_cfg.getBool(PLUGIN_DOMAIN, "disable", false);
show_gamecube = m_show_gc;
bool noChanges = true; bool noChanges = true;
bool updateSource = false; bool updateSource = false;
exitSource = false; exitSource = false;
@ -335,35 +331,33 @@ bool CMenu::_Source()
SetupInput(); SetupInput();
_showSource(); _showSource();
bool sourceIniLoaded = m_source.loaded();
if(!sourceIniLoaded) //set number of pages based on highest source btn number used
for(i = m_cfg.getInt("GENERAL", "max_source_buttons", 71); i > 11; --i)
{ {
m_btnMgr.show(m_sourceBtnHomebrew); string source = m_source.getString(fmt("BUTTON_%i", i), "source", "");
m_btnMgr.show(m_sourceBtnChannel); if (!source.empty())
m_btnMgr.show(m_sourceBtnWii);
m_btnMgr.show(m_sourceBtnGamecube);
m_btnMgr.show(m_sourceBtnPlugin);
}
else
{
//set number of pages based on highest source btn number used
for(i = m_cfg.getInt("GENERAL", "max_source_buttons", 71); i > 11; --i)
{ {
string source = m_source.getString(fmt("BUTTON_%i", i), "source", ""); source_Pages = (i / 12) + 1;
if (!source.empty()) break;
{
source_Pages = (i / 12) + 1;
break;
}
} }
_updateSourceBtns();
} }
_updateSourceBtns();
while(!m_exit) while(!m_exit)
{ {
updateSource = false; updateSource = false;
_mainLoopCommon(); _mainLoopCommon();
if(BTN_HOME_PRESSED || (BTN_A_PRESSED && m_btnMgr.selected(m_sourceBtnBack)) || (BTN_B_PRESSED)) if(BTN_HOME_PRESSED)
{
_hideSource();
_CfgSrc();
if(m_cfg.getBool("SOURCEFLOW", "enabled"))
return true;
_showSource();
_updateSourceBtns();
}
if((BTN_A_PRESSED && m_btnMgr.selected(m_sourceBtnBack)) || BTN_B_PRESSED)
{ {
if(selectedBtns == 1) if(selectedBtns == 1)
{ {
@ -440,63 +434,8 @@ bool CMenu::_Source()
m_btnMgr.click(m_sourceBtnPageP); m_btnMgr.click(m_sourceBtnPageP);
_updateSourceBtns(); _updateSourceBtns();
} }
else if(BTN_A_PRESSED && !sourceIniLoaded) else if(BTN_A_PRESSED || (BTN_PLUS_PRESSED && m_multisource))
{ {
// check default source buttons when no source_menu.ini
if(m_btnMgr.selected(m_sourceBtnWii))
{
_clearSources();
m_cfg.setBool(WII_DOMAIN, "source", true);
exitSource = true;
}
if(m_btnMgr.selected(m_sourceBtnGamecube))
{
if(!m_show_gc)
_showSourceNotice();
else
{
_clearSources();
m_cfg.setBool(GC_DOMAIN, "source", true);
exitSource = true;
}
}
if(m_btnMgr.selected(m_sourceBtnChannel))
{
if(!show_channel)
_showSourceNotice();
else
{
_clearSources();
m_cfg.setBool(CHANNEL_DOMAIN, "source", true);
exitSource = true;
}
}
if(m_btnMgr.selected(m_sourceBtnHomebrew))
{
if(!show_homebrew || (!parental_homebrew && m_locked))
_showSourceNotice();
else
{
_clearSources();
m_cfg.setBool(HOMEBREW_DOMAIN, "source", true);
exitSource = true;
}
}
if(m_btnMgr.selected(m_sourceBtnPlugin))
{
if(!show_emu)
_showSourceNotice();
else
{
_clearSources();
m_cfg.setBool(PLUGIN_DOMAIN, "source", true);
exitSource = true;
}
}
}
else if((BTN_A_PRESSED || (BTN_PLUS_PRESSED && m_multisource)) && sourceIniLoaded)
{
// check actual source menu buttons
j = (source_curPage - 1) * 12; j = (source_curPage - 1) * 12;
for(i = 0; i < 12; ++i) for(i = 0; i < 12; ++i)
{ {
@ -517,7 +456,7 @@ bool CMenu::_Source()
} }
else if(source == "dml") else if(source == "dml")
{ {
if(!m_show_gc) if(!show_gamecube)
_showSourceNotice(); _showSourceNotice();
else else
{ {
@ -549,7 +488,7 @@ bool CMenu::_Source()
} }
else if(source == "homebrew") else if(source == "homebrew")
{ {
if(!show_homebrew || (!parental_homebrew && m_locked)) if(!show_homebrew)
_showSourceNotice(); _showSourceNotice();
else else
{ {
@ -559,7 +498,7 @@ bool CMenu::_Source()
} }
else if(source == "allplugins") else if(source == "allplugins")
{ {
if(!show_emu) if(!show_plugin)
_showSourceNotice(); _showSourceNotice();
else else
{ {
@ -571,7 +510,7 @@ bool CMenu::_Source()
} }
else if(source == "plugin") else if(source == "plugin")
{ {
if(!show_emu) if(!show_plugin)
_showSourceNotice(); _showSourceNotice();
else else
{ {
@ -658,7 +597,7 @@ bool CMenu::_Source()
} }
else if(source == "dml") else if(source == "dml")
{ {
if(m_show_gc) if(show_gamecube)
m_cfg.setBool(GC_DOMAIN, "source", !m_cfg.getBool(GC_DOMAIN, "source")); m_cfg.setBool(GC_DOMAIN, "source", !m_cfg.getBool(GC_DOMAIN, "source"));
} }
else if(source == "emunand") else if(source == "emunand")
@ -679,12 +618,12 @@ bool CMenu::_Source()
} }
else if(source == "homebrew") else if(source == "homebrew")
{ {
if(show_homebrew && (parental_homebrew || !m_locked)) if(show_homebrew)
m_cfg.setBool(HOMEBREW_DOMAIN, "source", !m_cfg.getBool(HOMEBREW_DOMAIN, "source")); m_cfg.setBool(HOMEBREW_DOMAIN, "source", !m_cfg.getBool(HOMEBREW_DOMAIN, "source"));
} }
else if(source == "allplugins") else if(source == "allplugins")
{ {
if(show_emu) if(show_plugin)
{ {
m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount); m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount);
for(j = 0; m_plugin.PluginExist(j); ++j) /* opposite */ for(j = 0; m_plugin.PluginExist(j); ++j) /* opposite */
@ -694,7 +633,7 @@ bool CMenu::_Source()
} }
else if(source == "plugin") else if(source == "plugin")
{ {
if(show_emu) if(show_plugin)
{ {
magicNums.clear(); magicNums.clear();
magicNums = m_source.getStrings(btn_selected, "magic", ','); magicNums = m_source.getStrings(btn_selected, "magic", ',');
@ -753,27 +692,17 @@ void CMenu::_clearSources(void)
void CMenu::_initSourceMenu() void CMenu::_initSourceMenu()
{ {
TexData texGamecube; m_use_source = false;
TexData texGamecubes; themeName = m_cfg.getString("GENERAL", "theme", "default");
TexData texPlugin; if(!m_source.load(fmt("%s/%s/%s", m_sourceDir.c_str(), themeName.c_str(), SOURCE_FILENAME)))
TexData texPlugins; {
TexData texWii; if(!m_source.load(fmt("%s/%s", m_sourceDir.c_str(), SOURCE_FILENAME)))
TexData texWiis; return;
TexData texChannel; }
TexData texChannels; else
TexData texHomebrew; m_sourceDir = fmt("%s/%s", m_sourceDir.c_str(), themeName.c_str());
TexData texHomebrews;
TexHandle.fromImageFile(texWii, fmt("%s/btnusb.png", m_imgsDir.c_str())); m_use_source = true;
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()));
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()));
_addUserLabels(m_sourceLblUser, ARRAY_SIZE(m_sourceLblUser), "SOURCE"); _addUserLabels(m_sourceLblUser, ARRAY_SIZE(m_sourceLblUser), "SOURCE");
m_sourceBg = _texture("SOURCE/BG", "texture", theme.bg, false); m_sourceBg = _texture("SOURCE/BG", "texture", theme.bg, false);
@ -784,18 +713,6 @@ void CMenu::_initSourceMenu()
m_sourceBtnPageP = _addPicButton("SOURCE/PAGE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 172, 400, 48, 48); m_sourceBtnPageP = _addPicButton("SOURCE/PAGE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 172, 400, 48, 48);
m_sourceBtnBack = _addButton("SOURCE/BACK_BTN", theme.btnFont, L"", 420, 400, 200, 48, theme.btnFontColor); m_sourceBtnBack = _addButton("SOURCE/BACK_BTN", theme.btnFont, L"", 420, 400, 200, 48, theme.btnFontColor);
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_sourceBtnWii = _addPicButton("SOURCE/USB_BTN", texWii, texWiis, 235, 200, 48, 48);
m_sourceBtnGamecube = _addPicButton("SOURCE/DML_BTN", texGamecube, texGamecubes, 295, 200, 48, 48);
m_sourceBtnPlugin = _addPicButton("SOURCE/EMU_BTN", texPlugin, texPlugins, 355, 200, 48, 48);
themeName = m_cfg.getString("GENERAL", "theme", "default");
if(!m_source.load(fmt("%s/%s/%s", m_sourceDir.c_str(), themeName.c_str(), SOURCE_FILENAME)))
m_source.load(fmt("%s/%s", m_sourceDir.c_str(), SOURCE_FILENAME));
else
m_sourceDir = fmt("%s/%s", m_sourceDir.c_str(), themeName.c_str());
int row; int row;
int col; int col;
string ImgName; string ImgName;
@ -822,11 +739,6 @@ void CMenu::_initSourceMenu()
m_sourceBtnSource[i] = _addPicButton(fmt("SOURCE/SOURCE_BTN_%i", i), texConsoleImg, texConsoleImgs, (100 + 120 * col), (90 + 100 * row), 80, 80); m_sourceBtnSource[i] = _addPicButton(fmt("SOURCE/SOURCE_BTN_%i", i), texConsoleImg, texConsoleImgs, (100 + 120 * col), (90 + 100 * row), 80, 80);
_setHideAnim(m_sourceBtnSource[i], fmt("SOURCE/SOURCE_BTN_%i", i), 0, 0, -2.f, 0.f); _setHideAnim(m_sourceBtnSource[i], fmt("SOURCE/SOURCE_BTN_%i", i), 0, 0, -2.f, 0.f);
} }
_setHideAnim(m_sourceBtnChannel, "SOURCE/CHANNEL_BTN", 0, 40, 0.f, 0.f);
_setHideAnim(m_sourceBtnHomebrew, "SOURCE/HOMEBREW_BTN", 0, 40, 0.f, 0.f);
_setHideAnim(m_sourceBtnWii, "SOURCE/USB_BTN", 0, 40, 0.f, 0.f);
_setHideAnim(m_sourceBtnGamecube, "SOURCE/DML_BTN", 0, 40, 0.f, 0.f);
_setHideAnim(m_sourceBtnPlugin, "SOURCE/EMU_BTN", 0, 40, 0.f, 0.f);
_setHideAnim(m_sourceLblTitle, "SOURCE/TITLE", 0, 0, -2.f, 0.f); _setHideAnim(m_sourceLblTitle, "SOURCE/TITLE", 0, 0, -2.f, 0.f);
_setHideAnim(m_sourceLblNotice, "SOURCE/NOTICE", 0, 0, 1.f, 0.f); _setHideAnim(m_sourceLblNotice, "SOURCE/NOTICE", 0, 0, 1.f, 0.f);
_setHideAnim(m_sourceLblPage, "SOURCE/PAGE_BTN", 0, 0, 1.f, -1.f); _setHideAnim(m_sourceLblPage, "SOURCE/PAGE_BTN", 0, 0, 1.f, -1.f);