- Categories update.

- now you can have as many categories as you want.
- copied the idea of selected, hidden, and required categories from USB Loader GX. Thanks Cyan. Checkmark = selected, X = Hidden, and + = Required.  
- redid categories.ini layout and renamed it categories_v4.ini so you can copy and paste settings from the old one to the new one. Each view (USB,DML,EMU,NAND,HOMEBREW) has it's own numcategories, category names, and category settings. All games are now seperated based on the view. Don't forget to add 1 to numcategories for the show All mode.
- Replaced All checkbox with CLEAR button which clears all checkboxes so no category is selected and all games will be shown.
- Added features to the Game Selected Categories Menu.  Now the title is the title of the current game. You can now press plus(+) and minus(-) on wiimote to go to the next or previous games without going back to previous screen making it easier to setup categories for your games.
- note: all changes will not be saved in categories_v4.ini unless you exit wiiflow or launch a game.
This commit is contained in:
fledge68 2012-08-31 17:51:49 +00:00
parent 0b4ae96eb6
commit f90a4eedd7
10 changed files with 336 additions and 157 deletions

BIN
data/images/checkboxhid.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
data/images/checkboxreq.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -10,7 +10,7 @@
#define DML_DIR "%s:/games" #define DML_DIR "%s:/games"
#define CFG_FILENAME "wiiflow.ini" #define CFG_FILENAME "wiiflow.ini"
#define LANG_FILENAME "languages.ini" #define LANG_FILENAME "languages.ini"
#define CAT_FILENAME "categories.ini" #define CAT_FILENAME "categories_v4.ini"
#define SOURCE_FILENAME "source_menu.ini" #define SOURCE_FILENAME "source_menu.ini"
#define TITLES_FILENAME "titles.ini" #define TITLES_FILENAME "titles.ini"
#define CTITLES_FILENAME "custom_titles.ini" #define CTITLES_FILENAME "custom_titles.ini"

View File

@ -109,6 +109,8 @@ extern const u8 butzhcnoff_png[];
extern const u8 butzhcnoffs_png[]; extern const u8 butzhcnoffs_png[];
extern const u8 checkbox_png[]; extern const u8 checkbox_png[];
extern const u8 checkboxs_png[]; extern const u8 checkboxs_png[];
extern const u8 checkboxhid_png[];
extern const u8 checkboxreq_png[];
SmartBuf m_wbf1_font; SmartBuf m_wbf1_font;
SmartBuf m_wbf2_font; SmartBuf m_wbf2_font;
@ -460,7 +462,6 @@ void CMenu::init(void)
if (m_cfg.getBool("GENERAL", "favorites_on_startup", false)) if (m_cfg.getBool("GENERAL", "favorites_on_startup", false))
m_favorites = m_cfg.getBool(domain, "favorites", false); m_favorites = m_cfg.getBool(domain, "favorites", false);
m_max_categories = m_cat.getInt("GENERAL", "numcategories", 21);
m_bnr_settings = m_cfg.getBool("GENERAL", "banner_in_settings", true); m_bnr_settings = m_cfg.getBool("GENERAL", "banner_in_settings", true);
@ -1038,6 +1039,14 @@ void CMenu::_buildMenus(void)
theme.checkboxon = _texture(theme.texSet, "GENERAL", "checkbox_on", theme.checkboxon); theme.checkboxon = _texture(theme.texSet, "GENERAL", "checkbox_on", theme.checkboxon);
theme.checkboxons.fromPNG(checkboxs_png); theme.checkboxons.fromPNG(checkboxs_png);
theme.checkboxons = _texture(theme.texSet, "GENERAL", "checkbox_on_selected", theme.checkboxons); theme.checkboxons = _texture(theme.texSet, "GENERAL", "checkbox_on_selected", theme.checkboxons);
theme.checkboxHid.fromPNG(checkboxhid_png);
theme.checkboxHid = _texture(theme.texSet, "GENERAL", "checkbox_Hid", theme.checkboxHid);
theme.checkboxHids.fromPNG(checkboxhid_png);
theme.checkboxHids = _texture(theme.texSet, "GENERAL", "checkbox_Hid_selected", theme.checkboxHids);
theme.checkboxReq.fromPNG(checkboxreq_png);
theme.checkboxReq = _texture(theme.texSet, "GENERAL", "checkbox_Req", theme.checkboxReq);
theme.checkboxReqs.fromPNG(checkboxreq_png);
theme.checkboxReqs = _texture(theme.texSet, "GENERAL", "checkbox_Req_selected", theme.checkboxReqs);
theme.pbarTexL.fromPNG(pbarleft_png); theme.pbarTexL.fromPNG(pbarleft_png);
theme.pbarTexL = _texture(theme.texSet, "GENERAL", "progressbar_texture_left", theme.pbarTexL); theme.pbarTexL = _texture(theme.texSet, "GENERAL", "progressbar_texture_left", theme.pbarTexL);
@ -1511,8 +1520,10 @@ void CMenu::_initCF(void)
Config dump, gameAgeList; Config dump, gameAgeList;
GameTDB gametdb; GameTDB gametdb;
const char *domain = _domainFromView(); const char *domain = _domainFromView();
m_cf.clear(); m_cf.clear();
m_cf.reserve(m_gameList.size()); m_cf.reserve(m_gameList.size());
vector<bool> EnabledPlugins; vector<bool> EnabledPlugins;
if(m_current_view == COVERFLOW_EMU) if(m_current_view == COVERFLOW_EMU)
EnabledPlugins = m_plugin.GetEnabledPlugins(m_cfg); EnabledPlugins = m_plugin.GetEnabledPlugins(m_cfg);
@ -1521,6 +1532,7 @@ void CMenu::_initCF(void)
if(dumpGameLst) dump.load(fmt("%s/" TITLES_DUMP_FILENAME, m_settingsDir.c_str())); if(dumpGameLst) dump.load(fmt("%s/" TITLES_DUMP_FILENAME, m_settingsDir.c_str()));
m_gcfg1.load(fmt("%s/" GAME_SETTINGS1_FILENAME, m_settingsDir.c_str())); m_gcfg1.load(fmt("%s/" GAME_SETTINGS1_FILENAME, m_settingsDir.c_str()));
int ageLock = m_cfg.getInt("GENERAL", "age_lock"); int ageLock = m_cfg.getInt("GENERAL", "age_lock");
if (ageLock < 2 || ageLock > 19) if (ageLock < 2 || ageLock > 19)
ageLock = 19; ageLock = 19;
@ -1534,7 +1546,18 @@ void CMenu::_initCF(void)
gametdb.SetLanguageCode(m_loc.getString(m_curLanguage, "gametdb_code", "EN").c_str()); gametdb.SetLanguageCode(m_loc.getString(m_curLanguage, "gametdb_code", "EN").c_str());
} }
} }
const char *catviews = m_cat.getString(domain, "categories", "100000000000000000000").c_str();
m_max_categories = m_cat.getInt(fmt("%s/GENERAL", domain), "numcategories", 6);
string catDef = "1";
catDef.append(m_max_categories - 1, '0');
string catSettings = m_cat.getString(fmt("%s/GENERAL", domain), "categories", catDef).c_str();
if (catSettings.length() < m_max_categories)
{
catSettings.append((m_max_categories - catSettings.length()), '0');
m_cat.setString(fmt("%s/GENERAL", domain), "categories", catSettings);
}
const char *categories = m_cat.getString(fmt("%s/GENERAL", domain), "categories").c_str();
for (u32 i = 0; i < m_gameList.size(); ++i) for (u32 i = 0; i < m_gameList.size(); ++i)
{ {
string id; string id;
@ -1577,13 +1600,6 @@ void CMenu::_initCF(void)
id = string(m_gameList[i].id); id = string(m_gameList[i].id);
} }
string idcats = m_cat.getString("CATEGORIES", id, "").c_str();
if (idcats.length() < 21 && idcats.length() > 0)
{
idcats.append((21-idcats.length()), '0');
m_cat.setString("CATEGORIES", id, idcats);
}
bool ageLocked = false; bool ageLocked = false;
if (ageLock < 19) if (ageLock < 19)
{ {
@ -1661,23 +1677,54 @@ void CMenu::_initCF(void)
&& (!m_locked || !m_gcfg1.getBool("ADULTONLY", id, false)) && (!m_locked || !m_gcfg1.getBool("ADULTONLY", id, false))
&& !ageLocked) && !ageLocked)
{ {
if(catviews[0] == '0') string idcats = m_cat.getString(domain, id, catDef).c_str();
if (idcats.length() < m_max_categories)
{ {
const char *idcats = m_cat.getString("CATEGORIES", id, "").c_str(); idcats.append((m_max_categories - idcats.length()), '0');
if(strlen(idcats) == 0) m_cat.setString(domain, id, idcats);
}
if(categories[0] == '0')// if '1' skip checking cats and show all games
{
const char *idCats = m_cat.getString(domain, id).c_str();
bool inaCat = false;
bool inHiddenCat = false;
bool noHiddenCats = true;
bool SelectedCats = false;
int reqCount = 0;
int reqMatch = 0;
for(u8 j = 1; j < m_max_categories; ++j)
{
if(categories[j] == '3')
{
reqCount++;
if(idCats[j] == '1')
reqMatch++;
inaCat = true;
}
else if(categories[j] == '1')
{
SelectedCats = true;
if(idCats[j] == '1')
inaCat = true;
}
else if(categories[j] == '2')
{
noHiddenCats = false;
if(idCats[j] == '1')
inHiddenCat = true;
}
}
//continue; means don't add game to list (don't show)
if(inHiddenCat)
continue; continue;
else if(reqCount != reqMatch)
continue;
if(!inaCat)
{ {
bool idinacat = false; if(noHiddenCats)
for(u32 j = 1; j<m_max_categories; ++j) continue;
{ else if(SelectedCats)
if(catviews[j] == '1' && idcats[j] == '1')
{
idinacat = true;
break;
}
}
if(!idinacat)
continue; continue;
} }
} }

View File

@ -139,7 +139,6 @@ private:
STexture m_gameSettingsBg; STexture m_gameSettingsBg;
STexture m_gameBgLQ; STexture m_gameBgLQ;
STexture m_mainBgLQ; STexture m_mainBgLQ;
STexture m_categoryBg;
//Main Coverflow //Main Coverflow
u16 m_mainBtnConfig; u16 m_mainBtnConfig;
u16 m_mainBtnInfo; u16 m_mainBtnInfo;
@ -556,18 +555,6 @@ private:
STexture m_wifi; STexture m_wifi;
STexture m_controlsreq[4]; STexture m_controlsreq[4];
STexture m_controls[4]; STexture m_controls[4];
// Category menu
u16 m_categoryLblPage;
u16 m_categoryBtnPageM;
u16 m_categoryBtnPageP;
u16 m_categoryBtnBack;
u16 m_categoryLblTitle;
u16 m_categoryLblCat[21];
u16 m_categoryBtn[21];
u16 m_categoryBtnCat[21];
u16 m_categoryBtnCats[21];
u16 m_categoryLblUser[4];
u8 m_max_categories;
// NandEmulation // NandEmulation
string m_saveExtGameId; string m_saveExtGameId;
bool m_forceext; bool m_forceext;
@ -680,7 +667,7 @@ private:
lwp_t m_gameSoundThread; lwp_t m_gameSoundThread;
bool m_gamesound_changed; bool m_gamesound_changed;
u8 m_bnrSndVol; u8 m_bnrSndVol;
u8 m_max_categories;
bool m_video_playing; bool m_video_playing;
private: private:
@ -775,6 +762,10 @@ private:
STexture checkboxoffs; STexture checkboxoffs;
STexture checkboxon; STexture checkboxon;
STexture checkboxons; STexture checkboxons;
STexture checkboxHid;
STexture checkboxHids;
STexture checkboxReq;
STexture checkboxReqs;
STexture pbarTexL; STexture pbarTexL;
STexture pbarTexR; STexture pbarTexR;
STexture pbarTexC; STexture pbarTexC;

View File

@ -3,183 +3,129 @@
#include <string.h> #include <string.h>
#include <gccore.h> #include <gccore.h>
u8 m_categories[21]; // Category menu
u32 C_curPage; u16 m_categoryLblPage;
bool gameSet; u16 m_categoryBtnPageM;
u16 m_categoryBtnPageP;
u16 m_categoryBtnClear;
u16 m_categoryBtnBack;
u16 m_categoryLblTitle;
u16 m_categoryLblCat[11];
u16 m_categoryBtnCat[11];
u16 m_categoryBtnCats[11];
u16 m_categoryBtnCatHid[11];
u16 m_categoryBtnCatReq[11];
u16 m_categoryLblUser[4];
STexture m_categoryBg;
u8 m_categories[51];
u8 curPage;
u8 lastBtn; u8 lastBtn;
const char *catSettings;
string id;
bool gameSet;
void CMenu::_hideCategorySettings(bool instant) void CMenu::_hideCategorySettings(bool instant)
{ {
m_btnMgr.hide(m_categoryLblTitle, instant); m_btnMgr.hide(m_categoryLblTitle, instant);
m_btnMgr.hide(m_categoryBtnBack, instant);
m_btnMgr.hide(m_categoryLblPage, instant); m_btnMgr.hide(m_categoryLblPage, instant);
m_btnMgr.hide(m_categoryBtnPageM, instant); m_btnMgr.hide(m_categoryBtnPageM, instant);
m_btnMgr.hide(m_categoryBtnPageP, instant); m_btnMgr.hide(m_categoryBtnPageP, instant);
m_btnMgr.hide(m_categoryBtnClear, instant);
m_btnMgr.hide(m_categoryBtnBack, instant);
for(u8 i = 0; i < ARRAY_SIZE(m_categoryLblUser); ++i) for(u8 i = 0; i < ARRAY_SIZE(m_categoryLblUser); ++i)
{ {
if(m_categoryLblUser[i] != (u16)-1u) if(m_categoryLblUser[i] != (u16)-1u)
m_btnMgr.hide(m_categoryLblUser[i], instant); m_btnMgr.hide(m_categoryLblUser[i], instant);
} }
for(int i = 0; i < 21; ++i) for(int i = 1; i < 11; ++i)
{ {
m_btnMgr.hide(m_categoryLblCat[i]); m_btnMgr.hide(m_categoryLblCat[i]);
m_btnMgr.hide(m_categoryBtnCat[i]); m_btnMgr.hide(m_categoryBtnCat[i]);
m_btnMgr.hide(m_categoryBtnCats[i]); m_btnMgr.hide(m_categoryBtnCats[i]);
m_btnMgr.hide(m_categoryBtnCatHid[i]);
m_btnMgr.hide(m_categoryBtnCatReq[i]);
} }
} }
void CMenu::_showCategorySettings(void) void CMenu::_showCategorySettings(void)
{ {
_setBg(m_categoryBg, m_categoryBg); _setBg(m_categoryBg, m_categoryBg);
for(u8 i = 0; i < ARRAY_SIZE(m_categoryLblUser); ++i) for(u8 i = 0; i < ARRAY_SIZE(m_categoryLblUser); ++i)
{ {
if(m_categoryLblUser[i] != (u16)-1) if(m_categoryLblUser[i] != (u16)-1)
m_btnMgr.show(m_categoryLblUser[i]); m_btnMgr.show(m_categoryLblUser[i]);
} }
m_btnMgr.show(m_categoryLblTitle); m_btnMgr.show(m_categoryLblTitle);
m_btnMgr.show(m_categoryBtnClear);
m_btnMgr.show(m_categoryBtnBack); m_btnMgr.show(m_categoryBtnBack);
_updateCheckboxes(); _updateCheckboxes();
} }
void CMenu::_updateCheckboxes(void) void CMenu::_updateCheckboxes(void)
{ {
if(m_max_categories > 10) for(u8 i = 1; i < 11; ++i)
{ {
m_btnMgr.setText(m_categoryLblPage, wfmt(L"%i / 2", C_curPage)); m_btnMgr.hide(m_categoryBtnCat[i], true);
m_btnMgr.hide(m_categoryBtnCats[i], true);
m_btnMgr.hide(m_categoryBtnCatHid[i], true);
m_btnMgr.hide(m_categoryBtnCatReq[i], true);
m_btnMgr.hide(m_categoryLblCat[i], true);
}
if(m_max_categories > 11)
{
m_btnMgr.setText(m_categoryLblPage, wfmt(L"%i / %i", curPage, ((m_max_categories - 2) / 10) + 1));
m_btnMgr.show(m_categoryLblPage); m_btnMgr.show(m_categoryLblPage);
m_btnMgr.show(m_categoryBtnPageM); m_btnMgr.show(m_categoryBtnPageM);
m_btnMgr.show(m_categoryBtnPageP); m_btnMgr.show(m_categoryBtnPageP);
} }
for(u8 i = 0; i < 21; ++i)
{
m_btnMgr.hide(m_categoryBtnCat[i]);
m_btnMgr.hide(m_categoryBtnCats[i]);
m_btnMgr.hide(m_categoryLblCat[i]);
}
const char *catflags;
if (gameSet)
{
string id;
if(m_current_view != COVERFLOW_EMU)
id = m_cf.getId();
else
{
dir_discHdr *hdr = m_cf.getHdr();
string tempname(hdr->path);
tempname.erase(0, tempname.find_first_of('/')+1);
string dirName = tempname.substr(0, tempname.find_first_of('/')+1);
tempname.assign(&tempname[tempname.find_last_of('/') + 1]);
if(tempname.find_last_of('.') != string::npos)
tempname.erase(tempname.find_last_of('.'), tempname.size() - tempname.find_last_of('.'));
id = dirName+tempname;
}
catflags = m_cat.getString("CATEGORIES", id, "").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 = 1; i < 11; ++i)
{ {
int j = 11; int j = i + ((curPage - 1) * 10);
if(m_max_categories < 11) if(j == m_max_categories)
j = m_max_categories; break;
for(int i = 0; i < j; ++i) if(m_categories[0] == '1' && !gameSet)
{
if(i == 0 && gameSet)
continue;
if(catflags[i] == '1')
m_btnMgr.show(m_categoryBtnCats[i]);
else
m_btnMgr.show(m_categoryBtnCat[i]); m_btnMgr.show(m_categoryBtnCat[i]);
else
{
switch(m_categories[j])
{
case '0':
m_btnMgr.show(m_categoryBtnCat[i]);
break;
case '1':
m_btnMgr.show(m_categoryBtnCats[i]);
break;
case '2':
m_btnMgr.show(m_categoryBtnCatHid[i]);
break;
default:
m_btnMgr.show(m_categoryBtnCatReq[i]);
break;
}
}
m_btnMgr.setText(m_categoryLblCat[i], m_cat.getWString(fmt("%s/GENERAL", _domainFromView()), fmt("cat%d",j), wfmt(L"Category %i",j).c_str()));
m_btnMgr.show(m_categoryLblCat[i]); m_btnMgr.show(m_categoryLblCat[i]);
} }
}
else
{
for(int i = 11; i < m_max_categories; ++i)
{
if(catflags[i] == '1')
m_btnMgr.show(m_categoryBtnCats[i]);
else
m_btnMgr.show(m_categoryBtnCat[i]);
m_btnMgr.show(m_categoryLblCat[i]);
}
}
} }
void CMenu::_CategorySettings(bool fromGameSet) void CMenu::_CategorySettings(bool fromGameSet)
{ {
SetupInput(); SetupInput();
C_curPage = 1; curPage = 1;
gameSet = fromGameSet; gameSet = fromGameSet;
_showCategorySettings();
while(true) if(fromGameSet)
{ {
_mainLoopCommon();
if(!m_btnMgr.selected(lastBtn))
m_btnMgr.noHover(false);
if(BTN_HOME_PRESSED || BTN_B_PRESSED)
{
m_cat.save();
break;
}
else if(BTN_UP_PRESSED)
m_btnMgr.up();
else if(BTN_DOWN_PRESSED)
m_btnMgr.down();
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);
_updateCheckboxes();
}
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);
_updateCheckboxes();
}
if(BTN_A_PRESSED)
{
if(m_btnMgr.selected(m_categoryBtnBack))
{
m_cat.save();
break;
}
for(int i = 0; i < 21; ++i)
{
if(m_btnMgr.selected(m_categoryBtnCat[i]) || m_btnMgr.selected(m_categoryBtnCats[i]))
{
lastBtn = m_categoryBtnCat[i];
if(m_btnMgr.selected(m_categoryBtnCats[i]))
lastBtn = m_categoryBtnCats[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 < 21; ++j)
m_categories[j] = '0';
}
else
m_categories[0] = '0';
char catflags[22];
memset(&catflags, 0, sizeof(catflags));
memcpy(&catflags, &m_categories, sizeof(m_categories));
if(string (catflags) == "000000000000000000000")
catflags[0] = '1';
if (gameSet)
{
string id;
if(m_current_view != COVERFLOW_EMU) if(m_current_view != COVERFLOW_EMU)
id = m_cf.getId(); id = m_cf.getId();
else else
@ -193,11 +139,212 @@ void CMenu::_CategorySettings(bool fromGameSet)
tempname.erase(tempname.find_last_of('.'), tempname.size() - tempname.find_last_of('.')); tempname.erase(tempname.find_last_of('.'), tempname.size() - tempname.find_last_of('.'));
id = dirName+tempname; id = dirName+tempname;
} }
m_cat.setString("CATEGORIES", id, catflags); catSettings = m_cat.getString(_domainFromView(), id, "").c_str();
m_btnMgr.setText(m_categoryLblTitle, m_cf.getTitle());
} }
else else
m_cat.setString(_domainFromView(), "categories", catflags); {
catSettings = m_cat.getString(fmt("%s/GENERAL", _domainFromView()), "categories").c_str();
m_btnMgr.setText(m_categoryLblTitle, _t("cat1", L"Select Categories"));
}
memset(&m_categories, '0', m_max_categories);
memcpy(&m_categories, catSettings, m_max_categories);
_showCategorySettings();
while(true)
{
_mainLoopCommon();
m_cf.tick();
if(!m_btnMgr.selected(lastBtn))
m_btnMgr.noHover(false);
if(BTN_HOME_PRESSED || BTN_B_PRESSED || (BTN_A_PRESSED && m_btnMgr.selected(m_categoryBtnBack)))
{
char newCatSettings[m_max_categories + 1];
memset(&newCatSettings, 0, sizeof(newCatSettings));
memcpy(&newCatSettings, &m_categories, sizeof(m_categories));
if(!fromGameSet)
{
newCatSettings[0] = '1';
for(u8 i = 1; i < m_max_categories; i++)
{
if(newCatSettings[i] != '0')
{
newCatSettings[0] = '0';
break;
}
}
m_cat.setString(fmt("%s/GENERAL", _domainFromView()), "categories", newCatSettings);
}
else
m_cat.setString(_domainFromView(), id, newCatSettings);
//m_cat.save();
break;
}
else if(BTN_UP_PRESSED)
m_btnMgr.up();
else if(BTN_DOWN_PRESSED)
m_btnMgr.down();
if(BTN_PLUS_PRESSED && fromGameSet)
{
char newCatSettings[m_max_categories + 1];
memset(&newCatSettings, 0, sizeof(newCatSettings));
memcpy(&newCatSettings, &m_categories, sizeof(m_categories));
m_cat.setString(_domainFromView(), id, newCatSettings);
_hideCategorySettings();
m_cf.right();
curPage = 1;
if(m_current_view != COVERFLOW_EMU)
id = m_cf.getId();
else
{
dir_discHdr *hdr = m_cf.getHdr();
string tempname(hdr->path);
tempname.erase(0, tempname.find_first_of('/')+1);
string dirName = tempname.substr(0, tempname.find_first_of('/')+1);
tempname.assign(&tempname[tempname.find_last_of('/') + 1]);
if(tempname.find_last_of('.') != string::npos)
tempname.erase(tempname.find_last_of('.'), tempname.size() - tempname.find_last_of('.'));
id = dirName+tempname;
}
catSettings = m_cat.getString(_domainFromView(), id, "").c_str();
m_btnMgr.setText(m_categoryLblTitle, m_cf.getTitle());
memset(&m_categories, '0', m_max_categories);
memcpy(&m_categories, catSettings, m_max_categories);
_showCategorySettings();
}
if(BTN_MINUS_PRESSED && fromGameSet)
{
char newCatSettings[m_max_categories + 1];
memset(&newCatSettings, 0, sizeof(newCatSettings));
memcpy(&newCatSettings, &m_categories, sizeof(m_categories));
m_cat.setString(_domainFromView(), id, newCatSettings);
_hideCategorySettings();
m_cf.left();
curPage = 1;
if(m_current_view != COVERFLOW_EMU)
id = m_cf.getId();
else
{
dir_discHdr *hdr = m_cf.getHdr();
string tempname(hdr->path);
tempname.erase(0, tempname.find_first_of('/')+1);
string dirName = tempname.substr(0, tempname.find_first_of('/')+1);
tempname.assign(&tempname[tempname.find_last_of('/') + 1]);
if(tempname.find_last_of('.') != string::npos)
tempname.erase(tempname.find_last_of('.'), tempname.size() - tempname.find_last_of('.'));
id = dirName+tempname;
}
catSettings = m_cat.getString(_domainFromView(), id, "").c_str();
m_btnMgr.setText(m_categoryLblTitle, m_cf.getTitle());
memset(&m_categories, '0', m_max_categories);
memcpy(&m_categories, catSettings, m_max_categories);
_showCategorySettings();
}
if((BTN_LEFT_PRESSED && m_max_categories>11) || (BTN_A_PRESSED && m_btnMgr.selected(m_categoryBtnPageM)))
{
lastBtn = m_categoryBtnPageM;
m_btnMgr.noHover(true);
curPage--;
if(curPage < 1)
curPage = ((m_max_categories - 2) / 10) + 1;
if(BTN_LEFT_PRESSED || BTN_MINUS_PRESSED)
m_btnMgr.click(m_categoryBtnPageM);
_updateCheckboxes(); _updateCheckboxes();
}
else if((BTN_RIGHT_PRESSED && m_max_categories>11) || (BTN_A_PRESSED && m_btnMgr.selected(m_categoryBtnPageP)))
{
lastBtn = m_categoryBtnPageP;
m_btnMgr.noHover(true);
curPage++;
if(curPage > ((m_max_categories - 2) / 10) + 1)
curPage = 1;
if(BTN_RIGHT_PRESSED || BTN_PLUS_PRESSED)
m_btnMgr.click(m_categoryBtnPageP);
_updateCheckboxes();
}
if(BTN_A_PRESSED)
{
if(m_btnMgr.selected(m_categoryBtnClear))
{
m_categories[0] = '1';
for(int j = 1; j < m_max_categories; ++j)
m_categories[j] = '0';
_updateCheckboxes();
}
for(int i = 1; i < 11; ++i)
{
if(m_btnMgr.selected(m_categoryBtnCat[i]) || m_btnMgr.selected(m_categoryBtnCats[i]) || m_btnMgr.selected(m_categoryBtnCatHid[i]) || m_btnMgr.selected(m_categoryBtnCatReq[i]))
{
lastBtn = m_categoryBtnCat[i];
if(m_btnMgr.selected(m_categoryBtnCats[i]))
lastBtn = m_categoryBtnCats[i];
else if(m_btnMgr.selected(m_categoryBtnCatHid[i]))
lastBtn = m_categoryBtnCatHid[i];
else if(m_btnMgr.selected(m_categoryBtnCatReq[i]))
lastBtn = m_categoryBtnCatReq[i];
m_btnMgr.noHover(true);
int j = i + ((curPage - 1) * 10);
if(fromGameSet)
{
m_categories[j] = m_categories[j] == '0' ? '1' : '0';
}
else
{
m_categories[j] = m_categories[j] == '0' ? '1' : m_categories[j] == '1' ? '2' : m_categories[j] == '2' ? '3' : '0';
if(m_categories[0] == '1' && m_categories[j] != '0')
m_categories[0] = '0';
}
m_btnMgr.hide(m_categoryBtnCat[i], true);
m_btnMgr.hide(m_categoryBtnCats[i], true);
m_btnMgr.hide(m_categoryBtnCatHid[i], true);
m_btnMgr.hide(m_categoryBtnCatReq[i], true);
if(m_categories[0] =='1' && !fromGameSet)
m_btnMgr.show(m_categoryBtnCat[i]);
else
{
switch(m_categories[j])
{
case '0':
m_btnMgr.show(m_categoryBtnCat[i]);
break;
case '1':
m_btnMgr.show(m_categoryBtnCats[i]);
break;
case '2':
m_btnMgr.show(m_categoryBtnCatHid[i]);
break;
default:
m_btnMgr.show(m_categoryBtnCatReq[i]);
break;
}
}
break; break;
} }
} }
@ -211,40 +358,39 @@ void CMenu::_initCategorySettingsMenu(CMenu::SThemeData &theme)
_addUserLabels(theme, m_categoryLblUser, ARRAY_SIZE(m_categoryLblUser), "CATEGORY"); _addUserLabels(theme, m_categoryLblUser, ARRAY_SIZE(m_categoryLblUser), "CATEGORY");
m_categoryBg = _texture(theme.texSet, "CATEGORY/BG", "texture", theme.bg); 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_categoryLblTitle = _addTitle(theme, "CATEGORY/TITLE", theme.titleFont, L"", 20, 30, 600, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE);
m_categoryBtnPageM = _addPicButton(theme, "CATEGORY/PAGE_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 20, 400, 56, 56);
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_categoryBtnPageP = _addPicButton(theme, "CATEGORY/PAGE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 176, 400, 56, 56);
m_categoryBtnBack = _addButton(theme, "CATEGORY/BACK_BTN", theme.btnFont, L"", 420, 400, 200, 56, theme.btnFontColor); 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"", 256, 400, 100, 56, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC); m_categoryBtnClear = _addButton(theme, "CATEGORY/CLEAR_BTN", theme.btnFont, L"", 255, 400, 150, 56, theme.btnFontColor);
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_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);
m_categoryLblCat[0] = _addLabel(theme, "CATEGORY/CAT_0", theme.lblFont, L"", 85, 390, 100, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
for(int i = 1; i < 6; ++i) for(int i = 1; i < 6; ++i)
{ // Page 1 { // left half
m_categoryBtnCat[i] = _addPicButton(theme, fmt("CATEGORY/CAT_%i_BTN", i), theme.checkboxoff, theme.checkboxoffs, 30, (42+i*58), 44, 48); m_categoryBtnCat[i] = _addPicButton(theme, fmt("CATEGORY/CAT_%i_BTN", i), theme.checkboxoff, theme.checkboxoffs, 30, (42+i*58), 44, 48);
m_categoryBtnCats[i] = _addPicButton(theme, fmt("CATEGORY/CAT_%i_BTNS", i), theme.checkboxon, theme.checkboxons, 30, (42+i*58), 44, 48); m_categoryBtnCats[i] = _addPicButton(theme, fmt("CATEGORY/CAT_%i_BTNS", i), theme.checkboxon, theme.checkboxons, 30, (42+i*58), 44, 48);
m_categoryBtnCatHid[i] = _addPicButton(theme, fmt("CATEGORY/CAT_%i_BTNHID", i), theme.checkboxHid, theme.checkboxHids, 30, (42+i*58), 44, 48);
m_categoryBtnCatReq[i] = _addPicButton(theme, fmt("CATEGORY/CAT_%i_BTNREQ", i), theme.checkboxReq, theme.checkboxReqs, 30, (42+i*58), 44, 48);
m_categoryLblCat[i] = _addLabel(theme, fmt("CATEGORY/CAT_%i", i), theme.lblFont, L"", 85, (42+i*58), 230, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_categoryLblCat[i] = _addLabel(theme, fmt("CATEGORY/CAT_%i", i), theme.lblFont, L"", 85, (42+i*58), 230, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
// right half // right half
m_categoryBtnCat[i+5] = _addPicButton(theme, fmt("CATEGORY/CAT_%i_BTN", i+5), theme.checkboxoff, theme.checkboxoffs, 325, (42+i*58), 44, 48); m_categoryBtnCat[i+5] = _addPicButton(theme, fmt("CATEGORY/CAT_%i_BTN", i+5), theme.checkboxoff, theme.checkboxoffs, 325, (42+i*58), 44, 48);
m_categoryBtnCats[i+5] = _addPicButton(theme, fmt("CATEGORY/CAT_%i_BTNS", i+5), theme.checkboxon, theme.checkboxons, 325, (42+i*58), 44, 48); m_categoryBtnCats[i+5] = _addPicButton(theme, fmt("CATEGORY/CAT_%i_BTNS", i+5), theme.checkboxon, theme.checkboxons, 325, (42+i*58), 44, 48);
m_categoryBtnCatHid[i+5] = _addPicButton(theme, fmt("CATEGORY/CAT_%i_BTNHID", i+5), theme.checkboxHid, theme.checkboxHids, 325, (42+i*58), 44, 48);
m_categoryBtnCatReq[i+5] = _addPicButton(theme, fmt("CATEGORY/CAT_%i_BTNREQ", i+5), theme.checkboxReq, theme.checkboxReqs, 325, (42+i*58), 44, 48);
m_categoryLblCat[i+5] = _addLabel(theme, fmt("CATEGORY/CAT_%i", i+5), theme.txtFont, L"", 380, (42+i*58), 230, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_categoryLblCat[i+5] = _addLabel(theme, fmt("CATEGORY/CAT_%i", i+5), theme.txtFont, L"", 380, (42+i*58), 230, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
// Page 2
m_categoryBtnCat[i+10] = _addPicButton(theme, fmt("CATEGORY/CAT_%i_BTN", i+10), theme.checkboxoff, theme.checkboxoffs, 30, (42+i*58), 44, 48);
m_categoryBtnCats[i+10] = _addPicButton(theme, fmt("CATEGORY/CAT_%i_BTNS", i+10), theme.checkboxon, theme.checkboxons, 30, (42+i*58), 44, 48);
m_categoryLblCat[i+10] = _addLabel(theme, fmt("CATEGORY/CAT_%i", i+10), theme.lblFont, L"", 85, (42+i*58), 230, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
// right half
m_categoryBtnCat[i+15] = _addPicButton(theme, fmt("CATEGORY/CAT_%i_BTN", i+15), theme.checkboxoff, theme.checkboxoffs, 325, (42+i*58), 44, 48);
m_categoryBtnCats[i+15] = _addPicButton(theme, fmt("CATEGORY/CAT_%i_BTNS", i+15), theme.checkboxon, theme.checkboxons, 325, (42+i*58), 44, 48);
m_categoryLblCat[i+15] = _addLabel(theme, fmt("CATEGORY/CAT_%i", i+15), theme.txtFont, L"", 380, (42+i*58), 230, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
} }
_setHideAnim(m_categoryLblTitle, "CATEGORY/TITLE", 0, 0, -2.f, 0.f); _setHideAnim(m_categoryLblTitle, "CATEGORY/TITLE", 0, 0, -2.f, 0.f);
_setHideAnim(m_categoryLblPage, "CATEGORY/PAGE_BTN", 0, 0, 1.f, -1.f); _setHideAnim(m_categoryLblPage, "CATEGORY/PAGE_BTN", 0, 0, 1.f, -1.f);
_setHideAnim(m_categoryBtnPageM, "CATEGORY/PAGE_MINUS", 0, 0, 1.f, -1.f); _setHideAnim(m_categoryBtnPageM, "CATEGORY/PAGE_MINUS", 0, 0, 1.f, -1.f);
_setHideAnim(m_categoryBtnPageP, "CATEGORY/PAGE_PLUS", 0, 0, 1.f, -1.f); _setHideAnim(m_categoryBtnPageP, "CATEGORY/PAGE_PLUS", 0, 0, 1.f, -1.f);
_setHideAnim(m_categoryBtnClear, "CATEGORY/CLEAR_BTN", 0, 0, 1.f, -1.f);
_setHideAnim(m_categoryBtnBack, "CATEGORY/BACK_BTN", 0, 0, 1.f, -1.f); _setHideAnim(m_categoryBtnBack, "CATEGORY/BACK_BTN", 0, 0, 1.f, -1.f);
for(int i = 0; i < 21; ++i)
for(int i = 1; i < 11; ++i)
{ {
_setHideAnim(m_categoryBtnCat[i], fmt("CATEGORY/CAT_%i_BTN", i), 0, 0, 1.f, 0.f); _setHideAnim(m_categoryBtnCat[i], fmt("CATEGORY/CAT_%i_BTN", i), 0, 0, 1.f, 0.f);
_setHideAnim(m_categoryBtnCats[i], fmt("CATEGORY/CAT_%i_BTNS", i), 0, 0, 1.f, 0.f); _setHideAnim(m_categoryBtnCats[i], fmt("CATEGORY/CAT_%i_BTNS", i), 0, 0, 1.f, 0.f);
_setHideAnim(m_categoryBtnCatHid[i], fmt("CATEGORY/CAT_%i_BTNHID", i), 0, 0, 1.f, 0.f);
_setHideAnim(m_categoryBtnCatReq[i], fmt("CATEGORY/CAT_%i_BTNREQ", i), 0, 0, 1.f, 0.f);
_setHideAnim(m_categoryLblCat[i], fmt("CATEGORY/CAT_%i", i), 0, 0, 1.f, 0.f); _setHideAnim(m_categoryLblCat[i], fmt("CATEGORY/CAT_%i", i), 0, 0, 1.f, 0.f);
} }
_hideCategorySettings(true); _hideCategorySettings(true);
@ -253,13 +399,6 @@ void CMenu::_initCategorySettingsMenu(CMenu::SThemeData &theme)
void CMenu::_textCategorySettings(void) void CMenu::_textCategorySettings(void)
{ {
m_btnMgr.setText(m_categoryLblTitle, _t("cfgg17", L"Select Categories")); m_btnMgr.setText(m_categoryBtnClear, _t("cat2", L"Clear"));
m_btnMgr.setText(m_categoryBtnBack, _t("cd1", L"Back")); m_btnMgr.setText(m_categoryBtnBack, _t("cd1", L"Back"));
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()));
}
} }

View File

@ -717,7 +717,7 @@ int CMenu::main(void)
} }
} }
if(done==0 && m_cat.getBool("GENERAL", "category_on_start", false)) if(done==0 && m_cfg.getBool("GENERAL", "category_on_start", false))
{ {
done = 1; //set done so it doesnt keep doing it done = 1; //set done so it doesnt keep doing it
// show categories menu // show categories menu

View File

@ -453,11 +453,11 @@ void CMenu::_initSourceMenu(CMenu::SThemeData &theme)
_setHideAnim(m_sourceBtnUsb, "SOURCE/USB_BTN", 0, 40, 0.f, 0.f); _setHideAnim(m_sourceBtnUsb, "SOURCE/USB_BTN", 0, 40, 0.f, 0.f);
_setHideAnim(m_sourceBtnDML, "SOURCE/DML_BTN", 0, 40, 0.f, 0.f); _setHideAnim(m_sourceBtnDML, "SOURCE/DML_BTN", 0, 40, 0.f, 0.f);
_setHideAnim(m_sourceBtnEmu, "SOURCE/EMU_BTN", 0, 40, 0.f, 0.f); _setHideAnim(m_sourceBtnEmu, "SOURCE/EMU_BTN", 0, 40, 0.f, 0.f);
_setHideAnim(m_sourceLblTitle, "SOURCE/TITLE", 0, -200, 0.f, 1.f); _setHideAnim(m_sourceLblTitle, "SOURCE/TITLE", 0, 0, -2.f, 0.f);
_setHideAnim(m_sourceLblNotice, "SOURCE/NOTICE", 0, 0, 1.f, 0.f); _setHideAnim(m_sourceLblNotice, "SOURCE/NOTICE", 0, 0, 1.f, 0.f);
_setHideAnim(m_sourceLblPage, "SOURCE/PAGE_BTN", 0, 200, 1.f, 0.f); _setHideAnim(m_sourceLblPage, "SOURCE/PAGE_BTN", 0, 0, -1.f, 1.f);
_setHideAnim(m_sourceBtnPageM, "SOURCE/PAGE_MINUS", 0, 200, 1.f, 0.f); _setHideAnim(m_sourceBtnPageM, "SOURCE/PAGE_MINUS", 0, 0, -1.f, 1.f);
_setHideAnim(m_sourceBtnPageP, "SOURCE/PAGE_PLUS", 0, 200, 1.f, 0.f); _setHideAnim(m_sourceBtnPageP, "SOURCE/PAGE_PLUS", 0, 0, -1.f, 1.f);
for(int i = 0; i < 12; ++i) for(int i = 0; i < 12; ++i)
{ {

View File

@ -21,6 +21,8 @@ bylastplayed=By Last Played
byplaycount=By Play Count byplaycount=By Play Count
byplayers=By Players byplayers=By Players
bywifiplayers=By Wifi Players bywifiplayers=By Wifi Players
cat1=Select Categories
cat2=Clear
cd1=Back cd1=Back
cd2=Erase cd2=Erase
cd3=Age Lock cd3=Age Lock
@ -62,7 +64,7 @@ cfgg13=Download
cfgg14=Patch video modes cfgg14=Patch video modes
cfgg15=Cheat Codes cfgg15=Cheat Codes
cfgg16=Select cfgg16=Select
cfgg17=Select Categories cfgg17=Categories
cfgg18=Hook Type cfgg18=Hook Type
cfgg2=Video mode cfgg2=Video mode
cfgg21=Return To Channel cfgg21=Return To Channel