1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Added clickable and highlightable player flags in adv. options tab

This commit is contained in:
Michał W. Urbańczyk 2007-07-25 20:41:04 +00:00
parent e2d9f8956e
commit 53da2c389c
3 changed files with 14 additions and 1 deletions

View File

@ -24,7 +24,7 @@ struct OverButton
struct HighButton: public OverButton
{
HighButton( SDL_Rect Pos, CDefHandler* Imgs, bool Sel=false, int id=-1)
{type=0;imgs=Imgs;selectable=Sel;selected=false;state=0;pos=Pos;ID=id;};
{type=0;imgs=Imgs;selectable=Sel;selected=false;state=0;pos=Pos;ID=id;highlightable=false;};
HighButton(){}
bool selectable, selected;
bool highlightable, highlighted;

Binary file not shown.

View File

@ -55,10 +55,21 @@ class Options : public PreGameTab
int serialID;
int which; //-1=castle;0=hero;1=bonus
};
struct PlayerFlag:public HighButton
{
int color;
PlayerFlag(SDL_Rect Pos, CDefHandler* Imgs, int Color)
:HighButton(Pos,Imgs,false,7),color(Color)
{selectable=false;highlightable=true;}
void hover(bool on=true);
void press(bool down=true);
void select(bool on=true){};
};
struct PlayerOptions
{
PlayerOptions(int serial, int player);
Ecolor color;
PlayerFlag flag;
//SDL_Surface * bg;
OptionSwitch Cleft, Cright, Hleft, Hright, Bleft, Bright;
int nr;
@ -68,6 +79,7 @@ public:
SDL_Surface * bg,
* rHero, * rCastle, * nHero, * nCastle;
std::vector<SDL_Surface*> bgs;
std::vector<CDefHandler*> flags;
CDefHandler //* castles, * heroes, * bonus,
* left, * right,
* bonuses;
@ -130,6 +142,7 @@ public:
class CPreGame
{
public:
HighButton * highlighted;
PreGameTab* currentTab;
StartInfo ret;
bool run;