mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-12-25 03:11:58 +01:00
db8a2b137c
-fixed using categories to hide GC disc 2's. Apparently this has never really worked right for some time or ever. -fixed deleting the cached cover texture file for plugin games. Delete cover for plugins only deletes the cached texture file (.wfc) -fixed favorites and adultonly (parental lock) for plugin games. Apparently I may have broke this a few revisions back. -favorites and adultonly for plugin games now have their own domains in gamecfg1- [FAVORITES_PLUGINS] and [ADULTONLY_PLUGINS]. just makes it more organized. -only wii, GC, channels are added to [PLAYCOUNT] and [LAST_PLAYED] in gamecfg1. -now loading gamecfg1 at startup and leaving it loaded till exit. no more loading it and unloading all the time. -fixed scrolling for game_info synopsis, credits, and help text. -made source menu buttons wider for wiiflow default. old 80x80, now 100x80. looks better. -display music info now defaults to off -screensaver_disabled now defaults to yes -show GC view button is now on by default no matter what. the only way it is disabled is if you edit wiiflow.ini manually. this is how all the view buttons work. -removed hiding homebrew button but if wiiflow locked it won't work or in sourceflow it won't show. -dump_list is now under [GENERAL] instead of each view. Also only works for Wii, GC, and channels. -sorting only works for Wii, GC, and Channels now. disabled for sourceflow, plugins, homebrew, and combined view. -now if no games are found a message is shown with the current path so you can see where wiiflow is looking. (except for plugins) -removed auto create emuNAND for emuNAND view if gamelist is empty. just go to settings>NAND settings if you want to extract or disable it. -now when no games are found all buttons at bottom are still accessible allowing you to change the view or go to settings and change current partition or path and even extract your NAND to create a EmuNAND. Or go to Home Menu and Install a Wii or GC game. -removed auto extract NAND to emuNAND when launching a Wii game with EmuNAND save. Now a message is diplayed saying 'emuNAND for saves not found - using real NAND'. -made the speed at which cover titles fade in/out almost instantly. -removed update button from Home Menu. online update code is still there but not used and probably won't be used any more as there just isn't a need for it now. -removed ftp button from Home Menu and all code for the FTP server. I just use WiiXplorer's FTP server. it seems to work better for me. -disabled keep USB Alive thread for now. i think there's a possibilty it might be the cause of my SD/USB files getting corrupted. -removed Btn B and - combo to switch partitions. didn't seem useful anymore. -redid nand emulation settings menu. looks like this now: pg1 Select EmuNAND EmuNAND Enulation Select SaveNAND SaveNAND Emulation pg2 Extract Saves All Missing Extract NAND Select Saves Partition -no longer blocking Select Plugin menu and View icons when using source menu combined view -now Select Plugins Menu is like switching to plugin view but you get to choose the plugins first -now [PLUGIN] partition= is the default partition for all plugins. to change individual plugins add 'romPartition=x' to the plugin ini. x is the partition number 0 thru 8 with SD being 0. this is how my usbloadergx plugin mod works.
168 lines
4.5 KiB
C++
168 lines
4.5 KiB
C++
|
|
// Buttons
|
|
|
|
#ifndef __GUI_HPP
|
|
#define __GUI_HPP
|
|
|
|
#include <ogc/pad.h>
|
|
#include "wiiuse/wpad.h"
|
|
#include "wupc/wupc.h"
|
|
#include "sicksaxis-wrapper/sicksaxis-wrapper.h"
|
|
|
|
#include "video.hpp"
|
|
#include "FreeTypeGX.h"
|
|
#include "text.hpp"
|
|
#include "music/gui_sound.h"
|
|
#include "wstringEx/wstringEx.hpp"
|
|
|
|
struct SButtonTextureSet
|
|
{
|
|
TexData left;
|
|
TexData right;
|
|
TexData center;
|
|
TexData leftSel;
|
|
TexData rightSel;
|
|
TexData centerSel;
|
|
};
|
|
|
|
class CButtonsMgr
|
|
{
|
|
public:
|
|
bool init();
|
|
void setRumble(bool enabled) { m_rumbleEnabled = enabled; }
|
|
void reserve(u32 capacity) { m_elts.reserve(capacity); }
|
|
s16 addButton(SFont font, const wstringEx &text, int x, int y, u32 width, u32 height, const CColor &color,
|
|
const SButtonTextureSet &texSet, GuiSound *clickSound = NULL, GuiSound *hoverSound = NULL);
|
|
s16 addLabel(SFont font, const wstringEx &text, int x, int y, u32 width, u32 height, const CColor &color,
|
|
s16 style, const TexData &bg = _noTexture);
|
|
s16 addPicButton(const u8 *pngNormal, const u8 *pngSelected, int x, int y, u32 width, u32 height,
|
|
GuiSound *clickSound = NULL, GuiSound *hoverSound = NULL);
|
|
s16 addPicButton(TexData &texNormal, TexData &texSelected, int x, int y, u32 width, u32 height,
|
|
GuiSound *clickSound = NULL, GuiSound *hoverSound = NULL);
|
|
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, u32 startline, bool unwrap = false);
|
|
void setBtnTexture(s16 id, TexData &texNormal, TexData &texSelected);
|
|
void freeBtnTexture(s16 id);
|
|
void setTexture(s16 id ,TexData &bg);
|
|
void setTexture(s16 id, TexData &bg, int width, int height);
|
|
void setProgress(s16 id, float f, bool instant = false);
|
|
void reset(s16 id, bool instant = false);
|
|
void moveBy(s16 id, int x, int y, bool instant = false);
|
|
void getTotalHeight(s16 id, int &height);
|
|
void getDimensions(s16 id, int &x, int &y, u32 &width, u32 &height);
|
|
void hide(s16 id, int dx, int dy, float scaleX, float scaleY, bool instant = false);
|
|
void hide(s16 id, bool instant = false);
|
|
void show(s16 id, bool instant = false);
|
|
void mouse(int chan, int x, int y);
|
|
void setMouse(bool enable);
|
|
void up(void);
|
|
void down(void);
|
|
void draw(void);
|
|
void tick(void);
|
|
void noClick(bool noclick = false);
|
|
void noHover(bool nohover = false);
|
|
void click(s16 id = -1);
|
|
bool selected(s16 button = -1);
|
|
void setRumble(int, bool wii = false, bool gc = false, bool wupc = false);
|
|
void deselect(void){ for(int chan = WPAD_MAX_WIIMOTES-1; chan >= 0; chan--) m_selected[chan] = -1; }
|
|
void stopSounds(void);
|
|
void setSoundVolume(int vol);
|
|
private:
|
|
struct SHideParam
|
|
{
|
|
int dx;
|
|
int dy;
|
|
float scaleX;
|
|
float scaleY;
|
|
public:
|
|
SHideParam(void) : dx(0), dy(0), scaleX(1.f), scaleY(1.f) { }
|
|
};
|
|
enum EltType {
|
|
GUIELT_BUTTON,
|
|
GUIELT_LABEL,
|
|
GUIELT_PROGRESS
|
|
};
|
|
struct SElement
|
|
{
|
|
SHideParam hideParam;
|
|
EltType t;
|
|
bool visible;
|
|
int x;
|
|
int y;
|
|
int w;
|
|
int h;
|
|
Vector3D pos;
|
|
Vector3D targetPos;
|
|
u8 alpha;
|
|
u8 targetAlpha;
|
|
float scaleX;
|
|
float scaleY;
|
|
float targetScaleX;
|
|
float targetScaleY;
|
|
int moveByX;
|
|
int moveByY;
|
|
public:
|
|
virtual ~SElement(void) { }
|
|
virtual void tick(void);
|
|
protected:
|
|
SElement(void) { }
|
|
};
|
|
struct SButton : public SElement
|
|
{
|
|
SFont font;
|
|
SButtonTextureSet tex;
|
|
CText text;
|
|
CColor textColor;
|
|
float click;
|
|
GuiSound *clickSound;
|
|
GuiSound *hoverSound;
|
|
public:
|
|
SButton(void) { t = GUIELT_BUTTON; }
|
|
virtual void tick(void);
|
|
};
|
|
struct SLabel : public SElement
|
|
{
|
|
SFont font;
|
|
CText text;
|
|
CColor textColor;
|
|
u16 textStyle;
|
|
TexData texBg;
|
|
public:
|
|
SLabel(void) { t = GUIELT_LABEL; }
|
|
virtual void tick(void);
|
|
};
|
|
struct SProgressBar : public SElement
|
|
{
|
|
SButtonTextureSet tex;
|
|
float val;
|
|
float targetVal;
|
|
public:
|
|
SProgressBar(void) { t = GUIELT_PROGRESS; }
|
|
virtual void tick(void);
|
|
};
|
|
private:
|
|
vector<SElement*> m_elts;
|
|
s32 m_selected[WPAD_MAX_WIIMOTES];
|
|
bool m_rumbleEnabled;
|
|
u8 m_rumble[WPAD_MAX_WIIMOTES];
|
|
bool wii_rumble[WPAD_MAX_WIIMOTES];
|
|
bool gc_rumble[WPAD_MAX_WIIMOTES];
|
|
bool wupc_rumble[WPAD_MAX_WIIMOTES];
|
|
GuiSound *m_sndHover;
|
|
GuiSound *m_sndClick;
|
|
u8 m_soundVolume;
|
|
bool m_noclick;
|
|
bool m_nohover;
|
|
bool m_mouse;
|
|
private:
|
|
void _drawBtn(SButton &b, bool selected, bool click);
|
|
void _drawLbl(SLabel &b);
|
|
void _drawPBar(const SProgressBar &b);
|
|
static TexData _noTexture;
|
|
};
|
|
|
|
extern CButtonsMgr m_btnMgr;
|
|
|
|
#endif // !defined(__GUI_HPP)
|