Files
wagic/projects/mtg/include/DeckMenu.h
techdragon.nguyen@gmail.com 6c1497bbd5 Revamped Deck Selection Screen using abrasax's design as a template.
TODO:  
     change literals to use constants, 
     refactor the rendering code for the menu to have be leaner.
     add text scroller to list all the tasks. 
         * 1st implementation will list all the tasks.dat  
         * 2nd round will try to get the scroller to only display relevant tasks to ai

Special thanks to wololo and MootPoint for helping me hammer this out.  To abrasax, for the initial design of the layout.
2010-11-01 08:22:55 +00:00

54 lines
1.1 KiB
C++

/*
A class for very simple menus structure
*/
#ifndef _DeckMenu_H_
#define _DeckMenu_H_
#include <string>
#include <JGui.h>
#include "WFont.h"
#include "hge/hgeparticle.h"
#include "DeckMetaData.h"
class DeckMenu:public JGuiController{
private:
int mHeight, mWidth, mX, mY;
int titleX, titleY, titleWidth;
int descX, descY, descHeight, descWidth;
int statsX, statsY, statsHeight, statsWidth;
int fontId;
std::string title;
int displaytitle;
int maxItems, startId;
float selectionT, selectionY;
float timeOpen;
static unsigned int refCount;
JQuad *background;
JTexture *backgroundTexture;
static WFont* titleFont;
static hgeParticleSystem* stars;
// This works only because of no multithreading
static PIXEL_TYPE jewelGraphics[9];
inline void MogrifyJewel();
public:
bool autoTranslate;
DeckMenu(int id, JGuiListener* listener, int fontId, const char * _title = "");
void Render();
void Update(float dt);
void Add(int id, const char * Text, string desc = "", bool forceFocus = false, DeckMetaData *deckMetaData = NULL);
void Close();
float selectionTargetY;
bool closed;
static void destroy();
};
#endif