From c97818c8aae280df1e34a8b9bc18b9abd204029f Mon Sep 17 00:00:00 2001 From: fledge68 Date: Sun, 8 Apr 2012 14:48:50 +0000 Subject: [PATCH] - Categories Update. re-added numcategories so you can have less than 20 categories if you want. re-added categories per view (usb, dml,channels, brew,etc..). added press 'B' on fav icon on game selected screen to go directly to game categories just like pressing 'B' on fav icon on main menu. moved 'All' button to lower left. replaced on and off buttons with check boxes - don't worry I already compressed them and they only add 4k to WiiFlow. And a few other minor changes. --- source/gui/gui.cpp | 9 +- source/gui/gui.hpp | 2 + source/menu/menu.cpp | 28 +++--- source/menu/menu.hpp | 17 ++-- source/menu/menu_categories.cpp | 147 ++++++++++++++++++-------------- source/menu/menu_game.cpp | 7 +- source/menu/menu_main.cpp | 10 +-- 7 files changed, 126 insertions(+), 94 deletions(-) diff --git a/source/gui/gui.cpp b/source/gui/gui.cpp index 717f0166..66afff0b 100644 --- a/source/gui/gui.cpp +++ b/source/gui/gui.cpp @@ -22,6 +22,7 @@ bool CButtonsMgr::init(CVideo &vid) m_rumbleEnabled = false; m_soundVolume = 0xFF; m_noclick = false; + m_nohover = false; m_vid = vid; soundInit(); @@ -231,7 +232,8 @@ void CButtonsMgr::mouse(int chan, int x, int y) if (s != m_selected[chan]) { if (m_soundVolume > 0 && !!but.hoverSound) - but.hoverSound->Play(m_soundVolume); + if(!m_nohover) + but.hoverSound->Play(m_soundVolume); if (m_rumbleEnabled) { m_rumble[chan] = 4; @@ -314,6 +316,11 @@ void CButtonsMgr::down(void) } } +void CButtonsMgr::noHover(bool nohover) +{ + m_nohover = nohover; +} + void CButtonsMgr::noClick(bool noclick) { m_noclick = noclick; diff --git a/source/gui/gui.hpp b/source/gui/gui.hpp index 677044d1..cef9f18e 100644 --- a/source/gui/gui.hpp +++ b/source/gui/gui.hpp @@ -57,6 +57,7 @@ public: void draw(void); void tick(void); void noClick(bool noclick = false); + void noHover(bool nohover = false); void click(u32 id = (u32)-1); bool selected(u32 button = (u32)-1); void setRumble(int, bool wii = false, bool gc = false); @@ -147,6 +148,7 @@ private: SmartGuiSound m_sndClick; u8 m_soundVolume; bool m_noclick; + bool m_nohover; CVideo m_vid; private: void _drawBtn(const SButton &b, bool selected, bool click); diff --git a/source/menu/menu.cpp b/source/menu/menu.cpp index af598ab3..1f9fa17f 100644 --- a/source/menu/menu.cpp +++ b/source/menu/menu.cpp @@ -101,7 +101,8 @@ extern const u8 butzhcnon_png[]; extern const u8 butzhcnons_png[]; extern const u8 butzhcnoff_png[]; extern const u8 butzhcnoffs_png[]; - +extern const u8 checkbox_png[]; +extern const u8 checkboxs_png[]; using namespace std; @@ -116,7 +117,6 @@ CMenu::CMenu(CVideo &vid) : m_thrdStepLen = 0.f; m_locked = false; m_favorites = false; - m_category = 0; m_networkInit = false; m_thrdNetwork = false; m_mutex = 0; @@ -418,8 +418,7 @@ void CMenu::init(void) if (m_cfg.getBool("GENERAL", "favorites_on_startup", false)) m_favorites = m_cfg.getBool(domain, "favorites", false); - m_category = m_cat.getInt(domain, "category", 0); - m_max_categories = m_cat.getInt(domain, "numcategories", 12); + m_max_categories = m_cat.getInt("GENERAL", "numcategories", 21); m_cfg.setString("GAMERCARD", "gamercards", "wiinnertag|dutag"); m_cfg.getString("GAMERCARD", "wiinnertag_url", WIINNERTAG_URL); @@ -940,6 +939,15 @@ void CMenu::_buildMenus(void) theme.btnZHCNOffs.fromPNG(butzhcnoffs_png); theme.btnZHCNOffs = _texture(theme.texSet, "GENERAL", "button_zhcn_off_selected", theme.btnZHCNOffs); + theme.checkboxoff.fromPNG(checkbox_png); + theme.checkboxoff = _texture(theme.texSet, "GENERAL", "checkbox_off", theme.checkboxoff); + theme.checkboxoffs.fromPNG(checkbox_png); + theme.checkboxoffs = _texture(theme.texSet, "GENERAL", "checkbox_off_selected", theme.checkboxoffs); + theme.checkboxon.fromPNG(checkboxs_png); + theme.checkboxon = _texture(theme.texSet, "GENERAL", "checkbox_on", theme.checkboxon); + theme.checkboxons.fromPNG(checkboxs_png); + theme.checkboxons = _texture(theme.texSet, "GENERAL", "checkbox_on_selected", theme.checkboxons); + theme.pbarTexL.fromPNG(pbarleft_png); theme.pbarTexL = _texture(theme.texSet, "GENERAL", "progressbar_texture_left", theme.pbarTexL); theme.pbarTexR.fromPNG(pbarright_png); @@ -1406,7 +1414,7 @@ void CMenu::_initCF(void) { Config m_dump; const char *domain = _domainFromView(); - const char *catviews = m_cat.getString("GENERAL", "categories", "").c_str(); + const char *catviews = m_cat.getString(domain, "categories", "100000000000000000000").c_str(); m_cf.clear(); m_cf.reserve(m_gameList.size()); @@ -1423,21 +1431,21 @@ void CMenu::_initCF(void) string id = string((const char *)m_gameList[i].hdr.id, m_current_view == COVERFLOW_CHANNEL ? 4 : 6); string idcats = m_cat.getString("CATEGORIES", id, "").c_str(); - if (idcats.length() == 12) + if (idcats.length() < 21 && idcats.length() > 0) { - idcats.append("00000000"); + idcats.append((21-idcats.length()), '0'); m_cat.setString("CATEGORIES", id, idcats); } - if ((!m_favorites || m_gcfg1.getBool("FAVORITES", id, false)) && (!m_locked || !m_gcfg1.getBool("ADULTONLY", id, false)) && !m_gcfg1.getBool("HIDDEN", id, false)) + if ((!m_favorites || m_gcfg1.getBool("FAVORITES", id, false)) && (!m_locked || !m_gcfg1.getBool("ADULTONLY", id, false))) { if (catviews[0] == '0') { const char *idcats = m_cat.getString("CATEGORIES", id, "").c_str(); - if (strlen(idcats) != 20) continue; + if (strlen(idcats) == 0) continue; else { bool idinacat=0; - for (u32 j = 1; j<20; ++j) if (catviews[j] == '1' && idcats[j] == '1') idinacat=1; + for (u32 j = 1; j #include -u8 m_categories[20]; +u8 m_categories[21]; u32 C_curPage; bool gameSet; +u8 lastBtn; void CMenu::_hideCategorySettings(bool instant) { @@ -17,55 +18,64 @@ void CMenu::_hideCategorySettings(bool instant) for (u32 i = 0; i < ARRAY_SIZE(m_categoryLblUser); ++i) if (m_categoryLblUser[i] != -1u) m_btnMgr.hide(m_categoryLblUser[i], instant); - for (int i=0; i<20; ++i) + for (int i=0; i<21; ++i) { m_btnMgr.hide(m_categoryLblCat[i]); - m_btnMgr.hide(m_categoryBtnCat[i]); - m_btnMgr.hide(m_categoryBtnCats[i]); + m_btnMgr.hide(m_categoryBtn[i]); } } void CMenu::_showCategorySettings(void) { _setBg(m_categoryBg, m_categoryBg); + for (u32 i = 0; i < ARRAY_SIZE(m_categoryLblUser); ++i) if (m_categoryLblUser[i] != -1u) m_btnMgr.show(m_categoryLblUser[i]); m_btnMgr.show(m_categoryLblTitle); m_btnMgr.show(m_categoryBtnBack); - m_btnMgr.setText(m_categoryLblPage, wfmt(L"%i / 2", C_curPage)); - m_btnMgr.show(m_categoryLblPage); - m_btnMgr.show(m_categoryBtnPageM); - m_btnMgr.show(m_categoryBtnPageP); - - for (u32 i = 0; i < ARRAY_SIZE(m_categoryLblUser); ++i) if (m_categoryLblUser[i] != -1u) m_btnMgr.show(m_categoryLblUser[i]); + if (m_max_categories > 10) + { + m_btnMgr.setText(m_categoryLblPage, wfmt(L"%i / 2", C_curPage)); + m_btnMgr.show(m_categoryLblPage); + m_btnMgr.show(m_categoryBtnPageM); + m_btnMgr.show(m_categoryBtnPageP); + } + _updateCheckboxes(); +} + +void CMenu::_updateCheckboxes(void) +{ + for (int i=0; i<21; ++i) + { + m_btnMgr.hide(m_categoryBtn[i]); + m_btnMgr.hide(m_categoryLblCat[i]); + } string id(m_cf.getId()); const char *catflags; if (gameSet) catflags = m_cat.getString("CATEGORIES", id, "").c_str(); - else catflags = m_cat.getString("GENERAL", "categories", "10000000000000000000").c_str(); + else catflags = m_cat.getString(_domainFromView(), "categories", "100000000000000000000").c_str(); memset(&m_categories, '0', sizeof(m_categories)); if (strlen(catflags) == sizeof(m_categories)) memcpy(&m_categories, catflags, sizeof(m_categories)); if (C_curPage == 1) { - for (int i = 0; i < 10; ++i) + int j = 11; + if (m_max_categories < 11) j = m_max_categories; + for (int i = 0; i < j; ++i) { if (i == 0 && gameSet) continue; m_btnMgr.show(m_categoryLblCat[i]); - if (catflags[i] == '1') m_btnMgr.show(m_categoryBtnCats[i]); - else m_btnMgr.show(m_categoryBtnCat[i]); - m_btnMgr.hide(m_categoryLblCat[i+10]); - m_btnMgr.hide(m_categoryBtnCat[i+10]); - m_btnMgr.hide(m_categoryBtnCats[i+10]); + if (catflags[i] == '1') m_categoryBtn[i] = m_categoryBtnCats[i]; + else m_categoryBtn[i] = m_categoryBtnCat[i]; + m_btnMgr.show(m_categoryBtn[i]); } } else { - for (int i = 10; i < 20; ++i) + for (int i = 11; i < m_max_categories; ++i) { m_btnMgr.show(m_categoryLblCat[i]); - if (catflags[i] == '1') m_btnMgr.show(m_categoryBtnCats[i]); - else m_btnMgr.show(m_categoryBtnCat[i]); - m_btnMgr.hide(m_categoryLblCat[i-10]); - m_btnMgr.hide(m_categoryBtnCat[i-10]); - m_btnMgr.hide(m_categoryBtnCats[i-10]); + if (catflags[i] == '1') m_categoryBtn[i] = m_categoryBtnCats[i]; + else m_categoryBtn[i] = m_categoryBtnCat[i]; + m_btnMgr.show(m_categoryBtn[i]); } } } @@ -74,51 +84,55 @@ void CMenu::_CategorySettings(bool fromGameSet) { SetupInput(); C_curPage = 1; - gameSet = false; - if (fromGameSet) gameSet=true; + gameSet = fromGameSet; _showCategorySettings(); while (true) { _mainLoopCommon(); + if (!m_btnMgr.selected(lastBtn)) m_btnMgr.noHover(false); if (BTN_HOME_PRESSED || BTN_B_PRESSED) break; else if (BTN_UP_PRESSED) m_btnMgr.up(); else if (BTN_DOWN_PRESSED) m_btnMgr.down(); - if (BTN_MINUS_PRESSED || BTN_LEFT_PRESSED || (BTN_A_PRESSED && m_btnMgr.selected(m_categoryBtnPageM))) + if (((BTN_MINUS_PRESSED || BTN_LEFT_PRESSED) && m_max_categories>11) || (BTN_A_PRESSED && m_btnMgr.selected(m_categoryBtnPageM))) { + lastBtn = m_categoryBtnPageM; + m_btnMgr.noHover(true); C_curPage = C_curPage == 1 ? 2 : 1; - if(BTN_LEFT_PRESSED || BTN_MINUS_PRESSED) m_btnMgr.click(m_categoryBtnPageM); - _hideCategorySettings(); - _showCategorySettings(); + if (BTN_LEFT_PRESSED || BTN_MINUS_PRESSED) m_btnMgr.click(m_categoryBtnPageM); + _updateCheckboxes(); } - else if (BTN_PLUS_PRESSED || BTN_RIGHT_PRESSED || (BTN_A_PRESSED && m_btnMgr.selected(m_categoryBtnPageP))) + else if (((BTN_PLUS_PRESSED || BTN_RIGHT_PRESSED) && m_max_categories>11) || (BTN_A_PRESSED && m_btnMgr.selected(m_categoryBtnPageP))) { + lastBtn = m_categoryBtnPageP; + m_btnMgr.noHover(true); C_curPage = C_curPage == 1 ? 2 : 1; if(BTN_RIGHT_PRESSED || BTN_PLUS_PRESSED) m_btnMgr.click(m_categoryBtnPageP); - _hideCategorySettings(); - _showCategorySettings(); + _updateCheckboxes(); } if (BTN_A_PRESSED) { if (m_btnMgr.selected(m_categoryBtnBack)) break; - for (int i = 0; i < 20; ++i) + for (int i = 0; i < 21; ++i) { - if (m_btnMgr.selected(m_categoryBtnCat[i]) || m_btnMgr.selected(m_categoryBtnCats[i])) + if (m_btnMgr.selected(m_categoryBtn[i])) { + lastBtn = m_categoryBtn[i]; + m_btnMgr.noHover(true); m_categories[i] = m_categories[i] == '1' ? '0' : '1'; - if (i == 0 && m_categories[i] == '1') for (int j=1; j<20; ++j) m_categories[j] = '0'; + if (i == 0 && m_categories[i] == '1') for (int j=1; j<21; ++j) m_categories[j] = '0'; else m_categories[0] = '0'; - char catflags[21]; + char catflags[22]; memset(&catflags, 0, sizeof(catflags)); memcpy(&catflags, &m_categories, sizeof(m_categories)); string id(m_cf.getId()); + if (string (catflags) == "000000000000000000000") catflags[0] = '1'; if (gameSet) m_cat.setString("CATEGORIES", id, catflags); - else m_cat.setString("GENERAL", "categories", catflags); - _hideCategorySettings(); - _showCategorySettings(); + else m_cat.setString(_domainFromView(), "categories", catflags); + _updateCheckboxes(); break; } } @@ -133,37 +147,42 @@ void CMenu::_initCategorySettingsMenu(CMenu::SThemeData &theme) m_categoryBg = _texture(theme.texSet, "CATEGORY/BG", "texture", theme.bg); m_categoryLblTitle = _addTitle(theme, "CATEGORY/TITLE", theme.titleFont, L"", 20, 30, 600, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE); m_categoryBtnBack = _addButton(theme, "CATEGORY/BACK_BTN", theme.btnFont, L"", 420, 400, 200, 56, theme.btnFontColor); - m_categoryLblPage = _addLabel(theme, "CATEGORY/PAGE_BTN", theme.btnFont, L"", 76, 400, 100, 56, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC); - m_categoryBtnPageM = _addPicButton(theme, "CATEGORY/PAGE_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 20, 400, 56, 56); - m_categoryBtnPageP = _addPicButton(theme, "CATEGORY/PAGE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 176, 400, 56, 56); - - for (int i = 0; i < 5; i++) - { // Page 1 - m_categoryLblCat[i] = _addLabel(theme, sfmt("CATEGORY/CAT_%i", i).c_str(), theme.lblFont, L"", 125, (100+i*58), 185, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); - m_categoryBtnCat[i] = _addButton(theme, sfmt("CATEGORY/CAT_%i_BTN", i).c_str(), theme.btnFont, L"", 20, (100+i*58), 96, 48, theme.btnFontColor); - m_categoryBtnCats[i] = _addButton(theme, sfmt("CATEGORY/CAT_%i_BTNS", i).c_str(), theme.btnFont, L"", 20, (100+i*58), 96, 48, theme.selsbtnFontColor); - // right half - m_categoryLblCat[i+5] = _addLabel(theme, sfmt("CATEGORY/CAT_%i", i+5).c_str(), theme.txtFont, L"", 425, (100+i*58), 185, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); - m_categoryBtnCat[i+5] = _addButton(theme, sfmt("CATEGORY/CAT_%i_BTN", i+5).c_str(), theme.btnFont, L"", 320, (100+i*58), 96, 48, theme.btnFontColor); - m_categoryBtnCats[i+5] = _addButton(theme, sfmt("CATEGORY/CAT_%i_BTNS", i+5).c_str(), theme.btnFont, L"", 320, (100+i*58), 96, 48, theme.selsbtnFontColor); - // Page 2 - m_categoryLblCat[i+10] = _addLabel(theme, sfmt("CATEGORY/CAT_%i", i+10).c_str(), theme.lblFont, L"", 125, (100+i*58), 185, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); - m_categoryBtnCat[i+10] = _addButton(theme, sfmt("CATEGORY/CAT_%i_BTN", i+10).c_str(), theme.btnFont, L"", 20, (100+i*58), 96, 48, theme.btnFontColor); - m_categoryBtnCats[i+10] = _addButton(theme, sfmt("CATEGORY/CAT_%i_BTNS", i+10).c_str(), theme.btnFont, L"", 20, (100+i*58), 96, 48, theme.selsbtnFontColor); - // right half - m_categoryLblCat[i+15] = _addLabel(theme, sfmt("CATEGORY/CAT_%i", i+15).c_str(), theme.txtFont, L"", 425, (100+i*58), 185, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); - m_categoryBtnCat[i+15] = _addButton(theme, sfmt("CATEGORY/CAT_%i_BTN", i+15).c_str(), theme.btnFont, L"", 320, (100+i*58), 96, 48, theme.btnFontColor); - m_categoryBtnCats[i+15] = _addButton(theme, sfmt("CATEGORY/CAT_%i_BTNS", i+15).c_str(), theme.btnFont, L"", 320, (100+i*58), 96, 48, theme.selsbtnFontColor); + m_categoryLblPage = _addLabel(theme, "CATEGORY/PAGE_BTN", theme.btnFont, L"", 256, 400, 100, 56, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC); + m_categoryBtnPageM = _addPicButton(theme, "CATEGORY/PAGE_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 200, 400, 56, 56); + m_categoryBtnPageP = _addPicButton(theme, "CATEGORY/PAGE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 356, 400, 56, 56); + m_categoryLblCat[0] = _addLabel(theme, "CATEGORY/CAT_0", theme.lblFont, L"", 85, 390, 100, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); + m_categoryBtnCat[0] = _addPicButton(theme, "CATEGORY/CAT_0_BTN", theme.checkboxoff, theme.checkboxoffs, 30, 390, 44, 48); + m_categoryBtnCats[0] = _addPicButton(theme, "CATEGORY/CAT_0_BTNS", theme.checkboxon, theme.checkboxons, 30, 390, 44, 48); + int j = 1; + for (int i = 1; i < 11; i+=2) + { // Page 1 + m_categoryLblCat[i] = _addLabel(theme, sfmt("CATEGORY/CAT_%i", i).c_str(), theme.lblFont, L"", 85, (42+j*58), 230, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); + m_categoryBtnCat[i] = _addPicButton(theme, sfmt("CATEGORY/CAT_%i_BTN", i).c_str(), theme.checkboxoff, theme.checkboxoffs, 30, (42+j*58), 44, 48); + m_categoryBtnCats[i] = _addPicButton(theme, sfmt("CATEGORY/CAT_%i_BTNS", i).c_str(), theme.checkboxon, theme.checkboxons, 30, (42+j*58), 44, 48); + // right half + m_categoryLblCat[i+1] = _addLabel(theme, sfmt("CATEGORY/CAT_%i", i+1).c_str(), theme.txtFont, L"", 380, (42+j*58), 230, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); + m_categoryBtnCat[i+1] = _addPicButton(theme, sfmt("CATEGORY/CAT_%i_BTN", i+1).c_str(), theme.checkboxoff, theme.checkboxoffs, 325, (42+j*58), 44, 48); + m_categoryBtnCats[i+1] = _addPicButton(theme, sfmt("CATEGORY/CAT_%i_BTNS", i+1).c_str(), theme.checkboxon, theme.checkboxons, 325, (42+j*58), 44, 48); + // Page 2 + m_categoryLblCat[i+10] = _addLabel(theme, sfmt("CATEGORY/CAT_%i", i+10).c_str(), theme.lblFont, L"", 85, (42+j*58), 230, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); + m_categoryBtnCat[i+10] = _addPicButton(theme, sfmt("CATEGORY/CAT_%i_BTN", i+10).c_str(), theme.checkboxoff, theme.checkboxoffs, 30, (42+j*58), 44, 48); + m_categoryBtnCats[i+10] = _addPicButton(theme, sfmt("CATEGORY/CAT_%i_BTNS", i+10).c_str(), theme.checkboxon, theme.checkboxons, 30, (42+j*58), 44, 48); + // right half + m_categoryLblCat[i+11] = _addLabel(theme, sfmt("CATEGORY/CAT_%i", i+11).c_str(), theme.txtFont, L"", 380, (42+j*58), 230, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); + m_categoryBtnCat[i+11] = _addPicButton(theme, sfmt("CATEGORY/CAT_%i_BTN", i+11).c_str(), theme.checkboxoff, theme.checkboxoffs, 325, (42+j*58), 44, 48); + m_categoryBtnCats[i+11] = _addPicButton(theme, sfmt("CATEGORY/CAT_%i_BTNS", i+11).c_str(), theme.checkboxon, theme.checkboxons, 325, (42+j*58), 44, 48); + ++j; } _setHideAnim(m_categoryLblTitle, "CATEGORY/TITLE", 0, -200, 0.f, 1.f); _setHideAnim(m_categoryLblPage, "CATEGORY/PAGE_BTN", 0, 200, 1.f, 0.f); _setHideAnim(m_categoryBtnPageM, "CATEGORY/PAGE_MINUS", 0, 200, 1.f, 0.f); _setHideAnim(m_categoryBtnPageP, "CATEGORY/PAGE_PLUS", 0, 200, 1.f, 0.f); _setHideAnim(m_categoryBtnBack, "CATEGORY/BACK_BTN", 0, 200, 1.f, 0.f); - for (int i = 0; i < 20; ++i) { + for (int i = 0; i < 21; ++i) { _setHideAnim(m_categoryBtnCat[i], sfmt("CATEGORY/CAT_%i_BTN", i).c_str(), 0, 0, 1.f, 0.f); _setHideAnim(m_categoryBtnCats[i], sfmt("CATEGORY/CAT_%i_BTNS", i).c_str(), 0, 0, 1.f, 0.f); _setHideAnim(m_categoryLblCat[i], sfmt("CATEGORY/CAT_%i", i).c_str(), 0, 0, 1.f, 0.f); + m_categoryBtn[i] = m_categoryBtnCat[i]; } _hideCategorySettings(true); _textCategorySettings(); @@ -171,14 +190,12 @@ void CMenu::_initCategorySettingsMenu(CMenu::SThemeData &theme) void CMenu::_textCategorySettings(void) { - m_btnMgr.setText(m_categoryLblTitle, _t("cfgg17", L"Categories")); + m_btnMgr.setText(m_categoryLblTitle, _t("", L"Select Categories")); m_btnMgr.setText(m_categoryBtnBack, _t("cd1", L"Back")); - for (int i=0; i<20; ++i) + for (int i=0; i<21; ++i) { if (i == 0) m_btnMgr.setText(m_categoryLblCat[i], _t("dl3", L"All")); else m_btnMgr.setText(m_categoryLblCat[i], m_cat.getWString("GENERAL", fmt("cat%d",i), wfmt(L"Category %i",i).c_str())); - m_btnMgr.setText(m_categoryBtnCat[i], _t("off", L"OFF")); - m_btnMgr.setText(m_categoryBtnCats[i], _t("on", L"ON")); } } diff --git a/source/menu/menu_game.cpp b/source/menu/menu_game.cpp index 85ecb520..95fe08fe 100644 --- a/source/menu/menu_game.cpp +++ b/source/menu/menu_game.cpp @@ -370,7 +370,12 @@ void CMenu::_game(bool launch) m_gameSelected = true; startGameSound = 1; } - + if (BTN_B_PRESSED && (m_btnMgr.selected(m_gameBtnFavoriteOn) || m_btnMgr.selected(m_gameBtnFavoriteOff))) + { + _hideGame(); + _CategorySettings(true); + _showGame(); + } if (BTN_HOME_PRESSED || BTN_B_PRESSED) { m_gameSound.Stop(); diff --git a/source/menu/menu_main.cpp b/source/menu/menu_main.cpp index 01ab237a..2ade992a 100644 --- a/source/menu/menu_main.cpp +++ b/source/menu/menu_main.cpp @@ -271,11 +271,7 @@ int CMenu::main(void) m_current_view = COVERFLOW_HOMEBREW; else if (BTN_RIGHT_PRESSED && show_channel) m_current_view = COVERFLOW_CHANNEL; - if (cv != m_current_view) - { - m_category = m_cat.getInt(_domainFromView(), "category", 0); - LoadView(); - } + if (cv != m_current_view) LoadView(); } if (cv == m_current_view && !m_btnMgr.selected(m_mainBtnChannel) && !m_btnMgr.selected(m_mainBtnUsb) && !m_btnMgr.selected(m_mainBtnDML) && !m_btnMgr.selected(m_mainBtnHomebrew)) { @@ -449,10 +445,7 @@ int CMenu::main(void) { m_cfg.setBool("NAND", "disable", !m_cfg.getBool("NAND", "disable", true)); gprintf("EmuNand is %s\n", m_cfg.getBool("NAND", "disable", true) ? "Disabled" : "Enabled"); - - m_category = m_cat.getInt("NAND", "category", 0); m_current_view = COVERFLOW_CHANNEL; - LoadView(); } else if (m_btnMgr.selected(m_mainBtnNext) || m_btnMgr.selected(m_mainBtnPrev)) @@ -539,7 +532,6 @@ int CMenu::main(void) m_current_view = (show_homebrew && (parental_homebrew || !m_locked)) ? COVERFLOW_HOMEBREW : COVERFLOW_USB; else if (m_current_view == COVERFLOW_HOMEBREW) m_current_view = COVERFLOW_USB; - m_category = m_cat.getInt(_domainFromView(), "category", 0); LoadView(); } else if (m_btnMgr.selected(m_mainBtnInit))