2012-01-21 21:57:41 +01:00
|
|
|
|
|
|
|
#include "menu.hpp"
|
|
|
|
|
|
|
|
template <class T> static inline T loopNum(T i, T s)
|
|
|
|
{
|
|
|
|
return (i + s) % s;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CMenu::_hideConfig3(bool instant)
|
|
|
|
{
|
2012-05-04 05:46:18 +02:00
|
|
|
_hideConfigCommon(instant);
|
2012-03-04 22:33:14 +01:00
|
|
|
|
2016-12-14 19:47:13 +01:00
|
|
|
m_btnMgr.hide(m_config3LblGameLanguage, instant);
|
|
|
|
m_btnMgr.hide(m_config3LblLanguage, instant);
|
|
|
|
m_btnMgr.hide(m_config3BtnLanguageP, instant);
|
|
|
|
m_btnMgr.hide(m_config3BtnLanguageM, instant);
|
|
|
|
|
|
|
|
m_btnMgr.hide(m_config3LblGameVideo, instant);
|
|
|
|
m_btnMgr.hide(m_config3LblVideo, instant);
|
|
|
|
m_btnMgr.hide(m_config3BtnVideoP, instant);
|
|
|
|
m_btnMgr.hide(m_config3BtnVideoM, instant);
|
|
|
|
|
|
|
|
m_btnMgr.hide(m_config3LblGCDefaults, instant);
|
|
|
|
m_btnMgr.hide(m_config3BtnGCDefaults, instant);
|
2016-12-01 01:05:39 +01:00
|
|
|
|
|
|
|
m_btnMgr.hide(m_config3LblChannelsType, instant);
|
|
|
|
m_btnMgr.hide(m_config3LblChannelsTypeVal, instant);
|
|
|
|
m_btnMgr.hide(m_config3BtnChannelsTypeP, instant);
|
|
|
|
m_btnMgr.hide(m_config3BtnChannelsTypeM, instant);
|
|
|
|
|
2012-07-05 15:15:23 +02:00
|
|
|
for(u8 i = 0; i < ARRAY_SIZE(m_config3LblUser); ++i)
|
2012-09-13 16:54:17 +02:00
|
|
|
if(m_config3LblUser[i] != -1)
|
2012-01-21 21:57:41 +01:00
|
|
|
m_btnMgr.hide(m_config3LblUser[i], instant);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CMenu::_showConfig3(void)
|
|
|
|
{
|
2018-10-31 20:51:15 +01:00
|
|
|
_showConfigCommon(m_config3Bg, 3);
|
2012-03-04 22:33:14 +01:00
|
|
|
|
2016-12-14 19:47:13 +01:00
|
|
|
m_btnMgr.show(m_config3LblGameLanguage);
|
|
|
|
m_btnMgr.show(m_config3LblLanguage);
|
|
|
|
m_btnMgr.show(m_config3BtnLanguageP);
|
|
|
|
m_btnMgr.show(m_config3BtnLanguageM);
|
|
|
|
|
|
|
|
m_btnMgr.show(m_config3LblGameVideo);
|
|
|
|
m_btnMgr.show(m_config3LblVideo);
|
|
|
|
m_btnMgr.show(m_config3BtnVideoP);
|
|
|
|
m_btnMgr.show(m_config3BtnVideoM);
|
|
|
|
|
|
|
|
m_btnMgr.show(m_config3LblGCDefaults);
|
|
|
|
m_btnMgr.show(m_config3BtnGCDefaults);
|
2016-12-01 01:05:39 +01:00
|
|
|
|
|
|
|
m_btnMgr.show(m_config3LblChannelsType);
|
|
|
|
m_btnMgr.show(m_config3LblChannelsTypeVal);
|
|
|
|
m_btnMgr.show(m_config3BtnChannelsTypeP);
|
|
|
|
m_btnMgr.show(m_config3BtnChannelsTypeM);
|
2012-01-21 21:57:41 +01:00
|
|
|
|
2012-07-05 15:15:23 +02:00
|
|
|
for(u8 i = 0; i < ARRAY_SIZE(m_config3LblUser); ++i)
|
2012-09-13 16:54:17 +02:00
|
|
|
if(m_config3LblUser[i] != -1)
|
2012-01-21 21:57:41 +01:00
|
|
|
m_btnMgr.show(m_config3LblUser[i]);
|
|
|
|
|
2016-12-14 19:47:13 +01:00
|
|
|
int i = min(max(0, m_cfg.getInt("GENERAL", "video_mode", 0)), (int)ARRAY_SIZE(CMenu::_GlobalVideoModes) - 1);
|
|
|
|
m_btnMgr.setText(m_config3LblVideo, _t(CMenu::_GlobalVideoModes[i].id, CMenu::_GlobalVideoModes[i].text));
|
2012-01-21 21:57:41 +01:00
|
|
|
|
2016-12-14 19:47:13 +01:00
|
|
|
i = min(max(0, m_cfg.getInt("GENERAL", "game_language", 0)), (int)ARRAY_SIZE(CMenu::_languages) - 1);
|
|
|
|
m_btnMgr.setText(m_config3LblLanguage, _t(CMenu::_languages[i].id, CMenu::_languages[i].text));
|
|
|
|
|
2018-11-16 22:38:48 +01:00
|
|
|
i = m_cfg.getInt(CHANNEL_DOMAIN, "channels_type", CHANNELS_REAL) - 1;
|
2016-12-01 01:05:39 +01:00
|
|
|
m_btnMgr.setText(m_config3LblChannelsTypeVal, _t(CMenu::_ChannelsType[i].id, CMenu::_ChannelsType[i].text));
|
2012-01-21 21:57:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int CMenu::_config3(void)
|
|
|
|
{
|
2012-05-04 05:46:18 +02:00
|
|
|
int change = CONFIG_PAGE_NO_CHANGE;
|
2012-01-21 21:57:41 +01:00
|
|
|
|
|
|
|
_showConfig3();
|
2012-09-09 20:35:15 +02:00
|
|
|
while(!m_exit)
|
2012-01-21 21:57:41 +01:00
|
|
|
{
|
2012-05-04 05:46:18 +02:00
|
|
|
change = _configCommon();
|
|
|
|
if (change != CONFIG_PAGE_NO_CHANGE)
|
2012-01-21 21:57:41 +01:00
|
|
|
break;
|
|
|
|
if (BTN_A_PRESSED)
|
|
|
|
{
|
2012-05-04 05:46:18 +02:00
|
|
|
if (m_btnMgr.selected(m_config3BtnLanguageP) || m_btnMgr.selected(m_config3BtnLanguageM))
|
2012-01-21 21:57:41 +01:00
|
|
|
{
|
|
|
|
s8 direction = m_btnMgr.selected(m_config3BtnLanguageP) ? 1 : -1;
|
2018-05-08 15:49:43 +02:00
|
|
|
m_cfg.setInt("GENERAL", "game_language", (int)loopNum(m_cfg.getUInt("GENERAL", "game_language", 0) + direction, ARRAY_SIZE(CMenu::_languages)));
|
2012-01-21 21:57:41 +01:00
|
|
|
_showConfig3();
|
|
|
|
}
|
|
|
|
else if (m_btnMgr.selected(m_config3BtnVideoP) || m_btnMgr.selected(m_config3BtnVideoM))
|
|
|
|
{
|
|
|
|
s8 direction = m_btnMgr.selected(m_config3BtnVideoP) ? 1 : -1;
|
2018-05-08 15:49:43 +02:00
|
|
|
m_cfg.setInt("GENERAL", "video_mode", (int)loopNum(m_cfg.getUInt("GENERAL", "video_mode", 0) + direction, ARRAY_SIZE(CMenu::_GlobalVideoModes)));
|
2012-01-21 21:57:41 +01:00
|
|
|
_showConfig3();
|
|
|
|
}
|
2016-12-14 19:47:13 +01:00
|
|
|
else if (m_btnMgr.selected(m_config3BtnGCDefaults))
|
2012-03-04 22:33:14 +01:00
|
|
|
{
|
2016-12-14 19:47:13 +01:00
|
|
|
_hideConfig3();
|
|
|
|
_configGC();
|
2012-01-21 21:57:41 +01:00
|
|
|
_showConfig3();
|
|
|
|
}
|
2016-12-01 01:05:39 +01:00
|
|
|
else if (m_btnMgr.selected(m_config3BtnChannelsTypeP) || m_btnMgr.selected(m_config3BtnChannelsTypeM))
|
2012-01-21 21:57:41 +01:00
|
|
|
{
|
2016-12-01 01:05:39 +01:00
|
|
|
s8 direction = m_btnMgr.selected(m_config3BtnChannelsTypeP) ? 1 : -1;
|
2018-05-08 15:49:43 +02:00
|
|
|
m_cfg.setInt(CHANNEL_DOMAIN, "channels_type", 1 + (int)loopNum(m_cfg.getUInt(CHANNEL_DOMAIN, "channels_type", 1) - 1 + direction, ARRAY_SIZE(CMenu::_ChannelsType)));
|
2012-01-21 21:57:41 +01:00
|
|
|
_showConfig3();
|
2016-12-14 19:47:13 +01:00
|
|
|
if(m_current_view & COVERFLOW_CHANNEL || m_current_view & COVERFLOW_PLUGIN)
|
2016-12-01 01:05:39 +01:00
|
|
|
m_refreshGameList = true;
|
2012-01-21 21:57:41 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_hideConfig3();
|
2012-05-04 05:46:18 +02:00
|
|
|
return change;
|
2012-01-21 21:57:41 +01:00
|
|
|
}
|
|
|
|
|
2012-11-03 20:16:03 +01:00
|
|
|
void CMenu::_initConfig3Menu()
|
2012-01-21 21:57:41 +01:00
|
|
|
{
|
2012-11-03 20:16:03 +01:00
|
|
|
_addUserLabels(m_config3LblUser, ARRAY_SIZE(m_config3LblUser), "CONFIG3");
|
|
|
|
m_config3Bg = _texture("CONFIG3/BG", "texture", theme.bg, false);
|
2016-12-14 19:47:13 +01:00
|
|
|
|
2013-11-04 20:46:23 +01:00
|
|
|
m_config3LblGameVideo = _addLabel("CONFIG3/VIDEO", theme.lblFont, L"", 20, 125, 290, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
|
|
|
|
m_config3LblVideo = _addLabel("CONFIG3/VIDEO_BTN", theme.btnFont, L"", 468, 130, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC);
|
|
|
|
m_config3BtnVideoM = _addPicButton("CONFIG3/VIDEO_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 420, 130, 48, 48);
|
|
|
|
m_config3BtnVideoP = _addPicButton("CONFIG3/VIDEO_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 572, 130, 48, 48);
|
2016-12-14 19:47:13 +01:00
|
|
|
|
2013-11-04 20:46:23 +01:00
|
|
|
m_config3LblGameLanguage = _addLabel("CONFIG3/GAME_LANG", theme.lblFont, L"", 20, 185, 290, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
|
|
|
|
m_config3LblLanguage = _addLabel("CONFIG3/GAME_LANG_BTN", theme.btnFont, L"", 468, 190, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC);
|
|
|
|
m_config3BtnLanguageM = _addPicButton("CONFIG3/GAME_LANG_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 420, 190, 48, 48);
|
|
|
|
m_config3BtnLanguageP = _addPicButton("CONFIG3/GAME_LANG_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 572, 190, 48, 48);
|
|
|
|
|
2016-12-14 19:47:13 +01:00
|
|
|
m_config3LblGCDefaults = _addLabel("CONFIG3/GC_DEFAULTS", theme.lblFont, L"", 20, 245, 290, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
|
|
|
|
m_config3BtnGCDefaults = _addButton("CONFIG3/GC_DEFAULTS_BTN", theme.btnFont, L"", 420, 250, 200, 48, theme.btnFontColor);
|
2013-08-17 15:21:43 +02:00
|
|
|
|
2016-12-01 01:05:39 +01:00
|
|
|
m_config3LblChannelsType = _addLabel("CONFIG3/CHANNELS_TYPE", theme.lblFont, L"", 20, 305, 290, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
|
|
|
|
m_config3LblChannelsTypeVal = _addLabel("CONFIG3/CHANNELS_TYPE_BTN", theme.btnFont, L"", 468, 310, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC);
|
|
|
|
m_config3BtnChannelsTypeM = _addPicButton("CONFIG3/CHANNELS_TYPE_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 420, 310, 48, 48);
|
|
|
|
m_config3BtnChannelsTypeP = _addPicButton("CONFIG3/CHANNELS_TYPE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 572, 310, 48, 48);
|
2013-11-04 20:46:23 +01:00
|
|
|
|
|
|
|
_setHideAnim(m_config3LblGameVideo, "CONFIG3/VIDEO", 50, 0, -2.f, 0.f);
|
|
|
|
_setHideAnim(m_config3LblVideo, "CONFIG3/VIDEO_BTN", -50, 0, 1.f, 0.f);
|
|
|
|
_setHideAnim(m_config3BtnVideoM, "CONFIG3/VIDEO_MINUS", -50, 0, 1.f, 0.f);
|
|
|
|
_setHideAnim(m_config3BtnVideoP, "CONFIG3/VIDEO_PLUS", -50, 0, 1.f, 0.f);
|
|
|
|
_setHideAnim(m_config3LblGameLanguage, "CONFIG3/GAME_LANG", 50, 0, -2.f, 0.f);
|
|
|
|
_setHideAnim(m_config3LblLanguage, "CONFIG3/GAME_LANG_BTN", -50, 0, 1.f, 0.f);
|
|
|
|
_setHideAnim(m_config3BtnLanguageM, "CONFIG3/GAME_LANG_MINUS", -50, 0, 1.f, 0.f);
|
|
|
|
_setHideAnim(m_config3BtnLanguageP, "CONFIG3/GAME_LANG_PLUS", -50, 0, 1.f, 0.f);
|
|
|
|
|
2016-12-14 19:47:13 +01:00
|
|
|
_setHideAnim(m_config3LblGCDefaults, "CONFIG3/GC_DEFAULTS", 50, 0, -2.f, 0.f);
|
|
|
|
_setHideAnim(m_config3BtnGCDefaults, "CONFIG3/GC_DEFAULTS_BTN", -50, 0, 1.f, 0.f);
|
2013-08-17 15:21:43 +02:00
|
|
|
|
2016-12-01 01:05:39 +01:00
|
|
|
_setHideAnim(m_config3LblChannelsType, "CONFIG3/CHANNELS_TYPE", 50, 0, -2.f, 0.f);
|
|
|
|
_setHideAnim(m_config3LblChannelsTypeVal, "CONFIG3/CHANNELS_TYPE_BTN", -50, 0, 1.f, 0.f);
|
|
|
|
_setHideAnim(m_config3BtnChannelsTypeM, "CONFIG3/CHANNELS_TYPE_MINUS", -50, 0, 1.f, 0.f);
|
|
|
|
_setHideAnim(m_config3BtnChannelsTypeP, "CONFIG3/CHANNELS_TYPE_PLUS", -50, 0, 1.f, 0.f);
|
2012-01-21 21:57:41 +01:00
|
|
|
_hideConfig3(true);
|
|
|
|
_textConfig3();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CMenu::_textConfig3(void)
|
|
|
|
{
|
|
|
|
m_btnMgr.setText(m_config3LblGameVideo, _t("cfgb3", L"Default video mode"));
|
|
|
|
m_btnMgr.setText(m_config3LblGameLanguage, _t("cfgb4", L"Default game language"));
|
2016-12-14 19:47:13 +01:00
|
|
|
m_btnMgr.setText(m_config3LblGCDefaults, _t("cfgb9", L"GameCube default settings"));
|
|
|
|
m_btnMgr.setText(m_config3BtnGCDefaults, _t("dl16", L"Set"));
|
2016-12-01 01:05:39 +01:00
|
|
|
m_btnMgr.setText(m_config3LblChannelsType, _t("cfgb7", L"Channels Type"));
|
2012-01-21 21:57:41 +01:00
|
|
|
}
|
2012-03-04 22:33:14 +01:00
|
|
|
|