Files
wagic/projects/mtg/include/PlayGuiObject.h
valfieri 7c696ac213 Improved Commander format card selection rule, added new keyword
"autocommandzone=" to trigger abilities from Command Zone (e.g. Commander Ninjutsu), added/fixed some primitives, added a new GUI Button to show Player's Sideboard.
2020-12-08 20:48:11 +01:00

73 lines
1.3 KiB
C++

/*
A class for all interactive objects in the play area (cards, avatars, etc...)
*/
#ifndef _PLAYGUIOBJECT_H_
#define _PLAYGUIOBJECT_H_
#define GUI_AVATAR 1
#define GUI_CARD 2
#define GUI_GRAVEYARD 3
#define GUI_LIBRARY 4
#define GUI_OPPONENTHAND 5
#define GUI_EXILE 6
#define GUI_COMMANDZONE 7
#define GUI_SIDEBOARD 8
#include <JGui.h>
#include "WEvent.h"
#include "Pos.h"
class PlayGuiObject: public JGuiObject, public JGuiListener, public Pos
{
protected:
public:
int wave;
float mHeight;
float defaultHeight;
bool mHasFocus;
int type;
virtual void Entering()
{
mHasFocus = true;
zoom = 1.4f;
}
;
virtual bool Leaving(JButton)
{
mHasFocus = false;
zoom = 1.0;
return true;
}
;
virtual bool CheckUserInput(JButton)
{
return false;
}
;
virtual bool ButtonPressed()
{
return true;
}
;
virtual void Render();
virtual void Update(float dt);
PlayGuiObject(float desiredHeight, float x, float y, int inID, bool hasFocus);
PlayGuiObject(float desiredHeight, const Pos& ref, int inID, bool hasFocus);
virtual void ButtonPressed(int, int) {}
virtual bool getTopLeft(float& top, float& left)
{
top = actY;
left = actX;
return true;
}
;
virtual ~PlayGuiObject() {};
};
#endif