1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +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 struct HighButton: public OverButton
{ {
HighButton( SDL_Rect Pos, CDefHandler* Imgs, bool Sel=false, int id=-1) 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(){} HighButton(){}
bool selectable, selected; bool selectable, selected;
bool highlightable, highlighted; bool highlightable, highlighted;

Binary file not shown.

View File

@ -55,10 +55,21 @@ class Options : public PreGameTab
int serialID; int serialID;
int which; //-1=castle;0=hero;1=bonus 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 struct PlayerOptions
{ {
PlayerOptions(int serial, int player); PlayerOptions(int serial, int player);
Ecolor color; Ecolor color;
PlayerFlag flag;
//SDL_Surface * bg; //SDL_Surface * bg;
OptionSwitch Cleft, Cright, Hleft, Hright, Bleft, Bright; OptionSwitch Cleft, Cright, Hleft, Hright, Bleft, Bright;
int nr; int nr;
@ -68,6 +79,7 @@ public:
SDL_Surface * bg, SDL_Surface * bg,
* rHero, * rCastle, * nHero, * nCastle; * rHero, * rCastle, * nHero, * nCastle;
std::vector<SDL_Surface*> bgs; std::vector<SDL_Surface*> bgs;
std::vector<CDefHandler*> flags;
CDefHandler //* castles, * heroes, * bonus, CDefHandler //* castles, * heroes, * bonus,
* left, * right, * left, * right,
* bonuses; * bonuses;
@ -130,6 +142,7 @@ public:
class CPreGame class CPreGame
{ {
public: public:
HighButton * highlighted;
PreGameTab* currentTab; PreGameTab* currentTab;
StartInfo ret; StartInfo ret;
bool run; bool run;