1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-05 15:05:40 +02:00
vcmi/client/CKingdomInterface.h
Ivan Savenko c6408f5b4b - Full support for Mystic Pond (Rampart)
- Fixed converHordes issue
- Partial implementation of kingdom overview window
2010-01-28 16:15:46 +00:00

113 lines
3.2 KiB
C++

#ifndef __CKINGDOMINTERFACE_H__
#define __CKINGDOMINTERFACE_H__
#include "../global.h"
#include <SDL.h>
#include "GUIBase.h"
#include "../hch/CMusicBase.h"
class AdventureMapButton;
class CHighlightableButtonsGroup;
class CResDataBar;
class CStatusBar;
class CSlider;
class CMinorResDataBar;
class HoverableArea;
/*
* CKingdomInterface.h, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
class CKingdomInterface : public CIntObject
{
class CResIncomePic : public CIntObject
{
public:
int resID,value;//resource ID
std::string hoverText;
CResIncomePic(int RID, CDefEssential * Mines);//c-tor
~CResIncomePic();//d-tor
void hover(bool on);
void show(SDL_Surface * to);
CDefEssential * mines;//pointer to mines pictures;
};
class CTownItem : public CIntObject
{
public:
int numb;//position on screen (1..size)
const CGTownInstance * town;
void show(SDL_Surface * to);
void activate();
void deactivate();
CTownItem (int num);//c-tor
~CTownItem();//d-tor
};
class CHeroItem : public CIntObject
{
public:
const CGHeroInstance * hero;
int artGroup,numb;//current art group (0 = equiped, 1 = misc, 2 = backpack)
void onArtChange(int newstate);//changes artgroup
void show(SDL_Surface * to);
void activate();
void deactivate();
CHeroItem (int num);//c-tor
~CHeroItem();//d-tor
};
public:
//common data
int state;//1 = towns showed, 2 = heroes;
SDL_Surface * bg;//background
CStatusBar * statusbar;//statusbar
CResDataBar *resdatabar;//resources
//buttons
AdventureMapButton *exit;//exit button
AdventureMapButton *toTowns;//town button
AdventureMapButton *toHeroes;//hero button
CDefEssential * title; //title bar
//hero/town lists
CSlider * slider;//slider
bool showHarrisoned;//show harrisoned hero in heroes list or not, disabled by default
int heroPos,townPos;//position of lists
std::vector<CHeroItem *> heroes;//heroes list
std::vector<CTownItem *> towns;//towns list
static CDefEssential * slots, *fort, *hall;
//objects list
int objSize, objPos;
CDefEssential *objPics;
std::map<int,std::pair<int, std::string*> > objList; //dwelling ID, count, hover text
std::vector <HoverableArea* > ObjList;//list of dwellings
AdventureMapButton* ObjUp, *ObjDown, *ObjTop, *ObjBottom;//buttons for dwellings list
//income pics
std::vector<CResIncomePic *> incomes;//mines + incomes
CDefEssential * mines;//picture of mines
CKingdomInterface(); //c-tor
~CKingdomInterface(); //d-tor
void moveObjectList(int newPos);
void recreateHeroList(int pos);//recreating heroes list (on slider move)
void recreateTownList(int pos);//same for town list
void keyPressed(const SDL_KeyboardEvent & key);
void listToTowns();//changing list to town view
void listToHeroes();//changing list to heroes view
void sliderMoved(int newpos);//when we move a slider...
void show(SDL_Surface * to);
void showAll(SDL_Surface * to);
void close();
void activate();
void deactivate();
};
#endif // __CCASTLEINTERFACE_H__