This btw points out another circular dependancy between the texture and the JQuad - a texture owns a bunch of JQuads, yet the renderer uses JQuads and always assumes that the texture is valid. We're going to need to add more defensiveness to JGE to protect against this. Other changes in this check-in: WResourceManager doesn't derive from JResourceManager anymore. It actually didn't require anything from the base, so I killed the dependency. Also cleaned up the notion of a WTrackedQuad in the WCachedResource - it didn't need a separate class, just a better container. I've build this & tested against PSP, win, linux, QT (linux). I haven't tried against iOS and QT Win, or Maemo. If these other platforms are broken, I apologize in advance! - I'm hoping it should be fairly simple to put them back into play.
86 lines
1.9 KiB
C++
86 lines
1.9 KiB
C++
/*
|
|
A class for menus with a fixed layout
|
|
*/
|
|
#ifndef _DeckMenu_H_
|
|
#define _DeckMenu_H_
|
|
|
|
#include <string>
|
|
#include "WFont.h"
|
|
#include "hge/hgeparticle.h"
|
|
#include "DeckMetaData.h"
|
|
#include "TextScroller.h"
|
|
|
|
class DeckMenu: public JGuiController
|
|
{
|
|
protected:
|
|
|
|
float mHeight, mWidth, mX, mY;
|
|
float titleX, titleY, titleWidth;
|
|
float descX, descY, descHeight, descWidth;
|
|
float statsX, statsY, statsHeight, statsWidth;
|
|
float avatarX, avatarY;
|
|
float detailedInfoBoxX, detailedInfoBoxY;
|
|
float starsOffsetX;
|
|
|
|
bool menuInitialized;
|
|
string backgroundName;
|
|
|
|
int fontId;
|
|
string title;
|
|
string displayTitle;
|
|
WFont * mFont;
|
|
float titleFontScale;
|
|
|
|
int maxItems, startId;
|
|
|
|
float selectionT, selectionY;
|
|
float timeOpen;
|
|
|
|
static hgeParticleSystem* stars;
|
|
|
|
void initMenuItems();
|
|
string getDescription();
|
|
string getMetaInformation();
|
|
DeckMetaData *mSelectedDeck;
|
|
int mSelectedDeckId;
|
|
bool mShowDetailsScreen;
|
|
bool mAlwaysShowDetailsButton;
|
|
bool mClosed;
|
|
|
|
public:
|
|
VerticalTextScroller * mScroller;
|
|
bool mAutoTranslate;
|
|
float mSelectionTargetY;
|
|
|
|
//used for detailed info button
|
|
JQuadPtr pspIcons[8];
|
|
JTexture * pspIconsTexture;
|
|
|
|
DeckMenu(int id, JGuiListener* listener, int fontId, const string _title = "", const int& startIndex = 0, bool alwaysShowDetailsButton = false);
|
|
~DeckMenu();
|
|
|
|
DeckMetaData * getSelectedDeck();
|
|
void enableDisplayDetailsOverride();
|
|
bool showDetailsScreen();
|
|
bool isClosed()
|
|
{
|
|
return mClosed;
|
|
}
|
|
int getSelectedDeckId()
|
|
{
|
|
return mSelectedDeckId;
|
|
}
|
|
|
|
void Render();
|
|
void Update(float dt);
|
|
void Add(int id, const char * Text, string desc = "", bool forceFocus = false, DeckMetaData *deckMetaData = NULL);
|
|
void Close();
|
|
void updateScroller();
|
|
void RenderBackground();
|
|
void RenderDeckManaColors();
|
|
|
|
static void destroy();
|
|
};
|
|
|
|
#endif
|