I've also added my current work on the zone navigation system (class Navigator) - it's currently turned off for now (the override for this is inside of CardSelectorSingleton's Instance() call, simply comment out the NEW CardSelector and uncomment out the NEW Navigator line.) It's functional, but I want to do more testing before considering wiring it into the game options or something similar. (Also, note that it currently doesn't support the mouse functionality added by DJardin.) Lastly, there's a bug crash fix in ActionStack that I tripped across while testing - basically, an illegal index value would have us walk off the bounds of a vector.
82 lines
1.4 KiB
C++
82 lines
1.4 KiB
C++
#ifndef _GUIHAND_H_
|
|
#define _GUIHAND_H_
|
|
|
|
#include "GuiLayers.h"
|
|
#include "WEvent.h"
|
|
#include "MTGGameZones.h"
|
|
#include "CardGui.h"
|
|
#include "GuiHand.h"
|
|
|
|
class GuiHand;
|
|
|
|
struct HandLimitor : public Limitor
|
|
{
|
|
GuiHand* hand;
|
|
virtual bool select(Target*);
|
|
virtual bool greyout(Target*);
|
|
|
|
HandLimitor(GuiHand* hand);
|
|
};
|
|
|
|
class GuiHand : public GuiLayer
|
|
{
|
|
public:
|
|
static const float ClosedRowX;
|
|
static const float LeftRowX;
|
|
static const float RightRowX;
|
|
|
|
static const float OpenX;
|
|
static const float ClosedX;
|
|
static const float OpenY;
|
|
static const float ClosedY;
|
|
|
|
protected:
|
|
const MTGHand* hand;
|
|
JQuad *back;
|
|
vector<CardView*> cards;
|
|
|
|
public:
|
|
GuiHand(MTGHand* hand);
|
|
~GuiHand();
|
|
void Update(float dt);
|
|
bool isInHand(CardView*);
|
|
|
|
friend struct HandLimitor;
|
|
};
|
|
|
|
class GuiHandOpponent : public GuiHand
|
|
{
|
|
public:
|
|
GuiHandOpponent(MTGHand* hand);
|
|
virtual void Render();
|
|
virtual int receiveEventPlus(WEvent* e);
|
|
virtual int receiveEventMinus(WEvent* e);
|
|
};
|
|
|
|
class GuiHandSelf : public GuiHand
|
|
{
|
|
protected:
|
|
enum
|
|
{
|
|
Open,
|
|
Closed
|
|
} state;
|
|
Pos backpos;
|
|
|
|
public:
|
|
GuiHandSelf(MTGHand* hand);
|
|
~GuiHandSelf();
|
|
virtual int receiveEventPlus(WEvent* e);
|
|
virtual int receiveEventMinus(WEvent* e);
|
|
|
|
void Repos();
|
|
bool CheckUserInput(JButton key);
|
|
virtual void Render();
|
|
void Update(float dt);
|
|
float LeftBoundary();
|
|
|
|
HandLimitor* limitor;
|
|
};
|
|
|
|
#endif // _GUIHAND_H_
|