usbloadergx/source/libwiigui/gui_gamecarousel.h

58 lines
1.3 KiB
C
Raw Normal View History

#ifndef _GUIGAMECAROUSEL_H_
#define _GUIGAMECAROUSEL_H_
#include "gui.h"
2009-06-13 02:24:36 +02:00
#include "../usbloader/disc.h"
2009-09-27 20:19:53 +02:00
class GuiImageAsync;
class GuiGameCarousel : public GuiElement
{
public:
GuiGameCarousel(int w, int h, struct discHdr * l, int gameCnt, const char *themePath, const u8 *imagebg, int selected = 0, int offset = 0);
~GuiGameCarousel();
int FindMenuItem(int c, int d);
int GetClickedOption();
int GetSelectedOption();
void ResetState();
void SetFocus(int f);
void Draw();
void Update(GuiTrigger * t);
int GetOffset();
void Reload(struct discHdr * l, int count);
//GuiText * optionVal[PAGESIZE];
protected:
2009-09-27 20:19:53 +02:00
GuiImageData noCover;
int selectedItem;
int listOffset;
int scrollbaron;
**Changes *Fixed effect GOROUND so that it doesn't cause alignment issues anymore (the format for this effect is very different than it originally was, if you plan on using it for something, look at the documentation in gui.h. *Major revamp of gui_gamecarousel (everything is awesome and perfect, except it still can't launch games, and thus it is still not in the gui). **gui_gamecarousel Notes: *You can use the same technique as last time to test the carousel (except I recommend adding startat and offset to the line since I added support for it). *I realized not everyone will agree for my choice of curvature and spacing for the games on the carousel, so I made them variable. At the top of gui_gamecarousel.cpp are a bunch of definitions that set up these values. *SCALE determines the size of the game boxes. *DEG_OFFSET is the number of degrees between the boxes (remember, changing the RADIUS will affect the linear distance each degree represents). *RADIUS determines the curvature of the arc (higher radius makes it less curved). *IN_SPEED determines the speed at which the boxes come in (higher number makes it faster). *SHFIT_SPEED determines the speed at which the boxes move when you turn the carousel. *PAGESIZE determines how many boxes are drawn (remember, the number of visible boxes is determined by DEG_OFFSET and RADIUS, with the default values you can see 7). *Everything eles (the animations, position of the movement buttons, etc.) is automatically determined from these values (my 8th grade math teacher was right, trig isn't totally worthless), so you shouldn't need to change anything at all, except the aforementioned values (or the b0rken game launching code). *If you find a set of values you think looks better than mine, post a picture and the list of values in an issue or on IRC. *These will probably become theamable at some point, but I figure we should get this added to the gui first (I was hoping to do it tonight, but some stuff came up, and I need to go to bed). Wow I write really long commit notes.
2009-05-29 07:27:29 +02:00
int pagesize;
int speed;
int clickedItem;
struct discHdr * gameList;
int gameCnt;
int * gameIndex;
GuiButton ** game;
2009-09-27 20:19:53 +02:00
GuiImageAsync ** coverImg;
GuiText * gamename;
GuiButton * btnRight;
GuiButton * btnLeft;
GuiImage * btnLeftImg;
GuiImage * btnRightImg;
GuiImageData * imgLeft;
GuiImageData * imgRight;
GuiSound * btnSoundOver;
GuiSound * btnSoundClick;
GuiTrigger * trigA;
GuiTrigger * trigL;
GuiTrigger * trigR;
GuiTrigger * trigPlus;
GuiTrigger * trigMinus;
};
#endif