2016-12-14 19:47:13 +01:00
|
|
|
|
|
|
|
#include "menu.hpp"
|
|
|
|
|
2018-10-15 16:23:34 +02:00
|
|
|
TexData m_configGCBg;
|
|
|
|
|
2016-12-14 19:47:13 +01:00
|
|
|
s16 m_configGCLblTitle;
|
|
|
|
s16 m_configGCBtnBack;
|
|
|
|
s16 m_configGCLblUser[4];
|
|
|
|
|
2018-10-15 16:23:34 +02:00
|
|
|
s16 m_configGCLblPage;
|
|
|
|
s16 m_configGCBtnPageM;
|
|
|
|
s16 m_configGCBtnPageP;
|
|
|
|
|
2016-12-14 19:47:13 +01:00
|
|
|
template <class T> static inline T loopNum(T i, T s)
|
|
|
|
{
|
|
|
|
return (i + s) % s;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CMenu::_hideConfigGC(bool instant)
|
|
|
|
{
|
|
|
|
m_btnMgr.hide(m_configGCLblTitle, instant);
|
2022-06-24 20:05:59 +02:00
|
|
|
m_btnMgr.hide(m_configGCBtnBack, instant);
|
2018-10-15 16:23:34 +02:00
|
|
|
m_btnMgr.hide(m_configGCLblPage, instant);
|
|
|
|
m_btnMgr.hide(m_configGCBtnPageM, instant);
|
|
|
|
m_btnMgr.hide(m_configGCBtnPageP, instant);
|
2016-12-14 19:47:13 +01:00
|
|
|
for(u8 i = 0; i < ARRAY_SIZE(m_configGCLblUser); ++i)
|
|
|
|
if(m_configGCLblUser[i] != -1)
|
|
|
|
m_btnMgr.hide(m_configGCLblUser[i], instant);
|
2022-06-15 00:54:29 +02:00
|
|
|
_hideConfigButtons(instant);
|
2016-12-14 19:47:13 +01:00
|
|
|
}
|
|
|
|
|
2022-06-24 20:05:59 +02:00
|
|
|
void CMenu::_showConfigGC(int curPage)
|
2016-12-14 19:47:13 +01:00
|
|
|
{
|
2022-06-24 20:05:59 +02:00
|
|
|
_setBg(m_configGCBg, m_configGCBg);
|
2016-12-14 19:47:13 +01:00
|
|
|
m_btnMgr.show(m_configGCLblTitle);
|
|
|
|
m_btnMgr.show(m_configGCBtnBack);
|
|
|
|
for(u8 i = 0; i < ARRAY_SIZE(m_configGCLblUser); ++i)
|
|
|
|
if(m_configGCLblUser[i] != -1)
|
|
|
|
m_btnMgr.show(m_configGCLblUser[i]);
|
|
|
|
|
2018-10-15 16:23:34 +02:00
|
|
|
m_btnMgr.show(m_configGCLblPage);
|
|
|
|
m_btnMgr.show(m_configGCBtnPageM);
|
|
|
|
m_btnMgr.show(m_configGCBtnPageP);
|
2022-06-24 20:05:59 +02:00
|
|
|
m_btnMgr.setText(m_configGCLblPage, wfmt(L"%i / %i", curPage, 2));
|
2018-10-15 16:23:34 +02:00
|
|
|
|
2022-06-15 00:54:29 +02:00
|
|
|
_hideConfigButtons(true);
|
2018-10-15 16:23:34 +02:00
|
|
|
|
|
|
|
int i;
|
|
|
|
if(curPage == 1)
|
|
|
|
{
|
2022-06-15 00:54:29 +02:00
|
|
|
m_btnMgr.setText(m_configLbl1, _t("cfgb5", L"Video mode"));
|
|
|
|
m_btnMgr.setText(m_configLbl2, _t("cfgb6", L"Game language"));
|
|
|
|
m_btnMgr.setText(m_configLbl3, _t("cfgb2", L"Game loader"));
|
|
|
|
m_btnMgr.setText(m_configLbl4, _t("cfgb10", L"Devo Emu Memcard"));
|
|
|
|
m_btnMgr.show(m_configLbl1);
|
|
|
|
m_btnMgr.show(m_configLbl2);
|
|
|
|
m_btnMgr.show(m_configLbl3);
|
|
|
|
m_btnMgr.show(m_configLbl4);
|
|
|
|
|
2018-10-15 16:23:34 +02:00
|
|
|
i = min(max(0, m_cfg.getInt(GC_DOMAIN, "video_mode", 0)), (int)ARRAY_SIZE(CMenu::_GlobalGCvideoModes) - 1);
|
2022-06-15 00:54:29 +02:00
|
|
|
m_btnMgr.setText(m_configLbl1Val, _t(CMenu::_GlobalGCvideoModes[i].id, CMenu::_GlobalGCvideoModes[i].text));
|
2018-10-15 16:23:34 +02:00
|
|
|
|
|
|
|
i = min(max(0, m_cfg.getInt(GC_DOMAIN, "game_language", 0)), (int)ARRAY_SIZE(CMenu::_GlobalGClanguages) - 1);
|
2022-06-15 00:54:29 +02:00
|
|
|
m_btnMgr.setText(m_configLbl2Val, _t(CMenu::_GlobalGClanguages[i].id, CMenu::_GlobalGClanguages[i].text));
|
2018-10-15 16:23:34 +02:00
|
|
|
|
|
|
|
i = min(max(0, m_cfg.getInt(GC_DOMAIN, "default_loader", 2)), (int)ARRAY_SIZE(CMenu::_GlobalGCLoaders) - 1);
|
2022-06-15 00:54:29 +02:00
|
|
|
m_btnMgr.setText(m_configLbl3Val, _t(CMenu::_GlobalGCLoaders[i].id, CMenu::_GlobalGCLoaders[i].text));
|
2018-10-15 16:23:34 +02:00
|
|
|
|
2022-06-15 00:54:29 +02:00
|
|
|
m_btnMgr.setText(m_configBtn4, m_cfg.getBool(GC_DOMAIN, "devo_memcard_emu", false) ? _t("on", L"On") : _t("off", L"Off"));
|
2018-10-15 16:23:34 +02:00
|
|
|
|
2022-06-15 00:54:29 +02:00
|
|
|
m_btnMgr.show(m_configLbl1Val);
|
|
|
|
m_btnMgr.show(m_configBtn1M);
|
|
|
|
m_btnMgr.show(m_configBtn1P);
|
|
|
|
m_btnMgr.show(m_configLbl2Val);
|
|
|
|
m_btnMgr.show(m_configBtn2M);
|
|
|
|
m_btnMgr.show(m_configBtn2P);
|
|
|
|
m_btnMgr.show(m_configLbl3Val);
|
|
|
|
m_btnMgr.show(m_configBtn3M);
|
|
|
|
m_btnMgr.show(m_configBtn3P);
|
|
|
|
m_btnMgr.show(m_configBtn4);
|
2018-10-15 16:23:34 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-06-15 00:54:29 +02:00
|
|
|
m_btnMgr.setText(m_configLbl1, _t("cfgb11", L"Nintendont Emu Memcard"));
|
|
|
|
m_btnMgr.setText(m_configLbl2, _t("cfgb12", L"Nintendont Wii U Widescreen"));
|
|
|
|
m_btnMgr.show(m_configLbl1);
|
|
|
|
m_btnMgr.show(m_configLbl2);
|
|
|
|
|
2018-10-15 16:23:34 +02:00
|
|
|
// minus 2 and [i + 1] because there is no global array that does not include 'default'
|
|
|
|
i = min(max(0, m_cfg.getInt(GC_DOMAIN, "emu_memcard", 1)), (int)ARRAY_SIZE(CMenu::_NinEmuCard) - 2);
|
2022-06-15 00:54:29 +02:00
|
|
|
m_btnMgr.setText(m_configLbl1Val, _t(CMenu::_NinEmuCard[i + 1].id, CMenu::_NinEmuCard[i + 1].text));
|
2018-10-15 16:23:34 +02:00
|
|
|
|
2022-06-15 00:54:29 +02:00
|
|
|
m_btnMgr.setText(m_configBtn2, m_cfg.getBool(GC_DOMAIN, "wiiu_widescreen", false) ? _t("on", L"On") : _t("off", L"Off"));
|
2018-10-15 16:23:34 +02:00
|
|
|
|
2022-06-15 00:54:29 +02:00
|
|
|
m_btnMgr.show(m_configLbl1Val);
|
|
|
|
m_btnMgr.show(m_configBtn1M);
|
|
|
|
m_btnMgr.show(m_configBtn1P);
|
|
|
|
m_btnMgr.show(m_configBtn2);
|
2018-10-15 16:23:34 +02:00
|
|
|
}
|
2016-12-14 19:47:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void CMenu::_configGC(void)
|
|
|
|
{
|
2018-10-15 16:23:34 +02:00
|
|
|
int i;
|
|
|
|
bool j;
|
2022-06-24 20:05:59 +02:00
|
|
|
int curPage = 1;
|
2016-12-14 19:47:13 +01:00
|
|
|
SetupInput();
|
2022-06-24 20:05:59 +02:00
|
|
|
_showConfigGC(curPage);
|
2016-12-14 19:47:13 +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();
|
2018-10-15 16:23:34 +02:00
|
|
|
else if(BTN_LEFT_PRESSED || (BTN_A_PRESSED && m_btnMgr.selected(m_configGCBtnPageM)))
|
|
|
|
{
|
|
|
|
curPage--;
|
|
|
|
if(curPage < 1)
|
|
|
|
curPage = 2;
|
|
|
|
if(!BTN_A_PRESSED)
|
|
|
|
m_btnMgr.click(m_configGCBtnPageM);
|
2022-06-24 20:05:59 +02:00
|
|
|
_showConfigGC(curPage);
|
2018-10-15 16:23:34 +02:00
|
|
|
}
|
|
|
|
else if(BTN_RIGHT_PRESSED || (BTN_A_PRESSED && m_btnMgr.selected(m_configGCBtnPageP)))
|
|
|
|
{
|
|
|
|
curPage++;
|
|
|
|
if(curPage > 2)
|
|
|
|
curPage = 1;
|
|
|
|
if(!BTN_A_PRESSED)
|
|
|
|
m_btnMgr.click(m_configGCBtnPageP);
|
2022-06-24 20:05:59 +02:00
|
|
|
_showConfigGC(curPage);
|
2018-10-15 16:23:34 +02:00
|
|
|
}
|
2016-12-14 19:47:13 +01:00
|
|
|
else if(BTN_A_PRESSED)
|
|
|
|
{
|
|
|
|
if(m_btnMgr.selected(m_configGCBtnBack))
|
|
|
|
break;
|
2022-06-15 00:54:29 +02:00
|
|
|
if(curPage == 1)
|
2018-10-15 16:23:34 +02:00
|
|
|
{
|
2022-06-15 00:54:29 +02:00
|
|
|
if(m_btnMgr.selected(m_configBtn2P) || m_btnMgr.selected(m_configBtn2M))
|
|
|
|
{
|
|
|
|
s8 direction = m_btnMgr.selected(m_configBtn2P) ? 1 : -1;
|
|
|
|
i = loopNum(m_cfg.getInt(GC_DOMAIN, "game_language", 0) + direction, (int)ARRAY_SIZE(CMenu::_GlobalGClanguages));
|
|
|
|
m_cfg.setInt(GC_DOMAIN, "game_language", i);
|
|
|
|
m_btnMgr.setText(m_configLbl2Val, _t(CMenu::_GlobalGClanguages[i].id, CMenu::_GlobalGClanguages[i].text));
|
|
|
|
}
|
|
|
|
else if(m_btnMgr.selected(m_configBtn1P) || m_btnMgr.selected(m_configBtn1M))
|
|
|
|
{
|
|
|
|
s8 direction = m_btnMgr.selected(m_configBtn1P) ? 1 : -1;
|
|
|
|
i = loopNum(m_cfg.getInt(GC_DOMAIN, "video_mode", 0) + direction, (int)ARRAY_SIZE(CMenu::_GlobalGCvideoModes));
|
|
|
|
m_cfg.setInt(GC_DOMAIN, "video_mode", i);
|
|
|
|
m_btnMgr.setText(m_configLbl1Val, _t(CMenu::_GlobalGCvideoModes[i].id, CMenu::_GlobalGCvideoModes[i].text));
|
|
|
|
}
|
|
|
|
else if(m_btnMgr.selected(m_configBtn3P) || m_btnMgr.selected(m_configBtn3M))
|
|
|
|
{
|
|
|
|
s8 direction = m_btnMgr.selected(m_configBtn3P) ? 1 : -1;
|
|
|
|
i = loopNum(m_cfg.getInt(GC_DOMAIN, "default_loader", 1) + direction, (int)ARRAY_SIZE(CMenu::_GlobalGCLoaders));
|
|
|
|
m_cfg.setInt(GC_DOMAIN, "default_loader", i);
|
|
|
|
m_btnMgr.setText(m_configLbl3Val, _t(CMenu::_GlobalGCLoaders[i].id, CMenu::_GlobalGCLoaders[i].text));
|
|
|
|
}
|
|
|
|
else if(m_btnMgr.selected(m_configBtn4))
|
|
|
|
{
|
|
|
|
j = !m_cfg.getBool(GC_DOMAIN, "devo_memcard_emu", false);
|
|
|
|
m_cfg.setBool(GC_DOMAIN, "devo_memcard_emu", j);
|
|
|
|
m_btnMgr.setText(m_configBtn4, j ? _t("on", L"On") : _t("off", L"Off"));
|
|
|
|
}
|
2018-10-15 16:23:34 +02:00
|
|
|
}
|
2022-06-15 00:54:29 +02:00
|
|
|
else
|
2018-10-15 16:23:34 +02:00
|
|
|
{
|
2022-06-15 00:54:29 +02:00
|
|
|
if(m_btnMgr.selected(m_configBtn1P) || m_btnMgr.selected(m_configBtn1M))
|
|
|
|
{
|
|
|
|
s8 direction = m_btnMgr.selected(m_configBtn1P) ? 1 : -1;
|
|
|
|
i = loopNum(m_cfg.getInt(GC_DOMAIN, "emu_memcard", 1) + direction, (int)ARRAY_SIZE(CMenu::_NinEmuCard) - 1);
|
|
|
|
m_cfg.setInt(GC_DOMAIN, "emu_memcard", i);
|
|
|
|
m_btnMgr.setText(m_configLbl1Val, _t(CMenu::_NinEmuCard[i + 1].id, CMenu::_NinEmuCard[i + 1].text));
|
|
|
|
}
|
|
|
|
else if(m_btnMgr.selected(m_configBtn2))
|
|
|
|
{
|
|
|
|
j = !m_cfg.getBool(GC_DOMAIN, "wiiu_widescreen", false);
|
|
|
|
m_cfg.setBool(GC_DOMAIN, "wiiu_widescreen", j);
|
|
|
|
m_btnMgr.setText(m_configBtn2, j ? _t("on", L"On") : _t("off", L"Off"));
|
|
|
|
}
|
2016-12-14 19:47:13 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_hideConfigGC();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CMenu::_initConfigGCMenu(void)
|
|
|
|
{
|
|
|
|
m_configGCBg = _texture("CONFIGGC/BG", "texture", theme.bg, false);
|
|
|
|
|
|
|
|
_addUserLabels(m_configGCLblUser, ARRAY_SIZE(m_configGCLblUser), "CONFIGGC");
|
2018-12-28 01:47:00 +01:00
|
|
|
m_configGCLblTitle = _addLabel("CONFIGGC/TITLE", theme.titleFont, L"", 0, 10, 640, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE);
|
2016-12-14 19:47:13 +01:00
|
|
|
m_configGCBtnBack = _addButton("CONFIGGC/BACK_BTN", theme.btnFont, L"", 420, 400, 200, 48, theme.btnFontColor);
|
2018-10-15 16:23:34 +02:00
|
|
|
m_configGCLblPage = _addLabel("CONFIGGC/PAGE_BTN", theme.btnFont, L"", 68, 400, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC);
|
|
|
|
m_configGCBtnPageM = _addPicButton("CONFIGGC/PAGE_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 20, 400, 48, 48);
|
|
|
|
m_configGCBtnPageP = _addPicButton("CONFIGGC/PAGE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 172, 400, 48, 48);
|
2016-12-14 19:47:13 +01:00
|
|
|
|
|
|
|
_setHideAnim(m_configGCLblTitle, "CONFIGGC/TITLE", 0, 0, -2.f, 0.f);
|
|
|
|
_setHideAnim(m_configGCBtnBack, "CONFIGGC/BACK_BTN", 0, 0, 1.f, -1.f);
|
2018-10-15 16:23:34 +02:00
|
|
|
_setHideAnim(m_configGCLblPage, "CONFIGGC/PAGE_BTN", 0, 0, 1.f, -1.f);
|
|
|
|
_setHideAnim(m_configGCBtnPageM, "CONFIGGC/PAGE_MINUS", 0, 0, 1.f, -1.f);
|
|
|
|
_setHideAnim(m_configGCBtnPageP, "CONFIGGC/PAGE_PLUS", 0, 0, 1.f, -1.f);
|
2016-12-14 19:47:13 +01:00
|
|
|
|
|
|
|
_hideConfigGC(true);
|
|
|
|
_textConfigGC();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CMenu::_textConfigGC(void)
|
|
|
|
{
|
2018-10-15 16:23:34 +02:00
|
|
|
m_btnMgr.setText(m_configGCLblTitle, _t("cfgb8", L"GC Default Settings"));
|
2016-12-14 19:47:13 +01:00
|
|
|
m_btnMgr.setText(m_configGCBtnBack, _t("cfg10", L"Back"));
|
2018-10-15 16:23:34 +02:00
|
|
|
}
|