mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-12 02:28:11 +02:00
Added missing (?) includes from last revision.
This commit is contained in:
parent
0f22ba0c0f
commit
88e42828da
@ -11,6 +11,8 @@
|
||||
#include "../hch/CDefHandler.h"
|
||||
#include "../hch/CGeneralTextHandler.h"
|
||||
#include "../hch/CObjectHandler.h"
|
||||
#include "../hch/CTownHandler.h"
|
||||
#include "../lib/map.h"
|
||||
#include <boost/assign/std/vector.hpp>
|
||||
#include <sstream>
|
||||
using namespace boost::assign;
|
||||
@ -24,26 +26,26 @@ using namespace CSDL_Ext;
|
||||
* License: GNU General Public License v2.0 or later
|
||||
* Full text of license available in license.txt file, in main folder
|
||||
*
|
||||
*/
|
||||
|
||||
*/
|
||||
|
||||
int PicCount = 4;
|
||||
|
||||
CDefEssential* CKingdomInterface::slots;
|
||||
CDefEssential* CKingdomInterface::fort;
|
||||
CDefEssential* CKingdomInterface::hall;
|
||||
|
||||
|
||||
CDefEssential* CKingdomInterface::slots;
|
||||
CDefEssential* CKingdomInterface::fort;
|
||||
CDefEssential* CKingdomInterface::hall;
|
||||
|
||||
CKingdomInterface::CKingdomInterface()
|
||||
{
|
||||
OBJ_CONSTRUCTION_CAPTURING_ALL;
|
||||
defActions = SHARE_POS;
|
||||
{
|
||||
OBJ_CONSTRUCTION_CAPTURING_ALL;
|
||||
defActions = SHARE_POS;
|
||||
pos.x = screen->w/2 - 400;
|
||||
pos.y = screen->h/2 - 300;
|
||||
size = 4;//we have 4 visible items in the list, would be nice to move this value to configs later
|
||||
heroPos = townPos = 0;
|
||||
state = 2;
|
||||
size = 4;//we have 4 visible items in the list, would be nice to move this value to configs later
|
||||
heroPos = townPos = 0;
|
||||
state = 2;
|
||||
showHarrisoned = false;
|
||||
|
||||
bg = BitmapHandler::loadBitmap("OVCAST.bmp");
|
||||
|
||||
bg = BitmapHandler::loadBitmap("OVCAST.bmp");
|
||||
graphics->blueToPlayersAdv(bg, LOCPLINT->playerID);
|
||||
mines = CDefHandler::giveDefEss("OVMINES.DEF");
|
||||
slots = CDefHandler::giveDefEss("OVSLOT.DEF");
|
||||
@ -51,61 +53,61 @@ CKingdomInterface::CKingdomInterface()
|
||||
hall = CDefHandler::giveDefEss("ITMTL.DEF");
|
||||
fort = CDefHandler::giveDefEss("ITMCL.DEF");
|
||||
|
||||
toHeroes = new AdventureMapButton (CGI->generaltexth->overview[11],"",
|
||||
toHeroes = new AdventureMapButton (CGI->generaltexth->overview[11],"",
|
||||
boost::bind(&CKingdomInterface::listToHeroes,this),748,492,"OVBUTN1.DEF");
|
||||
toHeroes->block(2);
|
||||
toHeroes->block(2);
|
||||
|
||||
toTowns = new AdventureMapButton (CGI->generaltexth->overview[12],"",
|
||||
toTowns = new AdventureMapButton (CGI->generaltexth->overview[12],"",
|
||||
boost::bind(&CKingdomInterface::listToTowns,this),748,528,"OVBUTN6.DEF");
|
||||
toTowns->block(0);
|
||||
toTowns->block(0);
|
||||
|
||||
exit = new AdventureMapButton (CGI->generaltexth->allTexts[600],"",
|
||||
boost::bind(&CKingdomInterface::close,this),748,563,"OVBUTN1.DEF");
|
||||
exit->bitmapOffset = 3;
|
||||
exit = new AdventureMapButton (CGI->generaltexth->allTexts[600],"",
|
||||
boost::bind(&CKingdomInterface::close,this),748,563,"OVBUTN1.DEF");
|
||||
exit->bitmapOffset = 3;
|
||||
|
||||
statusbar = new CStatusBar(pos.x+7,pos.y+555,"TSTATBAR.bmp",732);
|
||||
resdatabar = new CResDataBar("KRESBAR.bmp",pos.x+3,pos.y+575,32,2,76,76);
|
||||
|
||||
for (int i=0; i<RESOURCE_QUANTITY; i++)
|
||||
incomes.push_back(new CResIncomePic(i,mines));
|
||||
|
||||
heroes.resize(size);
|
||||
for(size_t i=0;i<size;i++)//preparing lists for input
|
||||
heroes[i] = NULL;
|
||||
towns.resize(size);
|
||||
for(size_t i=0;i<size;i++)
|
||||
towns[i] = NULL;
|
||||
|
||||
|
||||
heroes.resize(size);
|
||||
for(size_t i=0;i<size;i++)//preparing lists for input
|
||||
heroes[i] = NULL;
|
||||
towns.resize(size);
|
||||
for(size_t i=0;i<size;i++)
|
||||
towns[i] = NULL;
|
||||
|
||||
slider = new CSlider(4, 4, 483, boost::bind (&CKingdomInterface::sliderMoved, this, _1),
|
||||
size, LOCPLINT->cb->howManyHeroes(showHarrisoned), 0, false, 0);
|
||||
size, LOCPLINT->cb->howManyHeroes(showHarrisoned), 0, false, 0);
|
||||
}
|
||||
|
||||
CKingdomInterface::~CKingdomInterface()
|
||||
{
|
||||
SDL_FreeSurface(bg);
|
||||
{
|
||||
SDL_FreeSurface(bg);
|
||||
|
||||
delete statusbar;
|
||||
delete resdatabar;
|
||||
|
||||
delete resdatabar;
|
||||
|
||||
delete exit;
|
||||
delete toTowns;
|
||||
delete toHeroes;
|
||||
|
||||
delete slider;
|
||||
delete title;
|
||||
delete slots;
|
||||
delete fort;
|
||||
delete hall;
|
||||
delete mines;
|
||||
|
||||
/* for(size_t i=0;i<size;i++)
|
||||
delete heroes[i];
|
||||
heroes.clear();
|
||||
for(size_t i=0;i<size;i++)
|
||||
delete towns[i];
|
||||
towns.clear();*/
|
||||
for(size_t i=0;i<incomes.size();i++)
|
||||
delete incomes[i];
|
||||
delete toTowns;
|
||||
delete toHeroes;
|
||||
|
||||
delete slider;
|
||||
delete title;
|
||||
delete slots;
|
||||
delete fort;
|
||||
delete hall;
|
||||
delete mines;
|
||||
|
||||
/* for(size_t i=0;i<size;i++)
|
||||
delete heroes[i];
|
||||
heroes.clear();
|
||||
for(size_t i=0;i<size;i++)
|
||||
delete towns[i];
|
||||
towns.clear();*/
|
||||
for(size_t i=0;i<incomes.size();i++)
|
||||
delete incomes[i];
|
||||
incomes.clear();
|
||||
}
|
||||
|
||||
@ -120,50 +122,50 @@ void CKingdomInterface::showAll( SDL_Surface * to/*=NULL*/)
|
||||
blitAt(bg,pos,to);
|
||||
resdatabar->draw(to);
|
||||
toTowns->show(to);
|
||||
toHeroes->show(to);
|
||||
exit->show(to);
|
||||
toHeroes->show(to);
|
||||
exit->show(to);
|
||||
if (state == 1)
|
||||
{//printing text "Town", "Harrisoned hero", "Visiting hero"
|
||||
{//printing text "Town", "Harrisoned hero", "Visiting hero"
|
||||
CSDL_Ext::printAtMiddle(CGI->generaltexth->overview[3],pos.x+145,pos.y+12,TNRB16,zwykly,to);
|
||||
CSDL_Ext::printAtMiddle(CGI->generaltexth->overview[4],pos.x+370,pos.y+12,TNRB16,zwykly,to);
|
||||
CSDL_Ext::printAtMiddle(CGI->generaltexth->overview[5],pos.x+600,pos.y+12,TNRB16,zwykly,to);
|
||||
for (size_t i=0; i<size; i++)
|
||||
towns[i]->show(to);//show town list
|
||||
CSDL_Ext::printAtMiddle(CGI->generaltexth->overview[5],pos.x+600,pos.y+12,TNRB16,zwykly,to);
|
||||
for (size_t i=0; i<size; i++)
|
||||
towns[i]->show(to);//show town list
|
||||
}
|
||||
else
|
||||
{//text "Hero/stats" and "Skills"
|
||||
{//text "Hero/stats" and "Skills"
|
||||
CSDL_Ext::printAtMiddle(CGI->generaltexth->overview[0],pos.x+150,pos.y+12,TNRB16,zwykly,to);
|
||||
CSDL_Ext::printAtMiddle(CGI->generaltexth->overview[1],pos.x+500,pos.y+12,TNRB16,zwykly,to);
|
||||
for (size_t i=0; i<size; i++)
|
||||
heroes[i]->show(to);//show hero list
|
||||
CSDL_Ext::printAtMiddle(CGI->generaltexth->overview[1],pos.x+500,pos.y+12,TNRB16,zwykly,to);
|
||||
for (size_t i=0; i<size; i++)
|
||||
heroes[i]->show(to);//show hero list
|
||||
}
|
||||
|
||||
for(size_t i=0;i<incomes.size();i++)
|
||||
incomes[i]->show(to);//printing resource incomes
|
||||
|
||||
incomes[i]->show(to);//printing resource incomes
|
||||
|
||||
if(screen->w != 800 || screen->h !=600)
|
||||
CMessage::drawBorder(LOCPLINT->playerID,to,828,628,pos.x-14,pos.y-15);
|
||||
CMessage::drawBorder(LOCPLINT->playerID,to,828,628,pos.x-14,pos.y-15);
|
||||
show(to);
|
||||
}
|
||||
|
||||
void CKingdomInterface::show(SDL_Surface * to)
|
||||
{
|
||||
{
|
||||
statusbar->show(to);
|
||||
}
|
||||
|
||||
void CKingdomInterface::activate()
|
||||
{
|
||||
{
|
||||
LOCPLINT->statusbar = statusbar;
|
||||
exit->activate();
|
||||
toTowns->activate();
|
||||
toHeroes->activate();
|
||||
toHeroes->activate();
|
||||
if (state == 1)
|
||||
for (int i=0; i<size; i++)
|
||||
towns[i]->activate();
|
||||
else
|
||||
for (int i=0; i<size; i++)
|
||||
heroes[i]->activate();
|
||||
|
||||
heroes[i]->activate();
|
||||
|
||||
slider->activate();
|
||||
}
|
||||
|
||||
@ -177,52 +179,52 @@ void CKingdomInterface::deactivate()
|
||||
towns[i]->deactivate();
|
||||
else
|
||||
for (int i=0; i<size; i++)
|
||||
heroes[i]->deactivate();
|
||||
heroes[i]->deactivate();
|
||||
slider->deactivate();
|
||||
}
|
||||
|
||||
void CKingdomInterface::keyPressed(const SDL_KeyboardEvent & key)
|
||||
{
|
||||
}
|
||||
|
||||
void CKingdomInterface::recreateHeroList(int pos)
|
||||
{
|
||||
for (int j=0; j<size; j++)
|
||||
delete heroes[j];//removing old list
|
||||
std::vector<const CGHeroInstance*> Heroes = LOCPLINT->cb->getHeroesInfo(true);
|
||||
int i=0, cnt=0;
|
||||
for (int j = 0; ((j<Heroes.size()) && (i<size));j++)
|
||||
{
|
||||
if (Heroes[j]->inTownGarrison && (!showHarrisoned))//if hero in garrison and we don't show them
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (cnt<pos)//skipping heroes
|
||||
{
|
||||
cnt++;
|
||||
continue;
|
||||
}//this hero will be added
|
||||
heroes[i] = new CHeroItem(i, Heroes[j]);
|
||||
|
||||
void CKingdomInterface::recreateHeroList(int pos)
|
||||
{
|
||||
for (int j=0; j<size; j++)
|
||||
delete heroes[j];//removing old list
|
||||
std::vector<const CGHeroInstance*> Heroes = LOCPLINT->cb->getHeroesInfo(true);
|
||||
int i=0, cnt=0;
|
||||
for (int j = 0; ((j<Heroes.size()) && (i<size));j++)
|
||||
{
|
||||
if (Heroes[j]->inTownGarrison && (!showHarrisoned))//if hero in garrison and we don't show them
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (cnt<pos)//skipping heroes
|
||||
{
|
||||
cnt++;
|
||||
continue;
|
||||
}//this hero will be added
|
||||
heroes[i] = new CHeroItem(i, Heroes[j]);
|
||||
i++;
|
||||
}
|
||||
for (i;i<size;i++)//if we still have empty pieces
|
||||
heroes[i] = new CHeroItem(i, NULL);//empty pic
|
||||
GH.totalRedraw();
|
||||
}
|
||||
|
||||
void CKingdomInterface::recreateTownList(int pos)
|
||||
{
|
||||
std::vector<const CGTownInstance*> Towns = LOCPLINT->cb->getTownsInfo(true);
|
||||
for(int i=0;i<size;i++)
|
||||
{
|
||||
}
|
||||
for (i;i<size;i++)//if we still have empty pieces
|
||||
heroes[i] = new CHeroItem(i, NULL);//empty pic
|
||||
GH.totalRedraw();
|
||||
}
|
||||
|
||||
void CKingdomInterface::recreateTownList(int pos)
|
||||
{
|
||||
std::vector<const CGTownInstance*> Towns = LOCPLINT->cb->getTownsInfo(true);
|
||||
for(int i=0;i<size;i++)
|
||||
{
|
||||
delete towns[i];//remove old
|
||||
if (i+pos<Towns.size())
|
||||
towns[i] = new CTownItem(i, Towns[i+pos]);//and add new
|
||||
else
|
||||
towns[i] = new CTownItem(i, NULL);//empty pic
|
||||
}
|
||||
GH.totalRedraw();
|
||||
}
|
||||
towns[i] = new CTownItem(i, NULL);//empty pic
|
||||
}
|
||||
GH.totalRedraw();
|
||||
}
|
||||
|
||||
void CKingdomInterface::listToTowns()
|
||||
{
|
||||
@ -230,13 +232,13 @@ void CKingdomInterface::listToTowns()
|
||||
toHeroes->block(0);
|
||||
toTowns->block(2);
|
||||
heroPos = slider->value;
|
||||
slider->setAmount(LOCPLINT->cb->howManyTowns());
|
||||
slider->value=townPos;//moving slider
|
||||
recreateTownList(townPos);
|
||||
for (size_t i=0;i<size;i++)//TODO:is this loop needed?
|
||||
{
|
||||
towns[i]->deactivate();
|
||||
heroes[i]->activate();
|
||||
slider->setAmount(LOCPLINT->cb->howManyTowns());
|
||||
slider->value=townPos;//moving slider
|
||||
recreateTownList(townPos);
|
||||
for (size_t i=0;i<size;i++)//TODO:is this loop needed?
|
||||
{
|
||||
towns[i]->deactivate();
|
||||
heroes[i]->activate();
|
||||
}
|
||||
}
|
||||
|
||||
@ -245,56 +247,56 @@ void CKingdomInterface::listToHeroes()
|
||||
state = 2;
|
||||
toHeroes->block(2);
|
||||
toTowns->block(0);
|
||||
townPos = slider->value;
|
||||
townPos = slider->value;
|
||||
slider->setAmount(LOCPLINT->cb->howManyHeroes(showHarrisoned));
|
||||
slider->value=heroPos;//moving slider
|
||||
recreateHeroList(heroPos);
|
||||
for (size_t i=0;i<size;i++)//TODO:is this loop needed?
|
||||
{
|
||||
towns[i]->deactivate();
|
||||
heroes[i]->activate();
|
||||
recreateHeroList(heroPos);
|
||||
for (size_t i=0;i<size;i++)//TODO:is this loop needed?
|
||||
{
|
||||
towns[i]->deactivate();
|
||||
heroes[i]->activate();
|
||||
}
|
||||
}
|
||||
|
||||
void CKingdomInterface::sliderMoved(int newpos)
|
||||
{
|
||||
if ( state == 1 )//towns
|
||||
if ( state == 1 )//towns
|
||||
{
|
||||
townPos = newpos;
|
||||
recreateTownList(newpos);
|
||||
townPos = newpos;
|
||||
recreateTownList(newpos);
|
||||
}
|
||||
else//heroes
|
||||
else//heroes
|
||||
{
|
||||
heroPos = newpos;
|
||||
recreateHeroList(newpos);
|
||||
}
|
||||
heroPos = newpos;
|
||||
recreateHeroList(newpos);
|
||||
}
|
||||
}
|
||||
|
||||
CKingdomInterface::CResIncomePic::CResIncomePic(int RID, CDefEssential * Mines)
|
||||
{
|
||||
{
|
||||
resID = RID;
|
||||
pos.x += 20 + RID*80;
|
||||
pos.y += 495;
|
||||
pos.h = 54;
|
||||
pos.w = (resID!=7)?68:136;//gold pile is bigger
|
||||
mines = Mines;
|
||||
|
||||
value = 0;
|
||||
int resource = resID==7?6:resID;
|
||||
pos.w = (resID!=7)?68:136;//gold pile is bigger
|
||||
mines = Mines;
|
||||
|
||||
for(size_t i = 0; i<CGI->state->map->objects.size(); i++)
|
||||
{
|
||||
value = 0;
|
||||
int resource = resID==7?6:resID;
|
||||
|
||||
for(size_t i = 0; i<CGI->state->map->objects.size(); i++)
|
||||
{
|
||||
CGObjectInstance* obj = CGI->state->map->objects[i];
|
||||
if (obj)
|
||||
if (obj->ID == 53 && obj->subID == resource && //this is mine, produce required resource
|
||||
CGI->state->currentPlayer == obj->tempOwner )//mine is ours
|
||||
value++;
|
||||
}
|
||||
if (resID == 7)//we need to calculate income of whole kingdom
|
||||
{
|
||||
value *=1000;// mines = 1000 gold
|
||||
std::vector<const CGHeroInstance*> heroes = LOCPLINT->cb->getHeroesInfo(true);
|
||||
for(size_t i=0; i<heroes.size();i++)
|
||||
if (obj)
|
||||
if (obj->ID == 53 && obj->subID == resource && //this is mine, produce required resource
|
||||
CGI->state->currentPlayer == obj->tempOwner )//mine is ours
|
||||
value++;
|
||||
}
|
||||
if (resID == 7)//we need to calculate income of whole kingdom
|
||||
{
|
||||
value *=1000;// mines = 1000 gold
|
||||
std::vector<const CGHeroInstance*> heroes = LOCPLINT->cb->getHeroesInfo(true);
|
||||
for(size_t i=0; i<heroes.size();i++)
|
||||
switch(heroes[i]->getSecSkillLevel(13))//some heroes may have estates
|
||||
{
|
||||
case 1: //basic
|
||||
@ -306,11 +308,11 @@ CKingdomInterface::CResIncomePic::CResIncomePic(int RID, CDefEssential * Mines)
|
||||
case 3: //expert
|
||||
value += 500;
|
||||
break;
|
||||
}
|
||||
std::vector<const CGTownInstance*> towns = LOCPLINT->cb->getTownsInfo(true);
|
||||
for(size_t i=0; i<towns.size();i++)
|
||||
value += towns[i]->dailyIncome();
|
||||
}
|
||||
}
|
||||
std::vector<const CGTownInstance*> towns = LOCPLINT->cb->getTownsInfo(true);
|
||||
for(size_t i=0; i<towns.size();i++)
|
||||
value += towns[i]->dailyIncome();
|
||||
}
|
||||
}
|
||||
|
||||
CKingdomInterface::CResIncomePic::~CResIncomePic()
|
||||
@ -322,10 +324,10 @@ void CKingdomInterface::CResIncomePic::hover(bool on)
|
||||
}
|
||||
|
||||
void CKingdomInterface::CResIncomePic::show(SDL_Surface * to)
|
||||
{
|
||||
if (resID < 7)//this is not income
|
||||
blitAt(mines->ourImages[resID].bitmap,pos.x,pos.y,to);
|
||||
|
||||
{
|
||||
if (resID < 7)//this is not income
|
||||
blitAt(mines->ourImages[resID].bitmap,pos.x,pos.y,to);
|
||||
|
||||
std::ostringstream oss;
|
||||
oss << value;
|
||||
CSDL_Ext::printAtMiddle(oss.str(),pos.x+pos.w/2,pos.y+50,GEOR13,zwykly,to);
|
||||
@ -333,14 +335,14 @@ void CKingdomInterface::CResIncomePic::show(SDL_Surface * to)
|
||||
|
||||
|
||||
CKingdomInterface::CTownItem::CTownItem(int num, const CGTownInstance * Town)
|
||||
{
|
||||
// defActions = ACTIVATE | DEACTIVATE | SHOWALL | DISPOSE;
|
||||
{
|
||||
// defActions = ACTIVATE | DEACTIVATE | SHOWALL | DISPOSE;
|
||||
numb = num;
|
||||
pos.x = screen->w/2 - 400 + 23;
|
||||
pos.y = screen->h/2 - 300 + 26+num*116;
|
||||
pos.w = 702;
|
||||
pos.h = 114;
|
||||
town = Town;
|
||||
town = Town;
|
||||
}
|
||||
|
||||
CKingdomInterface::CTownItem::~CTownItem()
|
||||
@ -436,14 +438,14 @@ void CKingdomInterface::CTownItem::show(SDL_Surface * to)
|
||||
}
|
||||
|
||||
CKingdomInterface::CHeroItem::CHeroItem(int num, const CGHeroInstance * Hero)
|
||||
{
|
||||
{
|
||||
numb = num;
|
||||
pos.x = screen->w/2 - 400 + 23;
|
||||
pos.y = screen->h/2 - 300 + 26+num*116;
|
||||
pos.w = 702;
|
||||
pos.h = 114;
|
||||
hero = Hero;
|
||||
artGroup = 0;
|
||||
artGroup = 0;
|
||||
}
|
||||
|
||||
CKingdomInterface::CHeroItem::~CHeroItem()
|
||||
@ -457,7 +459,7 @@ void CKingdomInterface::CHeroItem::show(SDL_Surface * to)
|
||||
blitAt(slots->ourImages[numb % PicCount].bitmap,pos.x,pos.y,to);
|
||||
return;
|
||||
}//print background, different for arts view/backpack mode
|
||||
blitAt(slots->ourImages[(artGroup=2)?4:5].bitmap,pos.x,pos.y,to);
|
||||
blitAt(slots->ourImages[(artGroup=2)?4:5].bitmap,pos.x,pos.y,to);
|
||||
//text "Artifacts"
|
||||
CSDL_Ext::printAtMiddle(CGI->generaltexth->overview[2],pos.x+320,pos.y+55,GEOR13,zwykly,to);
|
||||
int X = pos.x+6;//portrait
|
||||
@ -492,12 +494,12 @@ void CKingdomInterface::CHeroItem::show(SDL_Surface * to)
|
||||
CSDL_Ext::printAtMiddle(strnew.str(),(pos.x+298),(pos.y+31),GEORM,zwykly,to);
|
||||
}
|
||||
//hero speciality
|
||||
blitAt(graphics->un32->ourImages[hero->subID].bitmap, pos.x+375, pos.y+6, to);
|
||||
blitAt(graphics->un32->ourImages[hero->subID].bitmap, pos.x+375, pos.y+6, to);
|
||||
|
||||
for(int i=0; i<hero->secSkills.size(); i++)
|
||||
{//secondary skills
|
||||
int skill = hero->secSkills[i].first,
|
||||
level = hero->secSkills[i].second;
|
||||
level = hero->secSkills[i].second;
|
||||
blitAt(graphics->abils32->ourImages[skill*3+level+2].bitmap,pos.x+411+i*36,pos.y+6,to);
|
||||
}
|
||||
|
||||
@ -520,7 +522,7 @@ void CKingdomInterface::CHeroItem::show(SDL_Surface * to)
|
||||
}
|
||||
|
||||
void CKingdomInterface::CHeroItem::onArtChange(int newstate)
|
||||
{
|
||||
{
|
||||
artGroup = newstate;
|
||||
}
|
||||
|
||||
|
@ -7,10 +7,10 @@
|
||||
#include <SDL.h>
|
||||
#include "GUIBase.h"
|
||||
#include "../hch/CMusicBase.h"
|
||||
class AdventureMapButton;
|
||||
class AdventureMapButton;
|
||||
class CHighlightableButtonsGroup;
|
||||
class CResDataBar;
|
||||
class CStatusBar;
|
||||
class CStatusBar;
|
||||
class CSlider;
|
||||
class CMinorResDataBar;
|
||||
|
||||
@ -25,85 +25,85 @@ class CMinorResDataBar;
|
||||
*/
|
||||
|
||||
class CKingdomInterface : public CIntObject
|
||||
{
|
||||
/* class CDwellingList : public
|
||||
{
|
||||
public:
|
||||
{
|
||||
/* class CDwellingList : public
|
||||
{
|
||||
public:
|
||||
void mouseMoved (const SDL_MouseMotionEvent & sEvent);
|
||||
void genList();
|
||||
void select(int which);
|
||||
void draw(SDL_Surface * to);
|
||||
int size(); //how many elements do we have
|
||||
int size(); //how many elements do we have
|
||||
}*/
|
||||
class CResIncomePic : public CIntObject
|
||||
{
|
||||
public:
|
||||
int resID,value;//resource ID
|
||||
CResIncomePic(int RID, CDefEssential * Mines);//c-tor
|
||||
~CResIncomePic();//d-tor
|
||||
class CResIncomePic : public CIntObject
|
||||
{
|
||||
public:
|
||||
int resID,value;//resource ID
|
||||
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..4)
|
||||
const CGTownInstance * town;
|
||||
void show(SDL_Surface * to);
|
||||
void activate();
|
||||
void deactivate();
|
||||
CTownItem (int num, const CGTownInstance * Town);//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, const CGHeroInstance * Hero);//c-tor
|
||||
~CHeroItem();//d-tor
|
||||
void show(SDL_Surface * to);
|
||||
CDefEssential * mines;//pointer to mines pictures;
|
||||
};
|
||||
public:
|
||||
//common data
|
||||
class CTownItem : public CIntObject
|
||||
{
|
||||
public:
|
||||
int numb;//position on screen (1..4)
|
||||
const CGTownInstance * town;
|
||||
void show(SDL_Surface * to);
|
||||
void activate();
|
||||
void deactivate();
|
||||
CTownItem (int num, const CGTownInstance * Town);//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, const CGHeroInstance * Hero);//c-tor
|
||||
~CHeroItem();//d-tor
|
||||
};
|
||||
public:
|
||||
//common data
|
||||
int state;//0 = initialisation 1 = towns showed, 2 = heroes;
|
||||
SDL_Surface * bg;//background
|
||||
CStatusBar * statusbar;//statusbar
|
||||
CResDataBar *resdatabar;//resources
|
||||
|
||||
CResDataBar *resdatabar;//resources
|
||||
|
||||
AdventureMapButton *exit;//exit button
|
||||
AdventureMapButton *toTowns;//town button
|
||||
AdventureMapButton *toHeroes;//hero button
|
||||
AdventureMapButton *toTowns;//town button
|
||||
AdventureMapButton *toHeroes;//hero button
|
||||
CDefEssential * title; //title bar
|
||||
//hero/town lists
|
||||
bool showHarrisoned;//show harrisoned hero in heroes list or not
|
||||
CSlider * slider;//slider
|
||||
int heroPos,townPos,size;//position of lists; size of list
|
||||
std::vector<CHeroItem *> heroes;//heroes list
|
||||
std::vector<CTownItem *> towns;//towns list
|
||||
static CDefEssential * slots, *fort, *hall;
|
||||
|
||||
//income pics
|
||||
std::vector<CResIncomePic *> incomes;//mines + incomes
|
||||
CDefEssential * mines;//picture of mines
|
||||
//hero/town lists
|
||||
bool showHarrisoned;//show harrisoned hero in heroes list or not
|
||||
CSlider * slider;//slider
|
||||
int heroPos,townPos,size;//position of lists; size of list
|
||||
std::vector<CHeroItem *> heroes;//heroes list
|
||||
std::vector<CTownItem *> towns;//towns list
|
||||
static CDefEssential * slots, *fort, *hall;
|
||||
|
||||
//income pics
|
||||
std::vector<CResIncomePic *> incomes;//mines + incomes
|
||||
CDefEssential * mines;//picture of mines
|
||||
|
||||
CKingdomInterface(); //c-tor
|
||||
~CKingdomInterface(); //d-tor
|
||||
void recreateHeroList(int pos);//recreating heroes list (on slider move)
|
||||
~CKingdomInterface(); //d-tor
|
||||
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 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__
|
||||
|
Loading…
Reference in New Issue
Block a user