mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-11-01 00:55:06 +01:00
- now if using homebrew plugin you can use favorites and categories. normal homebrew does not.
This commit is contained in:
parent
fbe1de2f4a
commit
26a978736c
BIN
out/boot.dol
BIN
out/boot.dol
Binary file not shown.
Before Width: | Height: | Size: 3.3 MiB After Width: | Height: | Size: 3.3 MiB |
@ -2798,24 +2798,16 @@ void CCoverFlow::_dropHQLOD(int i)
|
||||
m_items[i].texture = newTex;
|
||||
}
|
||||
|
||||
const char *CCoverFlow::getFilenameId(const dir_discHdr *curHdr, bool extension)
|
||||
const char *CCoverFlow::getFilenameId(const dir_discHdr *curHdr)
|
||||
{
|
||||
const char *NameOrID = NULL;
|
||||
if(NoGameID(curHdr->type))
|
||||
{
|
||||
if(strrchr(curHdr->path, '/') != NULL)
|
||||
{
|
||||
if(curHdr->type == TYPE_HOMEBREW || extension)
|
||||
NameOrID = strrchr(curHdr->path, '/') + 1;//returns title.ext or folder name for app
|
||||
else // plugin and sourceflow
|
||||
NameOrID = fmt("%ls", curHdr->title);// title without extension in lowercase
|
||||
}
|
||||
return strrchr(curHdr->path, '/') + 1;// app folder or rom name.ext
|
||||
else
|
||||
NameOrID = curHdr->path;//title for scummvm
|
||||
return curHdr->path;// title for scummvm
|
||||
}
|
||||
else
|
||||
NameOrID = curHdr->id;// ID for Wii, GC, & Channels
|
||||
return NameOrID;
|
||||
return curHdr->id;// ID for Wii, GC, & Channels
|
||||
}
|
||||
|
||||
CCoverFlow::CLRet CCoverFlow::_loadCoverTex(u32 i, bool box, bool hq, bool blankBoxCover)
|
||||
|
@ -135,7 +135,7 @@ public:
|
||||
const dir_discHdr * getSpecificHdr(u32) const;
|
||||
wstringEx getTitle(void) const;
|
||||
u64 getChanTitle(void) const;
|
||||
const char *getFilenameId(const dir_discHdr *curHdr, bool extension = true);
|
||||
const char *getFilenameId(const dir_discHdr *curHdr);
|
||||
//
|
||||
bool getRenderTex(void);
|
||||
void setRenderTex(bool);
|
||||
|
@ -1,6 +1,7 @@
|
||||
|
||||
#include "fanart.hpp"
|
||||
#include "memory/mem2.hpp"
|
||||
#include "types.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@ -29,20 +30,30 @@ void CFanart::unload()
|
||||
}
|
||||
|
||||
char fanartDir[164];
|
||||
bool CFanart::load(Config &m_wiiflowConfig, const char *path, const char *id, bool plugin_rom)
|
||||
bool CFanart::load(Config &m_wiiflowConfig, const char *path, const dir_discHdr *hdr)
|
||||
{
|
||||
bool retval = false;
|
||||
|
||||
if(!m_wiiflowConfig.getBool("FANART", "enable_fanart", true))
|
||||
return retval;
|
||||
return false;
|
||||
|
||||
unload();
|
||||
|
||||
char id[64];
|
||||
memset(id, 0, sizeof(id));
|
||||
if(NoGameID(hdr->type))
|
||||
{
|
||||
if(strrchr(hdr->path, '/') != NULL)
|
||||
wcstombs(id, hdr->title, sizeof(id) - 1);
|
||||
else
|
||||
strncpy(id, hdr->path, sizeof(id) - 1);// scummvm
|
||||
}
|
||||
else
|
||||
strcpy(id, hdr->id);
|
||||
|
||||
fanartDir[163] = '\0';
|
||||
strncpy(fanartDir, fmt("%s/%s", path, id), 163);
|
||||
|
||||
TexErr texErr = TexHandle.fromImageFile(m_bg, fmt("%s/background.png", fanartDir));
|
||||
if(texErr == TE_ERROR && !plugin_rom)
|
||||
if(texErr == TE_ERROR && !NoGameID(hdr->type))
|
||||
{
|
||||
strncpy(fanartDir, fmt("%s/%.3s", path, id), 163);
|
||||
texErr = TexHandle.fromImageFile(m_bg, fmt("%s/background.png", fanartDir));
|
||||
@ -53,14 +64,14 @@ bool CFanart::load(Config &m_wiiflowConfig, const char *path, const char *id, bo
|
||||
faConfig_Path[163] = '\0';
|
||||
strncpy(faConfig_Path, fmt("%s/%s.ini", fanartDir, id), 163);
|
||||
m_faConfig.load(faConfig_Path);
|
||||
if(!m_faConfig.loaded() && !plugin_rom)
|
||||
if(!m_faConfig.loaded() && !NoGameID(hdr->type))
|
||||
{
|
||||
strncpy(faConfig_Path, fmt("%s/%.3s.ini", fanartDir, id), 163);
|
||||
m_faConfig.load(faConfig_Path);
|
||||
if(!m_faConfig.loaded())
|
||||
{
|
||||
TexHandle.Cleanup(m_bg);
|
||||
return retval;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
TexHandle.fromImageFile(m_bglq, fmt("%s/background_lq.png", fanartDir));
|
||||
@ -70,12 +81,11 @@ bool CFanart::load(Config &m_wiiflowConfig, const char *path, const char *id, bo
|
||||
if (elm.IsValid()) m_elms.push_back(elm);
|
||||
}
|
||||
m_loaded = true;
|
||||
retval = true;
|
||||
m_defaultDelay = m_wiiflowConfig.getInt("FANART", "delay_after_animation", 200);
|
||||
m_delayAfterAnimation = m_faConfig.getInt("GENERAL", "delay_after_animation", m_defaultDelay);
|
||||
m_globalShowCoverAfterAnimation = m_wiiflowConfig.getOptBool("FANART", "show_cover_after_animation", 2);
|
||||
}
|
||||
return retval;
|
||||
return true;
|
||||
}
|
||||
|
||||
void CFanart::getBackground(const TexData * &hq, const TexData * &lq)
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "gui.hpp"
|
||||
#include "texture.hpp"
|
||||
#include "config/config.hpp"
|
||||
#include "loader/disc.h"
|
||||
|
||||
class CFanartElement
|
||||
{
|
||||
@ -58,7 +59,7 @@ public:
|
||||
~CFanart(void);
|
||||
|
||||
void unload();
|
||||
bool load(Config &m_wiiflowConfig, const char *path, const char *id, bool plugin_rom);
|
||||
bool load(Config &m_wiiflowConfig, const char *path, const dir_discHdr *hdr);
|
||||
bool isAnimationComplete();
|
||||
bool isLoaded();
|
||||
|
||||
|
@ -1970,18 +1970,16 @@ void CMenu::_initCF(void)
|
||||
u8 numReqCats = strlen(requiredCats);
|
||||
u8 numSelCats = strlen(selectedCats);
|
||||
u8 numHidCats = strlen(hiddenCats);
|
||||
char id[74];
|
||||
char catID[64];
|
||||
|
||||
for(vector<dir_discHdr>::iterator hdr = m_gameList.begin(); hdr != m_gameList.end(); ++hdr)
|
||||
{
|
||||
const char *id = NULL;
|
||||
const char *catID = NULL;
|
||||
const char *favDomain = "FAVORITES";
|
||||
const char *adultDomain = "ADULTONLY";
|
||||
|
||||
char tmp1[74];//title plus magic#
|
||||
memset(tmp1, 0, 74);
|
||||
char tmp2[64];
|
||||
memset(tmp2, 0, 64);
|
||||
memset(id, 0, 74);
|
||||
memset(catID, 0, 64);
|
||||
|
||||
if(m_sourceflow)
|
||||
{
|
||||
@ -1992,31 +1990,34 @@ void CMenu::_initCF(void)
|
||||
strcat(tmp1, tmp2);
|
||||
id = tmp1;*/
|
||||
}
|
||||
if(hdr->type == TYPE_HOMEBREW)
|
||||
else if(m_current_view == COVERFLOW_HOMEBREW)
|
||||
{
|
||||
CoverFlow.addItem(&(*hdr), 0, 0);
|
||||
continue;
|
||||
//id = strrchr(hdr->path, '/') + 1;
|
||||
}
|
||||
if(hdr->type == TYPE_PLUGIN)
|
||||
else if(hdr->type == TYPE_HOMEBREW)
|
||||
{
|
||||
wcstombs(id, hdr->title, 63);
|
||||
strcpy(catID, id);
|
||||
}
|
||||
else if(hdr->type == TYPE_PLUGIN)
|
||||
{
|
||||
strncpy(m_plugin.PluginMagicWord, fmt("%08x", hdr->settings[0]), 8);
|
||||
wcstombs(tmp2, hdr->title, 64);
|
||||
strcat(tmp1, m_plugin.PluginMagicWord);
|
||||
strcat(tmp1, fmt("/%s", tmp2));
|
||||
id = tmp1;
|
||||
catID = tmp2;
|
||||
if(strrchr(hdr->path, '/') != NULL)
|
||||
wcstombs(catID, hdr->title, 63);
|
||||
else
|
||||
strncpy(catID, hdr->path, 63);// scummvm
|
||||
strcpy(id, m_plugin.PluginMagicWord);
|
||||
strcat(id, fmt("/%s", catID));
|
||||
favDomain = "FAVORITES_PLUGINS";
|
||||
adultDomain = "ADULTONLY_PLUGINS";
|
||||
}
|
||||
else
|
||||
{
|
||||
id = hdr->id;
|
||||
strcpy(id, hdr->id);
|
||||
if(hdr->type == TYPE_GC_GAME && hdr->settings[0] == 1) /* disc 2 */
|
||||
{
|
||||
strcat(tmp1, fmt("%.6s_2", hdr->id));
|
||||
id = tmp1;
|
||||
}
|
||||
strcat(id, "_2");
|
||||
strcpy(catID, id);
|
||||
}
|
||||
|
||||
if((!m_favorites || m_gcfg1.getBool(favDomain, id, false))
|
||||
@ -2031,16 +2032,18 @@ void CMenu::_initCF(void)
|
||||
catDomain = "GAMECUBE";
|
||||
else if(hdr->type == TYPE_WII_GAME)
|
||||
catDomain = "WII";
|
||||
else if(hdr->type == TYPE_HOMEBREW)
|
||||
catDomain = "HOMEBREW";
|
||||
else
|
||||
catDomain = m_plugin.PluginMagicWord;
|
||||
|
||||
if(numReqCats != 0 || numSelCats != 0 || numHidCats != 0) // if all 0 skip checking cats and show all games
|
||||
{
|
||||
char idCats[10];
|
||||
strcpy(idCats, m_cat.getString(catDomain, hdr->type == TYPE_PLUGIN? catID : id).c_str());
|
||||
strcpy(idCats, m_cat.getString(catDomain, catID).c_str());
|
||||
u8 numIdCats = strlen(idCats);
|
||||
if(numIdCats == 0)
|
||||
m_cat.remove(catDomain, hdr->type == TYPE_PLUGIN? catID : id);
|
||||
m_cat.remove(catDomain, catID);
|
||||
bool inaCat = false;
|
||||
bool inHiddenCat = false;
|
||||
int reqMatch = 0;
|
||||
@ -2103,7 +2106,7 @@ void CMenu::_initCF(void)
|
||||
}
|
||||
}
|
||||
|
||||
if(dumpGameLst && hdr->type != TYPE_PLUGIN)
|
||||
if(dumpGameLst && !NoGameID(hdr->type))
|
||||
{
|
||||
const char *domain = NULL;
|
||||
switch(hdr->type)
|
||||
@ -2133,6 +2136,11 @@ void CMenu::_initCF(void)
|
||||
CoverFlow.addItem(&(*hdr), playcount, lastPlayed);
|
||||
}
|
||||
}
|
||||
/* remove them if false to keep file short */
|
||||
if(!m_gcfg1.getBool(favDomain, id))
|
||||
m_cfg.remove(favDomain, id);
|
||||
if(!m_gcfg1.getBool(adultDomain, id))
|
||||
m_cfg.remove(adultDomain, id);
|
||||
}
|
||||
|
||||
if(dumpGameLst)
|
||||
@ -2152,28 +2160,31 @@ void CMenu::_initCF(void)
|
||||
CoverFlow.setBoxMode(m_cfg.getBool(SOURCEFLOW_DOMAIN, "box_mode", true));
|
||||
CoverFlow.setSmallBoxMode(m_cfg.getBool(SOURCEFLOW_DOMAIN, "smallbox", false));
|
||||
}
|
||||
else if(m_current_view != COVERFLOW_PLUGIN)
|
||||
{
|
||||
CoverFlow.setBoxMode(m_cfg.getBool("GENERAL", "box_mode", true));
|
||||
CoverFlow.setSmallBoxMode(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount);
|
||||
if(m_current_view == COVERFLOW_PLUGIN && enabledPluginsCount > 0)// 1 main source is plugin mode
|
||||
{
|
||||
int boxmode_cnt = 0;
|
||||
for(u8 i = 0; m_plugin.PluginExist(i); ++i)
|
||||
{
|
||||
if(m_plugin.GetEnableStatus(m_cfg, m_plugin.getPluginMagic(i)))
|
||||
{
|
||||
if(m_plugin.GetBoxMode(i))
|
||||
boxmode_cnt++;
|
||||
}
|
||||
}
|
||||
if(boxmode_cnt == 0)
|
||||
CoverFlow.setBoxMode(false);
|
||||
else
|
||||
CoverFlow.setBoxMode(true);
|
||||
}
|
||||
if(enabledPluginsCount == 1 && m_cfg.getBool(PLUGIN_ENABLED, "48425257") && m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox"))
|
||||
CoverFlow.setSmallBoxMode(true);
|
||||
else
|
||||
CoverFlow.setBoxMode(m_cfg.getBool("GENERAL", "box_mode", true));
|
||||
CoverFlow.setSmallBoxMode(false);
|
||||
CoverFlow.setSmallBoxMode(false);
|
||||
int boxmode_cnt = 0;
|
||||
for(u8 i = 0; m_plugin.PluginExist(i); ++i)
|
||||
{
|
||||
if(m_plugin.GetEnableStatus(m_cfg, m_plugin.getPluginMagic(i)))
|
||||
{
|
||||
if(m_plugin.GetBoxMode(i))
|
||||
boxmode_cnt++;
|
||||
}
|
||||
}
|
||||
if(boxmode_cnt == 0)
|
||||
CoverFlow.setBoxMode(false);
|
||||
else
|
||||
CoverFlow.setBoxMode(true);
|
||||
}
|
||||
CoverFlow.setBufferSize(m_cfg.getInt("GENERAL", "cover_buffer", 20));
|
||||
CoverFlow.setHQcover(m_cfg.getBool("GENERAL", "cover_use_hq", true));
|
||||
@ -2205,11 +2216,13 @@ void CMenu::_initCF(void)
|
||||
path = false;
|
||||
if(strncasecmp(m_plugin.PluginMagicWord, "4E414E44", 8) == 0)//NAND
|
||||
path = false;
|
||||
if(strncasecmp(m_plugin.PluginMagicWord, "454E414E", 8) == 0)//EMUNAND
|
||||
path = false;
|
||||
strncpy(cur_item, m_cfg.getString("plugin_item", m_plugin.PluginMagicWord).c_str(), 63);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_sourceflow || m_current_view == COVERFLOW_HOMEBREW || (m_source_cnt > 1 && m_cfg.getInt("MULTI", "current_item_type", TYPE_PLUGIN) == TYPE_PLUGIN))
|
||||
if(m_sourceflow || m_current_view == COVERFLOW_HOMEBREW || (m_source_cnt > 1 && NoGameID(m_cfg.getInt("MULTI", "current_item_type", TYPE_PLUGIN))))
|
||||
path = true;
|
||||
strncpy(cur_item, m_cfg.getString(_domainFromView(), "current_item").c_str(), 63);
|
||||
}
|
||||
|
@ -19,11 +19,8 @@ TexData m_categoryBg;
|
||||
vector<char> m_categories;
|
||||
static u8 curPage;
|
||||
u8 lastBtn;
|
||||
const char *catSettings = NULL;
|
||||
const char *id = NULL;
|
||||
const char *pluginID = NULL;
|
||||
char id[64];
|
||||
const char *catDomain = NULL;
|
||||
char tmp[64];
|
||||
bool gameSet;
|
||||
|
||||
void CMenu::_hideCategorySettings(bool instant)
|
||||
@ -128,49 +125,46 @@ void CMenu::_getGameCategories(void)
|
||||
default:
|
||||
catDomain = m_plugin.PluginMagicWord;
|
||||
}
|
||||
memset(tmp, 0, 64);
|
||||
if(hdr->type == TYPE_PLUGIN)
|
||||
|
||||
memset(id, 0, 64);
|
||||
if(NoGameID(hdr->type))
|
||||
{
|
||||
wcstombs(tmp, hdr->title, 64);
|
||||
pluginID = tmp;
|
||||
if(strrchr(hdr->path, '/') != NULL)
|
||||
wcstombs(id, hdr->title, sizeof(id) - 1);
|
||||
else
|
||||
strncpy(id, hdr->path, sizeof(id) - 1);// scummvm
|
||||
}
|
||||
else
|
||||
strcpy(id, hdr->id);
|
||||
if(hdr->type == TYPE_GC_GAME && hdr->settings[0] == 1) /* disc 2 */
|
||||
strcat(id, "_2");
|
||||
|
||||
const char *gameCats = m_cat.getString(catDomain, id, "").c_str();
|
||||
if(strlen(gameCats) > 0)
|
||||
{
|
||||
id = hdr->id;
|
||||
if(hdr->type == TYPE_GC_GAME && hdr->settings[0] == 1) /* disc 2 */
|
||||
for(u8 j = 0; j < strlen(gameCats); ++j)
|
||||
{
|
||||
strcat(tmp, fmt("%.6s_2", hdr->id));
|
||||
id = tmp;
|
||||
}
|
||||
}
|
||||
const char *idCats = m_cat.getString(catDomain, hdr->type == TYPE_PLUGIN? pluginID : id).c_str();
|
||||
u8 numIdCats = strlen(idCats);
|
||||
if(numIdCats != 0)
|
||||
{
|
||||
for(u8 j = 0; j < numIdCats; ++j)
|
||||
{
|
||||
int k = (static_cast<int>(idCats[j])) - 32;
|
||||
int k = (static_cast<int>(gameCats[j])) - 32;
|
||||
m_categories.at(k) = '1';
|
||||
}
|
||||
}
|
||||
else
|
||||
m_cat.remove(catDomain, hdr->type == TYPE_PLUGIN? pluginID : id);
|
||||
m_cat.remove(catDomain, id);
|
||||
m_btnMgr.setText(m_categoryLblTitle, CoverFlow.getTitle());
|
||||
}
|
||||
|
||||
void CMenu::_setGameCategories(void)
|
||||
{
|
||||
const dir_discHdr *hdr = CoverFlow.getHdr();
|
||||
string newIdCats = "";
|
||||
string gameCats = "";
|
||||
for(int i = 1; i < m_max_categories; i++)
|
||||
{
|
||||
if(m_categories.at(i) == '1')
|
||||
{
|
||||
char cCh = static_cast<char>( i + 32);
|
||||
newIdCats = newIdCats + cCh;
|
||||
char cCh = static_cast<char>(i + 32);
|
||||
gameCats =+ cCh;
|
||||
}
|
||||
}
|
||||
m_cat.setString(catDomain, hdr->type == TYPE_PLUGIN? pluginID : id, newIdCats);
|
||||
m_cat.setString(catDomain, id, gameCats);
|
||||
}
|
||||
|
||||
void CMenu::_CategorySettings(bool fromGameSet)
|
||||
@ -195,9 +189,6 @@ void CMenu::_CategorySettings(bool fromGameSet)
|
||||
}
|
||||
else
|
||||
{
|
||||
//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();
|
||||
char requiredCats[10];
|
||||
char selectedCats[10];
|
||||
char hiddenCats[10];
|
||||
@ -275,7 +266,6 @@ void CMenu::_CategorySettings(bool fromGameSet)
|
||||
else
|
||||
{
|
||||
_setGameCategories();
|
||||
//m_refreshGameList = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -147,10 +147,29 @@ void CMenu::_hideGameSettingsPg(bool instant)
|
||||
|
||||
void CMenu::_showGameSettings()
|
||||
{
|
||||
//const char *id = CoverFlow.getId();
|
||||
//const dir_discHdr *GameHdr = CoverFlow.getHdr();
|
||||
u32 i;
|
||||
const char *id = GameHdr->id;
|
||||
|
||||
_setBg(m_gameSettingsBg, m_gameSettingsBg);
|
||||
for(i = 0; i < ARRAY_SIZE(m_gameSettingsLblUser); ++i)
|
||||
if(m_gameSettingsLblUser[i] != -1)
|
||||
m_btnMgr.show(m_gameSettingsLblUser[i]);
|
||||
|
||||
wstringEx title(_t("cfgg1", L"Settings"));
|
||||
if(!NoGameID(GameHdr->type))
|
||||
title.append(wfmt(L" [%.6s]", id));
|
||||
m_btnMgr.setText(m_gameSettingsLblTitle, title);
|
||||
m_btnMgr.show(m_gameSettingsLblTitle);
|
||||
|
||||
m_btnMgr.show(m_gameSettingsBtnBack);
|
||||
|
||||
if(GameHdr->type == TYPE_PLUGIN || GameHdr->type == TYPE_HOMEBREW)
|
||||
{
|
||||
m_btnMgr.show(m_gameSettingsBtnCategoryMain);
|
||||
m_btnMgr.show(m_gameSettingsLblCategoryMain);
|
||||
return;
|
||||
}
|
||||
|
||||
if(GameHdr->type == TYPE_GC_GAME)
|
||||
{
|
||||
GCLoader = min(m_gcfg2.getUInt(id, "gc_loader", 0), ARRAY_SIZE(CMenu::_GCLoader) - 1u);
|
||||
@ -160,27 +179,6 @@ void CMenu::_showGameSettings()
|
||||
m_gameSettingsMaxPgs = 5;
|
||||
if(GameHdr->type == TYPE_GC_GAME && GCLoader == DEVOLUTION)
|
||||
m_gameSettingsMaxPgs = 2;
|
||||
|
||||
_setBg(m_gameSettingsBg, m_gameSettingsBg);
|
||||
u32 i = 0;
|
||||
for(i = 0; i < ARRAY_SIZE(m_gameSettingsLblUser); ++i)
|
||||
if(m_gameSettingsLblUser[i] != -1)
|
||||
m_btnMgr.show(m_gameSettingsLblUser[i]);
|
||||
|
||||
wstringEx title(_t("cfgg1", L"Settings"));
|
||||
if(GameHdr->type != TYPE_PLUGIN)
|
||||
title.append(wfmt(L" [%.6s]", id));
|
||||
m_btnMgr.setText(m_gameSettingsLblTitle, title);
|
||||
m_btnMgr.show(m_gameSettingsLblTitle);
|
||||
|
||||
m_btnMgr.show(m_gameSettingsBtnBack);
|
||||
|
||||
if(GameHdr->type == TYPE_PLUGIN)
|
||||
{
|
||||
m_btnMgr.show(m_gameSettingsBtnCategoryMain);
|
||||
m_btnMgr.show(m_gameSettingsLblCategoryMain);
|
||||
return;
|
||||
}
|
||||
|
||||
m_btnMgr.setText(m_gameSettingsLblPage, wfmt(L"%i / %i", m_gameSettingsPage, m_gameSettingsMaxPgs));
|
||||
m_btnMgr.show(m_gameSettingsLblPage);
|
||||
|
@ -263,7 +263,7 @@ void CMenu::_extractBnr(const dir_discHdr *hdr)
|
||||
|
||||
void CMenu::_setCurrentItem(const dir_discHdr *hdr)
|
||||
{
|
||||
const char *title = CoverFlow.getFilenameId(hdr, true);// with extension
|
||||
const char *title = CoverFlow.getFilenameId(hdr);
|
||||
if(m_current_view == COVERFLOW_PLUGIN)
|
||||
{
|
||||
if(hdr->type == TYPE_PLUGIN)
|
||||
@ -274,8 +274,12 @@ void CMenu::_setCurrentItem(const dir_discHdr *hdr)
|
||||
strncpy(m_plugin.PluginMagicWord, "4E574949", 9);
|
||||
else if(hdr->type == TYPE_GC_GAME)
|
||||
strncpy(m_plugin.PluginMagicWord, "4E47434D", 9);
|
||||
else
|
||||
else if(hdr->type == TYPE_CHANNEL)
|
||||
strncpy(m_plugin.PluginMagicWord, "4E414E44", 9);
|
||||
else if(hdr->type == TYPE_EMUCHANNEL)
|
||||
strncpy(m_plugin.PluginMagicWord, "454E414E", 9);
|
||||
else //HOMEBREW
|
||||
strncpy(m_plugin.PluginMagicWord, "48425257", 9);
|
||||
}
|
||||
m_cfg.setString(PLUGIN_DOMAIN, "cur_magic", m_plugin.PluginMagicWord);
|
||||
m_cfg.setString("plugin_item", m_plugin.PluginMagicWord, title);
|
||||
@ -325,7 +329,7 @@ void CMenu::_showGame(void)
|
||||
Path = fmt("%s", m_fanartDir.c_str());
|
||||
else
|
||||
Path = fmt("%s/%s", m_fanartDir.c_str(), coverDir);
|
||||
if(m_fa.load(m_cfg, Path, CoverFlow.getFilenameId(GameHdr, false), GameHdr->type == TYPE_PLUGIN))
|
||||
if(m_fa.load(m_cfg, Path, CoverFlow.getHdr()))
|
||||
{
|
||||
const TexData *bg = NULL;
|
||||
const TexData *bglq = NULL;
|
||||
@ -336,24 +340,6 @@ void CMenu::_showGame(void)
|
||||
}
|
||||
else
|
||||
_setMainBg();
|
||||
return;
|
||||
|
||||
if(!m_zoom_banner)
|
||||
{
|
||||
for(u8 i = 0; i < ARRAY_SIZE(m_gameLblUser) - 1; ++i)
|
||||
if(m_gameLblUser[i] != -1)
|
||||
m_btnMgr.show(m_gameLblUser[i]);
|
||||
|
||||
m_btnMgr.show(m_gameBtnPlay);
|
||||
m_btnMgr.show(m_gameBtnBack);
|
||||
m_btnMgr.show(m_gameBtnToggle);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_btnMgr.show(m_gameBtnPlayFull);
|
||||
m_btnMgr.show(m_gameBtnBackFull);
|
||||
m_btnMgr.show(m_gameBtnToggleFull);
|
||||
}
|
||||
}
|
||||
|
||||
void CMenu::_cleanupBanner(bool gamechange)
|
||||
@ -451,31 +437,30 @@ void CMenu::_game(bool launch)
|
||||
|
||||
dir_discHdr *hdr = (dir_discHdr*)MEM2_alloc(sizeof(dir_discHdr));
|
||||
memcpy(hdr, CoverFlow.getHdr(), sizeof(dir_discHdr));
|
||||
if(hdr->type == TYPE_HOMEBREW)
|
||||
launch = true;
|
||||
_setCurrentItem(hdr);
|
||||
|
||||
const char *id = NULL;
|
||||
char tmp1[74];// title/magic#
|
||||
memset(tmp1, 0, 74);
|
||||
char tmp2[64];
|
||||
memset(tmp2, 0, 64);
|
||||
if(hdr->type == TYPE_PLUGIN)
|
||||
char id[74];
|
||||
char catID[64];
|
||||
memset(id, 0, 74);
|
||||
memset(catID, 0, 64);
|
||||
|
||||
if(hdr->type == TYPE_HOMEBREW)
|
||||
wcstombs(id, hdr->title, 63);
|
||||
else if(hdr->type == TYPE_PLUGIN)
|
||||
{
|
||||
strncpy(m_plugin.PluginMagicWord, fmt("%08x", hdr->settings[0]), 8);
|
||||
wcstombs(tmp2, hdr->title, 64);
|
||||
strcat(tmp1, m_plugin.PluginMagicWord);
|
||||
strcat(tmp1, fmt("/%s", tmp2));
|
||||
id = tmp1;
|
||||
if(strrchr(hdr->path, '/') != NULL)
|
||||
wcstombs(catID, hdr->title, 63);
|
||||
else
|
||||
strncpy(catID, hdr->path, 63);// scummvm
|
||||
strcpy(id, m_plugin.PluginMagicWord);
|
||||
strcat(id, fmt("/%s", catID));
|
||||
}
|
||||
else
|
||||
{
|
||||
id = hdr->id;
|
||||
strcpy(id, hdr->id);
|
||||
if(hdr->type == TYPE_GC_GAME && hdr->settings[0] == 1) /* disc 2 */
|
||||
{
|
||||
strcat(tmp1, fmt("%.6s_2", hdr->id));
|
||||
id = tmp1;
|
||||
}
|
||||
strcat(id, "_2");
|
||||
}
|
||||
|
||||
m_zoom_banner = m_cfg.getBool(_domainFromView(), "show_full_banner", false);
|
||||
@ -497,7 +482,7 @@ void CMenu::_game(bool launch)
|
||||
{
|
||||
m_fa.unload();
|
||||
CoverFlow.showCover();
|
||||
_setBg(m_gameBg, m_gameBgLQ);
|
||||
_setMainBg();
|
||||
}
|
||||
else //loop fanart
|
||||
m_fa.reset();
|
||||
@ -620,15 +605,15 @@ void CMenu::_game(bool launch)
|
||||
}
|
||||
else if(launch || BTN_A_PRESSED)
|
||||
{
|
||||
if(m_fa.isLoaded() && ShowPointer())
|
||||
if(m_fa.isLoaded() && ShowPointer())// stop and unload fanart
|
||||
{
|
||||
m_fa.unload();
|
||||
CoverFlow.showCover();
|
||||
_setBg(m_gameBg, m_gameBgLQ);
|
||||
_setMainBg();
|
||||
continue;
|
||||
}
|
||||
/* delete button */
|
||||
else if(m_btnMgr.selected(m_gameBtnDelete))
|
||||
else if(m_btnMgr.selected(m_gameBtnDelete) && hdr->type != TYPE_HOMEBREW)
|
||||
{
|
||||
_hideGame();
|
||||
m_banner.SetShowBanner(false);
|
||||
@ -846,24 +831,26 @@ void CMenu::_game(bool launch)
|
||||
memcpy(hdr, CoverFlow.getHdr(), sizeof(dir_discHdr));// get new game header
|
||||
_setCurrentItem(hdr);
|
||||
|
||||
memset(tmp1, 0, 74);
|
||||
memset(tmp2, 0, 64);
|
||||
if(hdr->type == TYPE_PLUGIN)
|
||||
memset(id, 0, 74);
|
||||
memset(catID, 0, 64);
|
||||
|
||||
if(hdr->type == TYPE_HOMEBREW)
|
||||
wcstombs(id, hdr->title, 64);
|
||||
else if(hdr->type == TYPE_PLUGIN)
|
||||
{
|
||||
strncpy(m_plugin.PluginMagicWord, fmt("%08x", hdr->settings[0]), 8);
|
||||
wcstombs(tmp2, hdr->title, 64);
|
||||
strcat(tmp1, m_plugin.PluginMagicWord);
|
||||
strcat(tmp1, fmt("/%s", tmp2));
|
||||
id = tmp1;
|
||||
if(strrchr(hdr->path, '/') != NULL)
|
||||
wcstombs(catID, hdr->title, 63);
|
||||
else
|
||||
strncpy(catID, hdr->path, 63);// scummvm
|
||||
strcpy(id, m_plugin.PluginMagicWord);
|
||||
strcat(id, fmt("/%s", catID));
|
||||
}
|
||||
else
|
||||
{
|
||||
id = hdr->id;
|
||||
strcpy(id, hdr->id);
|
||||
if(hdr->type == TYPE_GC_GAME && hdr->settings[0] == 1) /* disc 2 */
|
||||
{
|
||||
strcat(tmp1, fmt("%.6s_2", hdr->id));
|
||||
id = tmp1;
|
||||
}
|
||||
strcat(id, "_2");
|
||||
}
|
||||
if(m_newGame)
|
||||
{
|
||||
@ -1084,8 +1071,7 @@ void CMenu::_launch(const dir_discHdr *hdr)
|
||||
}
|
||||
/* get title from hdr */
|
||||
u32 title_len_no_ext = 0;
|
||||
const char *title = CoverFlow.getFilenameId(hdr, true);// with extension
|
||||
//m_cfg.setString(_domainFromView(), "current_item", title);
|
||||
const char *title = CoverFlow.getFilenameId(hdr);// with extension
|
||||
|
||||
/* get path from hdr */
|
||||
// example rom path - dev:/roms/super mario bros.zip
|
||||
|
@ -223,7 +223,9 @@ void CMenu::_showCF(bool refreshList)
|
||||
if(m_current_view == COVERFLOW_PLUGIN && !m_sourceflow)
|
||||
{
|
||||
m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount);
|
||||
if(enabledPluginsCount > 0)
|
||||
if(enabledPluginsCount == 1 && m_cfg.getBool(PLUGIN_ENABLED, "48425257") && m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox"))
|
||||
cf_domain = "_smallflow";
|
||||
else if(enabledPluginsCount > 0)
|
||||
{
|
||||
int sdc = 0;
|
||||
int shc = 0;
|
||||
|
@ -226,6 +226,10 @@ const vector<bool> &Plugin::GetEnabledPlugins(Config &cfg, u8 *num)
|
||||
return enabledPlugins;
|
||||
}
|
||||
|
||||
/* notes: "description" is used as the title because it basically is the title */
|
||||
/* the [GameDomain] is used as the path even thought it isn't the path */
|
||||
/* the [GameDomain] is usually short without any '/' */
|
||||
/* in scummvm.ini the path is the path without the exe or main app file added on */
|
||||
vector<dir_discHdr> Plugin::ParseScummvmINI(Config &ini, const char *Device, u32 Magic)
|
||||
{
|
||||
gprintf("Parsing scummvm.ini\n");
|
||||
|
Loading…
Reference in New Issue
Block a user