- all checkboxes are now a single button. we just change the texture from off to on instead of having 2 different buttons and hiding the off to show the on or vice versa. shrinks wiiflow dol and theme ini's. for categories, source menu editor, and plugin select menu's.

- fixed wiiflow language setting. I must've broke it a while back.
This commit is contained in:
Fledge68 2022-10-18 15:15:54 -05:00
parent 3da96c7737
commit 25a67d6539
9 changed files with 214 additions and 288 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 MiB

After

Width:  |  Height:  |  Size: 4.4 MiB

View File

@ -21,7 +21,6 @@ bool CButtonsMgr::init()
m_rumbleEnabled = false; m_rumbleEnabled = false;
m_soundVolume = 0xFF; m_soundVolume = 0xFF;
m_noclick = false; m_noclick = false;
m_nohover = false;
m_mouse = false; m_mouse = false;
soundInit(); soundInit();
@ -80,57 +79,57 @@ s16 CButtonsMgr::addPicButton(const u8 *pngNormal, const u8 *pngSelected, int x,
s16 CButtonsMgr::addLabel(SFont font, const wstringEx &text, int x, int y, u32 width, u32 height, const CColor &color, s16 style, const TexData &bg) s16 CButtonsMgr::addLabel(SFont font, const wstringEx &text, int x, int y, u32 width, u32 height, const CColor &color, s16 style, const TexData &bg)
{ {
SLabel *b = new SLabel; SLabel *lbl = new SLabel;
b->font = font; lbl->font = font;
b->visible = false; lbl->visible = false;
b->textStyle = style; lbl->textStyle = style;
b->text.setText(b->font, text); lbl->text.setText(lbl->font, text);
b->text.setFrame(width, b->textStyle, false, true); lbl->text.setFrame(width, lbl->textStyle, false, true);
b->textColor = color; lbl->textColor = color;
b->x = x + width / 2; lbl->x = x + width / 2;
b->y = y + height / 2; lbl->y = y + height / 2;
b->w = width; lbl->w = width;
b->h = height; lbl->h = height;
b->alpha = 0; lbl->alpha = 0;
b->targetAlpha = 0; lbl->targetAlpha = 0;
b->scaleX = 0.f; lbl->scaleX = 0.f;
b->scaleY = 0.f; lbl->scaleY = 0.f;
b->targetScaleX = 0.f; lbl->targetScaleX = 0.f;
b->targetScaleY = 0.f; lbl->targetScaleY = 0.f;
b->texBg = bg; lbl->texBg = bg;
b->moveByX = 0; lbl->moveByX = 0;
b->moveByY = 0; lbl->moveByY = 0;
u32 sz = m_elts.size(); u32 sz = m_elts.size();
m_elts.push_back(b); m_elts.push_back(lbl);
return m_elts.size() > sz ? m_elts.size() - 1 : -2; return m_elts.size() > sz ? m_elts.size() - 1 : -2;
} }
s16 CButtonsMgr::addProgressBar(int x, int y, u32 width, u32 height, SButtonTextureSet &texSet) s16 CButtonsMgr::addProgressBar(int x, int y, u32 width, u32 height, SButtonTextureSet &texSet)
{ {
SProgressBar *b = new SProgressBar; SProgressBar *pb = new SProgressBar;
b->visible = false; pb->visible = false;
b->x = x + width / 2; pb->x = x + width / 2;
b->y = y + height / 2; pb->y = y + height / 2;
b->w = width; pb->w = width;
b->h = height; pb->h = height;
b->alpha = 0; pb->alpha = 0;
b->targetAlpha = 0; pb->targetAlpha = 0;
b->scaleX = 0.f; pb->scaleX = 0.f;
b->scaleY = 0.f; pb->scaleY = 0.f;
b->targetScaleX = 0.f; pb->targetScaleX = 0.f;
b->targetScaleY = 0.f; pb->targetScaleY = 0.f;
b->tex = texSet; pb->tex = texSet;
b->val = 0.f; pb->val = 0.f;
b->targetVal = 0.f; pb->targetVal = 0.f;
b->moveByX = 0; pb->moveByX = 0;
b->moveByY = 0; pb->moveByY = 0;
u32 sz = m_elts.size(); u32 sz = m_elts.size();
m_elts.push_back(b); m_elts.push_back(pb);
return m_elts.size() > sz ? m_elts.size() - 1 : -2; return m_elts.size() > sz ? m_elts.size() - 1 : -2;
} }
@ -189,15 +188,17 @@ void CButtonsMgr::setText(s16 id, const wstringEx &text, u32 startline, bool unw
} }
} }
void CButtonsMgr::setBtnTexture(s16 id, TexData &texNormal, TexData &texSelected) void CButtonsMgr::setBtnTexture(s16 id, TexData &texNormal, TexData &texSelected, bool cleanup)
{ {
if (id == -1) return; if (id == -1) return;
if (id < (s32)m_elts.size()) if (id < (s32)m_elts.size())
{ {
SButton *b = (SButton*)m_elts[id]; SButton *b = (SButton*)m_elts[id];// buttons only. ie. source buttons and checkboxes
/* free old textures */ if(cleanup)/* free old textures for source buttons */
TexHandle.Cleanup(b->tex.center); {
TexHandle.Cleanup(b->tex.centerSel); TexHandle.Cleanup(b->tex.center);
TexHandle.Cleanup(b->tex.centerSel);
}
/*change textures */ /*change textures */
b->tex.center = texNormal; b->tex.center = texNormal;
b->tex.centerSel = texSelected; b->tex.centerSel = texSelected;
@ -209,7 +210,7 @@ void CButtonsMgr::freeBtnTexture(s16 id)
if(id == -1) return; if(id == -1) return;
if(id < (s32)m_elts.size()) if(id < (s32)m_elts.size())
{ {
SButton *b = (SButton*)m_elts[id]; SButton *b = (SButton*)m_elts[id];// for buttons only. ie. source buttons
TexHandle.Cleanup(b->tex.center); TexHandle.Cleanup(b->tex.center);
TexHandle.Cleanup(b->tex.centerSel); TexHandle.Cleanup(b->tex.centerSel);
} }
@ -295,9 +296,9 @@ void CButtonsMgr::setProgress(s16 id, float f, bool instant)
{ {
if(m_elts[id]->t == GUIELT_PROGRESS) if(m_elts[id]->t == GUIELT_PROGRESS)
{ {
SProgressBar *b = (SProgressBar*)m_elts[id]; SProgressBar *p = (SProgressBar*)m_elts[id];
b->targetVal = std::min(std::max(0.f, f), 1.f); p->targetVal = std::min(std::max(0.f, f), 1.f);
if (instant) b->val = b->targetVal; if (instant) p->val = p->targetVal;
} }
} }
@ -306,18 +307,18 @@ void CButtonsMgr::reset(s16 id, bool instant)
if (id == -1) return; if (id == -1) return;
if (id < (s32)m_elts.size()) if (id < (s32)m_elts.size())
{ {
SElement &b = *m_elts[id]; SElement &e = *m_elts[id];
b.x -= b.moveByX; e.x -= e.moveByX;
b.y -= b.moveByY; e.y -= e.moveByY;
if (instant) if (instant)
{ {
b.pos.x -= b.moveByX; e.pos.x -= e.moveByX;
b.pos.y -= b.moveByY; e.pos.y -= e.moveByY;
} }
b.targetPos.x -= b.moveByX; e.targetPos.x -= e.moveByX;
b.targetPos.y -= b.moveByY; e.targetPos.y -= e.moveByY;
b.moveByX = 0; e.moveByX = 0;
b.moveByY = 0; e.moveByY = 0;
} }
} }
@ -326,18 +327,18 @@ void CButtonsMgr::moveBy(s16 id, int x, int y, bool instant)
if (id == -1) return; if (id == -1) return;
if (id < (s32)m_elts.size()) if (id < (s32)m_elts.size())
{ {
CButtonsMgr::SElement &b = *m_elts[id]; CButtonsMgr::SElement &e = *m_elts[id];
b.moveByX += x; e.moveByX += x;
b.moveByY += y; e.moveByY += y;
b.x += x; e.x += x;
b.y += y; e.y += y;
if (instant) if (instant)
{ {
b.pos.x += x; e.pos.x += x;
b.pos.y += y; e.pos.y += y;
} }
b.targetPos.x += x; e.targetPos.x += x;
b.targetPos.y += y; e.targetPos.y += y;
} }
} }
@ -346,8 +347,8 @@ void CButtonsMgr::getTotalHeight(s16 id, int &height)
if (id == -1) return; if (id == -1) return;
if (id < (s32)m_elts.size()) if (id < (s32)m_elts.size())
{ {
SLabel *s = (SLabel*)m_elts[id]; SLabel *l = (SLabel*)m_elts[id];
height = s->text.getTotalHeight(); height = l->text.getTotalHeight();
} }
} }
@ -356,16 +357,16 @@ void CButtonsMgr::getDimensions(s16 id, int &x, int &y, u32 &width, u32 &height)
if (id == -1) return; if (id == -1) return;
if (id < (s32)m_elts.size()) if (id < (s32)m_elts.size())
{ {
CButtonsMgr::SElement &b = *m_elts[id]; CButtonsMgr::SElement &e = *m_elts[id];
x = b.targetPos.x; x = e.targetPos.x;
y = b.targetPos.y; y = e.targetPos.y;
width = b.w; width = e.w;
height = b.h; height = e.h;
if(b.t == GUIELT_LABEL) if(e.t == GUIELT_LABEL)
{ {
SLabel *s = (SLabel*)m_elts[id]; SLabel *l = (SLabel*)m_elts[id];
// Calculate height // Calculate height
height = s->text.getTotalHeight(); height = l->text.getTotalHeight();
} }
} }
} }
@ -375,22 +376,22 @@ void CButtonsMgr::hide(s16 id, int dx, int dy, float scaleX, float scaleY, bool
if (id == -1) return; if (id == -1) return;
if (id < (s32)m_elts.size()) if (id < (s32)m_elts.size())
{ {
SElement &b = *m_elts[id]; SElement &e = *m_elts[id];
b.hideParam.dx = dx; e.hideParam.dx = dx;
b.hideParam.dy = dy; e.hideParam.dy = dy;
b.hideParam.scaleX = scaleX; e.hideParam.scaleX = scaleX;
b.hideParam.scaleY = scaleY; e.hideParam.scaleY = scaleY;
b.visible = false; e.visible = false;
b.targetScaleX = scaleX; e.targetScaleX = scaleX;
b.targetScaleY = scaleY; e.targetScaleY = scaleY;
b.targetPos = Vector3D((float)(b.x + dx), (float)(b.y + dy), 0.f); e.targetPos = Vector3D((float)(e.x + dx), (float)(e.y + dy), 0.f);
b.targetAlpha = 0x00; e.targetAlpha = 0x00;
if (instant) if (instant)
{ {
b.scaleX = b.targetScaleX; e.scaleX = e.targetScaleX;
b.scaleY = b.targetScaleY; e.scaleY = e.targetScaleY;
b.pos = b.targetPos; e.pos = e.targetPos;
b.alpha = b.targetAlpha; e.alpha = e.targetAlpha;
} }
for(int chan = WPAD_MAX_WIIMOTES-1; chan >= 0; chan--) for(int chan = WPAD_MAX_WIIMOTES-1; chan >= 0; chan--)
if (m_selected[chan] == id) if (m_selected[chan] == id)
@ -403,8 +404,8 @@ void CButtonsMgr::hide(s16 id, bool instant)
if (id == -1) return; if (id == -1) return;
if (id < (s32)m_elts.size()) if (id < (s32)m_elts.size())
{ {
CButtonsMgr::SElement &b = *m_elts[id]; CButtonsMgr::SElement &e = *m_elts[id];
hide(id, b.hideParam.dx, b.hideParam.dy, b.hideParam.scaleX, b.hideParam.scaleY, instant); hide(id, e.hideParam.dx, e.hideParam.dy, e.hideParam.scaleX, e.hideParam.scaleY, instant);
} }
} }
@ -413,18 +414,18 @@ void CButtonsMgr::show(s16 id, bool instant)
if (id == -1) return; if (id == -1) return;
if (id < (s32)m_elts.size()) if (id < (s32)m_elts.size())
{ {
SElement &b = *m_elts[id]; SElement &e = *m_elts[id];
b.visible = true; e.visible = true;
b.targetScaleX = 1.0f; e.targetScaleX = 1.0f;
b.targetScaleY = 1.0f; e.targetScaleY = 1.0f;
b.targetPos = Vector3D((float)b.x, (float)b.y, 0); e.targetPos = Vector3D((float)e.x, (float)e.y, 0);
b.targetAlpha = 0xFF; e.targetAlpha = 0xFF;
if (instant) if (instant)
{ {
b.scaleX = b.targetScaleX; e.scaleX = e.targetScaleX;
b.scaleY = b.targetScaleY; e.scaleY = e.targetScaleY;
b.pos = b.targetPos; e.pos = e.targetPos;
b.alpha = b.targetAlpha; e.alpha = e.targetAlpha;
} }
} }
} }
@ -457,11 +458,6 @@ void CButtonsMgr::setMouse(bool enable)
m_mouse = enable; m_mouse = enable;
} }
void CButtonsMgr::noHover(bool nohover)
{
m_nohover = nohover;
}
void CButtonsMgr::noClick(bool noclick) void CButtonsMgr::noClick(bool noclick)
{ {
m_noclick = noclick; m_noclick = noclick;
@ -485,12 +481,13 @@ bool CButtonsMgr::selected(s16 button)
return false; return false;
} }
// we use this for checkboxes. when clicked it is hidden which looses the selected state. so when its re-shown we call this to also auto select it.
void CButtonsMgr::setSelected(s16 button) void CButtonsMgr::setSelected(s16 button)
{ {
SElement &b = *m_elts[button]; SElement &e = *m_elts[button];
m_selected[0] = button; m_selected[0] = button;
b.targetScaleX = 1.1f; e.targetScaleX = 1.1f;
b.targetScaleY = 1.1f; e.targetScaleY = 1.1f;
} }
@ -528,9 +525,10 @@ void CButtonsMgr::mouse(int chan, int x, int y)
if (m_elts.empty()) return; if (m_elts.empty()) return;
float w, h; float w, h;
s32 start = -1; s32 start = -1;// used as the current or last button
if(m_selected[chan] != -1 && m_selected[chan] < (s32)m_elts.size()) if(m_selected[chan] != -1 && m_selected[chan] < (s32)m_elts.size())
{ {
// return current or last button to its normal scale
m_elts[m_selected[chan]]->targetScaleX = 1.f; m_elts[m_selected[chan]]->targetScaleX = 1.f;
m_elts[m_selected[chan]]->targetScaleY = 1.f; m_elts[m_selected[chan]]->targetScaleY = 1.f;
start = m_selected[chan]; start = m_selected[chan];
@ -538,10 +536,10 @@ void CButtonsMgr::mouse(int chan, int x, int y)
m_selected[chan] = -1; m_selected[chan] = -1;
for(int i = (int)m_elts.size() - 1; i >= 0; --i) for(int i = (int)m_elts.size() - 1; i >= 0; --i)
{ {
SElement &b = *m_elts[i]; SElement &e = *m_elts[i];
if(b.t == GUIELT_BUTTON) if(e.t == GUIELT_BUTTON)
{ {
SButton &but = *(SButton*)&b; SButton &but = *(SButton*)&e;
w = (float)(but.w / 2); w = (float)(but.w / 2);
h = (float)(but.h / 2); h = (float)(but.h / 2);
if(but.visible && (float)x >= but.pos.x - w && (float)x < but.pos.x + w && (float)y >= but.pos.y - h && (float)y < but.pos.y + h) if(but.visible && (float)x >= but.pos.x - w && (float)x < but.pos.x + w && (float)y >= but.pos.y - h && (float)y < but.pos.y + h)
@ -550,13 +548,10 @@ void CButtonsMgr::mouse(int chan, int x, int y)
but.targetScaleX = 1.05f; but.targetScaleX = 1.05f;
but.targetScaleY = 1.05f; but.targetScaleY = 1.05f;
// //
if(start != m_selected[chan]) if(start != m_selected[chan])// if it's a new button play hover sound and rumble
{ {
if(m_soundVolume > 0) if(m_soundVolume > 0)
{ but.hoverSound->Play(m_soundVolume);
if(!m_nohover)
but.hoverSound->Play(m_soundVolume);
}
if(m_rumbleEnabled) if(m_rumbleEnabled)
{ {
m_rumble[chan] = 4; m_rumble[chan] = 4;
@ -579,11 +574,13 @@ void CButtonsMgr::up(void)
{ {
if(m_elts.empty() || m_mouse) if(m_elts.empty() || m_mouse)
return; return;
u32 start = 0; u32 start = 0;// set as first element. don't use -1.
for(int chan = WPAD_MAX_WIIMOTES-1; chan >= 0; chan--) for(int chan = WPAD_MAX_WIIMOTES-1; chan >= 0; chan--)
{ {
// check if a element is selected and if so use it as start element
if(m_selected[chan] != -1 && m_selected[chan] < (s32)m_elts.size()) if(m_selected[chan] != -1 && m_selected[chan] < (s32)m_elts.size())
{ {
// return current or last button to its normal scale
m_elts[m_selected[chan]]->targetScaleX = 1.f; m_elts[m_selected[chan]]->targetScaleX = 1.f;
m_elts[m_selected[chan]]->targetScaleY = 1.f; m_elts[m_selected[chan]]->targetScaleY = 1.f;
start = m_selected[chan]; start = m_selected[chan];
@ -593,12 +590,15 @@ void CButtonsMgr::up(void)
for(u32 i = 1; i <= m_elts.size(); ++i) for(u32 i = 1; i <= m_elts.size(); ++i)
{ {
u32 j = loopNum<u32>(start - i, m_elts.size()); u32 j = loopNum<u32>(start - i, m_elts.size());
SElement &b = *m_elts[j]; SElement &e = *m_elts[j];
if (b.t == GUIELT_BUTTON && b.visible) if(e.t == GUIELT_BUTTON && e.visible)
{ {
m_selected[0] = j; m_selected[0] = j;
b.targetScaleX = 1.1f;// mouse only enlarges 1.05 e.targetScaleX = 1.1f;// mouse only enlarges 1.05
b.targetScaleY = 1.1f; e.targetScaleY = 1.1f;
SButton &but = *(SButton*)&e;
if(m_soundVolume > 0)
but.hoverSound->Play(m_soundVolume);
break; break;
} }
} }
@ -626,12 +626,15 @@ void CButtonsMgr::down(void)
for(u32 i = 1; i <= m_elts.size(); ++i) for(u32 i = 1; i <= m_elts.size(); ++i)
{ {
u32 j = loopNum<u32>(start + i, m_elts.size()); u32 j = loopNum<u32>(start + i, m_elts.size());
SElement &b = *m_elts[j]; SElement &e = *m_elts[j];
if (b.t == GUIELT_BUTTON && b.visible) if(e.t == GUIELT_BUTTON && e.visible)
{ {
m_selected[0] = j; m_selected[0] = j;
b.targetScaleX = 1.1f;// mouse only enlarges 1.05 e.targetScaleX = 1.1f;// mouse only enlarges 1.05
b.targetScaleY = 1.1f; e.targetScaleY = 1.1f;
SButton &but = *(SButton*)&e;
if(m_soundVolume > 0)
but.hoverSound->Play(m_soundVolume);
break; break;
} }
} }

View File

@ -41,7 +41,7 @@ public:
s16 addProgressBar(int x, int y, u32 width, u32 height, SButtonTextureSet &texSet); s16 addProgressBar(int x, int y, u32 width, u32 height, SButtonTextureSet &texSet);
void setText(s16 id, const wstringEx &text, bool unwrap = false); void setText(s16 id, const wstringEx &text, bool unwrap = false);
void setText(s16 id, const wstringEx &text, u32 startline, bool unwrap = false); void setText(s16 id, const wstringEx &text, u32 startline, bool unwrap = false);
void setBtnTexture(s16 id, TexData &texNormal, TexData &texSelected); void setBtnTexture(s16 id, TexData &texNormal, TexData &texSelected, bool cleanup = true);
void freeBtnTexture(s16 id); void freeBtnTexture(s16 id);
void setTexture(s16 id ,TexData &bg); void setTexture(s16 id ,TexData &bg);
void setTexture(s16 id, TexData &bg, int width, int height); void setTexture(s16 id, TexData &bg, int width, int height);
@ -61,7 +61,6 @@ public:
void draw(void); void draw(void);
void tick(void); void tick(void);
void noClick(bool noclick = false); void noClick(bool noclick = false);
void noHover(bool nohover = false);
void click(s16 id = -1); void click(s16 id = -1);
bool selected(s16 button = -1); bool selected(s16 button = -1);
void setSelected(s16 button); void setSelected(s16 button);
@ -154,7 +153,6 @@ private:
GuiSound *m_sndClick; GuiSound *m_sndClick;
u8 m_soundVolume; u8 m_soundVolume;
bool m_noclick; bool m_noclick;
bool m_nohover;
bool m_mouse; bool m_mouse;
private: private:
void _drawBtn(SButton &b, bool selected, bool click); void _drawBtn(SButton &b, bool selected, bool click);

View File

@ -184,6 +184,9 @@ bool CMenu::init(bool usb_mounted)
strncpy(proxyPassword, m_cfg.getString("PROXY", "proxy_password", "").c_str(), sizeof(proxyPassword) - 1); strncpy(proxyPassword, m_cfg.getString("PROXY", "proxy_password", "").c_str(), sizeof(proxyPassword) - 1);
getProxyInfo(); getProxyInfo();
/* set default homebrew partition for first boot */
m_cfg.getInt(HOMEBREW_DOMAIN, "partition", strcmp(drive, "sd") == 0 ? 0 : 1);// drive is device where wiiflow is.
/* Set SD only to off if any usb device is attached */ /* Set SD only to off if any usb device is attached */
bool cfg_sdonly = m_cfg.getBool("GENERAL", "sd_only", usb_mounted ? false : true);// will only set it if this doesn't already exist - very first boot up bool cfg_sdonly = m_cfg.getBool("GENERAL", "sd_only", usb_mounted ? false : true);// will only set it if this doesn't already exist - very first boot up
if(cfg_sdonly != sdOnly)// done for backwards compatibility with older wiiflow lite's if(cfg_sdonly != sdOnly)// done for backwards compatibility with older wiiflow lite's

View File

@ -263,6 +263,10 @@ private:
s16 m_configBtn4M; s16 m_configBtn4M;
s16 m_configBtn4P; s16 m_configBtn4P;
// checkbox menus
s16 m_checkboxLblTxt[11];
s16 m_checkboxBtn[11];
// Download menu // Download menu
s16 m_downloadLblTitle; s16 m_downloadLblTitle;
s16 m_downloadBtnBack; s16 m_downloadBtnBack;

View File

@ -8,17 +8,11 @@ s16 m_categoryBtnPageP;
s16 m_categoryBtnClear; s16 m_categoryBtnClear;
s16 m_categoryBtnBack; s16 m_categoryBtnBack;
s16 m_categoryLblTitle; s16 m_categoryLblTitle;
s16 m_categoryLblCat[11];
s16 m_categoryBtnCat[11];
s16 m_categoryBtnCats[11];
s16 m_categoryBtnCatHid[11];
s16 m_categoryBtnCatReq[11];
s16 m_categoryLblUser[4]; s16 m_categoryLblUser[4];
TexData m_categoryBg; TexData m_categoryBg;
vector<char> m_categories; vector<char> m_categories;
static u8 curPage; static u8 curPage;
u8 lastBtn;
char id[64]; char id[64];
const char *catDomain = NULL; const char *catDomain = NULL;
bool gameSet; bool gameSet;
@ -39,11 +33,8 @@ void CMenu::_hideCategorySettings(bool instant)
for(u8 i = 1; i < 11; ++i) for(u8 i = 1; i < 11; ++i)
{ {
m_btnMgr.hide(m_categoryLblCat[i]); m_btnMgr.hide(m_checkboxLblTxt[i]);
m_btnMgr.hide(m_categoryBtnCat[i]); m_btnMgr.hide(m_checkboxBtn[i]);
m_btnMgr.hide(m_categoryBtnCats[i]);
m_btnMgr.hide(m_categoryBtnCatHid[i]);
m_btnMgr.hide(m_categoryBtnCatReq[i]);
} }
} }
@ -102,11 +93,8 @@ void CMenu::_updateCatCheckboxes(void)
{ {
for(u8 i = 1; i < 11; ++i) for(u8 i = 1; i < 11; ++i)
{ {
m_btnMgr.hide(m_categoryBtnCat[i], true); m_btnMgr.hide(m_checkboxBtn[i], true);
m_btnMgr.hide(m_categoryBtnCats[i], true); m_btnMgr.hide(m_checkboxLblTxt[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) if(m_max_categories > 11)
@ -125,19 +113,20 @@ void CMenu::_updateCatCheckboxes(void)
switch(m_categories[j]) switch(m_categories[j])
{ {
case '0': case '0':
m_btnMgr.show(m_categoryBtnCat[i]); m_btnMgr.setBtnTexture(m_checkboxBtn[i], theme.checkboxoff, theme.checkboxoffs, false);
break; break;
case '1': case '1':
m_btnMgr.show(m_categoryBtnCats[i]); m_btnMgr.setBtnTexture(m_checkboxBtn[i], theme.checkboxon, theme.checkboxons, false);
break; break;
case '2': case '2':
m_btnMgr.show(m_categoryBtnCatHid[i]); m_btnMgr.setBtnTexture(m_checkboxBtn[i], theme.checkboxHid, theme.checkboxHids, false);
break; break;
default: default:
m_btnMgr.show(m_categoryBtnCatReq[i]); m_btnMgr.setBtnTexture(m_checkboxBtn[i], theme.checkboxReq, theme.checkboxReqs, false);
} }
m_btnMgr.setText(m_categoryLblCat[i], m_cat.getWString(genDomain, fmt("cat%d",j), wfmt(L"Category %i",j).c_str())); m_btnMgr.setText(m_checkboxLblTxt[i], m_cat.getWString(genDomain, fmt("cat%d",j), wfmt(L"Category %i",j).c_str()));
m_btnMgr.show(m_categoryLblCat[i]); m_btnMgr.show(m_checkboxLblTxt[i]);
m_btnMgr.show(m_checkboxBtn[i]);
} }
} }
@ -268,8 +257,6 @@ void CMenu::_CategorySettings(bool fromGameSet)
{ {
_mainLoopCommon(); _mainLoopCommon();
CoverFlow.tick(); CoverFlow.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))) if(BTN_HOME_PRESSED || BTN_B_PRESSED || (BTN_A_PRESSED && m_btnMgr.selected(m_categoryBtnBack)))
{ {
@ -336,8 +323,6 @@ void CMenu::_CategorySettings(bool fromGameSet)
} }
if((BTN_LEFT_PRESSED && m_max_categories>11) || (BTN_A_PRESSED && m_btnMgr.selected(m_categoryBtnPageM))) if((BTN_LEFT_PRESSED && m_max_categories>11) || (BTN_A_PRESSED && m_btnMgr.selected(m_categoryBtnPageM)))
{ {
lastBtn = m_categoryBtnPageM;
m_btnMgr.noHover(true);
curPage--; curPage--;
if(curPage < 1) if(curPage < 1)
curPage = ((m_max_categories - 2) / 10) + 1; curPage = ((m_max_categories - 2) / 10) + 1;
@ -347,8 +332,6 @@ void CMenu::_CategorySettings(bool fromGameSet)
} }
else if((BTN_RIGHT_PRESSED && m_max_categories>11) || (BTN_A_PRESSED && m_btnMgr.selected(m_categoryBtnPageP))) 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++; curPage++;
if(curPage > ((m_max_categories - 2) / 10) + 1) if(curPage > ((m_max_categories - 2) / 10) + 1)
curPage = 1; curPage = 1;
@ -378,17 +361,8 @@ void CMenu::_CategorySettings(bool fromGameSet)
for(u8 i = 1; i < 11; ++i) for(u8 i = 1; i < 11; ++i)
{ {
m_refreshGameList = true; m_refreshGameList = true;
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])) if(m_btnMgr.selected(m_checkboxBtn[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); int j = i + ((curPage - 1) * 10);
if(fromGameSet) if(fromGameSet)
{ {
@ -404,29 +378,23 @@ void CMenu::_CategorySettings(bool fromGameSet)
if(m_categories.at(0) == '1' && m_categories.at(j) != '0') if(m_categories.at(0) == '1' && m_categories.at(j) != '0')
m_categories.at(0) = '0'; m_categories.at(0) = '0';
} }
m_btnMgr.hide(m_categoryBtnCat[i], true); m_btnMgr.hide(m_checkboxBtn[i], true);
m_btnMgr.hide(m_categoryBtnCats[i], true);
m_btnMgr.hide(m_categoryBtnCatHid[i], true);
m_btnMgr.hide(m_categoryBtnCatReq[i], true);
switch(m_categories.at(j)) switch(m_categories.at(j))
{ {
case '0': case '0':
m_btnMgr.show(m_categoryBtnCat[i]); m_btnMgr.setBtnTexture(m_checkboxBtn[i], theme.checkboxoff, theme.checkboxoffs, false);
m_btnMgr.setSelected(m_categoryBtnCat[i]);
break; break;
case '1': case '1':
m_btnMgr.show(m_categoryBtnCats[i]); m_btnMgr.setBtnTexture(m_checkboxBtn[i], theme.checkboxon, theme.checkboxons, false);
m_btnMgr.setSelected(m_categoryBtnCats[i]);
break; break;
case '2': case '2':
m_btnMgr.show(m_categoryBtnCatHid[i]); m_btnMgr.setBtnTexture(m_checkboxBtn[i], theme.checkboxHid, theme.checkboxHids, false);
m_btnMgr.setSelected(m_categoryBtnCatHid[i]);
break; break;
default: default:
m_btnMgr.show(m_categoryBtnCatReq[i]); m_btnMgr.setBtnTexture(m_checkboxBtn[i], theme.checkboxReq, theme.checkboxReqs, false);
m_btnMgr.setSelected(m_categoryBtnCatReq[i]);
break;
} }
m_btnMgr.show(m_checkboxBtn[i]);
m_btnMgr.setSelected(m_checkboxBtn[i]);
break; break;
} }
} }
@ -445,34 +413,14 @@ void CMenu::_initCategorySettingsMenu()
m_categoryBtnPageP = _addPicButton("CATEGORY/PAGE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 172, 400, 48, 48); m_categoryBtnPageP = _addPicButton("CATEGORY/PAGE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 172, 400, 48, 48);
m_categoryBtnBack = _addButton("CATEGORY/BACK_BTN", theme.btnFont, L"", 420, 400, 200, 48, theme.btnFontColor); m_categoryBtnBack = _addButton("CATEGORY/BACK_BTN", theme.btnFont, L"", 420, 400, 200, 48, theme.btnFontColor);
m_categoryBtnClear = _addButton("CATEGORY/CLEAR_BTN", theme.btnFont, L"", 230, 400, 180, 48, theme.btnFontColor); m_categoryBtnClear = _addButton("CATEGORY/CLEAR_BTN", theme.btnFont, L"", 230, 400, 180, 48, theme.btnFontColor);
for(u8 i = 1; i < 6; ++i)
{ // left half
m_categoryBtnCat[i] = _addPicButton(fmt("CATEGORY/CAT_%i_BTN", i), theme.checkboxoff, theme.checkboxoffs, 30, (39+i*58), 44, 48);
m_categoryBtnCats[i] = _addPicButton(fmt("CATEGORY/CAT_%i_BTNS", i), theme.checkboxon, theme.checkboxons, 30, (39+i*58), 44, 48);
m_categoryBtnCatHid[i] = _addPicButton(fmt("CATEGORY/CAT_%i_BTNHID", i), theme.checkboxHid, theme.checkboxHids, 30, (39+i*58), 44, 48);
m_categoryBtnCatReq[i] = _addPicButton(fmt("CATEGORY/CAT_%i_BTNREQ", i), theme.checkboxReq, theme.checkboxReqs, 30, (39+i*58), 44, 48);
m_categoryLblCat[i] = _addLabel(fmt("CATEGORY/CAT_%i", i), theme.lblFont, L"", 85, (42+i*58), 230, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
// right half
m_categoryBtnCat[i+5] = _addPicButton(fmt("CATEGORY/CAT_%i_BTN", i+5), theme.checkboxoff, theme.checkboxoffs, 325, (39+i*58), 44, 48);
m_categoryBtnCats[i+5] = _addPicButton(fmt("CATEGORY/CAT_%i_BTNS", i+5), theme.checkboxon, theme.checkboxons, 325, (39+i*58), 44, 48);
m_categoryBtnCatHid[i+5] = _addPicButton(fmt("CATEGORY/CAT_%i_BTNHID", i+5), theme.checkboxHid, theme.checkboxHids, 325, (39+i*58), 44, 48);
m_categoryBtnCatReq[i+5] = _addPicButton(fmt("CATEGORY/CAT_%i_BTNREQ", i+5), theme.checkboxReq, theme.checkboxReqs, 325, (39+i*58), 44, 48);
m_categoryLblCat[i+5] = _addLabel(fmt("CATEGORY/CAT_%i", i+5), theme.lblFont, 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_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(u8 i = 1; i < 11; ++i)
{
_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_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);
}
_hideCategorySettings(true); _hideCategorySettings(true);
_textCategorySettings(); _textCategorySettings();
} }

View File

@ -547,26 +547,25 @@ void CMenu::_configMain(void)
else if(m_btnMgr.selected(m_configBtn2P) || m_btnMgr.selected(m_configBtn2M)) else if(m_btnMgr.selected(m_configBtn2P) || m_btnMgr.selected(m_configBtn2M))
{ {
s8 direction = m_btnMgr.selected(m_configBtn2P) ? 1 : -1; s8 direction = m_btnMgr.selected(m_configBtn2P) ? 1 : -1;
curLanguage = loopNum(curLanguage + direction, (u32)languages_available.size()); if(languages_available.size() > 1)
m_curLanguage = languages_available[curLanguage];
if(!m_loc.load(fmt("%s/%s.ini", m_languagesDir.c_str(), m_curLanguage.c_str())))
{ {
m_curLanguage = "Default";
m_cfg.setString("GENERAL", "language", m_curLanguage.c_str());
m_loc.unload(); m_loc.unload();
} curLanguage = loopNum(curLanguage + direction, (u32)languages_available.size());
else m_curLanguage = languages_available[curLanguage];
if(m_curLanguage != "Default")
m_loc.load(fmt("%s/%s.ini", m_languagesDir.c_str(), m_curLanguage.c_str()));
m_cfg.setString("GENERAL", "language", m_curLanguage.c_str()); m_cfg.setString("GENERAL", "language", m_curLanguage.c_str());
_updateText(); _updateText();
m_btnMgr.setText(m_configLbl1, _t("cfga7", L"Theme")); m_btnMgr.setText(m_configLbl1, _t("cfga7", L"Theme"));
m_btnMgr.setText(m_configLbl2, _t("cfgc9", L"WiiFlow Language")); m_btnMgr.setText(m_configLbl2, _t("cfgc9", L"WiiFlow Language"));
m_btnMgr.setText(m_configLbl3, _t("cfgc4", L"Adjust Coverflow")); m_btnMgr.setText(m_configLbl3, _t("cfgc4", L"Adjust Coverflow"));
m_btnMgr.setText(m_configLbl4, _t("cfgc8", L"Startup Settings")); m_btnMgr.setText(m_configLbl4, _t("cfgc8", L"Startup Settings"));
m_btnMgr.setText(m_configLbl1Val, m_cfg.getString("GENERAL", "theme")); m_btnMgr.setText(m_configLbl1Val, m_cfg.getString("GENERAL", "theme"));
m_btnMgr.setText(m_configLbl2Val, m_curLanguage); m_btnMgr.setText(m_configLbl2Val, m_curLanguage);
m_btnMgr.setText(m_configBtn3, _t("cfgc5", L"Go")); m_btnMgr.setText(m_configBtn3, _t("cfgc5", L"Go"));
m_btnMgr.setText(m_configBtn4, _t("cfgc5", L"Go")); m_btnMgr.setText(m_configBtn4, _t("cfgc5", L"Go"));
}
} }
else if(m_btnMgr.selected(m_configBtn3)) else if(m_btnMgr.selected(m_configBtn3))
{ {
@ -959,7 +958,7 @@ void CMenu::_configMain(void)
} }
} }
} }
if(mainCfg_curPage == 2 && m_curLanguage != prevLanguage) if(m_curLanguage != prevLanguage)
{ {
m_cacheList.Init(m_settingsDir.c_str(), m_loc.getString(m_curLanguage, "gametdb_code", "EN").c_str(), m_pluginDataDir.c_str(), m_cacheList.Init(m_settingsDir.c_str(), m_loc.getString(m_curLanguage, "gametdb_code", "EN").c_str(), m_pluginDataDir.c_str(),
m_cfg.getString(CONFIG_FILENAME_SKIP_DOMAIN,CONFIG_FILENAME_SKIP_KEY,CONFIG_FILENAME_SKIP_DEFAULT)); m_cfg.getString(CONFIG_FILENAME_SKIP_DOMAIN,CONFIG_FILENAME_SKIP_KEY,CONFIG_FILENAME_SKIP_DEFAULT));

View File

@ -14,10 +14,6 @@ s16 m_pluginBtnPageM;
s16 m_pluginBtnPageP; s16 m_pluginBtnPageP;
s16 m_pluginBtnBack; s16 m_pluginBtnBack;
s16 m_pluginLblTitle; s16 m_pluginLblTitle;
s16 m_pluginLblCat[11];
s16 m_pluginBtn[11];
s16 m_pluginBtnCat[11];
s16 m_pluginBtnCats[11];
s16 m_pluginLblUser[4]; s16 m_pluginLblUser[4];
TexData m_pluginBg; TexData m_pluginBg;
@ -34,8 +30,8 @@ void CMenu::_hidePluginSettings(bool instant)
for(u8 i = 0; i < 11; ++i) for(u8 i = 0; i < 11; ++i)
{ {
m_btnMgr.hide(m_pluginLblCat[i]); m_btnMgr.hide(m_checkboxLblTxt[i]);
m_btnMgr.hide(m_pluginBtn[i]); m_btnMgr.hide(m_checkboxBtn[i]);
} }
} }
@ -55,7 +51,7 @@ void CMenu::_updatePluginText(void)
{ {
u32 IteratorHelp = (Plugin_curPage - 1) * 10; u32 IteratorHelp = (Plugin_curPage - 1) * 10;
for(u8 i = 1; i < min(IteratorHelp+10, (u32)m_max_plugins)-IteratorHelp+1; i++) for(u8 i = 1; i < min(IteratorHelp+10, (u32)m_max_plugins)-IteratorHelp+1; i++)
m_btnMgr.setText(m_pluginLblCat[i], m_plugin.GetPluginName(i+IteratorHelp-1)); m_btnMgr.setText(m_checkboxLblTxt[i], m_plugin.GetPluginName(i+IteratorHelp-1));
} }
void CMenu::_updatePluginCheckboxes(void) void CMenu::_updatePluginCheckboxes(void)
@ -69,27 +65,27 @@ void CMenu::_updatePluginCheckboxes(void)
} }
for(int i = 0; i < 11; ++i) for(int i = 0; i < 11; ++i)
{ {
m_btnMgr.hide(m_pluginBtn[i]); m_btnMgr.hide(m_checkboxBtn[i]);// instant?
m_btnMgr.hide(m_pluginLblCat[i]); m_btnMgr.hide(m_checkboxLblTxt[i]);
} }
const vector<bool> &EnabledPlugins = m_plugin.GetEnabledPlugins(&enabledPluginsCount); const vector<bool> &EnabledPlugins = m_plugin.GetEnabledPlugins(&enabledPluginsCount);
/* ALL Button */ /* ALL Button */
if(EnabledPlugins.size() == 0) if(EnabledPlugins.size() == 0)
m_pluginBtn[0] = m_pluginBtnCats[0]; m_btnMgr.setBtnTexture(m_checkboxBtn[0], theme.checkboxon, theme.checkboxons, false);
else else
m_pluginBtn[0] = m_pluginBtnCat[0]; m_btnMgr.setBtnTexture(m_checkboxBtn[0], theme.checkboxoff, theme.checkboxoffs, false);
m_btnMgr.show(m_pluginBtn[0]); m_btnMgr.show(m_checkboxBtn[0]);
m_btnMgr.show(m_pluginLblCat[0]); m_btnMgr.show(m_checkboxLblTxt[0]);
/* Single Plugins */ /* Single Plugins */
u32 IteratorHelp = (Plugin_curPage - 1) * 10; u32 IteratorHelp = (Plugin_curPage - 1) * 10;
for(u8 i = 1; i < min(IteratorHelp+10, (u32)m_max_plugins)-IteratorHelp+1; ++i) for(u8 i = 1; i < min(IteratorHelp+10, (u32)m_max_plugins)-IteratorHelp+1; ++i)
{ {
if(m_current_view == COVERFLOW_PLUGIN && (EnabledPlugins.size() == 0 || EnabledPlugins.at(i+IteratorHelp-1) == true)) if(m_current_view == COVERFLOW_PLUGIN && (EnabledPlugins.size() == 0 || EnabledPlugins.at(i+IteratorHelp-1) == true))
m_pluginBtn[i] = m_pluginBtnCats[i]; m_btnMgr.setBtnTexture(m_checkboxBtn[i], theme.checkboxon, theme.checkboxons, false);
else else
m_pluginBtn[i] = m_pluginBtnCat[i]; m_btnMgr.setBtnTexture(m_checkboxBtn[i], theme.checkboxoff, theme.checkboxoffs, false);
m_btnMgr.show(m_pluginBtn[i]); m_btnMgr.show(m_checkboxBtn[i]);
m_btnMgr.show(m_pluginLblCat[i]); m_btnMgr.show(m_checkboxLblTxt[i]);
} }
} }
@ -139,7 +135,7 @@ void CMenu::_PluginSettings()
u32 IteratorHelp = (Plugin_curPage - 1) * 10; u32 IteratorHelp = (Plugin_curPage - 1) * 10;
for(u8 i = 0; i < min(IteratorHelp+10, (u32)m_max_plugins)-IteratorHelp+1; ++i) for(u8 i = 0; i < min(IteratorHelp+10, (u32)m_max_plugins)-IteratorHelp+1; ++i)
{ {
if(m_btnMgr.selected(m_pluginBtn[i])) if(m_btnMgr.selected(m_checkboxBtn[i]))
{ {
m_refreshGameList = true; m_refreshGameList = true;
if(m_current_view != COVERFLOW_PLUGIN) if(m_current_view != COVERFLOW_PLUGIN)
@ -158,7 +154,7 @@ void CMenu::_PluginSettings()
else else
m_plugin.SetEnablePlugin(i+IteratorHelp-1);// switch plugin from off to on or vice versa m_plugin.SetEnablePlugin(i+IteratorHelp-1);// switch plugin from off to on or vice versa
_updatePluginCheckboxes(); _updatePluginCheckboxes();
m_btnMgr.setSelected(m_pluginBtn[i]); m_btnMgr.setSelected(m_checkboxBtn[i]);
break; break;
} }
} }
@ -208,31 +204,13 @@ void CMenu::_initPluginSettingsMenu()
m_pluginLblPage = _addLabel("PLUGIN/PAGE_BTN", theme.btnFont, L"", 68, 400, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC); m_pluginLblPage = _addLabel("PLUGIN/PAGE_BTN", theme.btnFont, L"", 68, 400, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC);
m_pluginBtnPageM = _addPicButton("PLUGIN/PAGE_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 20, 400, 48, 48); m_pluginBtnPageM = _addPicButton("PLUGIN/PAGE_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 20, 400, 48, 48);
m_pluginBtnPageP = _addPicButton("PLUGIN/PAGE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 172, 400, 48, 48); m_pluginBtnPageP = _addPicButton("PLUGIN/PAGE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 172, 400, 48, 48);
m_pluginBtnCat[0] = _addPicButton("PLUGIN/PLUGIN_0_BTN", theme.checkboxoff, theme.checkboxoffs, 270, 394, 44, 48);
m_pluginBtnCats[0] = _addPicButton("PLUGIN/PLUGIN_0_BTNS", theme.checkboxon, theme.checkboxons, 270, 394, 44, 48);
m_pluginLblCat[0] = _addLabel("PLUGIN/PLUGIN_0", theme.lblFont, L"", 325, 397, 100, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
for(int i = 1; i < 6; ++i)
{ // Page 1
m_pluginBtnCat[i] = _addPicButton(fmt("PLUGIN/PLUGIN_%i_BTN", i), theme.checkboxoff, theme.checkboxoffs, 30, (39+i*58), 44, 48);
m_pluginBtnCats[i] = _addPicButton(fmt("PLUGIN/PLUGIN_%i_BTNS", i), theme.checkboxon, theme.checkboxons, 30, (39+i*58), 44, 48);
m_pluginLblCat[i] = _addLabel(fmt("PLUGIN/PLUGIN_%i", i), theme.lblFont, L"", 85, (42+i*58), 230, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
// right half
m_pluginBtnCat[i+5] = _addPicButton(fmt("PLUGIN/PLUGIN_%i_BTN", i+5), theme.checkboxoff, theme.checkboxoffs, 325, (39+i*58), 44, 48);
m_pluginBtnCats[i+5] = _addPicButton(fmt("PLUGIN/PLUGIN_%i_BTNS", i+5), theme.checkboxon, theme.checkboxons, 325, (39+i*58), 44, 48);
m_pluginLblCat[i+5] = _addLabel(fmt("PLUGIN/PLUGIN_%i", i+5), theme.lblFont, L"", 380, (42+i*58), 230, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
}
_setHideAnim(m_pluginLblTitle, "PLUGIN/TITLE", 0, 0, -2.f, 0.f); _setHideAnim(m_pluginLblTitle, "PLUGIN/TITLE", 0, 0, -2.f, 0.f);
_setHideAnim(m_pluginLblPage, "PLUGIN/PAGE_BTN", 0, 0, 1.f, -1.f); _setHideAnim(m_pluginLblPage, "PLUGIN/PAGE_BTN", 0, 0, 1.f, -1.f);
_setHideAnim(m_pluginBtnPageM, "PLUGIN/PAGE_MINUS", 0, 0, 1.f, -1.f); _setHideAnim(m_pluginBtnPageM, "PLUGIN/PAGE_MINUS", 0, 0, 1.f, -1.f);
_setHideAnim(m_pluginBtnPageP, "PLUGIN/PAGE_PLUS", 0, 0, 1.f, -1.f); _setHideAnim(m_pluginBtnPageP, "PLUGIN/PAGE_PLUS", 0, 0, 1.f, -1.f);
_setHideAnim(m_pluginBtnBack, "PLUGIN/BACK_BTN", 0, 0, 1.f, -1.f); _setHideAnim(m_pluginBtnBack, "PLUGIN/BACK_BTN", 0, 0, 1.f, -1.f);
for(u8 i = 0; i < 11; ++i)
{
_setHideAnim(m_pluginBtnCat[i], fmt("PLUGIN/PLUGIN_%i_BTN", i), 0, 0, 1.f, 0.f);
_setHideAnim(m_pluginBtnCats[i], fmt("PLUGIN/PLUGIN_%i_BTNS", i), 0, 0, 1.f, 0.f);
_setHideAnim(m_pluginLblCat[i], fmt("PLUGIN/PLUGIN_%i", i), 0, 0, 1.f, 0.f);
m_pluginBtn[i] = m_pluginBtnCat[i];
}
_hidePluginSettings(true); _hidePluginSettings(true);
_textPluginSettings(); _textPluginSettings();
} }
@ -241,5 +219,5 @@ void CMenu::_textPluginSettings(void)
{ {
m_btnMgr.setText(m_pluginLblTitle, _t("cfgpl1", L"Select Plugins")); m_btnMgr.setText(m_pluginLblTitle, _t("cfgpl1", L"Select Plugins"));
m_btnMgr.setText(m_pluginBtnBack, _t("cd1", L"Back")); m_btnMgr.setText(m_pluginBtnBack, _t("cd1", L"Back"));
m_btnMgr.setText(m_pluginLblCat[0], _t("dl25", L"All")); m_btnMgr.setText(m_checkboxLblTxt[0], _t("dl25", L"All"));
} }

View File

@ -20,11 +20,6 @@ s16 m_checkboxesBtnPageP;
s16 m_checkboxesBtnBack; s16 m_checkboxesBtnBack;
s16 m_checkboxesLblTitle; s16 m_checkboxesLblTitle;
s16 m_checkboxLblTxt[11];
s16 m_checkboxBtn[11];
s16 m_checkboxBtnOff[11];
s16 m_checkboxBtnOn[11];
void CMenu::_hideCheckboxesMenu(bool instant) void CMenu::_hideCheckboxesMenu(bool instant)
{ {
m_btnMgr.hide(m_checkboxesLblTitle, instant); m_btnMgr.hide(m_checkboxesLblTitle, instant);
@ -92,7 +87,7 @@ void CMenu::_updateCheckboxes(void)
} }
for(int i = 0; i < 11; ++i) for(int i = 0; i < 11; ++i)
{ {
m_btnMgr.hide(m_checkboxBtn[i]); m_btnMgr.hide(m_checkboxBtn[i]);// instant true?
m_btnMgr.hide(m_checkboxLblTxt[i]); m_btnMgr.hide(m_checkboxLblTxt[i]);
} }
@ -107,17 +102,17 @@ void CMenu::_updateCheckboxes(void)
if(mode == 1) if(mode == 1)
{ {
if(m_source.getBool(sfmt("button_%i", firstCheckbox + i - 1), "hidden", false)) if(m_source.getBool(sfmt("button_%i", firstCheckbox + i - 1), "hidden", false))
m_checkboxBtn[i] = m_checkboxBtnOn[i]; m_btnMgr.setBtnTexture(m_checkboxBtn[i], theme.checkboxon, theme.checkboxons, false);
else else
m_checkboxBtn[i] = m_checkboxBtnOff[i]; m_btnMgr.setBtnTexture(m_checkboxBtn[i], theme.checkboxoff, theme.checkboxoffs, false);
} }
else if(mode == 2) else if(mode == 2)
{ {
m_checkboxBtn[i] = m_checkboxBtnOff[i];// all sources off m_btnMgr.setBtnTexture(m_checkboxBtn[i], theme.checkboxoff, theme.checkboxoffs, false);// all sources off
} }
else if(mode == 3) else if(mode == 3)
{ {
m_checkboxBtn[i] = m_checkboxBtnOff[i];// all plugins off m_btnMgr.setBtnTexture(m_checkboxBtn[i], theme.checkboxoff, theme.checkboxoffs, false);// all plugins off
} }
else else
{ {
@ -136,9 +131,9 @@ void CMenu::_updateCheckboxes(void)
} }
} }
if(found) if(found)
m_checkboxBtn[i] = m_checkboxBtnOn[i]; m_btnMgr.setBtnTexture(m_checkboxBtn[i], theme.checkboxon, theme.checkboxons, false);
else else
m_checkboxBtn[i] = m_checkboxBtnOff[i]; m_btnMgr.setBtnTexture(m_checkboxBtn[i], theme.checkboxoff, theme.checkboxoffs, false);
} }
} }
m_btnMgr.show(m_checkboxBtn[i]); m_btnMgr.show(m_checkboxBtn[i]);
@ -225,7 +220,7 @@ void CMenu::_checkboxesMenu(u8 md)
bool val = !m_source.getBool(button, "hidden", false); bool val = !m_source.getBool(button, "hidden", false);
m_source.setBool(button, "hidden", val); m_source.setBool(button, "hidden", val);
_updateCheckboxes(); _updateCheckboxes();
m_btnMgr.setSelected(m_checkboxBtn[i]); m_btnMgr.setSelected(m_checkboxBtn[i]);// re-select after hiding and showing with new texture in case of using d-pad instead of pointer
break; break;
} }
else if(mode == 2)// link - choose source else if(mode == 2)// link - choose source
@ -380,25 +375,23 @@ void CMenu::_initCheckboxesMenu()
_setHideAnim(m_checkboxesBtnBack, "CHECKBOX/BACK_BTN", 0, 0, 1.f, -1.f); _setHideAnim(m_checkboxesBtnBack, "CHECKBOX/BACK_BTN", 0, 0, 1.f, -1.f);
/* init checkboxes only here to be used in all menu's */ /* init checkboxes only here to be used in all menu's */
m_checkboxBtnOff[0] = _addPicButton("CHECKBOX/CHECKBOX_0_OFF", theme.checkboxoff, theme.checkboxoffs, 270, 394, 44, 48); m_checkboxBtn[0] = _addPicButton("CHECKBOX/CHECKBOX_0_OFF", theme.checkboxoff, theme.checkboxoffs, 270, 394, 44, 48);
m_checkboxBtnOn[0] = _addPicButton("CHECKBOX/CHECKBOX_0_ON", theme.checkboxon, theme.checkboxons, 270, 394, 44, 48);
m_checkboxLblTxt[0] = _addLabel("CHECKBOX/CHECKBOX_0_TXT", theme.lblFont, L"", 325, 397, 100, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_checkboxLblTxt[0] = _addLabel("CHECKBOX/CHECKBOX_0_TXT", theme.lblFont, L"", 325, 397, 100, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
for(int i = 1; i < 6; ++i) for(int i = 1; i < 6; ++i)// left
{ // Page 1 {
m_checkboxBtnOff[i] = _addPicButton(fmt("CHECKBOX/CHECKBOX_%i_OFF", i), theme.checkboxoff, theme.checkboxoffs, 30, (39+i*58), 44, 48); m_checkboxBtn[i] = _addPicButton(fmt("CHECKBOX/CHECKBOX_%i_OFF", i), theme.checkboxoff, theme.checkboxoffs, 30, (39+i*58), 44, 48);
m_checkboxBtnOn[i] = _addPicButton(fmt("CHECKBOX/CHECKBOX_%i_ON", i), theme.checkboxon, theme.checkboxons, 30, (39+i*58), 44, 48);
m_checkboxLblTxt[i] = _addLabel(fmt("CHECKBOX/CHECKBOX_%i_TXT", i), theme.lblFont, L"", 85, (42+i*58), 230, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_checkboxLblTxt[i] = _addLabel(fmt("CHECKBOX/CHECKBOX_%i_TXT", i), theme.lblFont, L"", 85, (42+i*58), 230, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
// right half }
m_checkboxBtnOff[i+5] = _addPicButton(fmt("CHECKBOX/CHECKBOX_%i_OFF", i+5), theme.checkboxoff, theme.checkboxoffs, 325, (39+i*58), 44, 48); for(int i = 1; i < 6; ++i)// right
m_checkboxBtnOn[i+5] = _addPicButton(fmt("CHECKBOX/CHECKBOX_%i_ON", i+5), theme.checkboxon, theme.checkboxons, 325, (39+i*58), 44, 48); {
m_checkboxBtn[i+5] = _addPicButton(fmt("CHECKBOX/CHECKBOX_%i_OFF", i+5), theme.checkboxoff, theme.checkboxoffs, 325, (39+i*58), 44, 48);
m_checkboxLblTxt[i+5] = _addLabel(fmt("CHECKBOX/CHECKBOX_%i_TXT", i+5), theme.lblFont, L"", 380, (42+i*58), 230, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_checkboxLblTxt[i+5] = _addLabel(fmt("CHECKBOX/CHECKBOX_%i_TXT", i+5), theme.lblFont, L"", 380, (42+i*58), 230, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
} }
for(u8 i = 0; i < 11; ++i) for(u8 i = 0; i < 11; ++i)
{ {
_setHideAnim(m_checkboxBtnOff[i], fmt("CHECKBOX/CHECKBOX_%i_OFF", i), 0, 0, 1.f, 0.f); _setHideAnim(m_checkboxBtn[i], fmt("CHECKBOX/CHECKBOX_%i_OFF", i), 0, 0, 1.f, 0.f);
_setHideAnim(m_checkboxBtnOn[i], fmt("CHECKBOX/CHECKBOX_%i_ON", i), 0, 0, 1.f, 0.f);
_setHideAnim(m_checkboxLblTxt[i], fmt("CHECKBOX/CHECKBOX_%i_TXT", i), 0, 0, 1.f, 0.f); _setHideAnim(m_checkboxLblTxt[i], fmt("CHECKBOX/CHECKBOX_%i_TXT", i), 0, 0, 1.f, 0.f);
m_checkboxBtn[i] = m_checkboxBtnOff[i];
} }
_hideCheckboxesMenu(true); _hideCheckboxesMenu(true);
_textCheckboxesMenu(); _textCheckboxesMenu();