Now you can combine views using the source menu. The source menu now works in two ways. First, the old point and click with 'A' to select a single source. And now, Second, choose the sources you want to see with the 'B' button. They'll click from off to on and back. when done selecting click on the back button or press 'Home'.

Note: The All Plugins source option has been removed and choosing either nand button on mutiple selection loads the nand you last used (real or emu)

The categories_v4.ini had to also be slightly modified to work with this. It will now contain a single 'GENERAL' section which contains the number of categories and the name of each.  A suggestion, I would use the first 20 for bostonbc's genres and ratings and the next ten or so for movie types(mplayerce) and the next ten or so for misc.

When using more than one source the partition selection and emu nand settings in config are disabled for now.

The source button on the main screen still works the same including the d-pad option.

Most of the credit for this goes to Fix94 for setting wiiflow up for this a long time ago.  I just took the 80% of work he'd already did and finished by getting it to work with the source menu.  Note there may be some issues.
This commit is contained in:
fledge68 2013-01-15 13:54:33 +00:00
parent 6ec1122f84
commit d5b16e66da
12 changed files with 389 additions and 149 deletions

View File

@ -39,11 +39,6 @@ void ListGenerator::Init(const char *settingsDir, const char *Language)
if(Language != NULL) gameTDB_Language = Language;
}
void ListGenerator::Cleanup()
{
this->clear(); //clear gamelist
}
void ListGenerator::OpenConfigs()
{
gameTDB.OpenFile(gameTDB_Path.c_str());
@ -224,7 +219,6 @@ static void Create_Channel_List()
void ListGenerator::CreateList(u32 Flow, u32 Device, const string& Path, const vector<string>& FileTypes,
const string& DBName, bool UpdateCache)
{
Cleanup();
if(!DBName.empty())
{
if(UpdateCache)

View File

@ -33,7 +33,6 @@ class ListGenerator : public vector<dir_discHdr>
{
public:
void Init(const char *settingsDir, const char *Language);
void Cleanup();
void CreateList(u32 Flow, u32 Device, const string& Path, const vector<string>& FileTypes,
const string& DBName, bool UpdateCache);
u32 Color;

View File

@ -1619,7 +1619,7 @@ void CMenu::_checkForSinglePlugin(void)
enabledPluginPos = 0;
enabledPluginsCount = 0;
const vector<bool> &EnabledPlugins = m_plugin.GetEnabledPlugins(m_cfg);
if(m_current_view == COVERFLOW_PLUGIN && EnabledPlugins.size() != 0)
if(m_cfg.getBool(PLUGIN_DOMAIN, "source", true) && EnabledPlugins.size() != 0)
{
for(u8 i = 0; i < EnabledPlugins.size(); i++)
{
@ -1653,7 +1653,7 @@ void CMenu::_initCF(void)
if (ageLock < 19)
{
gameAgeList.load(fmt("%s/" AGE_LOCK_FILENAME, m_settingsDir.c_str()));
if (m_current_view == COVERFLOW_USB || m_current_view == COVERFLOW_CHANNEL)
if(!gametdb.IsLoaded())
{
gametdb.OpenFile(fmt("%s/wiitdb.xml", m_settingsDir.c_str()));
gametdb.SetLanguageCode(m_loc.getString(m_curLanguage, "gametdb_code", "EN").c_str());
@ -1780,29 +1780,23 @@ void CMenu::_initCF(void)
switch(element->type)
{
case TYPE_CHANNEL:
catDomain = CHANNEL_DOMAIN;
catDomain = "NAND";
break;
case TYPE_HOMEBREW:
catDomain = HOMEBREW_DOMAIN;
catDomain = "HOMEBREW";
break;
case TYPE_GC_GAME:
catDomain = GC_DOMAIN;
catDomain = "DML";
break;
case TYPE_PLUGIN:
catDomain = PLUGIN_DOMAIN;
case TYPE_WII_GAME:
catDomain = "GAMES";
break;
default:
catDomain = WII_DOMAIN;
catDomain = (m_plugin.GetPluginName(m_plugin.GetPluginPosition(element->settings[0]))).toUTF8();
}
if(enabledPluginsCount == 1)
{
catDomain = (m_plugin.GetPluginName(enabledPluginPos)).toUTF8();
if(element->settings[0] != m_plugin.getPluginMagic(enabledPluginPos))
continue;
}
const char *requiredCats = m_cat.getString(fmt("%s/GENERAL", catDomain.c_str()), "required_categories").c_str();
const char *selectedCats = m_cat.getString(fmt("%s/GENERAL", catDomain.c_str()), "selected_categories").c_str();
const char *hiddenCats = m_cat.getString(fmt("%s/GENERAL", catDomain.c_str()), "hidden_categories").c_str();
const char *requiredCats = m_cat.getString("GENERAL", "required_categories").c_str();
const char *selectedCats = m_cat.getString("GENERAL", "selected_categories").c_str();
const char *hiddenCats = m_cat.getString("GENERAL", "hidden_categories").c_str();
u8 numReqCats = strlen(requiredCats);
u8 numSelCats = strlen(selectedCats);
u8 numHidCats = strlen(hiddenCats);
@ -1933,6 +1927,8 @@ void CMenu::_initCF(void)
CoverFlow.addItem(&(*element), fmt("%s/%s.png", m_picDir.c_str(), id.c_str()), fmt("%s/%s.png", m_boxPicDir.c_str(), id.c_str()), fmt("%s/%s", m_boxPicDir.c_str(), blankCoverName.c_str()), playcount, lastPlayed);
}
}
if(gametdb.IsLoaded())
gametdb.CloseFile();
m_gcfg1.unload();
if (dumpGameLst)
{
@ -1948,9 +1944,13 @@ void CMenu::_initCF(void)
CoverFlow.start();
if(!CoverFlow.empty())
{
u8 view = m_current_view;
if(m_current_view == COVERFLOW_MAX) // target the last launched game type view
m_current_view = m_last_view;
bool path = (m_current_view == COVERFLOW_PLUGIN || m_current_view == COVERFLOW_HOMEBREW);
if(!CoverFlow.findId(m_cfg.getString(domain, "current_item").c_str(), true, path))
if(!CoverFlow.findId(m_cfg.getString(_domainFromView(), "current_item").c_str(), true, path))
CoverFlow.defaultLoad();
m_current_view = view;
CoverFlow.startCoverLoader();
}
}
@ -2245,42 +2245,61 @@ bool CMenu::_loadChannelList(void)
m_cfg.getBool(CHANNEL_DOMAIN, "real_nand_config", false));
cacheDir = fmt("%s/%s_channels.db", m_listCacheDir.c_str(), DeviceName[currentPartition]);
}
bool updateCache = m_cfg.getBool(_domainFromView(), "update_cache");
bool updateCache = m_cfg.getBool(CHANNEL_DOMAIN, "update_cache");
vector<string> NullVector;
m_gameList.CreateList(m_current_view, currentPartition, std::string(),
m_gameList.CreateList(COVERFLOW_CHANNEL, currentPartition, std::string(),
NullVector, cacheDir, updateCache);
return m_gameList.size() > 0 ? true : false;
m_cfg.remove(CHANNEL_DOMAIN, "update_cache");
return true;
}
bool CMenu::_loadList(void)
{
CoverFlow.clear();
m_gameList.clear();
NANDemuView = false;
gprintf("Switching View to %s\n", _domainFromView());
u8 sources = 0;
gprintf("Creating Gamelist\n");
bool retval;
switch(m_current_view)
if(m_cfg.getBool(PLUGIN_DOMAIN, "source",false))
{
case COVERFLOW_CHANNEL:
retval = _loadChannelList();
break;
case COVERFLOW_HOMEBREW:
retval = _loadHomebrewList();
break;
case COVERFLOW_DML:
retval = _loadDmlList();
break;
case COVERFLOW_PLUGIN:
retval = _loadEmuList();
break;
default:
retval = _loadGameList();
break;
_loadEmuList();
m_current_view = COVERFLOW_PLUGIN;
sources++;
}
gprintf("Games found: %i\n", m_gameList.size());
m_cfg.remove(_domainFromView(), "update_cache");
return retval;
if(m_cfg.getBool(WII_DOMAIN, "source",false))
{
_loadGameList();
m_current_view = COVERFLOW_USB;
sources++;
}
if(m_cfg.getBool(CHANNEL_DOMAIN, "source",false))
{
m_current_view = COVERFLOW_CHANNEL;
_loadChannelList();
sources++;
}
if(m_cfg.getBool(GC_DOMAIN, "source",false))
{
_loadDmlList();
m_current_view = COVERFLOW_DML;
sources++;
}
if(m_cfg.getBool(HOMEBREW_DOMAIN, "source",false))
{
_loadHomebrewList();
m_current_view = COVERFLOW_HOMEBREW;
sources++;
}
if(sources > 1)
m_current_view = COVERFLOW_MAX;
gprintf("Games found: %i\n", m_gameList.size());
return m_gameList.size() > 0 ? true : false;
}
bool CMenu::_loadGameList(void)
@ -2289,15 +2308,14 @@ bool CMenu::_loadGameList(void)
if(!DeviceHandle.IsInserted(currentPartition))
return false;
m_gameList.clear();
DeviceHandle.OpenWBFS(currentPartition);
string gameDir(fmt(GAMES_DIR, DeviceName[currentPartition]));
string cacheDir(fmt("%s/%s_wii.db", m_listCacheDir.c_str(), DeviceName[currentPartition]));
bool updateCache = m_cfg.getBool(WII_DOMAIN, "update_cache");
m_gameList.CreateList(m_current_view, currentPartition, gameDir, stringToVector(".wbfs|.iso", '|'), cacheDir, updateCache);
m_gameList.CreateList(COVERFLOW_USB, currentPartition, gameDir, stringToVector(".wbfs|.iso", '|'), cacheDir, updateCache);
WBFS_Close();
return m_gameList.size() > 0 ? true : false;
m_cfg.remove(WII_DOMAIN, "update_cache");
return true;
}
bool CMenu::_loadHomebrewList()
@ -2306,13 +2324,12 @@ bool CMenu::_loadHomebrewList()
if(!DeviceHandle.IsInserted(currentPartition))
return false;
m_gameList.clear();
string gameDir(fmt(HOMEBREW_DIR, DeviceName[currentPartition]));
string cacheDir(fmt("%s/%s_homebrew.db", m_listCacheDir.c_str(), DeviceName[currentPartition]));
bool updateCache = m_cfg.getBool(HOMEBREW_DOMAIN, "update_cache");
m_gameList.CreateList(m_current_view, currentPartition, gameDir, stringToVector(".dol|.elf", '|'), cacheDir, updateCache);
return m_gameList.size() > 0 ? true : false;
m_gameList.CreateList(COVERFLOW_HOMEBREW, currentPartition, gameDir, stringToVector(".dol|.elf", '|'), cacheDir, updateCache);
m_cfg.remove(HOMEBREW_DOMAIN, "update_cache");
return true;
}
bool CMenu::_loadDmlList()
@ -2321,14 +2338,13 @@ bool CMenu::_loadDmlList()
if(!DeviceHandle.IsInserted(currentPartition))
return false;
m_gameList.clear();
string gameDir(fmt(currentPartition == SD ? DML_DIR : m_DMLgameDir.c_str(), DeviceName[currentPartition]));
string cacheDir(fmt("%s/%s_gamecube.db", m_listCacheDir.c_str(), DeviceName[currentPartition]));
bool updateCache = m_cfg.getBool(GC_DOMAIN, "update_cache");
m_gameList.CreateList(m_current_view, currentPartition, gameDir,
m_gameList.CreateList(COVERFLOW_DML, currentPartition, gameDir,
stringToVector(".iso|root", '|'),cacheDir, updateCache);
return m_gameList.size() > 0 ? true : false;
m_cfg.remove(GC_DOMAIN, "update_cache");
return true;
}
static vector<string> INI_List;
@ -2343,16 +2359,16 @@ bool CMenu::_loadEmuList()
currentPartition = m_cfg.getInt(PLUGIN_DOMAIN, "partition", SD);
if(!DeviceHandle.IsInserted(currentPartition))
return false;
bool updateCache = m_cfg.getBool(PLUGIN_DOMAIN, "update_cache");
bool updateCache = m_cfg.getBool(PLUGIN_DOMAIN, "update_cache");
vector<dir_discHdr> emuList;
Config m_plugin_cfg;
INI_List.clear();
m_gameList.clear();
GetFiles(m_pluginsDir.c_str(), stringToVector(".ini", '|'), GrabINIFiles, false, 1);
for(vector<string>::const_iterator Name = INI_List.begin(); Name != INI_List.end(); ++Name)
{
m_gameList.clear();
if(Name->find("scummvm.ini") != string::npos)
continue;
m_plugin_cfg.load(Name->c_str());
@ -2370,7 +2386,7 @@ bool CMenu::_loadEmuList()
vector<string> FileTypes = stringToVector(m_plugin_cfg.getString(PLUGIN_INI_DEF,"fileTypes"), '|');
m_gameList.Color = strtoul(m_plugin_cfg.getString(PLUGIN_INI_DEF,"coverColor").c_str(), NULL, 16);
m_gameList.Magic = MagicWord;
m_gameList.CreateList(m_current_view, currentPartition, gameDir, FileTypes, cacheDir, updateCache);
m_gameList.CreateList(COVERFLOW_PLUGIN, currentPartition, gameDir, FileTypes, cacheDir, updateCache);
for(vector<dir_discHdr>::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++)
emuList.push_back(*tmp_itr);
}
@ -2395,8 +2411,8 @@ bool CMenu::_loadEmuList()
emuList.clear();
//If we return to the coverflow before wiiflow quit we dont need to reload plugins
m_plugin.EndAdd();
return m_gameList.size() > 0 ? true : false;
m_cfg.remove(PLUGIN_DOMAIN, "update_cache");
return true;
}
void CMenu::_stopSounds(void)
@ -2619,27 +2635,7 @@ void CMenu::UpdateCache(u32 view)
UpdateCache(COVERFLOW_CHANNEL);
return;
}
const char *domain;
switch(view)
{
case COVERFLOW_CHANNEL:
domain = CHANNEL_DOMAIN;
break;
case COVERFLOW_HOMEBREW:
domain = HOMEBREW_DOMAIN;
break;
case COVERFLOW_DML:
domain = GC_DOMAIN;
break;
case COVERFLOW_PLUGIN:
domain = PLUGIN_DOMAIN;
break;
default:
domain = WII_DOMAIN;
}
m_cfg.setBool(domain, "update_cache", true);
m_cfg.setBool(_domainFromView(), "update_cache", true);
}
int CMenu::MIOSisDML()

View File

@ -43,6 +43,7 @@ public:
void loadDefaultFont(void);
void TempLoadIOS(int IOS = 0);
u8 m_current_view;
int m_last_view;
u8 enabledPluginPos;
u8 enabledPluginsCount;
char PluginMagicWord[9];

View File

@ -101,10 +101,9 @@ void CMenu::_updateCheckboxes(void)
break;
default:
m_btnMgr.show(m_categoryBtnCatReq[i]);
break;
}
m_btnMgr.setText(m_categoryLblCat[i], m_cat.getWString(fmt("%s/GENERAL", catDomain.c_str()), fmt("cat%d",j), wfmt(L"Category %i",j).c_str()));
m_btnMgr.setText(m_categoryLblCat[i], m_cat.getWString("GENERAL", fmt("cat%d",j), wfmt(L"Category %i",j).c_str()));
m_btnMgr.show(m_categoryLblCat[i]);
}
@ -112,6 +111,24 @@ void CMenu::_updateCheckboxes(void)
void CMenu::_getIDCats(void)
{
dir_discHdr *hdr = CoverFlow.getHdr();
switch(hdr->type)
{
case TYPE_CHANNEL:
catDomain = "NAND";
break;
case TYPE_HOMEBREW:
catDomain = "HOMEBREW";
break;
case TYPE_GC_GAME:
catDomain = "DML";
break;
case TYPE_WII_GAME:
catDomain = "GAMES";
break;
default:
catDomain = (m_plugin.GetPluginName(m_plugin.GetPluginPosition(hdr->settings[0]))).toUTF8();
}
id = _getId();
const char *idCats = m_cat.getString(catDomain, id, "").c_str();
u8 numIdCats = strlen(idCats);
@ -146,38 +163,19 @@ void CMenu::_CategorySettings(bool fromGameSet)
curPage = 1;
gameSet = fromGameSet;
catDomain = _domainFromView();
u8 pos = 0;
if(m_current_view == COVERFLOW_PLUGIN)
{
const vector<bool> &EnabledPlugins = m_plugin.GetEnabledPlugins(m_cfg);
if(EnabledPlugins.size() != 0)
{
char PluginMagicWord[9];
u8 enabledPluginsCount = 0;
for(u8 i = 0; i < EnabledPlugins.size(); i++)
{
snprintf(PluginMagicWord, sizeof(PluginMagicWord), "%08x", m_plugin.getPluginMagic(i));
if(m_cfg.getBool("PLUGIN", PluginMagicWord, true))
{
pos = i;
enabledPluginsCount++;
}
}
if(enabledPluginsCount == 1)
catDomain = (m_plugin.GetPluginName(pos)).toUTF8();
}
}
m_max_categories = m_cat.getInt(fmt("%s/GENERAL", catDomain.c_str()), "numcategories", 6);
m_max_categories = m_cat.getInt("GENERAL", "numcategories", 6);
m_categories.resize(m_max_categories, '0');
m_categories.assign(m_max_categories, '0');
if(fromGameSet)
{
_getIDCats();
}
else
{
const char *requiredCats = m_cat.getString(fmt("%s/GENERAL", catDomain.c_str()), "required_categories").c_str();
const char *selectedCats = m_cat.getString(fmt("%s/GENERAL", catDomain.c_str()), "selected_categories").c_str();
const char *hiddenCats = m_cat.getString(fmt("%s/GENERAL", catDomain.c_str()), "hidden_categories").c_str();
const char *requiredCats = m_cat.getString("GENERAL", "required_categories").c_str();
const char *selectedCats = m_cat.getString("GENERAL", "selected_categories").c_str();
const char *hiddenCats = m_cat.getString("GENERAL", "hidden_categories").c_str();
u8 numReqCats = strlen(requiredCats);
u8 numSelCats = strlen(selectedCats);
u8 numHidCats = strlen(hiddenCats);
@ -242,9 +240,9 @@ void CMenu::_CategorySettings(bool fromGameSet)
newReqCats = newReqCats + cCh;
}
}
m_cat.setString(fmt("%s/GENERAL", catDomain.c_str()), "selected_categories", newSelCats);
m_cat.setString(fmt("%s/GENERAL", catDomain.c_str()), "hidden_categories", newHidCats);
m_cat.setString(fmt("%s/GENERAL", catDomain.c_str()), "required_categories", newReqCats);
m_cat.setString("GENERAL", "selected_categories", newSelCats);
m_cat.setString("GENERAL", "hidden_categories", newHidCats);
m_cat.setString("GENERAL", "required_categories", newReqCats);
}
else
_setIDCats();

View File

@ -186,13 +186,13 @@ int CMenu::_config1(void)
}
else if ((m_btnMgr.selected(m_configBtnUnlock)) || (m_btnMgr.selected(m_configBtnSetCode)))
_code();
else if ((m_btnMgr.selected(m_configBtnPartitionP) || m_btnMgr.selected(m_configBtnPartitionM)))
else if ((m_btnMgr.selected(m_configBtnPartitionP) || m_btnMgr.selected(m_configBtnPartitionM)) && m_current_view != COVERFLOW_MAX)
{
s8 direction = m_btnMgr.selected(m_configBtnPartitionP) ? 1 : -1;
_setPartition(direction);
_showConfig();
}
else if (m_btnMgr.selected(m_configBtnCfg4))
else if (m_btnMgr.selected(m_configBtnCfg4) && m_current_view != COVERFLOW_MAX)
{
_cfNeedsUpdate();
CoverFlow.stopCoverLoader(true);

View File

@ -141,7 +141,7 @@ void CMenu::_showGameSettings(void)
}
else
{
if(m_current_view == COVERFLOW_USB && _checkSave(string((const char *)CoverFlow.getHdr()->id), false))
if(CoverFlow.getHdr()->type == TYPE_WII_GAME && _checkSave(string((const char *)CoverFlow.getHdr()->id), false))
g_numGCfPages = 5;
else
g_numGCfPages = 4;

View File

@ -552,7 +552,7 @@ int CMenu::_coverDownloader(bool missingOnly)
string newID = m_newID.getString(domain, coverList[i], coverList[i]);
if(!newID.empty() && strncasecmp(newID.c_str(), coverList[i].c_str(), m_current_view != COVERFLOW_USB ? 4 : 6) == 0)
if(!newID.empty() && strncasecmp(newID.c_str(), coverList[i].c_str(), coverList[i].length()) == 0)
m_newID.remove(domain, coverList[i]);
else if(!newID.empty())
{

View File

@ -557,6 +557,35 @@ void CMenu::_game(bool launch)
m_banner.DeleteBanner();
dir_discHdr *hdr = CoverFlow.getHdr();
m_gcfg2.load(fmt("%s/" GAME_SETTINGS2_FILENAME, m_settingsDir.c_str()));
// change to current games partition and set last_view for recall later
switch(hdr->type)
{
case TYPE_CHANNEL:
m_cfg.setInt("GENERAL", "last_view", COVERFLOW_CHANNEL);
currentPartition = m_cfg.getInt(CHANNEL_DOMAIN, "partition", 1);
break;
case TYPE_HOMEBREW:
m_cfg.setInt("GENERAL", "last_view", COVERFLOW_HOMEBREW);
currentPartition = m_cfg.getInt(HOMEBREW_DOMAIN, "partition", 1);
break;
case TYPE_GC_GAME:
m_cfg.setInt("GENERAL", "last_view", COVERFLOW_DML);
currentPartition = m_cfg.getInt(GC_DOMAIN, "partition", 1);
break;
case TYPE_WII_GAME:
m_cfg.setInt("GENERAL", "last_view", COVERFLOW_USB);
currentPartition = m_cfg.getInt(WII_DOMAIN, "partition", 1);
break;
default:
m_cfg.setInt("GENERAL", "last_view", COVERFLOW_PLUGIN);
_checkForSinglePlugin();
if(enabledPluginsCount == 1)
{
currentPartition = m_cfg.getInt("PLUGINS/PARTITION", PluginMagicWord, 1);
m_cfg.setInt(PLUGIN_DOMAIN, "partition", currentPartition);
}
currentPartition = m_cfg.getInt(PLUGIN_DOMAIN, "partition", 1);
}
if(currentPartition != SD && hdr->type == TYPE_GC_GAME && m_show_dml == 2 && (strstr(hdr->path, ".iso") == NULL ||
!m_devo_installed || min((u32)m_gcfg2.getInt(hdr->id, "gc_loader", 0), ARRAY_SIZE(CMenu::_GCLoader) - 1u) == 1))
{
@ -769,8 +798,6 @@ void CMenu::directlaunch(const char *GameID)
void CMenu::_launch(dir_discHdr *hdr)
{
/* So WiiFlow knows where we are */
m_cfg.setInt("GENERAL", "last_view", m_current_view);
/* Lets boot that shit */
if(hdr->type == TYPE_WII_GAME)
_launchGame(hdr, false);

View File

@ -111,6 +111,9 @@ void CMenu::_showMain(void)
else
m_btnMgr.show(m_mainBtnUsb);
break;
case COVERFLOW_MAX:
m_btnMgr.show(m_mainBtnUsb);
break;
case COVERFLOW_HOMEBREW:
m_btnMgr.show(m_mainBtnUsb);
break;
@ -247,12 +250,12 @@ int CMenu::main(void)
m_GameTDBLoaded = true;
m_gametdb.CloseFile();
}
if(LastViewRequested())
m_current_view = m_cfg.getInt("GENERAL", "last_view");
m_last_view = m_cfg.getInt("GENERAL", "last_view");
if(!(m_last_view < COVERFLOW_USB || m_last_view >= COVERFLOW_MAX))
m_current_view = m_last_view;
else if(m_Emulator_boot)
m_current_view = COVERFLOW_PLUGIN;
m_cfg.remove("GENERAL", "last_view");
if(m_cfg.getBool("GENERAL", "update_cache", false))
{
UpdateCache();
@ -308,6 +311,28 @@ int CMenu::main(void)
m_current_view = COVERFLOW_CHANNEL;
if(lastView == m_current_view)
m_current_view = COVERFLOW_HOMEBREW;
m_cfg.setBool(WII_DOMAIN, "source", false);
m_cfg.setBool(GC_DOMAIN, "source", false);
m_cfg.setBool(CHANNEL_DOMAIN, "source", false);
m_cfg.setBool(HOMEBREW_DOMAIN, "source", false);
m_cfg.setBool(PLUGIN_DOMAIN, "source", false);
switch(m_current_view)
{
case COVERFLOW_USB:
m_cfg.setBool(WII_DOMAIN, "source", true);
break;
case COVERFLOW_DML:
m_cfg.setBool(GC_DOMAIN, "source", true);
break;
case COVERFLOW_CHANNEL:
m_cfg.setBool(CHANNEL_DOMAIN, "source", true);
break;
case COVERFLOW_HOMEBREW:
m_cfg.setBool(HOMEBREW_DOMAIN, "source", true);
break;
default:
m_cfg.setBool(PLUGIN_DOMAIN, "source", true);
}
LoadView();
continue;
}
@ -345,8 +370,30 @@ int CMenu::main(void)
m_current_view = (show_emu ? COVERFLOW_PLUGIN : (show_homebrew && (parental_homebrew || !m_locked)) ? COVERFLOW_HOMEBREW : COVERFLOW_USB);
else if(m_current_view == COVERFLOW_PLUGIN)
m_current_view = (show_homebrew && (parental_homebrew || !m_locked)) ? COVERFLOW_HOMEBREW : COVERFLOW_USB;
else if(m_current_view == COVERFLOW_HOMEBREW)
else if(m_current_view == COVERFLOW_HOMEBREW || m_current_view == COVERFLOW_MAX)
m_current_view = COVERFLOW_USB;
m_cfg.setBool(WII_DOMAIN, "source", false);
m_cfg.setBool(GC_DOMAIN, "source", false);
m_cfg.setBool(CHANNEL_DOMAIN, "source", false);
m_cfg.setBool(HOMEBREW_DOMAIN, "source", false);
m_cfg.setBool(PLUGIN_DOMAIN, "source", false);
switch(m_current_view)
{
case COVERFLOW_USB:
m_cfg.setBool(WII_DOMAIN, "source", true);
break;
case COVERFLOW_DML:
m_cfg.setBool(GC_DOMAIN, "source", true);
break;
case COVERFLOW_CHANNEL:
m_cfg.setBool(CHANNEL_DOMAIN, "source", true);
break;
case COVERFLOW_HOMEBREW:
m_cfg.setBool(HOMEBREW_DOMAIN, "source", true);
break;
default:
m_cfg.setBool(PLUGIN_DOMAIN, "source", true);
}
LoadView();
}
else if(m_btnMgr.selected(m_mainBtnInit))

View File

@ -29,6 +29,7 @@ s16 m_sourceLblNotice;
s16 m_sourceLblPage;
s16 m_sourceBtnPageM;
s16 m_sourceBtnPageP;
s16 m_sourceBtnBack;
s16 m_sourceLblTitle;
s16 m_sourceBtnSource[12];
s16 m_sourceLblUser[4];
@ -46,6 +47,7 @@ void CMenu::_hideSource(bool instant)
m_btnMgr.hide(m_sourceLblPage, instant);
m_btnMgr.hide(m_sourceBtnPageM, instant);
m_btnMgr.hide(m_sourceBtnPageP, instant);
m_btnMgr.hide(m_sourceBtnBack, instant);
m_btnMgr.hide(m_sourceBtnHomebrew, instant);
m_btnMgr.hide(m_sourceBtnChannel, instant);
m_btnMgr.hide(m_sourceBtnUsb, instant);
@ -78,6 +80,7 @@ void CMenu::_showSource(void)
}
m_btnMgr.show(m_sourceLblTitle);
m_btnMgr.show(m_sourceBtnBack);
for(i = maxBtns; i > 11; --i)
{
@ -108,16 +111,47 @@ void CMenu::_updateSourceBtns(void)
for(u8 i = 0; i < 12; ++i)
{
string domain;
string btnSource = m_source.getString(fmt("BUTTON_%i", i + j), "source", "").c_str();
if(btnSource == "wii")
domain = WII_DOMAIN;
else if(btnSource == "dml")
domain = GC_DOMAIN;
else if(btnSource == "homebrew")
domain = HOMEBREW_DOMAIN;
else if(btnSource == "emunand")
domain = CHANNEL_DOMAIN;
else if(btnSource == "realnand")
domain = CHANNEL_DOMAIN;
else
{
domain = PLUGIN_DOMAIN;
if(m_cfg.getBool(domain, "source", false))
{
if(m_cfg.getBool("PLUGIN", m_source.getString(fmt("BUTTON_%i", i + j), "magic"), false))
ImgName = m_source.getString(fmt("BUTTON_%i", i + j),"image_s", "").c_str();
else
ImgName = m_source.getString(fmt("BUTTON_%i", i + j),"image", "").c_str();
}
else
ImgName = m_source.getString(fmt("BUTTON_%i", i + j),"image", "").c_str();
}
if(domain != PLUGIN_DOMAIN)
{
if(m_cfg.getBool(domain, "source", false))
ImgName = m_source.getString(fmt("BUTTON_%i", i + j),"image_s", "").c_str();
else
ImgName = m_source.getString(fmt("BUTTON_%i", i + j),"image", "").c_str();
}
TexData texConsoleImg;
TexData texConsoleImgs;
ImgName = m_source.getString(fmt("BUTTON_%i", i + j),"image", "").c_str();
if(TexHandle.fromImageFile(texConsoleImg, fmt("%s/%s", m_themeDataDir.c_str(), ImgName)) != TE_OK)
{
if(TexHandle.fromImageFile(texConsoleImg, fmt("%s/%s", m_sourceDir.c_str(), ImgName)) != TE_OK)
TexHandle.fromPNG(texConsoleImg, favoriteson_png);
}
ImgName = m_source.getString(fmt("BUTTON_%i", i + j),"image_s", "").c_str();
if(TexHandle.fromImageFile(texConsoleImgs, fmt("%s/%s", m_themeDataDir.c_str(), ImgName)) != TE_OK)
{
if(TexHandle.fromImageFile(texConsoleImgs, fmt("%s/%s", m_sourceDir.c_str(), ImgName)) != TE_OK)
@ -147,7 +181,7 @@ bool CMenu::_Source()
pdir = opendir(m_pluginsDir.c_str());
Config m_plugin_cfg;
u8 numPlugins = 0;
bool back = false;
bool back = true;
while((pent = readdir(pdir)) != NULL)
{
@ -173,7 +207,7 @@ bool CMenu::_Source()
bool show_channel = !m_cfg.getBool("GENERAL", "hidechannel", false);
bool show_emu = !m_cfg.getBool(PLUGIN_DOMAIN, "disable", false);
bool parental_homebrew = m_cfg.getBool(HOMEBREW_DOMAIN, "parental", false);
bool imgSelected = false;
m_showtimer = 0;
Source_curPage = 1;
pages = 1;
@ -193,16 +227,29 @@ bool CMenu::_Source()
while(!m_exit)
{
_mainLoopCommon();
if(BTN_HOME_PRESSED || BTN_B_PRESSED)
bool imgSelected = false;
if(BTN_HOME_PRESSED || (BTN_A_PRESSED && m_btnMgr.selected(m_sourceBtnBack)))
{
back = true;
u8 sourceCount = 0;
if(m_cfg.getBool(WII_DOMAIN, "source", false))
sourceCount++;
if(m_cfg.getBool(GC_DOMAIN, "source", false))
sourceCount++;
if(m_cfg.getBool(CHANNEL_DOMAIN, "source", false))
sourceCount++;
if(m_cfg.getBool(HOMEBREW_DOMAIN, "source", false))
sourceCount++;
if(m_cfg.getBool(PLUGIN_DOMAIN, "source", false))
sourceCount++;
if(sourceCount == 0)
m_cfg.setBool(WII_DOMAIN, "source", true);
break;
}
else if(BTN_UP_PRESSED)
m_btnMgr.up();
else if(BTN_DOWN_PRESSED)
m_btnMgr.down();
if(((BTN_MINUS_PRESSED || BTN_LEFT_PRESSED) && pages > 1) || (BTN_A_PRESSED && m_btnMgr.selected(m_sourceBtnPageM)))
else if(((BTN_MINUS_PRESSED || BTN_LEFT_PRESSED) && pages > 1) || (BTN_A_PRESSED && m_btnMgr.selected(m_sourceBtnPageM)))
{
Source_curPage--;
if(Source_curPage < 1)
@ -220,12 +267,13 @@ bool CMenu::_Source()
m_btnMgr.click(m_sourceBtnPageP);
_updateSourceBtns();
}
if(BTN_A_PRESSED)
else if(BTN_A_PRESSED)
{
// check default source buttons when no source_menu.ini
if(m_btnMgr.selected(m_sourceBtnUsb))
{
m_current_view = COVERFLOW_USB;
break;
imgSelected = true;
}
if(m_btnMgr.selected(m_sourceBtnDML))
{
@ -233,7 +281,7 @@ bool CMenu::_Source()
else
{
m_current_view = COVERFLOW_DML;
break;
imgSelected = true;
}
}
if(m_btnMgr.selected(m_sourceBtnChannel))
@ -242,7 +290,7 @@ bool CMenu::_Source()
else
{
m_current_view = COVERFLOW_CHANNEL;
break;
imgSelected = true;
}
}
if(m_btnMgr.selected(m_sourceBtnHomebrew))
@ -251,7 +299,7 @@ bool CMenu::_Source()
else
{
m_current_view = COVERFLOW_HOMEBREW;
break;
imgSelected = true;
}
}
if(m_btnMgr.selected(m_sourceBtnEmu))
@ -260,9 +308,10 @@ bool CMenu::_Source()
else
{
m_current_view = COVERFLOW_PLUGIN;
break;
imgSelected = true;
}
}
// check actual source menu buttons
u8 j = (Source_curPage - 1) * 12;
for(int i = 0; i < 12; ++i)
{
@ -359,8 +408,8 @@ bool CMenu::_Source()
_checkForSinglePlugin();
if(enabledPluginsCount == 1)
{
currentPartition = m_cfg.getInt("PLUGINS/PARTITION", PluginMagicWord, 1) + 1;
_setPartition(-1);
currentPartition = m_cfg.getInt("PLUGINS/PARTITION", PluginMagicWord, 1);
m_cfg.setInt(PLUGIN_DOMAIN, "partition", currentPartition);
}
int layout = m_source.getInt(fmt("BUTTON_%i", i + j), "emuflow", 0);
if(layout != 0)
@ -371,7 +420,133 @@ bool CMenu::_Source()
}
}
if(imgSelected)
{
back = false;
m_cfg.setBool(WII_DOMAIN, "source", false);
m_cfg.setBool(GC_DOMAIN, "source", false);
m_cfg.setBool(CHANNEL_DOMAIN, "source", false);
m_cfg.setBool(HOMEBREW_DOMAIN, "source", false);
m_cfg.setBool(PLUGIN_DOMAIN, "source", false);
switch(m_current_view)
{
case COVERFLOW_USB:
m_cfg.setBool(WII_DOMAIN, "source", true);
break;
case COVERFLOW_DML:
m_cfg.setBool(GC_DOMAIN, "source", true);
break;
case COVERFLOW_CHANNEL:
m_cfg.setBool(CHANNEL_DOMAIN, "source", true);
break;
case COVERFLOW_HOMEBREW:
m_cfg.setBool(HOMEBREW_DOMAIN, "source", true);
break;
default:
m_cfg.setBool(PLUGIN_DOMAIN, "source", true);
}
break;
}
}
else if(BTN_B_PRESSED)
{
u8 j = (Source_curPage - 1) * 12;
for(int i = 0; i < 12; ++i)
{
if(m_btnMgr.selected(m_sourceBtnSource[i]))
{
string source = m_source.getString(fmt("BUTTON_%i", i + j), "source", "");
if (source == "wii")
{
m_cfg.setBool(WII_DOMAIN, "source", !m_cfg.getBool(WII_DOMAIN, "source", false));
imgSelected = true;
break;
}
if (source == "dml")
{
if (!m_show_dml && !m_devo_installed) _showSourceNotice();
else
{
m_cfg.setBool(GC_DOMAIN, "source", !m_cfg.getBool(GC_DOMAIN, "source", false));
imgSelected = true;
break;
}
}
if (source == "emunand")
{
if (!show_channel) _showSourceNotice();
else
{
m_cfg.setBool(CHANNEL_DOMAIN, "source", !m_cfg.getBool(CHANNEL_DOMAIN, "source", false));
//m_cfg.setBool(CHANNEL_DOMAIN, "disable", false);
imgSelected = true;
break;
}
}
if (source == "realnand")
{
if (!show_channel) _showSourceNotice();
else
{
m_cfg.setBool(CHANNEL_DOMAIN, "source", !m_cfg.getBool(CHANNEL_DOMAIN, "source", false));
//m_cfg.setBool(CHANNEL_DOMAIN, "disable", true);
imgSelected = true;
break;
}
}
if (source == "homebrew")
{
if (!show_homebrew || (!parental_homebrew && m_locked)) _showSourceNotice();
else
{
m_cfg.setBool(HOMEBREW_DOMAIN, "source", !m_cfg.getBool(HOMEBREW_DOMAIN, "source", false));
imgSelected = true;
break;
}
}
if (source == "plugin")
{
if(!show_emu)
_showSourceNotice();
else
{
imgSelected = true;
// if all plugin btns off clear plugins before turning one on
if(!m_cfg.getBool(PLUGIN_DOMAIN, "source", false))
{
for (u8 k = 0; k < numPlugins; ++k)
m_plugin.SetEnablePlugin(m_cfg, k, 1);
}
vector<string> magicNums = m_source.getStrings(fmt("BUTTON_%i", i + j), "magic", ',');
if (magicNums.size() > 0)
{
for (vector<string>::iterator itr = magicNums.begin(); itr != magicNums.end(); itr++)
{
string magic = *itr;
if(m_cfg.getBool("PLUGIN", magic, false))// if plugin btn on turn it off
{
_checkForSinglePlugin();
if(enabledPluginsCount == 1) // if last plugin leave it set but turn domain off
m_cfg.setBool(PLUGIN_DOMAIN, "source", false);
else
m_cfg.setBool("PLUGIN", magic, false);
}
else // turn on plugin btn
{
m_cfg.setBool(PLUGIN_DOMAIN, "source", true);
m_cfg.setBool("PLUGIN", magic, true);
}
}
}
break;
}
}
}
}
}
if(imgSelected)
{
back = false;
_updateSourceBtns();
}
if(m_showtimer > 0)
{
@ -420,6 +595,7 @@ void CMenu::_initSourceMenu()
m_sourceLblPage = _addLabel("SOURCE/PAGE_BTN", theme.btnFont, L"", 62, 400, 98, 56, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC);
m_sourceBtnPageM = _addPicButton("SOURCE/PAGE_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 10, 400, 52, 56);
m_sourceBtnPageP = _addPicButton("SOURCE/PAGE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 160, 400, 52, 56);
m_sourceBtnBack = _addButton("SOURCE/BACK_BTN", theme.btnFont, L"", 420, 400, 200, 56, theme.btnFontColor);
m_sourceDir = m_cfg.getString("GENERAL", "dir_Source", fmt("%s/source_menu", m_dataDir.c_str()));
@ -462,10 +638,11 @@ void CMenu::_initSourceMenu()
_setHideAnim(m_sourceLblPage, "SOURCE/PAGE_BTN", 0, 0, -1.f, 1.f);
_setHideAnim(m_sourceBtnPageM, "SOURCE/PAGE_MINUS", 0, 0, -1.f, 1.f);
_setHideAnim(m_sourceBtnPageP, "SOURCE/PAGE_PLUS", 0, 0, -1.f, 1.f);
_setHideAnim(m_sourceBtnBack, "SOURCE/BACK_BTN", 0, 0, -2.f, 0.f);
for(int i = 0; i < 12; ++i)
{
_setHideAnim(m_sourceBtnSource[i], fmt("SOURCE/SOURCE_BTN_%i", i), 0, 0, 1.f, 0.f);
_setHideAnim(m_sourceBtnSource[i], fmt("SOURCE/SOURCE_BTN_%i", i), 0, 0, 1.f, 1.f);
}
_textSource();
_hideSource(true);
@ -475,4 +652,5 @@ void CMenu::_textSource(void)
{
m_btnMgr.setText(m_sourceLblTitle, _t("stup1", L"Select Source"));
m_btnMgr.setText(m_sourceLblNotice, _t("NMMOff", L"** DISABLED **"));
m_btnMgr.setText(m_sourceBtnBack, _t("cfg10", L"Back"));
}

View File

@ -70,8 +70,8 @@ public:
void Cleanup();
void EndAdd();
vector<dir_discHdr> ParseScummvmINI(Config &ini, const char *Device, u32 MagicWord);
private:
s8 GetPluginPosition(u32 magic);
private:
vector<PluginOptions> Plugins;
vector<bool> enabledPlugins;
char PluginMagicWord[9];