mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-11-23 19:59:16 +01:00
-changed some small thing to plugin loading again
This commit is contained in:
parent
eaf62500a9
commit
7bf6961ae3
@ -2,7 +2,7 @@
|
||||
#include <typeinfo>
|
||||
|
||||
template <class T>
|
||||
void CachedList<T>::Load(string path, string containing, string m_lastLanguage) /* Load All */
|
||||
void CachedList<T>::Load(string path, string containing, string m_lastLanguage, Config &m_plugin) /* Load All */
|
||||
{
|
||||
gprintf("\nLoading files containing %s in %s\n", containing.c_str(), path.c_str());
|
||||
m_loaded = false;
|
||||
|
@ -51,7 +51,7 @@ class CachedList : public safe_vector<T>
|
||||
}
|
||||
}
|
||||
|
||||
void Load(string path, string containing, string m_lastLanguage);
|
||||
void Load(string path, string containing, string m_lastLanguage, Config &m_plugin);
|
||||
void LoadChannels(string path, u32 channelType, string m_lastLanguage);
|
||||
|
||||
void Unload(){if(m_loaded) {this->clear(); m_loaded = false; m_database = "";}};
|
||||
@ -64,8 +64,6 @@ class CachedList : public safe_vector<T>
|
||||
void Remove(u32 index) {if(m_loaded) CCache<T>(*this, m_database, index, REMOVE);} /* Remove One */
|
||||
|
||||
void SetLanguage(string curLanguage) { m_curLanguage = curLanguage; }
|
||||
void LoadPluginConfig(const char* name) { m_plugin.load(name); }
|
||||
void UnloadPluginConfig() {m_plugin.unload(); };
|
||||
private:
|
||||
string make_db_name(string path);
|
||||
|
||||
@ -82,7 +80,6 @@ class CachedList : public safe_vector<T>
|
||||
string m_lastLanguage;
|
||||
string m_discinf;
|
||||
string m_DMLgameDir;
|
||||
Config m_plugin;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -1914,9 +1914,10 @@ bool CMenu::_loadGameList(void)
|
||||
if(!DeviceHandler::Instance()->IsInserted(currentPartition))
|
||||
return false;
|
||||
|
||||
Config tmpcfg;
|
||||
gprintf("%s\n", DeviceName[currentPartition]);
|
||||
DeviceHandler::Instance()->Open_WBFS(currentPartition);
|
||||
m_gameList.Load(sfmt(GAMES_DIR, DeviceName[currentPartition]), ".wbfs|.iso", m_cfg.getString("GAMES", "lastlanguage", "EN").c_str());
|
||||
m_gameList.Load(sfmt(GAMES_DIR, DeviceName[currentPartition]), ".wbfs|.iso", m_cfg.getString("GAMES", "lastlanguage", "EN").c_str(), tmpcfg);
|
||||
m_cfg.setString("GAMES", "lastlanguage", m_loc.getString(m_curLanguage, "gametdb_code", "EN"));
|
||||
m_cfg.save();
|
||||
return m_gameList.size() > 0 ? true : false;
|
||||
@ -1928,9 +1929,10 @@ bool CMenu::_loadHomebrewList()
|
||||
if(!DeviceHandler::Instance()->IsInserted(currentPartition))
|
||||
return false;
|
||||
|
||||
Config tmpcfg;
|
||||
gprintf("%s\n", DeviceName[currentPartition]);
|
||||
DeviceHandler::Instance()->Open_WBFS(currentPartition);
|
||||
m_gameList.Load(sfmt(HOMEBREW_DIR, DeviceName[currentPartition]), ".dol|.elf", m_cfg.getString("HOMEBREW", "lastlanguage", "EN").c_str());
|
||||
m_gameList.Load(sfmt(HOMEBREW_DIR, DeviceName[currentPartition]), ".dol|.elf", m_cfg.getString("HOMEBREW", "lastlanguage", "EN").c_str(), tmpcfg);
|
||||
m_cfg.setString("HOMEBREW", "lastlanguage", m_loc.getString(m_curLanguage, "gametdb_code", "EN"));
|
||||
m_cfg.save();
|
||||
return m_gameList.size() > 0 ? true : false;
|
||||
@ -1942,12 +1944,13 @@ bool CMenu::_loadDmlList()
|
||||
if(!DeviceHandler::Instance()->IsInserted(currentPartition))
|
||||
return false;
|
||||
|
||||
Config tmpcfg;
|
||||
gprintf("%s\n", DeviceName[currentPartition]);
|
||||
DeviceHandler::Instance()->Open_WBFS(currentPartition);
|
||||
if(currentPartition != SD)
|
||||
m_gameList.Load(sfmt(m_DMLgameDir.c_str(), DeviceName[currentPartition]), "boot.bin|.iso", m_cfg.getString("DML", "lastlanguage", "EN").c_str());
|
||||
m_gameList.Load(sfmt(m_DMLgameDir.c_str(), DeviceName[currentPartition]), "boot.bin|.iso", m_cfg.getString("DML", "lastlanguage", "EN").c_str(), tmpcfg);
|
||||
else
|
||||
m_gameList.Load(sfmt(DML_DIR, DeviceName[currentPartition]), "boot.bin|.iso", m_cfg.getString("DML", "lastlanguage", "EN").c_str());
|
||||
m_gameList.Load(sfmt(DML_DIR, DeviceName[currentPartition]), "boot.bin|.iso", m_cfg.getString("DML", "lastlanguage", "EN").c_str(), tmpcfg);
|
||||
m_cfg.setString("DML", "lastlanguage", m_loc.getString(m_curLanguage, "gametdb_code", "EN"));
|
||||
m_cfg.save();
|
||||
return m_gameList.size() > 0 ? true : false;
|
||||
@ -1985,11 +1988,9 @@ bool CMenu::_loadEmuList()
|
||||
m_gameList.clear();
|
||||
if(strcasestr(m_plugin_cfg.getString("PLUGIN","romDir","").c_str(), "scummvm.ini") == NULL)
|
||||
{
|
||||
m_gameList.LoadPluginConfig(fmt("%s/%s", m_pluginsDir.c_str(), pent->d_name));
|
||||
m_gameList.Load(sfmt("%s:/%s", DeviceName[currentPartition], m_plugin_cfg.getString("PLUGIN","romDir","").c_str()), m_plugin_cfg.getString("PLUGIN","fileTypes","").c_str(), m_cfg.getString("EMULATOR", "lastlanguage", "EN").c_str());
|
||||
m_gameList.Load(sfmt("%s:/%s", DeviceName[currentPartition], m_plugin_cfg.getString("PLUGIN","romDir","").c_str()), m_plugin_cfg.getString("PLUGIN","fileTypes","").c_str(), m_cfg.getString("EMULATOR", "lastlanguage", "EN").c_str(), m_plugin_cfg);
|
||||
for(safe_vector<dir_discHdr>::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++)
|
||||
emuList.push_back(*tmp_itr);
|
||||
m_gameList.UnloadPluginConfig();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -34,10 +34,10 @@ void MusicPlayer::Init(Config &cfg, string musicDir, string themeMusicDir)
|
||||
m_music_files.Init(cfg.getString("GENERAL", "dir_list_cache"), std::string(), std::string(), std::string(), false);
|
||||
|
||||
if (dir & THEME_MUSIC)
|
||||
m_music_files.Load(themeMusicDir, ".ogg|.mp3", "EN"); //|.mod|.xm|.s3m|.wav|.aiff");
|
||||
m_music_files.Load(themeMusicDir, ".ogg|.mp3", "EN", cfg); //|.mod|.xm|.s3m|.wav|.aiff");
|
||||
|
||||
if (dir & NORMAL_MUSIC)
|
||||
m_music_files.Load(musicDir, ".ogg|.mp3", "EN"); //|.mod|.xm|.s3m|.wav|.aiff");
|
||||
m_music_files.Load(musicDir, ".ogg|.mp3", "EN", cfg); //|.mod|.xm|.s3m|.wav|.aiff");
|
||||
|
||||
if (cfg.getBool("GENERAL", "randomize_music", false) && m_music_files.size() > 0)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user