had to undo my refactoring of the menuitem classes. for some reason it broke scrolling on the opponent ai selection screens.
This commit is contained in:
@@ -5,47 +5,81 @@
|
||||
#include <JLBFont.h>
|
||||
#include <JGui.h>
|
||||
#include "DeckMenu.h"
|
||||
#include "SimpleMenuItem.h"
|
||||
|
||||
using std::string;
|
||||
|
||||
class DeckMenuItem: public SimpleMenuItem
|
||||
class DeckMenuItem: public JGuiObject
|
||||
{
|
||||
private:
|
||||
bool mHasFocus;
|
||||
bool mScrollEnabled;
|
||||
bool mDisplayInitialized;
|
||||
bool mIsValidSelection;
|
||||
|
||||
DeckMenu* deckController;
|
||||
float mTitleResetWidth;
|
||||
|
||||
protected:
|
||||
virtual void checkUserClick();
|
||||
DeckMenu* parent;
|
||||
int fontId;
|
||||
string mText;
|
||||
float mX;
|
||||
float mY;
|
||||
float mTitleResetWidth;
|
||||
string mDescription;
|
||||
static float mYOffset;
|
||||
float mScrollerOffset;
|
||||
DeckMetaData *mMetaData;
|
||||
string mImageFilename;
|
||||
void checkUserClick();
|
||||
|
||||
public:
|
||||
DeckMenuItem(DeckMenu* _parent, int id, int fontId, string text, float x, float y, bool hasFocus = false, bool autoTranslate = false, DeckMetaData *meta = NULL);
|
||||
|
||||
|
||||
DeckMenuItem(DeckMenu* _parent, int id, int fontId, string text, float x, float y, bool hasFocus = false, bool autoTranslate = false, DeckMetaData *meta = NULL);
|
||||
~DeckMenuItem();
|
||||
|
||||
string imageFilename;
|
||||
float mScrollerOffset;
|
||||
DeckMetaData *meta;
|
||||
|
||||
virtual void Relocate(float x, float y);
|
||||
virtual float GetWidth();
|
||||
virtual void RenderWithOffset(float yOffset);
|
||||
virtual void Render();
|
||||
virtual void Update(float dt);
|
||||
|
||||
virtual bool getTopLeft(float& top, float& left)
|
||||
{
|
||||
return SimpleMenuItem::getTopLeft(top, left);
|
||||
}
|
||||
|
||||
virtual void Entering();
|
||||
virtual bool Leaving(JButton key);
|
||||
virtual bool ButtonPressed();
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
virtual JGuiController* getParent() const;
|
||||
virtual void RenderWithOffset(float yOffset);
|
||||
|
||||
virtual bool getTopLeft(float& top, float& left)
|
||||
{
|
||||
top = mY + mYOffset;
|
||||
left = mX;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Accessors
|
||||
|
||||
string getImageFilename() const { return mImageFilename; };
|
||||
float getY() const { return mY; };
|
||||
float getX() const { return mX; };
|
||||
string getDescription() const { return mDescription; };
|
||||
string getText() const { return mText; };
|
||||
bool hasFocus() const { return mHasFocus; };
|
||||
bool hasMetaData() const { return mMetaData == NULL ? false : true;};
|
||||
|
||||
float getWidth() const;
|
||||
string getDeckName() const;
|
||||
|
||||
string getDeckStatsSummary() const
|
||||
{
|
||||
if (mMetaData)
|
||||
return mMetaData->getStatsSummary();
|
||||
return "";
|
||||
}
|
||||
|
||||
DeckMetaData *getMetaData() const
|
||||
{
|
||||
return mMetaData;
|
||||
}
|
||||
|
||||
// Setters
|
||||
void setDescription( const string description ) { mDescription = description; };
|
||||
|
||||
;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user