J :
* Fix u32 into JButtons. * Add a few comments. * Remove useless variables.
This commit is contained in:
@@ -37,7 +37,7 @@ class ActionElement: public JGuiObject{
|
||||
virtual void Render(){};
|
||||
virtual int testDestroy(){return 0;};
|
||||
virtual int destroy(){return 0;};
|
||||
virtual bool CheckUserInput(u32 key){return false;};
|
||||
virtual bool CheckUserInput(JButton key){return false;};
|
||||
ActionElement(int id);
|
||||
virtual ~ActionElement();
|
||||
virtual int isReactingToTargetClick(Targetable * card);
|
||||
|
||||
@@ -24,7 +24,7 @@ class ActionLayer: public GuiLayer, public JGuiListener{
|
||||
int stuffHappened;
|
||||
virtual void Render();
|
||||
virtual void Update(float dt);
|
||||
bool CheckUserInput(u32 key);
|
||||
bool CheckUserInput(JButton key);
|
||||
ActionLayer();
|
||||
~ActionLayer();
|
||||
int cancelCurrentAction();
|
||||
|
||||
@@ -51,7 +51,7 @@ class Interruptible: public PlayGuiObject, public Targetable{
|
||||
int state, display;
|
||||
MTGCardInstance * source;
|
||||
virtual void Entering(){mHasFocus = true;};
|
||||
virtual bool Leaving(u32 key){mHasFocus = false;return true;};
|
||||
virtual bool Leaving(JButton key){mHasFocus = false;return true;};
|
||||
virtual bool ButtonPressed(){return true;};
|
||||
virtual int resolve(){return 0;};
|
||||
virtual void Render(){};
|
||||
@@ -169,7 +169,7 @@ class ActionStack :public GuiLayer{
|
||||
int addDamage(MTGCardInstance * _source, Damageable * target, int _damage);
|
||||
int addAbility(MTGAbility * ability);
|
||||
void Update(float dt);
|
||||
bool CheckUserInput(u32 key);
|
||||
bool CheckUserInput(JButton key);
|
||||
virtual void Render();
|
||||
ActionStack(GameObserver* game);
|
||||
int resolve();
|
||||
|
||||
@@ -20,7 +20,7 @@ class CardDisplay:public PlayGuiObjectController{
|
||||
void AddCard(MTGCardInstance * _card);
|
||||
void rotateLeft();
|
||||
void rotateRight();
|
||||
bool CheckUserInput(u32 key);
|
||||
bool CheckUserInput(JButton key);
|
||||
virtual void Update(float dt);
|
||||
void Render();
|
||||
void init(MTGGameZone * zone);
|
||||
|
||||
@@ -57,7 +57,7 @@ class ObjectSelector : public GuiLayer
|
||||
int bigMode;
|
||||
void Add(T*);
|
||||
void Remove(T*);
|
||||
bool CheckUserInput(u32 key);
|
||||
bool CheckUserInput(JButton key);
|
||||
void Update(float dt);
|
||||
void Render();
|
||||
void Limit(LimitorFunctor<T>* limitor, SelectorZone);
|
||||
|
||||
@@ -2,10 +2,7 @@
|
||||
#define _DUELLAYERS_H_
|
||||
|
||||
#include "GuiLayers.h"
|
||||
#include "PlayGuiObject.h"
|
||||
|
||||
template <typename T> class ObjectSelector;
|
||||
typedef ObjectSelector<PlayGuiObject> CardSelector;
|
||||
#include "CardSelector.h"
|
||||
|
||||
class MTGGuiHand;
|
||||
class MTGGuiPlay;
|
||||
|
||||
@@ -27,7 +27,7 @@ class GuiAvatars : public GuiLayer
|
||||
void Deactivate(PlayGuiObject* c);
|
||||
int receiveEventPlus(WEvent*);
|
||||
int receiveEventMinus(WEvent*);
|
||||
bool CheckUserInput(u32 key);
|
||||
bool CheckUserInput(JButton key);
|
||||
float LeftBoundarySelf();
|
||||
};
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class GuiCombat : public GuiLayer
|
||||
virtual void Update(float dt);
|
||||
virtual void Render();
|
||||
bool clickOK();
|
||||
virtual bool CheckUserInput(u32 key);
|
||||
virtual bool CheckUserInput(JButton key);
|
||||
virtual int receiveEventPlus(WEvent* e);
|
||||
virtual int receiveEventMinus(WEvent* e);
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ class GuiHandSelf : public GuiHand
|
||||
virtual int receiveEventMinus(WEvent* e);
|
||||
|
||||
void Repos();
|
||||
bool CheckUserInput(u32 key);
|
||||
bool CheckUserInput(JButton key);
|
||||
virtual void Render();
|
||||
void Update(float dt);
|
||||
float LeftBoundary();
|
||||
|
||||
@@ -14,7 +14,7 @@ class Player;
|
||||
|
||||
class GuiLayer{
|
||||
protected:
|
||||
u32 mActionButton;
|
||||
JButton mActionButton;
|
||||
public:
|
||||
int mCount;
|
||||
int mCurr;
|
||||
@@ -28,7 +28,7 @@ class GuiLayer{
|
||||
GuiLayer();
|
||||
virtual ~GuiLayer();
|
||||
virtual void Update(float dt);
|
||||
virtual bool CheckUserInput(u32 key){ return false; };
|
||||
virtual bool CheckUserInput(JButton key){ return false; };
|
||||
int getIndexOf(JGuiObject * object);
|
||||
JGuiObject * getByIndex (int index);
|
||||
virtual void Render();
|
||||
|
||||
@@ -13,7 +13,7 @@ struct GuiStatic : public PlayGuiObject{
|
||||
GuiAvatars* parent;
|
||||
GuiStatic(float desiredHeight, float x, float y, bool hasFocus, GuiAvatars* parent);
|
||||
virtual void Entering();
|
||||
virtual bool Leaving(u32 key);
|
||||
virtual bool Leaving(JButton key);
|
||||
};
|
||||
|
||||
struct GuiAvatar : public GuiStatic{
|
||||
@@ -42,7 +42,7 @@ struct GuiGameZone : public GuiStatic{
|
||||
CardDisplay * cd;
|
||||
int showCards;
|
||||
virtual void Render();
|
||||
virtual bool CheckUserInput(u32 key);
|
||||
virtual bool CheckUserInput(JButton key);
|
||||
virtual void Update(float dt);
|
||||
GuiGameZone(float x, float y, bool hasFocus, MTGGameZone * zone, GuiAvatars* parent);
|
||||
~GuiGameZone();
|
||||
|
||||
@@ -16,7 +16,7 @@ class MTGGamePhase: public ActionElement {
|
||||
public:
|
||||
MTGGamePhase(int id);
|
||||
virtual void Update(float dt);
|
||||
bool CheckUserInput(u32 key);
|
||||
bool CheckUserInput(JButton key);
|
||||
virtual MTGGamePhase * clone() const;
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
};
|
||||
|
||||
@@ -37,7 +37,7 @@ class MenuItem: public JGuiObject
|
||||
virtual void Update(float dt);
|
||||
|
||||
virtual void Entering();
|
||||
virtual bool Leaving(u32 key);
|
||||
virtual bool Leaving(JButton key);
|
||||
virtual bool ButtonPressed();
|
||||
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
class OSDLayer : public PlayGuiObjectController
|
||||
{
|
||||
virtual void Update(float dt);
|
||||
virtual bool CheckUserInput(u32 key);
|
||||
virtual bool CheckUserInput(JButton key);
|
||||
virtual void Render();
|
||||
};
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ class PlayGuiObject: public JGuiObject, public JGuiListener, public Pos{
|
||||
bool mHasFocus;
|
||||
int type;
|
||||
virtual void Entering(){mHasFocus = true; zoom = 1.4f;};
|
||||
virtual bool Leaving(u32 key){mHasFocus = false; zoom = 1.0; return true;};
|
||||
virtual bool CheckUserInput(u32 key) {return false;};
|
||||
virtual bool Leaving(JButton key){mHasFocus = false; zoom = 1.0; return true;};
|
||||
virtual bool CheckUserInput(JButton key) {return false;};
|
||||
virtual bool ButtonPressed(){return true;};
|
||||
virtual void Render();
|
||||
virtual void Update(float dt);
|
||||
|
||||
@@ -13,7 +13,7 @@ class PlayGuiObjectController : public GuiLayer{
|
||||
static int showBigCards;// 0 hide, 1 show, 2 show text
|
||||
public:
|
||||
virtual void Update(float dt);
|
||||
virtual bool CheckUserInput(u32 key);
|
||||
virtual bool CheckUserInput(JButton key);
|
||||
PlayGuiObjectController(){last_user_move=0;};
|
||||
virtual void Render(){GuiLayer::Render();};
|
||||
};
|
||||
|
||||
@@ -39,7 +39,7 @@ class SimpleMenuItem: public JGuiObject
|
||||
virtual void Update(float dt);
|
||||
|
||||
virtual void Entering();
|
||||
virtual bool Leaving(u32 key);
|
||||
virtual bool Leaving(JButton key);
|
||||
virtual bool ButtonPressed();
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
};
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <map>
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
#include "../../../JGE/src/TinyXML/tinyxml.h"
|
||||
#include "../../../JGE/src/tinyxml/tinyxml.h"
|
||||
#include <JGui.h>
|
||||
class GameObserver;
|
||||
#define CAMPAIGNS_FOLDER "Res/campaigns/"
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
void Update(float dt);
|
||||
|
||||
void Entering();
|
||||
bool Leaving(u32 key);
|
||||
bool Leaving(JButton key);
|
||||
bool ButtonPressed();
|
||||
bool hasFocus();
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
@@ -83,4 +83,4 @@ public:
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user