WiiFlow_Lite/source/menu/menu_error.cpp
fledge68 66c17c023c -removed sd only arg and replaced it with eisteinx2's code to detect sd only. with slight change because mountall() is called in other places.
-fixed font glyph x spacing so letters like W no longer bleed into or look like they connect to the next letter. also fixes letters like j's. thanks to usbloader gx freetypegx code.
-changed some font sizing. but had to make button fonts in bold. if not bold then sometime's the text would fade out and be hard to read. something to do with the wiiflow button images being transparent. has no effect on non transparent buttons like carbonik abz theme.
-fixed wfl so time and date in games is correct. thanks aphirst!
-now unloading theme.ini from mem after all buttons and labels are created. this is possible since coverflow.ini is now seperate from theme.ini.
- other minor code changes and rem's put in for easier code decyphering.
2018-07-09 14:53:35 +00:00

80 lines
2.0 KiB
C++

#include "menu.hpp"
s16 m_errorLblMessage;
s16 m_errorLblIcon;
s16 m_errorLblUser[4];
void CMenu::error(const wstringEx &msg)
{
SetupInput();
_hideAbout();
_hideCode();
_hideConfig();
_hideConfigAdv();
_hideConfig3();
_hideConfig4();
_hideConfigScreen();
_hideConfigSnd();
_hideDownload();
_hideExitTo();
_hideGame();
_hideMain();
_hideWBFS();
_hideCFTheme();
_hideCategorySettings();
_hideSystem();
_hideGameInfo();
_hideGameSettings();
_hideSource();
_hideWaitMessage();
m_btnMgr.setText(m_errorLblMessage, msg, true);
_showError();
gprintf(msg.toUTF8().c_str());
do
{
_mainLoopCommon();
} while (!m_exit && !BTN_B_PRESSED && !BTN_A_PRESSED && !BTN_HOME_PRESSED);
_hideError(false);
}
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]);
}
void CMenu::_initErrorMenu()
{
TexData texIcon;
TexHandle.fromImageFile(texIcon, fmt("%s/error.png", m_imgsDir.c_str()));
_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);
m_errorLblIcon = _addLabel("ERROR/ICON", theme.lblFont, L"", 40, 200, 64, 64, theme.lblFontColor, 0, texIcon);
//
_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)
{
}