2016-11-07 16:06:00 +01:00
|
|
|
|
|
|
|
#include "menu.hpp"
|
|
|
|
|
|
|
|
s16 m_cfghbLblTitle;
|
|
|
|
s16 m_cfghbBtnBack;
|
|
|
|
s16 m_cfghbLblUser[4];
|
|
|
|
|
2022-06-24 20:05:59 +02:00
|
|
|
TexData m_cfghbBg;
|
2016-11-07 16:06:00 +01:00
|
|
|
|
2022-06-24 20:05:59 +02:00
|
|
|
void CMenu::_hideConfigHB(bool instant)
|
|
|
|
{
|
|
|
|
m_btnMgr.hide(m_cfghbLblTitle, instant);
|
|
|
|
m_btnMgr.hide(m_cfghbBtnBack, instant);
|
|
|
|
for(u8 i = 0; i < ARRAY_SIZE(m_cfghbLblUser); ++i)
|
|
|
|
if(m_cfghbLblUser[i] != -1)
|
|
|
|
m_btnMgr.hide(m_cfghbLblUser[i], instant);
|
2016-11-07 16:06:00 +01:00
|
|
|
|
2022-06-24 20:05:59 +02:00
|
|
|
_hideConfigButtons(instant);
|
|
|
|
}
|
2016-11-07 16:06:00 +01:00
|
|
|
|
2022-06-24 20:05:59 +02:00
|
|
|
void CMenu::_showConfigHB(void)
|
2016-11-07 16:06:00 +01:00
|
|
|
{
|
2022-06-24 20:05:59 +02:00
|
|
|
_setBg(m_cfghbBg, m_cfghbBg);
|
2016-11-07 16:06:00 +01:00
|
|
|
m_btnMgr.show(m_cfghbLblTitle);
|
|
|
|
m_btnMgr.show(m_cfghbBtnBack);
|
|
|
|
for(u8 i = 0; i < ARRAY_SIZE(m_cfghbLblUser); ++i)
|
|
|
|
if(m_cfghbLblUser[i] != -1)
|
|
|
|
m_btnMgr.show(m_cfghbLblUser[i]);
|
|
|
|
|
2022-06-24 20:05:59 +02:00
|
|
|
m_btnMgr.setText(m_configLbl1, _t("cfghb5", L"Hide homebrew button"));
|
|
|
|
m_btnMgr.setText(m_configLbl2, _t("cfghb2", L"Coverflow Smallbox"));
|
|
|
|
m_btnMgr.setText(m_configLbl3, _t("cfghb4", L"Box Mode"));
|
|
|
|
m_btnMgr.setText(m_configLbl4, _t("cfghb3", L"Homebrew Partition"));
|
2016-11-07 16:06:00 +01:00
|
|
|
|
2022-06-24 20:05:59 +02:00
|
|
|
m_btnMgr.setText(m_configBtn1, m_cfg.getBool(HOMEBREW_DOMAIN, "disable", false) ? _t("yes", L"Yes") : _t("no", L"No"));
|
|
|
|
m_btnMgr.setText(m_configBtn2, m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox") ? _t("on", L"On") : _t("off", L"Off"));
|
|
|
|
m_btnMgr.setText(m_configBtn3, m_cfg.getBool(HOMEBREW_DOMAIN, "box_mode") ? _t("on", L"On") : _t("off", L"Off"));
|
2016-11-07 16:06:00 +01:00
|
|
|
|
2022-12-10 22:10:29 +01:00
|
|
|
currentPartition = m_cfg.getInt(HOMEBREW_DOMAIN, "partition", SD);
|
|
|
|
m_btnMgr.setText(m_configLbl4Val, upperCase(DeviceName[currentPartition]));
|
2016-11-07 16:06:00 +01:00
|
|
|
|
2022-06-24 20:05:59 +02:00
|
|
|
m_btnMgr.show(m_configLbl1);
|
|
|
|
m_btnMgr.show(m_configBtn1);
|
2016-11-07 16:06:00 +01:00
|
|
|
|
2022-06-24 20:05:59 +02:00
|
|
|
m_btnMgr.show(m_configLbl2);
|
|
|
|
m_btnMgr.show(m_configBtn2);
|
2016-11-07 16:06:00 +01:00
|
|
|
|
2022-06-24 20:05:59 +02:00
|
|
|
m_btnMgr.show(m_configLbl3);
|
|
|
|
m_btnMgr.show(m_configBtn3);
|
2016-11-07 16:06:00 +01:00
|
|
|
|
2022-06-24 20:05:59 +02:00
|
|
|
m_btnMgr.show(m_configLbl4);
|
|
|
|
m_btnMgr.show(m_configLbl4Val);
|
|
|
|
m_btnMgr.show(m_configBtn4P);
|
|
|
|
m_btnMgr.show(m_configBtn4M);
|
2016-11-07 16:06:00 +01:00
|
|
|
}
|
|
|
|
|
2022-06-24 20:05:59 +02:00
|
|
|
void CMenu::_ConfigHB(void)
|
2016-11-07 16:06:00 +01:00
|
|
|
{
|
|
|
|
SetupInput();
|
2022-06-24 20:05:59 +02:00
|
|
|
_showConfigHB();
|
2016-11-07 16:06:00 +01:00
|
|
|
|
|
|
|
while(!m_exit)
|
|
|
|
{
|
|
|
|
_mainLoopCommon();
|
|
|
|
if(BTN_HOME_PRESSED || BTN_B_PRESSED)
|
|
|
|
break;
|
|
|
|
else if(BTN_UP_PRESSED)
|
|
|
|
m_btnMgr.up();
|
|
|
|
else if(BTN_DOWN_PRESSED)
|
|
|
|
m_btnMgr.down();
|
|
|
|
else if(BTN_A_PRESSED)
|
|
|
|
{
|
|
|
|
if(m_btnMgr.selected(m_cfghbBtnBack))
|
|
|
|
break;
|
2022-06-24 20:05:59 +02:00
|
|
|
else if (m_btnMgr.selected(m_configBtn1))
|
2016-11-07 16:06:00 +01:00
|
|
|
{
|
2019-03-04 21:29:46 +01:00
|
|
|
m_cfg.setBool(HOMEBREW_DOMAIN, "disable", !m_cfg.getBool(HOMEBREW_DOMAIN, "disable"));
|
2022-06-24 20:05:59 +02:00
|
|
|
m_btnMgr.setText(m_configBtn1, m_cfg.getBool(HOMEBREW_DOMAIN, "disable") ? _t("yes", L"Yes") : _t("no", L"No"));
|
2016-11-07 16:06:00 +01:00
|
|
|
}
|
2022-06-24 20:05:59 +02:00
|
|
|
else if (m_btnMgr.selected(m_configBtn2))
|
2016-11-07 16:06:00 +01:00
|
|
|
{
|
|
|
|
m_refreshGameList = true;
|
2019-03-27 17:45:43 +01:00
|
|
|
m_cfg.setBool(HOMEBREW_DOMAIN, "update_cache", true);
|
2016-11-07 16:06:00 +01:00
|
|
|
m_cfg.setBool(HOMEBREW_DOMAIN, "smallbox", !m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox", false));
|
2022-06-24 20:05:59 +02:00
|
|
|
m_btnMgr.setText(m_configBtn2, m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox") ? _t("on", L"On") : _t("off", L"Off"));
|
2016-11-07 16:06:00 +01:00
|
|
|
}
|
2022-06-24 20:05:59 +02:00
|
|
|
else if (m_btnMgr.selected(m_configBtn3))
|
2016-11-07 16:06:00 +01:00
|
|
|
{
|
|
|
|
m_refreshGameList = true;
|
|
|
|
m_cfg.setBool(HOMEBREW_DOMAIN, "box_mode", !m_cfg.getBool(HOMEBREW_DOMAIN, "box_mode", false));
|
2022-06-24 20:05:59 +02:00
|
|
|
m_btnMgr.setText(m_configBtn3, m_cfg.getBool(HOMEBREW_DOMAIN, "box_mode") ? _t("on", L"On") : _t("off", L"Off"));
|
2016-11-07 16:06:00 +01:00
|
|
|
}
|
2022-06-24 20:05:59 +02:00
|
|
|
else if (m_btnMgr.selected(m_configBtn4P) || m_btnMgr.selected(m_configBtn4M))
|
2016-11-07 16:06:00 +01:00
|
|
|
{
|
2022-06-24 20:05:59 +02:00
|
|
|
s8 direction = m_btnMgr.selected(m_configBtn4P) ? 1 : -1;
|
2022-11-29 22:39:12 +01:00
|
|
|
_setPartition(direction, m_cfg.getInt(HOMEBREW_DOMAIN, "partition"), COVERFLOW_HOMEBREW);
|
2022-12-10 22:10:29 +01:00
|
|
|
m_cfg.setInt(HOMEBREW_DOMAIN, "partition", currentPartition);
|
|
|
|
m_btnMgr.setText(m_configLbl4Val, upperCase(DeviceName[currentPartition]));
|
2022-11-29 22:39:12 +01:00
|
|
|
if(m_current_view & COVERFLOW_HOMEBREW ||
|
2022-12-10 22:10:29 +01:00
|
|
|
(m_current_view & COVERFLOW_PLUGIN && m_plugin.GetEnabledStatus(HB_PMAGIC)))
|
2022-11-29 22:39:12 +01:00
|
|
|
{
|
|
|
|
m_refreshGameList = true;
|
|
|
|
//m_cfg.setBool(HOMEBREW_DOMAIN, "update_cache", true);
|
|
|
|
}
|
2016-11-07 16:06:00 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-06-24 20:05:59 +02:00
|
|
|
_hideConfigHB();
|
2016-11-07 16:06:00 +01:00
|
|
|
}
|
|
|
|
|
2022-06-24 20:05:59 +02:00
|
|
|
void CMenu::_initConfigHB(void)
|
2016-11-07 16:06:00 +01:00
|
|
|
{
|
|
|
|
m_cfghbBg = _texture("CFG_HB/BG", "texture", theme.bg, false);
|
|
|
|
|
|
|
|
_addUserLabels(m_cfghbLblUser, ARRAY_SIZE(m_cfghbLblUser), "CFG_HB");
|
2018-12-28 01:47:00 +01:00
|
|
|
m_cfghbLblTitle = _addLabel("CFG_HB/TITLE", theme.titleFont, L"", 0, 10, 640, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE);
|
2016-11-07 16:06:00 +01:00
|
|
|
m_cfghbBtnBack = _addButton("CFG_HB/BACK_BTN", theme.btnFont, L"", 420, 400, 200, 48, theme.btnFontColor);
|
|
|
|
|
|
|
|
_setHideAnim(m_cfghbLblTitle, "CFG_HB/TITLE", 0, 0, -2.f, 0.f);
|
|
|
|
_setHideAnim(m_cfghbBtnBack, "CFG_HB/BACK_BTN", 0, 0, 1.f, -1.f);
|
|
|
|
|
2022-06-24 20:05:59 +02:00
|
|
|
_hideConfigHB(true);
|
|
|
|
_textConfigHB();
|
2016-11-07 16:06:00 +01:00
|
|
|
}
|
2016-12-14 19:47:13 +01:00
|
|
|
|
2022-06-24 20:05:59 +02:00
|
|
|
void CMenu::_textConfigHB(void)
|
2016-12-14 19:47:13 +01:00
|
|
|
{
|
|
|
|
m_btnMgr.setText(m_cfghbLblTitle, _t("cfghb1", L"Homebrew Settings"));
|
|
|
|
m_btnMgr.setText(m_cfghbBtnBack, _t("cfg10", L"Back"));
|
|
|
|
}
|