- fixed source menu setup linking source buttons to plugins

- cleaned up gui code a tiny bit.
- beta 5
This commit is contained in:
Fledge68 2020-09-07 06:26:12 -05:00
parent 9a8a752e6f
commit 144e7669ed
5 changed files with 27 additions and 31 deletions

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 MiB

After

Width:  |  Height:  |  Size: 4.1 MiB

View File

@ -1,6 +1,6 @@
#define APP_NAME "WiiFlow WFL" #define APP_NAME "WiiFlow WFL"
#define APP_VERSION "5.4.7 beta 4" #define APP_VERSION "5.4.7 beta 5"
#define APP_DATA_DIR "wiiflow" #define APP_DATA_DIR "wiiflow"
#define APPS_DIR "apps/wiiflow" #define APPS_DIR "apps/wiiflow"

View File

@ -62,6 +62,24 @@ s16 CButtonsMgr::addButton(SFont font, const wstringEx &text, int x, int y, u32
return m_elts.size() > sz ? m_elts.size() - 1 : -2; return m_elts.size() > sz ? m_elts.size() - 1 : -2;
} }
s16 CButtonsMgr::addPicButton(TexData &texNormal, TexData &texSelected, int x, int y, u32 width, u32 height, GuiSound *clickSound, GuiSound *hoverSound)
{
SButtonTextureSet texSet;
texSet.center = texNormal;
texSet.centerSel = texSelected;
return addButton(SFont(), wstringEx(), x, y, width, height, CColor(), texSet, clickSound, hoverSound);
}
s16 CButtonsMgr::addPicButton(const u8 *pngNormal, const u8 *pngSelected, int x, int y, u32 width, u32 height, GuiSound *clickSound, GuiSound *hoverSound)
{
SButtonTextureSet texSet;
TexHandle.fromPNG(texSet.center, pngNormal);
TexHandle.fromPNG(texSet.centerSel, pngSelected);
return addButton(SFont(), wstringEx(), x, y, width, height, CColor(), texSet, clickSound, hoverSound);
}
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 *b = new SLabel;
@ -119,24 +137,6 @@ s16 CButtonsMgr::addProgressBar(int x, int y, u32 width, u32 height, SButtonText
return m_elts.size() > sz ? m_elts.size() - 1 : -2; return m_elts.size() > sz ? m_elts.size() - 1 : -2;
} }
s16 CButtonsMgr::addPicButton(TexData &texNormal, TexData &texSelected, int x, int y, u32 width, u32 height, GuiSound *clickSound, GuiSound *hoverSound)
{
SButtonTextureSet texSet;
texSet.center = texNormal;
texSet.centerSel = texSelected;
return addButton(SFont(), wstringEx(), x, y, width, height, CColor(), texSet, clickSound, hoverSound);
}
s16 CButtonsMgr::addPicButton(const u8 *pngNormal, const u8 *pngSelected, int x, int y, u32 width, u32 height, GuiSound *clickSound, GuiSound *hoverSound)
{
SButtonTextureSet texSet;
TexHandle.fromPNG(texSet.center, pngNormal);
TexHandle.fromPNG(texSet.centerSel, pngSelected);
return addButton(SFont(), wstringEx(), x, y, width, height, CColor(), texSet, clickSound, hoverSound);
}
void CButtonsMgr::setText(s16 id, const wstringEx &text, bool unwrap)// unwrap means no wrap void CButtonsMgr::setText(s16 id, const wstringEx &text, bool unwrap)// unwrap means no wrap
{ {
if (id == -1) return; if (id == -1) return;
@ -530,12 +530,12 @@ 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;
u16 start = -1; s32 start = -1;
if(m_selected[chan] != -1 && m_selected[chan] < (s32)m_elts.size()) if(m_selected[chan] != -1 && m_selected[chan] < (s32)m_elts.size())
{ {
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 = (u16)m_selected[chan]; start = m_selected[chan];
} }
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)
@ -790,12 +790,8 @@ void CButtonsMgr::_drawBtn(CButtonsMgr::SButton &b, bool selected, bool click)
} }
if (!b.font.font) return; if (!b.font.font) return;
b.font.font->reset(); b.font.font->reset();
//CColor txtColor(b.textColor.r, b.textColor.g, b.textColor.b, (u8)((int)b.textColor.a * (int)alpha / 0xFF));
//if(m_vid.wide())
// scaleX *= 0.8f;
b.font.font->setXScale(scaleX); b.font.font->setXScale(scaleX);
b.font.font->setYScale(scaleY); b.font.font->setYScale(scaleY);
//b.font.font->drawText(0, 0, b.text.c_str(), txtColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE);
b.text.setColor(CColor(b.textColor.r, b.textColor.g, b.textColor.b, (u8)((int)b.textColor.a * (int)alpha / 0xFF))); b.text.setColor(CColor(b.textColor.r, b.textColor.g, b.textColor.b, (u8)((int)b.textColor.a * (int)alpha / 0xFF)));
b.text.setFrame(b.w, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, true, true); b.text.setFrame(b.w, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, true, true);
b.text.draw(); b.text.draw();
@ -839,9 +835,6 @@ void CButtonsMgr::_drawLbl(CButtonsMgr::SLabel &b)
if (!b.font.font) return; if (!b.font.font) return;
b.font.font->reset(); b.font.font->reset();
b.text.setColor(CColor(b.textColor.r, b.textColor.g, b.textColor.b, (u8)((int)b.textColor.a * (int)alpha / 0xFF)));
//if(m_vid.wide())
// scaleX *= 0.8f;
b.font.font->setXScale(scaleX); b.font.font->setXScale(scaleX);
b.font.font->setYScale(scaleY); b.font.font->setYScale(scaleY);
float posX = b.pos.x; float posX = b.pos.x;
@ -864,8 +857,9 @@ void CButtonsMgr::_drawLbl(CButtonsMgr::SLabel &b)
guMtxTransApply(modelViewMtx, modelViewMtx, posX, posY, 0.f); guMtxTransApply(modelViewMtx, modelViewMtx, posX, posY, 0.f);
GX_LoadPosMtxImm(modelViewMtx, GX_PNMTX0); GX_LoadPosMtxImm(modelViewMtx, GX_PNMTX0);
if (b.moveByX != 0 || b.moveByY != 0) if (b.moveByX != 0 || b.moveByY != 0)
GX_SetScissor(b.targetPos.x - b.moveByX - b.w/2, b.targetPos.y - b.moveByY - b.h/2, b.w, b.h); GX_SetScissor(b.targetPos.x - b.moveByX - b.w/2, b.targetPos.y - b.moveByY - b.h/2, b.w, b.h);
b.text.setColor(CColor(b.textColor.r, b.textColor.g, b.textColor.b, (u8)((int)b.textColor.a * (int)alpha / 0xFF)));
b.text.draw(); b.text.draw();
if (b.moveByX != 0 || b.moveByY != 0) if (b.moveByX != 0 || b.moveByY != 0)
GX_SetScissor(0, 0, m_vid.width(), m_vid.height()); GX_SetScissor(0, 0, m_vid.width(), m_vid.height());

View File

@ -246,6 +246,7 @@ void CMenu::_checkboxesMenu(u8 md)
else if(mode == 4) else if(mode == 4)
{ {
bool found = false; bool found = false;
u8 pluginsCount = 0;
string newMagics; string newMagics;
string pluginMagic = sfmt("%08x", m_plugin.GetPluginMagic(firstCheckbox + i - 1)); string pluginMagic = sfmt("%08x", m_plugin.GetPluginMagic(firstCheckbox + i - 1));
string button = sfmt("button_%i", curSource); string button = sfmt("button_%i", curSource);
@ -261,10 +262,11 @@ void CMenu::_checkboxesMenu(u8 md)
} }
else else
{ {
if(j == 0) if(pluginsCount == 0)
newMagics = magicNums[0]; newMagics = magicNums[j];
else else
newMagics.append(',' + magicNums[j]); newMagics.append(',' + magicNums[j]);
pluginsCount++;
} }
} }
} }