refactored DeckMenuItem to be a derived class of SimpleMenuItem. Not sure why I had made them distinct.
TODO: review DeckMenu and SimpleMenu to see if it would be better to have them derive from a base class rather than be distinct.
This commit is contained in:
@@ -62,14 +62,9 @@ public:
|
||||
DeckMetaData * getSelectedDeck();
|
||||
void enableDisplayDetailsOverride();
|
||||
bool showDetailsScreen();
|
||||
bool isClosed()
|
||||
{
|
||||
return mClosed;
|
||||
}
|
||||
int getSelectedDeckId()
|
||||
{
|
||||
return mSelectedDeckId;
|
||||
}
|
||||
|
||||
bool isClosed() const { return mClosed; }
|
||||
int getSelectedDeckId() const { return mSelectedDeckId; }
|
||||
|
||||
void Render();
|
||||
void Update(float dt);
|
||||
|
||||
@@ -22,13 +22,13 @@ protected:
|
||||
virtual 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();
|
||||
|
||||
string imageFilename;
|
||||
string desc;
|
||||
float mScrollerOffset;
|
||||
DeckMetaData *meta;
|
||||
|
||||
virtual bool hasFocus();
|
||||
|
||||
virtual void Relocate(float x, float y);
|
||||
virtual float GetWidth();
|
||||
virtual void Render();
|
||||
@@ -38,18 +38,7 @@ public:
|
||||
{
|
||||
return SimpleMenuItem::getTopLeft(top, left);
|
||||
}
|
||||
|
||||
string GetText()
|
||||
{
|
||||
return mText;
|
||||
}
|
||||
string GetDescription()
|
||||
{
|
||||
return desc;
|
||||
}
|
||||
|
||||
DeckMenuItem(DeckMenu* _parent, int id, int fontId, string text, float x, float y, bool hasFocus = false, bool autoTranslate = false, DeckMetaData *meta = NULL);
|
||||
~DeckMenuItem();
|
||||
|
||||
virtual void Entering();
|
||||
virtual bool Leaving(JButton key);
|
||||
virtual bool ButtonPressed();
|
||||
|
||||
@@ -18,34 +18,44 @@ private:
|
||||
SimpleMenu* parent;
|
||||
float mScale;
|
||||
float mTargetScale;
|
||||
|
||||
protected:
|
||||
int fontId;
|
||||
string mText;
|
||||
bool mHasFocus;
|
||||
bool mIsValidSelection;
|
||||
float mX;
|
||||
float mY;
|
||||
|
||||
protected:
|
||||
int mFontId;
|
||||
string mText;
|
||||
static float mYOffset;
|
||||
float mXOffset;
|
||||
|
||||
bool mIsValidSelection;
|
||||
virtual void checkUserClick();
|
||||
|
||||
string mDescription;
|
||||
|
||||
public:
|
||||
string desc;
|
||||
SimpleMenuItem(int id);
|
||||
SimpleMenuItem(SimpleMenu* _parent, int id, int fontId, string text, float x, float y, bool hasFocus = false, bool autoTranslate = false);
|
||||
|
||||
float mX;
|
||||
float mY;
|
||||
virtual int getFontId() const;
|
||||
virtual void setFontId( const int& fontId );
|
||||
virtual void setX( const float& x ) { mX = x; };
|
||||
virtual void setY( const float& y ) { mY = y; };
|
||||
|
||||
virtual void setIsSelectionValid( bool validSelection );
|
||||
virtual void setFocus(bool value);
|
||||
virtual void setDescription( const string& desc );
|
||||
virtual void setText( const string& text);
|
||||
|
||||
virtual bool isSelectionValid() const;
|
||||
virtual bool hasFocus() const;
|
||||
virtual string getDescription() const;
|
||||
virtual string getText() const;
|
||||
float getX() const;
|
||||
float getY() const;
|
||||
virtual void checkUserClick();
|
||||
|
||||
|
||||
virtual float GetWidth() const;
|
||||
virtual void Relocate(float x, float y);
|
||||
virtual float GetWidth();
|
||||
|
||||
virtual bool hasFocus();
|
||||
|
||||
void RenderWithOffset(float yOffset);
|
||||
virtual void RenderWithOffset(float yOffset);
|
||||
virtual void Render();
|
||||
virtual void Update(float dt);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user