2012-01-21 21:57:41 +01:00
|
|
|
|
|
|
|
#include "menu.hpp"
|
|
|
|
|
2012-09-13 16:54:17 +02:00
|
|
|
s16 m_errorLblMessage;
|
|
|
|
s16 m_errorLblIcon;
|
|
|
|
s16 m_errorLblUser[4];
|
2012-01-21 21:57:41 +01:00
|
|
|
|
2022-07-14 23:48:12 +02:00
|
|
|
void CMenu::_hideError(bool instant)
|
|
|
|
{
|
|
|
|
m_btnMgr.hide(m_errorLblIcon, instant);
|
|
|
|
m_btnMgr.hide(m_errorLblMessage, instant);
|
|
|
|
for(u8 i = 0; i < ARRAY_SIZE(m_errorLblUser); ++i)
|
|
|
|
if(m_errorLblUser[i] != -1)
|
|
|
|
m_btnMgr.hide(m_errorLblUser[i], instant);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CMenu::_showError(void)
|
|
|
|
{
|
|
|
|
_setBg(m_errorBg, m_errorBg);
|
|
|
|
m_btnMgr.show(m_errorLblMessage);
|
|
|
|
m_btnMgr.show(m_errorLblIcon);
|
|
|
|
for(u8 i = 0; i < ARRAY_SIZE(m_errorLblUser); ++i)
|
|
|
|
if(m_errorLblUser[i] != -1)
|
|
|
|
m_btnMgr.show(m_errorLblUser[i]);
|
|
|
|
}
|
|
|
|
|
2022-07-14 00:11:44 +02:00
|
|
|
void CMenu::_error(const wstringEx &msg)
|
2012-01-21 21:57:41 +01:00
|
|
|
{
|
|
|
|
SetupInput();
|
|
|
|
_hideAbout();
|
|
|
|
_hideCode();
|
2022-06-01 00:33:27 +02:00
|
|
|
_hideConfigMain();
|
2022-07-27 00:58:40 +02:00
|
|
|
_hideConfigGCGame();
|
2012-01-21 21:57:41 +01:00
|
|
|
_hideDownload();
|
2018-07-09 16:53:35 +02:00
|
|
|
_hideExitTo();
|
2012-01-21 21:57:41 +01:00
|
|
|
_hideGame();
|
|
|
|
_hideMain();
|
|
|
|
_hideWBFS();
|
|
|
|
_hideCFTheme();
|
|
|
|
_hideCategorySettings();
|
|
|
|
_hideGameInfo();
|
2022-08-05 22:04:05 +02:00
|
|
|
_hideConfigGame();
|
2012-01-21 21:57:41 +01:00
|
|
|
_hideWaitMessage();
|
|
|
|
m_btnMgr.setText(m_errorLblMessage, msg, true);
|
|
|
|
_showError();
|
2012-05-11 05:37:56 +02:00
|
|
|
|
2018-12-24 14:42:31 +01:00
|
|
|
gprintf("error msg: %s\n", msg.toUTF8().c_str());
|
2012-01-21 21:57:41 +01:00
|
|
|
do
|
|
|
|
{
|
|
|
|
_mainLoopCommon();
|
2016-11-07 16:06:00 +01:00
|
|
|
} while (!m_exit && !BTN_B_PRESSED && !BTN_A_PRESSED && !BTN_HOME_PRESSED);
|
2012-01-21 21:57:41 +01:00
|
|
|
_hideError(false);
|
|
|
|
}
|
|
|
|
|
2012-11-03 20:16:03 +01:00
|
|
|
void CMenu::_initErrorMenu()
|
2012-01-21 21:57:41 +01:00
|
|
|
{
|
2012-11-03 20:16:03 +01:00
|
|
|
_addUserLabels(m_errorLblUser, ARRAY_SIZE(m_errorLblUser), "ERROR");
|
|
|
|
m_errorBg = _texture("ERROR/BG", "texture", theme.bg, false);
|
|
|
|
m_errorLblMessage = _addLabel("ERROR/MESSAGE", theme.lblFont, L"", 112, 20, 500, 440, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
|
2022-07-14 23:48:12 +02:00
|
|
|
TexData texIcon;
|
|
|
|
TexHandle.fromImageFile(texIcon, fmt("%s/error.png", m_imgsDir.c_str()));
|
2012-11-03 20:16:03 +01:00
|
|
|
m_errorLblIcon = _addLabel("ERROR/ICON", theme.lblFont, L"", 40, 200, 64, 64, theme.lblFontColor, 0, texIcon);
|
2012-01-21 21:57:41 +01:00
|
|
|
//
|
|
|
|
_setHideAnim(m_errorLblMessage, "ERROR/MESSAGE", 0, 0, 0.f, 0.f);
|
|
|
|
_setHideAnim(m_errorLblIcon, "ERROR/ICON", -50, 0, 0.f, 0.f);
|
|
|
|
//
|
|
|
|
_hideError(true);
|
|
|
|
_textError();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CMenu::_textError(void)
|
|
|
|
{
|
|
|
|
}
|