mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-12-28 12:51:52 +01:00
- expanded fanart path chars from 64 to 164. should help with long rom names. thanks wiimpathy.
- made the following fanart changes: *fanart still auto displays *only fanart shows. no cover and no game title and no buttons (play, back, favs, etc.) *to stop and exit fanart press 'a' while pointer hand is on screen. if pointer hand is not on screen pressing 'a' launches game. pressing 'b' exits game selected screen and returns to normal coverflow. d-pad right and left still go to next or previous game. *fanart can either play once or loop. when play once is done it automatically clears fanart and returns to cover view. with looping it will restart the fanart. looping is good for slideshows of game images. looping and play once is determined by the setting "show_cover_after_animation". if set to no then looping is enabled. set to yes for only once.
This commit is contained in:
parent
b93ace2b6b
commit
2daed253a4
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 |
@ -236,7 +236,6 @@ bool CCoverFlow::init(const u8 *font, const u32 font_size, bool vid_50hz)
|
||||
// Load font
|
||||
m_font.fromBuffer(font, font_size, TITLEFONT);
|
||||
m_fontColor = CColor(0xFFFFFFFF);
|
||||
m_fanartFontColor = CColor(0xFFFFFFFF);
|
||||
|
||||
if(vid_50hz)
|
||||
{
|
||||
@ -498,16 +497,6 @@ void CCoverFlow::setColors(bool selected, const CColor &begColor, const CColor &
|
||||
lo.mouseOffColor = offColor;
|
||||
}
|
||||
|
||||
void CCoverFlow::setFanartPlaying(const bool isPlaying)
|
||||
{
|
||||
m_fanartPlaying = isPlaying;
|
||||
}
|
||||
|
||||
void CCoverFlow::setFanartTextColor(const CColor textColor)
|
||||
{
|
||||
m_fanartFontColor = textColor;
|
||||
}
|
||||
|
||||
void CCoverFlow::setMirrorAlpha(float cover, float title)
|
||||
{
|
||||
m_mirrorAlpha = cover;
|
||||
@ -1181,7 +1170,7 @@ void CCoverFlow::_drawTitle(int i, bool mirror, bool rectangle)
|
||||
Mtx modelMtx;
|
||||
Mtx modelViewMtx;
|
||||
Vector3D rotAxis(0.f, 1.f, 0.f);
|
||||
CColor color(m_fanartPlaying ? m_fanartFontColor : m_fontColor);
|
||||
CColor color(m_fontColor);
|
||||
|
||||
if (m_hideCover) return;
|
||||
if (m_covers[i].txtColor == 0) return;
|
||||
|
@ -106,8 +106,6 @@ public:
|
||||
void setTitleWidth(bool selected, float side, float center);
|
||||
void setTitleStyle(bool selected, u16 side, u16 center);
|
||||
void setColors(bool selected, const CColor &begColor, const CColor &endColor, const CColor &offColor);
|
||||
void setFanartPlaying(const bool isPlaying);
|
||||
void setFanartTextColor(const CColor textColor);
|
||||
void setShadowColors(bool selected, const CColor ¢erColor, const CColor &begColor, const CColor &endColor, const CColor &offColor);
|
||||
void setShadowPos(float scale, float x, float y);
|
||||
void setMirrorAlpha(float cover, float title);
|
||||
@ -274,8 +272,6 @@ private:
|
||||
u32 m_numBufCovers;
|
||||
SFont m_font;
|
||||
CColor m_fontColor;
|
||||
CColor m_fanartFontColor;
|
||||
bool m_fanartPlaying;
|
||||
bool m_box;
|
||||
bool m_smallBox;
|
||||
bool m_useHQcover;
|
||||
|
@ -31,6 +31,7 @@ void CFanart::unload()
|
||||
TexHandle.Cleanup(m_bglq);
|
||||
}
|
||||
|
||||
char fanartDir[164];
|
||||
bool CFanart::load(Config &m_globalConfig, const char *path, const char *id, bool plugin_rom)
|
||||
{
|
||||
bool retval = false;
|
||||
@ -40,25 +41,25 @@ bool CFanart::load(Config &m_globalConfig, const char *path, const char *id, boo
|
||||
|
||||
unload();
|
||||
|
||||
char dir[64];
|
||||
dir[63] = '\0';
|
||||
strncpy(dir, fmt("%s/%s", path, id), 63);
|
||||
//char dir[164];
|
||||
fanartDir[163] = '\0';
|
||||
strncpy(fanartDir, fmt("%s/%s", path, id), 163);
|
||||
|
||||
TexErr texErr = TexHandle.fromImageFile(m_bg, fmt("%s/background.png", dir));
|
||||
TexErr texErr = TexHandle.fromImageFile(m_bg, fmt("%s/background.png", fanartDir));
|
||||
if(texErr == TE_ERROR && !plugin_rom)
|
||||
{
|
||||
strncpy(dir, fmt("%s/%.3s", path, id), 63);
|
||||
texErr = TexHandle.fromImageFile(m_bg, fmt("%s/background.png", dir));
|
||||
strncpy(fanartDir, fmt("%s/%.3s", path, id), 163);
|
||||
texErr = TexHandle.fromImageFile(m_bg, fmt("%s/background.png", fanartDir));
|
||||
}
|
||||
if(texErr == TE_OK)
|
||||
{
|
||||
char cfg_char[64];
|
||||
cfg_char[63] = '\0';
|
||||
strncpy(cfg_char, fmt("%s/%s.ini", dir, id), 63);
|
||||
char cfg_char[164];
|
||||
cfg_char[163] = '\0';
|
||||
strncpy(cfg_char, fmt("%s/%s.ini", fanartDir, id), 163);
|
||||
m_cfg.load(cfg_char);
|
||||
if(!m_cfg.loaded() && !plugin_rom)
|
||||
{
|
||||
strncpy(cfg_char, fmt("%s/%.3s.ini", dir, id), 63);
|
||||
strncpy(cfg_char, fmt("%s/%.3s.ini", fanartDir, id), 163);
|
||||
m_cfg.load(cfg_char);
|
||||
if(!m_cfg.loaded())
|
||||
{
|
||||
@ -66,10 +67,10 @@ bool CFanart::load(Config &m_globalConfig, const char *path, const char *id, boo
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
TexHandle.fromImageFile(m_bglq, fmt("%s/background_lq.png", dir));
|
||||
TexHandle.fromImageFile(m_bglq, fmt("%s/background_lq.png", fanartDir));
|
||||
for(int i = 1; i <= 6; i++)
|
||||
{
|
||||
CFanartElement elm(m_cfg, dir, i);
|
||||
CFanartElement elm(m_cfg, fanartDir, i);
|
||||
if (elm.IsValid()) m_elms.push_back(elm);
|
||||
}
|
||||
m_loaded = true;
|
||||
@ -94,45 +95,23 @@ void CFanart::getBackground(const TexData * &hq, const TexData * &lq)
|
||||
lq = hq;
|
||||
}
|
||||
|
||||
CColor CFanart::getTextColor(CColor themeTxtColor)
|
||||
void CFanart::reset()
|
||||
{
|
||||
return m_loaded ? m_cfg.getColor("GENERAL", "textcolor", CColor(themeTxtColor)) : themeTxtColor;
|
||||
for(vector<CFanartElement>::iterator Elm = m_elms.begin(); Elm != m_elms.end(); Elm++)
|
||||
Elm->Cleanup();
|
||||
m_elms.clear();
|
||||
for(int i = 1; i <= 6; i++)
|
||||
{
|
||||
CFanartElement elm(m_cfg, fanartDir, i);
|
||||
if (elm.IsValid()) m_elms.push_back(elm);
|
||||
}
|
||||
}
|
||||
|
||||
bool CFanart::hideCover()
|
||||
bool CFanart::noLoop()
|
||||
{
|
||||
if(!m_loaded)
|
||||
return false; // If no fanart is loaded, return false
|
||||
/*
|
||||
|
||||
fanart_hidecover defaults to True
|
||||
fanart_showafter defaults to False
|
||||
|
||||
hideCover | fanart_hideCover | showAfter | fanart_showAfter | animating | hide
|
||||
1 True * * * * True
|
||||
2 False * * * * False
|
||||
3 default False * * * False
|
||||
4 default default/True True * True True
|
||||
5 default default/True True * False False
|
||||
6 default default/True False * * True
|
||||
7 default default/True default True True True
|
||||
8 default default/True default True False False
|
||||
9 * * * * * True
|
||||
*/
|
||||
// rules 1 and 2
|
||||
if(m_globalHideCover != 2)
|
||||
return m_globalHideCover == 1;
|
||||
// rule 3
|
||||
if(!m_cfg.getBool("GENERAL", "hidecover", true))
|
||||
return false;
|
||||
// rules 4, 5 and 6
|
||||
if(m_globalShowCoverAfterAnimation != 2)
|
||||
return m_globalShowCoverAfterAnimation == 0 || !isAnimationComplete();
|
||||
// rules 7 and 8
|
||||
if(m_cfg.getBool("GENERAL", "show_cover_after_animation", false))
|
||||
return !isAnimationComplete();
|
||||
// rule 9
|
||||
return true;
|
||||
return m_globalShowCoverAfterAnimation == 1;
|
||||
return m_cfg.getBool("GENERAL", "show_cover_after_animation", false);
|
||||
}
|
||||
|
||||
bool CFanart::isLoaded()
|
||||
@ -147,6 +126,7 @@ bool CFanart::isAnimationComplete()
|
||||
|
||||
void CFanart::tick()
|
||||
{
|
||||
if(!m_loaded) return;
|
||||
m_animationComplete = true;
|
||||
for(u32 i = 0; i < m_elms.size(); ++i)
|
||||
{
|
||||
|
@ -67,10 +67,10 @@ public:
|
||||
bool isLoaded();
|
||||
|
||||
void getBackground(const TexData * &hq, const TexData * &lq);
|
||||
CColor getTextColor(CColor themeTxtColor = CColor(0xFFFFFFFF));
|
||||
bool hideCover();
|
||||
void draw(bool front = true);
|
||||
void tick();
|
||||
bool noLoop();
|
||||
void reset();
|
||||
|
||||
private:
|
||||
vector<CFanartElement> m_elms;
|
||||
|
@ -1675,9 +1675,6 @@ void CMenu::_mainLoopCommon(bool withCF, bool adjusting)
|
||||
CoverFlow.tick();
|
||||
m_btnMgr.tick();
|
||||
m_fa.tick();
|
||||
m_fa.hideCover() ? CoverFlow.hideCover() : CoverFlow.showCover();
|
||||
CoverFlow.setFanartPlaying(m_fa.isLoaded());
|
||||
CoverFlow.setFanartTextColor(m_fa.getTextColor(m_theme.getColor("_COVERFLOW", "font_color", CColor(0xFFFFFFFF))));
|
||||
|
||||
/* video setup */
|
||||
m_vid.prepare();
|
||||
|
@ -313,8 +313,7 @@ void CMenu::_showGame(void)
|
||||
m_fa.getBackground(bg, bglq);
|
||||
if(bg != NULL && bglq != NULL)
|
||||
_setBg(*bg, *bglq);
|
||||
if(m_fa.hideCover())
|
||||
CoverFlow.hideCover();
|
||||
CoverFlow.hideCover();
|
||||
}
|
||||
else
|
||||
_setBg(m_gameBg, m_gameBgLQ);
|
||||
@ -473,11 +472,22 @@ void CMenu::_game(bool launch)
|
||||
|
||||
while(!m_exit)
|
||||
{
|
||||
if(m_fa.isLoaded() && m_fa.isAnimationComplete())
|
||||
{
|
||||
if(m_fa.noLoop())
|
||||
{
|
||||
m_fa.unload();
|
||||
CoverFlow.showCover();
|
||||
_setBg(m_gameBg, m_gameBgLQ);
|
||||
}
|
||||
else //loop fanart
|
||||
m_fa.reset();
|
||||
}
|
||||
if(startGameSound < 1)
|
||||
startGameSound++;
|
||||
|
||||
if(startGameSound == -5)
|
||||
_showGame();
|
||||
_showGame();// this also starts fanart with unloading previous fanart.
|
||||
|
||||
if(!launch)
|
||||
_mainLoopCommon(true);
|
||||
@ -591,8 +601,15 @@ void CMenu::_game(bool launch)
|
||||
}
|
||||
else if(launch || BTN_A_PRESSED)
|
||||
{
|
||||
if(m_fa.isLoaded() && ShowPointer())
|
||||
{
|
||||
m_fa.unload();
|
||||
CoverFlow.showCover();
|
||||
_setBg(m_gameBg, m_gameBgLQ);
|
||||
continue;
|
||||
}
|
||||
/* delete button */
|
||||
if(m_btnMgr.selected(m_gameBtnDelete))
|
||||
else if(m_btnMgr.selected(m_gameBtnDelete))
|
||||
{
|
||||
_hideGame();
|
||||
m_banner.SetShowBanner(false);
|
||||
@ -835,7 +852,7 @@ void CMenu::_game(bool launch)
|
||||
}
|
||||
|
||||
/* showing and hiding buttons based on banner zoomed state */
|
||||
if(!m_zoom_banner || m_fa.isLoaded())
|
||||
if(!m_zoom_banner && !m_fa.isLoaded())
|
||||
{
|
||||
/* always hide full banner buttons */
|
||||
m_btnMgr.hide(m_gameBtnPlayFull);
|
||||
@ -895,7 +912,7 @@ void CMenu::_game(bool launch)
|
||||
m_btnMgr.hide(m_gameLblUser[4]);
|
||||
}
|
||||
}
|
||||
else // banner zoomed full screen
|
||||
else if(!m_fa.isLoaded())// banner zoomed full screen
|
||||
{
|
||||
if(m_banner_loaded && !m_soundThrdBusy)// there is a banner
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user