WiiFlow_Lite/source/menu/menu_config_hb.cpp

183 lines
6.9 KiB
C++
Raw Normal View History

-updated NIN_CFG_VERSION to 7 for Nintendont argsboot and added triforce arcade option to game settings menu. tested and working. -fixed wii u widescreen option in game config menu. should properly work now. thanks pBullet! -added a fix for coverflow titles display when coverflow has 3 or more rows. for some reason 3 or more rows caused the title to display improperly. -removed **disabled** message from source menu. no need for it - was a stupid idea. if you don't want it to display then remove it from your source menu or don't add it. when a view is disabled in wiiflow_lite.ini then only that view icon is disabled from showing on the main menu screen. -removed titles.ini which wasn't really used except for displaying the return to channel in settings. I googled it and nothing really showed up. it seemed to be the same as custom_titles.ini - it seemed useless. -removed cacheing sourceflow list. the list is never big enuff to worry about cacheing. plus if you add or remove source btns you won't have to reload cache for the changes to take effect. -removed max_source_btns from wiiflow_lite.ini - added code to get highest source menu btn so now source menu can have as many buttons as you like. -removed Manage Languages Menu - restored option to just change wiiflow language. no need for downloading languages and the google link didn't work anyway. when i make a pack all the languages will be included. -added flat cover options for sourceflow and homebrew view. can be turned on/off via their config menu's accessed via 'HOME' btn. -added config menu for homebrew view - press 'HOME' btn while in homebrew view to access it. config menu options are - switch apps partition, adjust coverflow, smallbox on/off, and flat covers on/off. -updated config menu for source menu/flow. options include - sourceflow on/off, adjust coverflow, smallbox on/off, flat covers on/off, and for source menu only - multisource on/off. -added coverflow layouts/versions for individual plugins - which means each plugin can have its own coverflow layout without affecting the others. -set HQ cover to default to ON -made it so coverflow doesn't reload every time you access another menu or change favorites or whatever. -added error messages to game and app launching if any of the bin files needed for launching are missing. previously whenever these errors occurred wiiflow would just exit without the user knowing why. Now the error message should display before exit so the user has an idea what went wrong. had to move cleanup() back some for the errors to show. hopefully that doesn't cause out of mem issues for users with large game collections. -added error messages to game config menu. now all config options will show but if you can't use it then a error shows telling you. such as 'use neek2o' will be available but if you set it to on and neek2o isn't installed then an error message shows. added error msgs for extracting and flashing saves too. -added show_mem=yes/no option to wiiflow_lite.ini under [DEBUG]. manually edit wiiflow_lite.ini to turn it on/off. if set to 'yes' wiiflow will show how much free mem is available on screen. no need to compile wiiflow for this option anymore. -cleaned up some of the boot up code. -starting a random game - just hold 'B' and press '-'. no longer press'B' on config or question mark icon and no need to allow it in wiiflow_lite.ini
2016-11-07 16:06:00 +01:00
#include "menu.hpp"
s16 m_cfghbLblTitle;
s16 m_cfghbBtnBack;
s16 m_cfghbLblUser[4];
s16 m_cfghbLblAdjustCF;
s16 m_cfghbBtnAdjustCF;
s16 m_cfghbLblSmallbox;
s16 m_cfghbBtnSmallbox;
s16 m_cfghbLblBoxMode;
s16 m_cfghbBtnBoxMode;
s16 m_cfghbLblPartition;
s16 m_cfghbLblPartitionVal;
s16 m_cfghbBtnPartitionP;
s16 m_cfghbBtnPartitionM;
TexData m_cfghbBg;
static void _showCfgHB(void)
{
m_btnMgr.show(m_cfghbLblTitle);
m_btnMgr.show(m_cfghbBtnBack);
for(u8 i = 0; i < ARRAY_SIZE(m_cfghbLblUser); ++i)
if(m_cfghbLblUser[i] != -1)
m_btnMgr.show(m_cfghbLblUser[i]);
m_btnMgr.show(m_cfghbLblAdjustCF);
m_btnMgr.show(m_cfghbBtnAdjustCF);
m_btnMgr.show(m_cfghbLblSmallbox);
m_btnMgr.show(m_cfghbBtnSmallbox);
m_btnMgr.show(m_cfghbLblBoxMode);
m_btnMgr.show(m_cfghbBtnBoxMode);
m_btnMgr.show(m_cfghbLblPartition);
m_btnMgr.show(m_cfghbLblPartitionVal);
m_btnMgr.show(m_cfghbBtnPartitionP);
m_btnMgr.show(m_cfghbBtnPartitionM);
}
static void _hideCfgHB(bool instant)
{
m_btnMgr.hide(m_cfghbLblTitle, instant);
m_btnMgr.hide(m_cfghbBtnBack, instant);
for(u8 i = 0; i < ARRAY_SIZE(m_cfghbLblUser); ++i)
if(m_cfghbLblUser[i] != -1)
m_btnMgr.hide(m_cfghbLblUser[i], instant);
m_btnMgr.hide(m_cfghbLblAdjustCF, instant);
m_btnMgr.hide(m_cfghbBtnAdjustCF, instant);
m_btnMgr.hide(m_cfghbLblSmallbox, instant);
m_btnMgr.hide(m_cfghbBtnSmallbox, instant);
m_btnMgr.hide(m_cfghbLblBoxMode, instant);
m_btnMgr.hide(m_cfghbBtnBoxMode, instant);
m_btnMgr.hide(m_cfghbLblPartition, instant);
m_btnMgr.hide(m_cfghbLblPartitionVal, instant);
m_btnMgr.hide(m_cfghbBtnPartitionP, instant);
m_btnMgr.hide(m_cfghbBtnPartitionM, instant);
}
void CMenu::_CfgHB(void)
{
m_btnMgr.setText(m_cfghbBtnSmallbox, m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox") ? _t("on", L"On") : _t("off", L"Off"));
m_btnMgr.setText(m_cfghbBtnBoxMode, m_cfg.getBool(HOMEBREW_DOMAIN, "box_mode") ? _t("on", L"On") : _t("off", L"Off"));
currentPartition = m_cfg.getInt(HOMEBREW_DOMAIN, "partition", 0);
const char *partitionname = DeviceName[currentPartition];
m_btnMgr.setText(m_cfghbLblPartitionVal, upperCase(partitionname));
SetupInput();
_setBg(m_cfghbBg, m_cfghbBg);
_showCfgHB();
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();
else if(BTN_A_PRESSED)
{
if(m_btnMgr.selected(m_cfghbBtnBack))
break;
else if (m_btnMgr.selected(m_cfghbBtnAdjustCF))
{
m_refreshGameList = true;
_hideCfgHB(true);
_cfTheme();
_showCfgHB();
}
else if (m_btnMgr.selected(m_cfghbBtnSmallbox))
{
m_refreshGameList = true;
m_cfg.setBool(HOMEBREW_DOMAIN, "smallbox", !m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox", false));
m_btnMgr.setText(m_cfghbBtnSmallbox, m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox") ? _t("on", L"On") : _t("off", L"Off"));
}
else if (m_btnMgr.selected(m_cfghbBtnBoxMode))
{
m_refreshGameList = true;
m_cfg.setBool(HOMEBREW_DOMAIN, "box_mode", !m_cfg.getBool(HOMEBREW_DOMAIN, "box_mode", false));
m_btnMgr.setText(m_cfghbBtnBoxMode, m_cfg.getBool(HOMEBREW_DOMAIN, "box_mode") ? _t("on", L"On") : _t("off", L"Off"));
}
else if (m_btnMgr.selected(m_cfghbBtnPartitionP) || m_btnMgr.selected(m_cfghbBtnPartitionM))
{
m_refreshGameList = true;
s8 direction = m_btnMgr.selected(m_cfghbBtnPartitionP) ? 1 : -1;
_setPartition(direction);
const char *partitionname = DeviceName[currentPartition];
m_btnMgr.setText(m_cfghbLblPartitionVal, upperCase(partitionname));
}
}
}
_hideCfgHB(true);
}
void CMenu::_textCfgHB(void)
{
m_btnMgr.setText(m_cfghbLblTitle, _t("cfghb1", L"Homebrew Settings"));
m_btnMgr.setText(m_cfghbLblAdjustCF, _t("cfgc4", L"Adjust Coverflow"));
m_btnMgr.setText(m_cfghbBtnAdjustCF, _t("cfgc5", L"Go"));
m_btnMgr.setText(m_cfghbLblSmallbox, _t("cfghb2", L"Coverflow Smallbox"));
m_btnMgr.setText(m_cfghbLblBoxMode, _t("cfghb6", L"Box Mode"));
m_btnMgr.setText(m_cfghbLblPartition, _t("cfghb3", L"Homebrew Partition"));
m_btnMgr.setText(m_cfghbBtnBack, _t("cfg10", L"Back"));
}
void CMenu::_initCfgHB(void)
{
m_cfghbBg = _texture("CFG_HB/BG", "texture", theme.bg, false);
_addUserLabels(m_cfghbLblUser, ARRAY_SIZE(m_cfghbLblUser), "CFG_HB");
m_cfghbLblTitle = _addTitle("CFG_HB/TITLE", theme.titleFont, L"", 0, 10, 640, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE);
m_cfghbBtnBack = _addButton("CFG_HB/BACK_BTN", theme.btnFont, L"", 420, 400, 200, 48, theme.btnFontColor);
m_cfghbLblAdjustCF = _addLabel("CFG_HB/ADJUST_CF", theme.lblFont, L"", 20, 125, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_cfghbBtnAdjustCF = _addButton("CFG_HB/ADJUST_CF_BTN", theme.btnFont, L"", 420, 130, 200, 48, theme.btnFontColor);
m_cfghbLblSmallbox = _addLabel("CFG_HB/HB_SMALLBOX", theme.lblFont, L"", 20, 185, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_cfghbBtnSmallbox = _addButton("CFG_HB/HB_SMALLBOX_BTN", theme.btnFont, L"", 420, 190, 200, 48, theme.btnFontColor);
m_cfghbLblBoxMode = _addLabel("CFG_HB/HB_BOXMODE", theme.lblFont, L"", 20, 245, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_cfghbBtnBoxMode = _addButton("CFG_HB/HB_BOXMODE_BTN", theme.btnFont, L"", 420, 250, 200, 48, theme.btnFontColor);
m_cfghbLblPartition = _addLabel("CFG_HB/HB_PARTITION", theme.lblFont, L"", 20, 305, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_cfghbLblPartitionVal = _addLabel("CFG_HB/HB_PARTITION_VAL", theme.btnFont, L"", 468, 310, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC);
m_cfghbBtnPartitionM = _addPicButton("CFG_HB/HB_PARTITION_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 420, 310, 48, 48);
m_cfghbBtnPartitionP = _addPicButton("CFG_HB/HB_PARTITION_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 572, 310, 48, 48);
_setHideAnim(m_cfghbLblTitle, "CFG_HB/TITLE", 0, 0, -2.f, 0.f);
_setHideAnim(m_cfghbBtnBack, "CFG_HB/BACK_BTN", 0, 0, 1.f, -1.f);
_setHideAnim(m_cfghbLblAdjustCF, "CFG_HB/ADJUST_CF", -50, 0, -2.f, 0.f);
_setHideAnim(m_cfghbBtnAdjustCF, "CFG_HB/ADJUST_CF_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_cfghbLblSmallbox, "CFG_HB/HB_SMALLBOX", -50, 0, -2.f, 0.f);
_setHideAnim(m_cfghbBtnSmallbox, "CFG_HB/HB_SMALLBOX_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_cfghbLblBoxMode, "CFG_HB/HB_BOXMODE", -50, 0, -2.f, 0.f);
_setHideAnim(m_cfghbBtnBoxMode, "CFG_HB/HB_BOXMODE_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_cfghbLblPartition, "CFG_HB/HB_PARTITION", -50, 0, -2.f, 0.f);
_setHideAnim(m_cfghbLblPartitionVal, "CFG_HB/HB_PARTITION_VAL", -50, 0, 1.f, 0.f);
_setHideAnim(m_cfghbBtnPartitionM, "CFG_HB/HB_PARTITION_MINUS", -50, 0, 1.f, 0.f);
_setHideAnim(m_cfghbBtnPartitionP, "CFG_HB/HB_PARTITION_PLUS", -50, 0, 1.f, 0.f);
_hideCfgHB(true);
_textCfgHB();
}