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.
This commit is contained in:
50
projects/mtg/include/DeckMenuItem.h
Normal file
50
projects/mtg/include/DeckMenuItem.h
Normal file
@@ -0,0 +1,50 @@
|
||||
#ifndef _DECKMENU_ITEM_H
|
||||
#define _DECKMENU_ITEM_H
|
||||
|
||||
#include <string>
|
||||
#include <JLBFont.h>
|
||||
#include <JGui.h>
|
||||
#include "DeckMenu.h"
|
||||
|
||||
using std::string;
|
||||
|
||||
#define SCALE_SELECTED 1.2f
|
||||
#define SCALE_NORMAL 1.0f
|
||||
|
||||
|
||||
class DeckMenuItem: public JGuiObject
|
||||
{
|
||||
private:
|
||||
bool mHasFocus;
|
||||
DeckMenu* parent;
|
||||
int fontId;
|
||||
string mText;
|
||||
float mScale;
|
||||
float mTargetScale;
|
||||
|
||||
public:
|
||||
string imageFilename;
|
||||
string desc;
|
||||
DeckMetaData *meta;
|
||||
|
||||
DeckMenuItem(DeckMenu* _parent, int id, int fontId, string text, int x, int y, bool hasFocus = false, bool autoTranslate = false, DeckMetaData *meta = NULL);
|
||||
~DeckMenuItem();
|
||||
int mX;
|
||||
int mY;
|
||||
|
||||
void Relocate(int x, int y);
|
||||
int GetWidth();
|
||||
bool hasFocus();
|
||||
|
||||
void RenderWithOffset(float yOffset);
|
||||
virtual void Render();
|
||||
virtual void Update(float dt);
|
||||
|
||||
virtual void Entering();
|
||||
virtual bool Leaving(JButton key);
|
||||
virtual bool ButtonPressed();
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
virtual bool getTopLeft(int& top, int& left) {top = mY; left = mX; return true;};
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user