diff --git a/CAdvmapInterface.cpp b/CAdvmapInterface.cpp index 920d97587..fe7baacf2 100644 --- a/CAdvmapInterface.cpp +++ b/CAdvmapInterface.cpp @@ -5,7 +5,10 @@ extern TTF_Font * TNRB16, *TNR, *GEOR13, *GEORXX; //fonts using namespace boost::logic; using namespace CSDL_Ext; - +CDefHandler * CHeroList::arrdo = NULL; +CDefHandler * CHeroList::arrup = NULL; +CDefHandler * CTownList::arrdo = NULL; +CDefHandler * CTownList::arrup = NULL; CAdvMapInt::~CAdvMapInt() { SDL_FreeSurface(bg); @@ -125,6 +128,45 @@ void CList::deactivate() void CList::clickLeft(tribool down) { }; +CHeroList::CHeroList() +{ + pos = genRect(192,64,609,196); +} +void CHeroList::select(int which) +{ +} +void CHeroList::clickLeft(tribool down) +{ +} +void CHeroList::clickRight(tribool down) +{ +} +void CHeroList::hover (bool on) +{ +} +void CHeroList::keyPressed (SDL_KeyboardEvent & key) +{ +} +CTownList::CTownList() +{ + pos = genRect(192,48,747,196); + arrdo = NULL; +} +void CTownList::select(int which) +{ +} +void CTownList::clickLeft(tribool down) +{ +} +void CTownList::clickRight(tribool down) +{ +} +void CTownList::hover (bool on) +{ +} +void CTownList::keyPressed (SDL_KeyboardEvent & key) +{ +} CStatusBar::CStatusBar(int x, int y) { bg=CGI->bitmaph->loadBitmap("ADROLLVR.bmp"); diff --git a/CAdvmapInterface.h b/CAdvmapInterface.h index c9b407ca2..eb943cbcd 100644 --- a/CAdvmapInterface.h +++ b/CAdvmapInterface.h @@ -34,6 +34,7 @@ public: class CList : public ClickableL, public ClickableR, public Hoverable, public KeyInterested, public virtual CIntObject { +public: SDL_Surface * bg; //arrow up, arrow down int posw, posh; //position width/height @@ -46,14 +47,28 @@ class CList class CHeroList : public CList { +public: + static CDefHandler *arrup, *arrdo; + + CHeroList(); void select(int which); + void clickLeft(tribool down); void clickRight(tribool down); + void hover (bool on); + void keyPressed (SDL_KeyboardEvent & key); }; class CTownList : public CList { +public: + static CDefHandler *arrup, *arrdo; + + CTownList(); void select(int which); + void clickLeft(tribool down); void clickRight(tribool down); + void hover (bool on); + void keyPressed (SDL_KeyboardEvent & key); }; class CResourceBar :public ClickableR, public CIntObject @@ -161,6 +176,9 @@ public: CStatusBar statusbar; + CHeroList heroList; + CTownList townList; + //fuctions binded to buttons void fshowOverview(); void fswitchLevel(); diff --git a/CGameInterface.cpp b/CGameInterface.cpp index 988c348c6..f3fcddaba 100644 --- a/CGameInterface.cpp +++ b/CGameInterface.cpp @@ -28,6 +28,10 @@ void CButtonBase::show() } } +ClickableL::ClickableL() +{ + pressedL=false; +} void ClickableL::clickLeft(tribool down) { if (down) @@ -44,6 +48,10 @@ void ClickableL::deactivate() LOCPLINT->lclickable.erase (std::find(LOCPLINT->lclickable.begin(),LOCPLINT->lclickable.end(),this)); } +ClickableR::ClickableR() +{ + pressedR=false; +} void ClickableR::activate() { LOCPLINT->rclickable.push_back(this); diff --git a/CGameInterface.h b/CGameInterface.h index 0a3b11e75..7ae7cf9fe 100644 --- a/CGameInterface.h +++ b/CGameInterface.h @@ -34,6 +34,7 @@ class ClickableL : public virtual CIntObject //for left-clicks { public: bool pressedL; + ClickableL(); virtual void clickLeft (tribool down)=0; virtual void activate()=0; virtual void deactivate()=0; @@ -42,6 +43,7 @@ class ClickableR : public virtual CIntObject //for right-clicks { public: bool pressedR; + ClickableR(); virtual void clickRight (tribool down)=0; virtual void activate()=0; virtual void deactivate()=0; @@ -70,7 +72,7 @@ public: virtual void yourTurn()=0{}; }; -class CGlobalAI : public CGameInterface // callback for AI +class CGlobalAI : public CGameInterface // AI class (to derivate) { public: virtual void yourTurn(){}; diff --git a/CMT.cpp b/CMT.cpp index 0dadc2188..c08e22e4b 100644 --- a/CMT.cpp +++ b/CMT.cpp @@ -59,7 +59,7 @@ const char * NAME = "VCMI 0.3"; version of the library linked do not match, or Z_ERRNO if there is an error reading or writing the files. */ SDL_Surface * ekran, * screen, * screen2; -TTF_Font * TNRB16, *TNR, *GEOR13, *GEORXX; +TTF_Font * TNRB16, *TNR, *GEOR13, *GEORXX, *GEORM; int _tmain(int argc, _TCHAR* argv[]) { @@ -86,6 +86,7 @@ int _tmain(int argc, _TCHAR* argv[]) //TNR = TTF_OpenFont("Fonts\\tnr.ttf",10); GEOR13 = TTF_OpenFont("Fonts\\georgia.ttf",13); GEORXX = TTF_OpenFont("Fonts\\tnrb.ttf",22); + GEORM = TTF_OpenFont("Fonts\\georgia.ttf",10); //initializing audio CMusicHandler * mush = new CMusicHandler; diff --git a/CPreGame.cpp b/CPreGame.cpp index 57f89d05d..def7fd079 100644 Binary files a/CPreGame.cpp and b/CPreGame.cpp differ diff --git a/CPreGame.h b/CPreGame.h index 87ea8c21b..e56a36911 100644 --- a/CPreGame.h +++ b/CPreGame.h @@ -177,12 +177,13 @@ class MapSel : public PreGameTab public: ESortBy sortBy; SDL_Surface * bg; - int selected; + int selected; //selected map CDefHandler * Dtypes, * Dvic; - CDefHandler *Dsizes, * Dloss; + CDefHandler *Dsizes, * Dloss, + * sFlags; std::vector scenList; std::vector scenImgs; - int current; + //int current; std::vector ourMaps; IntBut<> small, medium, large, xlarge, all; SetrButton<> nrplayer, mapsize, type, name, viccon, loscon; @@ -198,6 +199,7 @@ public: void select(int which, bool updateMapsList=true); void moveByOne(bool up); void printSelectedInfo(); + void printFlags(); MapSel(); ~MapSel(); }; @@ -224,6 +226,7 @@ class CPreGame { public: std::string playerName; + int playerColor; HighButton * highlighted; PreGameTab* currentTab; StartInfo ret;