mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Added clickable and highlightable player flags in adv. options tab
This commit is contained in:
		| @@ -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; | ||||
|   | ||||
							
								
								
									
										
											BIN
										
									
								
								CPreGame.cpp
									
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								CPreGame.cpp
									
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										13
									
								
								CPreGame.h
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								CPreGame.h
									
									
									
									
									
								
							| @@ -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; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user