2016-11-07 16:06:00 +01:00
|
|
|
|
2013-06-27 19:14:11 +02:00
|
|
|
#include "menu.hpp"
|
|
|
|
|
2013-08-18 18:22:54 +02:00
|
|
|
s16 m_coverbnrLblTitle;
|
|
|
|
s16 m_coverbnrBtnBack;
|
2013-08-11 23:44:29 +02:00
|
|
|
s16 m_coverbnrLblUser[4];
|
2022-07-05 20:22:03 +02:00
|
|
|
|
2013-06-27 19:14:11 +02:00
|
|
|
TexData m_coverbnrBg;
|
|
|
|
|
|
|
|
void CMenu::_hideCoverBanner(bool instant)
|
|
|
|
{
|
2013-08-18 18:22:54 +02:00
|
|
|
m_btnMgr.hide(m_coverbnrLblTitle, instant);
|
|
|
|
m_btnMgr.hide(m_coverbnrBtnBack, instant);
|
2013-08-11 23:44:29 +02:00
|
|
|
for(u8 i = 0; i < ARRAY_SIZE(m_coverbnrLblUser); ++i)
|
|
|
|
if(m_coverbnrLblUser[i] != -1)
|
|
|
|
m_btnMgr.hide(m_coverbnrLblUser[i], instant);
|
2022-07-05 20:22:03 +02:00
|
|
|
|
|
|
|
_hideConfigButtons(instant);
|
2013-06-27 19:14:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CMenu::_showCoverBanner(void)
|
|
|
|
{
|
|
|
|
_setBg(m_coverbnrBg, m_coverbnrBg);
|
2013-08-18 18:22:54 +02:00
|
|
|
m_btnMgr.show(m_coverbnrLblTitle);
|
|
|
|
m_btnMgr.show(m_coverbnrBtnBack);
|
2013-08-11 23:44:29 +02:00
|
|
|
for(u8 i = 0; i < ARRAY_SIZE(m_coverbnrLblUser); ++i)
|
|
|
|
if(m_coverbnrLblUser[i] != -1)
|
|
|
|
m_btnMgr.show(m_coverbnrLblUser[i]);
|
2022-07-05 20:22:03 +02:00
|
|
|
|
|
|
|
m_btnMgr.setText(m_configLbl1, _t("cfgbnr1", L"Download Cover"));
|
|
|
|
m_btnMgr.setText(m_configLbl2, _t("cfgbnr2", L"Delete Cover"));
|
|
|
|
m_btnMgr.setText(m_configLbl3, _t("cfgbnr3", L"Download Custom Banner"));
|
|
|
|
m_btnMgr.setText(m_configLbl4, _t("cfgbnr4", L"Delete Banner"));
|
|
|
|
|
|
|
|
m_btnMgr.setText(m_configBtn1, _t("cfgbnr5", L"Download"));
|
|
|
|
m_btnMgr.setText(m_configBtn2, _t("cfgbnr6", L"Delete"));
|
|
|
|
m_btnMgr.setText(m_configBtn3, _t("cfgbnr5", L"Download"));
|
|
|
|
m_btnMgr.setText(m_configBtn4, _t("cfgbnr6", L"Delete"));
|
|
|
|
|
|
|
|
m_btnMgr.show(m_configLbl1);
|
|
|
|
m_btnMgr.show(m_configLbl2);
|
|
|
|
m_btnMgr.show(m_configLbl3);
|
|
|
|
m_btnMgr.show(m_configLbl4);
|
|
|
|
|
|
|
|
m_btnMgr.show(m_configBtn1);
|
|
|
|
m_btnMgr.show(m_configBtn2);
|
|
|
|
m_btnMgr.show(m_configBtn3);
|
|
|
|
m_btnMgr.show(m_configBtn4);
|
2013-06-27 19:14:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CMenu::_CoverBanner(void)
|
|
|
|
{
|
|
|
|
const char *id = CoverFlow.getId();
|
2013-08-18 18:22:54 +02:00
|
|
|
SetupInput();
|
2013-06-27 19:14:11 +02:00
|
|
|
_showCoverBanner();
|
|
|
|
while(!m_exit)
|
|
|
|
{
|
|
|
|
_mainLoopCommon();
|
2022-07-05 20:22:03 +02:00
|
|
|
if(BTN_HOME_PRESSED || BTN_B_PRESSED || (BTN_A_PRESSED && m_btnMgr.selected(m_coverbnrBtnBack)))
|
2013-06-27 19:14:11 +02:00
|
|
|
break;
|
2022-07-05 20:22:03 +02:00
|
|
|
else if(BTN_UP_PRESSED)
|
2013-08-18 18:22:54 +02:00
|
|
|
m_btnMgr.up();
|
2022-07-05 20:22:03 +02:00
|
|
|
else if(BTN_DOWN_PRESSED)
|
2013-08-18 18:22:54 +02:00
|
|
|
m_btnMgr.down();
|
2013-06-27 19:14:11 +02:00
|
|
|
else if(BTN_A_PRESSED)
|
|
|
|
{
|
2022-07-05 20:22:03 +02:00
|
|
|
if(m_btnMgr.selected(m_configBtn1))
|
2013-06-27 19:14:11 +02:00
|
|
|
{
|
|
|
|
_hideCoverBanner();
|
2018-12-13 01:03:33 +01:00
|
|
|
_download(id, 1);
|
2013-06-27 19:14:11 +02:00
|
|
|
_showCoverBanner();
|
|
|
|
}
|
2022-07-05 20:22:03 +02:00
|
|
|
else if(m_btnMgr.selected(m_configBtn2))
|
2013-06-27 19:14:11 +02:00
|
|
|
{
|
|
|
|
_hideCoverBanner();
|
|
|
|
RemoveCover(id);
|
2018-11-23 22:31:04 +01:00
|
|
|
error(_t("deltcover", L"Cover is deleted."));
|
2013-06-27 19:14:11 +02:00
|
|
|
_showCoverBanner();
|
|
|
|
}
|
2022-07-05 20:22:03 +02:00
|
|
|
else if(m_btnMgr.selected(m_configBtn3))
|
2013-06-27 19:14:11 +02:00
|
|
|
{
|
|
|
|
_hideCoverBanner();
|
|
|
|
fsop_deleteFile(fmt("%s/%s.bnr", m_bnrCacheDir.c_str(), id));
|
|
|
|
fsop_deleteFile(fmt("%s/%s.bnr", m_customBnrDir.c_str(), id));
|
2013-08-22 20:55:08 +02:00
|
|
|
fsop_deleteFile(fmt("%s/%.3s.bnr", m_bnrCacheDir.c_str(), id));
|
|
|
|
fsop_deleteFile(fmt("%s/%.3s.bnr", m_customBnrDir.c_str(), id));
|
2018-12-13 01:03:33 +01:00
|
|
|
_download(id, 2);
|
2018-07-16 00:56:31 +02:00
|
|
|
m_newGame = true;
|
2013-06-27 19:14:11 +02:00
|
|
|
_showCoverBanner();
|
|
|
|
}
|
2022-07-05 20:22:03 +02:00
|
|
|
else if(m_btnMgr.selected(m_configBtn4))
|
2013-06-27 19:14:11 +02:00
|
|
|
{
|
|
|
|
_hideCoverBanner();
|
|
|
|
fsop_deleteFile(fmt("%s/%s.bnr", m_bnrCacheDir.c_str(), id));
|
|
|
|
fsop_deleteFile(fmt("%s/%s.bnr", m_customBnrDir.c_str(), id));
|
2013-08-22 20:55:08 +02:00
|
|
|
fsop_deleteFile(fmt("%s/%.3s.bnr", m_bnrCacheDir.c_str(), id));
|
|
|
|
fsop_deleteFile(fmt("%s/%.3s.bnr", m_customBnrDir.c_str(), id));
|
2018-11-23 22:31:04 +01:00
|
|
|
error(_t("deltbanner", L"Banner is deleted."));
|
2018-07-16 00:56:31 +02:00
|
|
|
m_newGame = true;
|
2013-06-27 19:14:11 +02:00
|
|
|
_showCoverBanner();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_hideCoverBanner();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CMenu::_initCoverBanner()
|
|
|
|
{
|
2013-08-18 18:22:54 +02:00
|
|
|
m_coverbnrBg = _texture("COVERBNR/BG", "texture", theme.bg, false);
|
2022-07-05 20:22:03 +02:00
|
|
|
|
2013-08-11 23:44:29 +02:00
|
|
|
_addUserLabels(m_coverbnrLblUser, ARRAY_SIZE(m_coverbnrLblUser), "COVERBNR");
|
2018-12-28 01:47:00 +01:00
|
|
|
m_coverbnrLblTitle = _addLabel("COVERBNR/TITLE", theme.titleFont, L"", 0, 10, 640, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE);
|
2013-11-04 20:46:23 +01:00
|
|
|
m_coverbnrBtnBack = _addButton("COVERBNR/BACK_BTN", theme.btnFont, L"", 420, 400, 200, 48, theme.btnFontColor);
|
|
|
|
|
|
|
|
_setHideAnim(m_coverbnrLblTitle, "COVERBNR/TITLE", 0, 0, -2.f, 0.f);
|
2013-08-18 18:22:54 +02:00
|
|
|
_setHideAnim(m_coverbnrBtnBack, "COVERBNR/BACK_BTN", 0, 0, 1.f, -1.f);
|
2022-07-05 20:22:03 +02:00
|
|
|
|
2013-06-27 19:14:11 +02:00
|
|
|
_hideCoverBanner(true);
|
|
|
|
_textCoverBanner();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CMenu::_textCoverBanner(void)
|
|
|
|
{
|
2013-08-18 18:22:54 +02:00
|
|
|
m_btnMgr.setText(m_coverbnrLblTitle, _t("cfgg40", L"Manage Cover and Banner"));
|
|
|
|
m_btnMgr.setText(m_coverbnrBtnBack, _t("cfg10", L"Back"));
|
2013-06-27 19:14:11 +02:00
|
|
|
}
|