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.
64 lines
1.8 KiB
C++
64 lines
1.8 KiB
C++
/* Graphical representation of a Card Instance, used in game */
|
|
|
|
#ifndef _CARD_GUI_H_
|
|
#define _CARD_GUI_H_
|
|
|
|
#include <hge/hgeparticle.h>
|
|
#include <JGui.h>
|
|
#include "Pos.h"
|
|
#include "PlayGuiObject.h"
|
|
#include "MTGCardInstance.h"
|
|
|
|
class MTGCardInstance;
|
|
class PlayGuiObject;
|
|
|
|
struct CardGui : public PlayGuiObject {
|
|
protected:
|
|
|
|
public:
|
|
static const float Width;
|
|
static const float Height;
|
|
static const float BigWidth;
|
|
static const float BigHeight;
|
|
|
|
MTGCardInstance* card;
|
|
CardGui(MTGCardInstance* card, float x, float y);
|
|
CardGui(MTGCardInstance* card, const Pos& ref);
|
|
virtual void Render();
|
|
void RenderBig(const Pos&); //Tries to render the Big version of a card picture, backups to text version in case of failure
|
|
static void RenderBig(MTGCard * card, const Pos& pos);
|
|
void alternateRenderBig(const Pos&); //Renders Text Version of a card
|
|
void renderCountersBig(const Pos& pos);
|
|
virtual void Update(float dt);
|
|
static void alternateRender(MTGCard * card, const Pos& pos);
|
|
static void tinyCropRender(MTGCard * card, const Pos& pos, JQuad * quad);
|
|
static JQuad * alternateThumbQuad(MTGCard * card);
|
|
virtual ostream& toString(ostream&) const;
|
|
};
|
|
|
|
|
|
class CardView : public CardGui {
|
|
public:
|
|
|
|
typedef enum {
|
|
nullZone, handZone, playZone
|
|
} SelectorZone;
|
|
|
|
const SelectorZone owner;
|
|
|
|
MTGCardInstance* getCard(); // remove this when possible
|
|
CardView(const SelectorZone, MTGCardInstance* card, float x, float y);
|
|
CardView(const SelectorZone, MTGCardInstance* card, const Pos& ref);
|
|
void Render(){CardGui::Render();};
|
|
void Render(JQuad* q){Pos::Render(q);};
|
|
virtual ostream& toString(ostream&) const;
|
|
};
|
|
|
|
class TransientCardView : public CardGui {
|
|
public:
|
|
TransientCardView(MTGCardInstance* card, float x, float y);
|
|
TransientCardView(MTGCardInstance* card, const Pos& ref);
|
|
};
|
|
|
|
#endif
|