2010-01-25 23:25:14 +02:00
|
|
|
#include "CKingdomInterface.h"
|
|
|
|
#include "AdventureMapButton.h"
|
|
|
|
#include "CAdvmapInterface.h"
|
2010-01-31 14:10:13 +02:00
|
|
|
#include "../CCallback.h"
|
2010-02-01 01:30:47 +02:00
|
|
|
#include "../global.h"
|
2010-01-30 21:08:26 +02:00
|
|
|
#include "CConfigHandler.h"
|
2010-01-25 23:25:14 +02:00
|
|
|
#include "CGameInfo.h"
|
2010-01-31 14:10:13 +02:00
|
|
|
#include "CHeroWindow.h"
|
2010-01-30 21:08:26 +02:00
|
|
|
#include "CSpellWindow.h"
|
2010-01-25 23:25:14 +02:00
|
|
|
#include "CMessage.h"
|
|
|
|
#include "SDL_Extensions.h"
|
|
|
|
#include "Graphics.h"
|
|
|
|
#include "../hch/CArtHandler.h"
|
2010-02-01 01:30:47 +02:00
|
|
|
#include "../hch/CBuildingHandler.h"
|
2010-01-25 23:25:14 +02:00
|
|
|
#include "../hch/CDefHandler.h"
|
2010-02-01 19:07:46 +02:00
|
|
|
#include "../hch/CHeroHandler.h"
|
2010-01-25 23:25:14 +02:00
|
|
|
#include "../hch/CGeneralTextHandler.h"
|
|
|
|
#include "../hch/CObjectHandler.h"
|
2010-01-26 13:56:29 +02:00
|
|
|
#include "../hch/CTownHandler.h"
|
|
|
|
#include "../lib/map.h"
|
2010-01-28 18:15:46 +02:00
|
|
|
#include "../lib/NetPacks.h"
|
2010-02-01 19:07:46 +02:00
|
|
|
#include <boost/algorithm/string/replace.hpp>
|
2010-01-31 14:10:13 +02:00
|
|
|
#include <boost/assign/std/vector.hpp>
|
|
|
|
#include <boost/assign/list_of.hpp>
|
2010-02-01 19:07:46 +02:00
|
|
|
#include <boost/lexical_cast.hpp>
|
2010-01-30 21:08:26 +02:00
|
|
|
#include <boost/format.hpp>
|
2010-01-25 23:25:14 +02:00
|
|
|
#include <sstream>
|
|
|
|
using namespace boost::assign;
|
|
|
|
using namespace CSDL_Ext;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* CKingdomInterface.cpp, 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
|
|
|
|
*
|
2010-01-26 13:56:29 +02:00
|
|
|
*/
|
2010-01-31 14:10:13 +02:00
|
|
|
|
2010-01-30 21:08:26 +02:00
|
|
|
#define ADVOPT (conf.go()->ac)
|
2010-01-26 13:56:29 +02:00
|
|
|
CDefEssential* CKingdomInterface::slots;
|
|
|
|
CDefEssential* CKingdomInterface::fort;
|
|
|
|
CDefEssential* CKingdomInterface::hall;
|
|
|
|
|
2010-01-25 23:25:14 +02:00
|
|
|
CKingdomInterface::CKingdomInterface()
|
2010-01-26 13:56:29 +02:00
|
|
|
{
|
|
|
|
OBJ_CONSTRUCTION_CAPTURING_ALL;
|
2010-02-01 01:30:47 +02:00
|
|
|
defActions = SHARE_POS | DISPOSE;
|
2010-01-31 14:10:13 +02:00
|
|
|
PicCount = ADVOPT.overviewPics;
|
2010-02-01 01:30:47 +02:00
|
|
|
size = ADVOPT.overviewSize;
|
2010-01-25 23:25:14 +02:00
|
|
|
pos.x = screen->w/2 - 400;
|
2010-01-28 18:15:46 +02:00
|
|
|
pos.y = screen->h/2 - (68+58*size);
|
2010-01-31 14:10:13 +02:00
|
|
|
showHarrisoned = false;//set to true if you want to see garrisoned heroes
|
2010-02-01 01:30:47 +02:00
|
|
|
heroPos = townPos = objPos = state = 0;
|
2010-01-26 13:56:29 +02:00
|
|
|
|
2010-01-31 14:10:13 +02:00
|
|
|
bg = BitmapHandler::loadBitmap(ADVOPT.overviewBg);
|
2010-01-25 23:25:14 +02:00
|
|
|
graphics->blueToPlayersAdv(bg, LOCPLINT->playerID);
|
2010-02-01 01:30:47 +02:00
|
|
|
|
|
|
|
mines = CDefHandler::giveDefEss("OVMINES.DEF");
|
|
|
|
title = CDefHandler::giveDefEss("OVTITLE.DEF");
|
|
|
|
hall = CDefHandler::giveDefEss("ITMTL.DEF");
|
|
|
|
fort = CDefHandler::giveDefEss("ITMCL.DEF");
|
2010-01-31 14:10:13 +02:00
|
|
|
objPics = CDefHandler::giveDefEss("FLAGPORT.DEF");
|
2010-02-01 01:30:47 +02:00
|
|
|
slots = CDefHandler::giveDefEss("OVSLOT.DEF");
|
2010-01-25 23:25:14 +02:00
|
|
|
|
2010-01-26 13:56:29 +02:00
|
|
|
toHeroes = new AdventureMapButton (CGI->generaltexth->overview[11],"",
|
2010-01-28 18:15:46 +02:00
|
|
|
boost::bind(&CKingdomInterface::listToHeroes,this),748,28+size*116,"OVBUTN1.DEF");
|
2010-01-26 13:56:29 +02:00
|
|
|
toHeroes->block(2);
|
2010-01-25 23:25:14 +02:00
|
|
|
|
2010-01-26 13:56:29 +02:00
|
|
|
toTowns = new AdventureMapButton (CGI->generaltexth->overview[12],"",
|
2010-01-28 18:15:46 +02:00
|
|
|
boost::bind(&CKingdomInterface::listToTowns,this),748,64+size*116,"OVBUTN6.DEF");
|
2010-01-26 13:56:29 +02:00
|
|
|
toTowns->block(0);
|
2010-01-25 23:25:14 +02:00
|
|
|
|
2010-01-26 13:56:29 +02:00
|
|
|
exit = new AdventureMapButton (CGI->generaltexth->allTexts[600],"",
|
2010-01-28 18:15:46 +02:00
|
|
|
boost::bind(&CKingdomInterface::close,this),748,99+size*116,"OVBUTN1.DEF");
|
2010-01-26 13:56:29 +02:00
|
|
|
exit->bitmapOffset = 3;
|
2010-01-25 23:25:14 +02:00
|
|
|
|
2010-01-28 18:15:46 +02:00
|
|
|
statusbar = new CStatusBar(pos.x+7,pos.y+91+size*116,"TSTATBAR.bmp",732);
|
|
|
|
resdatabar = new CResDataBar("KRESBAR.bmp",pos.x+3,pos.y+111+size*116,32,2,76,76);
|
2010-01-31 14:10:13 +02:00
|
|
|
|
2010-01-30 21:08:26 +02:00
|
|
|
for(size_t i=0;i<size;i++)//creating empty hero/town lists for input
|
2010-02-01 01:30:47 +02:00
|
|
|
{
|
|
|
|
heroes.push_back( new CHeroItem(i,this));
|
|
|
|
towns.push_back( new CTownItem(i,this));
|
|
|
|
}
|
2010-01-26 13:56:29 +02:00
|
|
|
|
2010-01-28 18:15:46 +02:00
|
|
|
slider = new CSlider(4, 4, size*116+19, boost::bind (&CKingdomInterface::sliderMoved, this, _1),
|
2010-01-26 13:56:29 +02:00
|
|
|
size, LOCPLINT->cb->howManyHeroes(showHarrisoned), 0, false, 0);
|
2010-01-28 18:15:46 +02:00
|
|
|
|
|
|
|
//creating objects list
|
|
|
|
ObjTop = new AdventureMapButton ("","", boost::bind(&CKingdomInterface::moveObjectList,this,0),
|
|
|
|
733,4,"OVBUTN4.DEF");
|
|
|
|
|
|
|
|
ObjUp = new AdventureMapButton ("","", boost::bind(&CKingdomInterface::moveObjectList,this,1),
|
|
|
|
733,24,"OVBUTN4.DEF");
|
|
|
|
ObjUp->bitmapOffset = 4;
|
|
|
|
|
|
|
|
ObjDown = new AdventureMapButton ("","", boost::bind(&CKingdomInterface::moveObjectList,this,2),
|
|
|
|
733,size*116-18,"OVBUTN4.DEF");
|
|
|
|
ObjDown->bitmapOffset = 6;
|
|
|
|
|
|
|
|
ObjBottom = new AdventureMapButton ("","", boost::bind(&CKingdomInterface::moveObjectList,this,3),
|
|
|
|
733,size*116+2,"OVBUTN4.DEF");
|
|
|
|
ObjBottom->bitmapOffset = 2;
|
|
|
|
|
2010-02-01 01:30:47 +02:00
|
|
|
for (size_t i=0; i<SKILL_PER_HERO; i++)
|
|
|
|
{
|
|
|
|
incomes.push_back(new HoverableArea());//bottom panel with mines
|
|
|
|
incomes[i]->pos = genRect(54,68,pos.x+20+i*80,pos.y+31+size*116);
|
|
|
|
incomes[i]->hoverText = CGI->generaltexth->mines[i].first;
|
|
|
|
}
|
|
|
|
incomes[7]->pos.w = 136;
|
|
|
|
incomes[7]->hoverText = CGI->generaltexth->allTexts[255];
|
|
|
|
incomesVal+=0,0,0,0,0,0,0,0;//for mines images
|
|
|
|
|
2010-01-28 18:15:46 +02:00
|
|
|
std::map<std::pair<int,int>,int> addObjects;//objects to print, except 17th dwelling
|
|
|
|
//format: (id,subID),image index
|
|
|
|
#define INSERT_MAP addObjects.insert(std::pair<std::pair<int,int>,int>(std::pair<int,int>
|
|
|
|
INSERT_MAP (20,1) ,81));//Golem factory
|
|
|
|
INSERT_MAP (42,0) ,82));//Lighthouse
|
|
|
|
INSERT_MAP (33,0) ,83));//Garrison
|
|
|
|
INSERT_MAP (219,0),83));//Garrison
|
|
|
|
INSERT_MAP (33,1) ,84));//Anti-magic Garrison
|
|
|
|
INSERT_MAP (219,1),84));//Anti-magic Garrison
|
|
|
|
INSERT_MAP (53,7) ,85));//Abandoned mine
|
|
|
|
INSERT_MAP (20,0) ,86));//Conflux
|
|
|
|
INSERT_MAP (87,0) ,87));//Harbor
|
|
|
|
#undef INSERT_MAP
|
2010-02-01 01:30:47 +02:00
|
|
|
|
2010-01-28 18:15:46 +02:00
|
|
|
for(size_t i = 0; i<CGI->state->map->objects.size(); i++)
|
|
|
|
{
|
2010-01-30 21:08:26 +02:00
|
|
|
CGObjectInstance* obj = CGI->state->map->objects[i];//current object
|
2010-01-28 18:15:46 +02:00
|
|
|
if (obj)
|
|
|
|
{
|
2010-01-30 21:08:26 +02:00
|
|
|
if (obj->tempOwner == CGI->state->currentPlayer)//if object is our
|
2010-01-28 18:15:46 +02:00
|
|
|
{
|
2010-02-01 01:30:47 +02:00
|
|
|
std::pair<int,int > curElm = std::pair<int,int >(obj->ID, obj->subID);
|
2010-01-30 21:08:26 +02:00
|
|
|
if ( obj->ID == 17 )//dwelling, text is a plural name of a creature
|
2010-01-28 18:15:46 +02:00
|
|
|
{
|
|
|
|
objList[obj->subID].first += 1;
|
|
|
|
objList[obj->subID].second = & CGI->creh->creatures[CGI->objh->cregens[obj->subID]].namePl;
|
|
|
|
}
|
|
|
|
else if (addObjects.find(curElm) != addObjects.end())
|
2010-01-30 21:08:26 +02:00
|
|
|
{//object from addObjects map, text is name of the object
|
2010-01-28 18:15:46 +02:00
|
|
|
objList[addObjects[curElm]].first += 1;
|
|
|
|
objList[addObjects[curElm]].second = & obj->hoverName;
|
|
|
|
}
|
2010-02-01 01:30:47 +02:00
|
|
|
else if ( obj->ID == 53 )//TODO: abandoned mines
|
|
|
|
incomesVal[obj->subID]+=1;
|
2010-01-28 18:15:46 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2010-02-01 01:30:47 +02:00
|
|
|
|
2010-01-28 18:15:46 +02:00
|
|
|
addObjects.clear();
|
|
|
|
objSize = (size*116-64)/57; //in object list will fit (height of panel)/(height of one element) items
|
|
|
|
ObjList.resize(objSize);
|
|
|
|
for(size_t i=0;i<objSize;i++)
|
|
|
|
{
|
|
|
|
ObjList[i] = new HoverableArea();
|
|
|
|
ObjList[i]->pos = genRect(50,50,pos.x+740,pos.y+44+i*57);
|
|
|
|
}
|
2010-02-01 01:30:47 +02:00
|
|
|
|
|
|
|
incomesVal[7] = incomesVal[6]*1000;//gold mines -> total income
|
|
|
|
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
|
|
|
|
incomesVal[7] += 125;
|
|
|
|
break;
|
|
|
|
case 2: //advanced
|
|
|
|
incomesVal[7] += 250;
|
|
|
|
break;
|
|
|
|
case 3: //expert
|
|
|
|
incomesVal[7] += 500;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
std::vector<const CGTownInstance*> towns = LOCPLINT->cb->getTownsInfo(true);
|
|
|
|
for(size_t i=0; i<towns.size();i++)
|
|
|
|
incomesVal[7] += towns[i]->dailyIncome();
|
2010-01-28 18:15:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CKingdomInterface::moveObjectList(int newPos)
|
|
|
|
{
|
|
|
|
int top = objList.size() > objSize ? 0 : objList.size() - objSize ;
|
|
|
|
int bottom = objList.size() > objSize ? objList.size() - objSize : 0 ;
|
|
|
|
switch (newPos)//checking what button was pressed
|
|
|
|
{
|
2010-01-30 21:08:26 +02:00
|
|
|
/* Top */ case 0: objPos = top;
|
2010-01-28 18:15:46 +02:00
|
|
|
break;
|
2010-01-30 21:08:26 +02:00
|
|
|
/* Up */ case 1: objPos = objPos==top?top:(objPos-1);
|
2010-01-28 18:15:46 +02:00
|
|
|
break;
|
2010-01-30 21:08:26 +02:00
|
|
|
/* Down */ case 2: objPos = objPos==bottom?bottom:(objPos+1);
|
2010-01-28 18:15:46 +02:00
|
|
|
break;
|
2010-01-30 21:08:26 +02:00
|
|
|
/*Bottom*/ case 3: objPos = bottom;
|
2010-01-28 18:15:46 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
GH.totalRedraw();
|
2010-01-25 23:25:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
CKingdomInterface::~CKingdomInterface()
|
2010-01-26 13:56:29 +02:00
|
|
|
{
|
|
|
|
SDL_FreeSurface(bg);
|
2010-01-25 23:25:14 +02:00
|
|
|
|
2010-01-30 21:08:26 +02:00
|
|
|
delete title;//deleting .def
|
2010-01-26 13:56:29 +02:00
|
|
|
delete slots;
|
|
|
|
delete fort;
|
|
|
|
delete hall;
|
2010-01-30 21:08:26 +02:00
|
|
|
delete objPics;
|
2010-02-01 01:30:47 +02:00
|
|
|
delete mines;
|
2010-01-26 13:56:29 +02:00
|
|
|
|
2010-01-30 21:08:26 +02:00
|
|
|
towns.clear();//deleting lists
|
2010-01-26 13:56:29 +02:00
|
|
|
heroes.clear();
|
2010-01-25 23:25:14 +02:00
|
|
|
incomes.clear();
|
2010-01-28 18:15:46 +02:00
|
|
|
ObjList.clear();
|
|
|
|
objList.clear();
|
2010-01-25 23:25:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CKingdomInterface::close()
|
|
|
|
{
|
|
|
|
GH.popIntTotally(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CKingdomInterface::showAll( SDL_Surface * to/*=NULL*/)
|
|
|
|
{
|
|
|
|
LOCPLINT->adventureInt->resdatabar.draw(to);
|
|
|
|
blitAt(bg,pos,to);
|
|
|
|
resdatabar->draw(to);
|
|
|
|
toTowns->show(to);
|
2010-01-26 13:56:29 +02:00
|
|
|
toHeroes->show(to);
|
|
|
|
exit->show(to);
|
2010-01-28 18:15:46 +02:00
|
|
|
|
|
|
|
ObjTop->show(to);
|
|
|
|
ObjUp->show(to);
|
|
|
|
ObjDown->show(to);
|
|
|
|
ObjBottom->show(to);
|
|
|
|
|
|
|
|
for (size_t i=0; i<ObjList.size(); i++)//list may be moved, recreate hover text
|
|
|
|
ObjList[i]->hoverText = "";
|
|
|
|
|
|
|
|
int skipCount=0, curPos=objPos<0?(-objPos):0;
|
|
|
|
for (std::map<int,std::pair<int, std::string*> >::iterator it=objList.begin(); it!= objList.end(); it++)
|
|
|
|
{
|
2010-01-30 21:08:26 +02:00
|
|
|
if (skipCount<objPos)//we will show only objects from objPos
|
2010-01-28 18:15:46 +02:00
|
|
|
{
|
|
|
|
skipCount++;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
blitAt(objPics->ourImages[(*it).first].bitmap,pos.x+740,pos.y+44+curPos*57,to);
|
|
|
|
|
2010-01-30 21:08:26 +02:00
|
|
|
std::ostringstream ostrs;//objects count
|
2010-01-28 18:15:46 +02:00
|
|
|
ostrs << (*it).second.first;
|
|
|
|
CSDL_Ext::printTo(ostrs.str(),pos.x+790,pos.y+94+curPos*57,GEOR13,zwykly,to);
|
|
|
|
|
|
|
|
ObjList[curPos]->hoverText = * (*it).second.second;
|
|
|
|
curPos++;
|
|
|
|
if (curPos == objSize)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2010-01-25 23:25:14 +02:00
|
|
|
if (state == 1)
|
2010-01-26 13:56:29 +02:00
|
|
|
{//printing text "Town", "Harrisoned hero", "Visiting hero"
|
2010-01-25 23:25:14 +02:00
|
|
|
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);
|
2010-01-26 13:56:29 +02:00
|
|
|
CSDL_Ext::printAtMiddle(CGI->generaltexth->overview[5],pos.x+600,pos.y+12,TNRB16,zwykly,to);
|
|
|
|
for (size_t i=0; i<size; i++)
|
2010-01-30 21:08:26 +02:00
|
|
|
towns[i]->showAll(to);//show town list
|
2010-01-25 23:25:14 +02:00
|
|
|
}
|
|
|
|
else
|
2010-01-26 13:56:29 +02:00
|
|
|
{//text "Hero/stats" and "Skills"
|
2010-01-25 23:25:14 +02:00
|
|
|
CSDL_Ext::printAtMiddle(CGI->generaltexth->overview[0],pos.x+150,pos.y+12,TNRB16,zwykly,to);
|
2010-01-26 13:56:29 +02:00
|
|
|
CSDL_Ext::printAtMiddle(CGI->generaltexth->overview[1],pos.x+500,pos.y+12,TNRB16,zwykly,to);
|
|
|
|
for (size_t i=0; i<size; i++)
|
2010-01-30 21:08:26 +02:00
|
|
|
heroes[i]->showAll(to);//show hero list
|
2010-01-25 23:25:14 +02:00
|
|
|
}
|
2010-02-01 01:30:47 +02:00
|
|
|
for (int i = 0; i<7; i++)
|
|
|
|
blitAt(mines->ourImages[i].bitmap,pos.x + 20 + i*80,pos.y + 31+size*116,to);
|
2010-01-25 23:25:14 +02:00
|
|
|
|
|
|
|
for(size_t i=0;i<incomes.size();i++)
|
2010-02-01 01:30:47 +02:00
|
|
|
{
|
|
|
|
std::ostringstream oss;
|
|
|
|
oss << incomesVal[i];
|
|
|
|
CSDL_Ext::printAtMiddle(oss.str(),incomes[i]->pos.x+incomes[i]->pos.w/2,incomes[i]->pos.y+50,GEOR13,zwykly,to);
|
|
|
|
}
|
2010-01-26 13:56:29 +02:00
|
|
|
|
2010-01-28 18:15:46 +02:00
|
|
|
slider->showAll(to);
|
2010-01-25 23:25:14 +02:00
|
|
|
if(screen->w != 800 || screen->h !=600)
|
2010-01-28 18:15:46 +02:00
|
|
|
CMessage::drawBorder(LOCPLINT->playerID,to,828,136+116*size+29,pos.x-14,pos.y-15);
|
2010-01-25 23:25:14 +02:00
|
|
|
show(to);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CKingdomInterface::show(SDL_Surface * to)
|
2010-01-31 14:10:13 +02:00
|
|
|
{
|
2010-01-25 23:25:14 +02:00
|
|
|
statusbar->show(to);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CKingdomInterface::activate()
|
2010-01-31 14:10:13 +02:00
|
|
|
{
|
2010-01-25 23:25:14 +02:00
|
|
|
LOCPLINT->statusbar = statusbar;
|
|
|
|
exit->activate();
|
|
|
|
toTowns->activate();
|
2010-01-26 13:56:29 +02:00
|
|
|
toHeroes->activate();
|
2010-01-28 18:15:46 +02:00
|
|
|
|
|
|
|
ObjTop->activate();
|
|
|
|
ObjUp->activate();
|
|
|
|
ObjDown->activate();
|
|
|
|
ObjBottom->activate();
|
|
|
|
|
|
|
|
for (size_t i=0; i<ObjList.size(); i++)
|
|
|
|
ObjList[i]->activate();
|
|
|
|
|
|
|
|
for (size_t i=0; i<incomes.size(); i++)
|
|
|
|
incomes[i]->activate();
|
2010-01-25 23:25:14 +02:00
|
|
|
if (state == 1)
|
2010-01-30 21:08:26 +02:00
|
|
|
for (size_t i=0; i<size; i++)
|
2010-01-25 23:25:14 +02:00
|
|
|
towns[i]->activate();
|
|
|
|
else
|
2010-01-30 21:08:26 +02:00
|
|
|
for (size_t i=0; i<size; i++)
|
2010-01-26 13:56:29 +02:00
|
|
|
heroes[i]->activate();
|
|
|
|
|
2010-01-25 23:25:14 +02:00
|
|
|
slider->activate();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CKingdomInterface::deactivate()
|
|
|
|
{
|
|
|
|
exit->deactivate();
|
|
|
|
toTowns->deactivate();
|
|
|
|
toHeroes->deactivate();
|
2010-01-28 18:15:46 +02:00
|
|
|
|
|
|
|
ObjTop->deactivate();
|
|
|
|
ObjUp->deactivate();
|
|
|
|
ObjDown->deactivate();
|
|
|
|
ObjBottom->deactivate();
|
|
|
|
|
|
|
|
for (size_t i=0; i<ObjList.size(); i++)
|
|
|
|
ObjList[i]->deactivate();
|
|
|
|
|
|
|
|
for (size_t i=0; i<incomes.size(); i++)
|
|
|
|
incomes[i]->deactivate();
|
2010-01-31 14:10:13 +02:00
|
|
|
|
2010-01-25 23:25:14 +02:00
|
|
|
if (state == 1)
|
2010-01-30 21:08:26 +02:00
|
|
|
for (size_t i=0; i<size; i++)
|
2010-01-25 23:25:14 +02:00
|
|
|
towns[i]->deactivate();
|
|
|
|
else
|
2010-01-30 21:08:26 +02:00
|
|
|
for (size_t i=0; i<size; i++)
|
2010-01-26 13:56:29 +02:00
|
|
|
heroes[i]->deactivate();
|
2010-01-25 23:25:14 +02:00
|
|
|
slider->deactivate();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CKingdomInterface::keyPressed(const SDL_KeyboardEvent & key)
|
|
|
|
{
|
|
|
|
}
|
2010-01-26 13:56:29 +02:00
|
|
|
|
|
|
|
void CKingdomInterface::recreateHeroList(int pos)
|
|
|
|
{
|
|
|
|
std::vector<const CGHeroInstance*> Heroes = LOCPLINT->cb->getHeroesInfo(true);
|
|
|
|
int i=0, cnt=0;
|
2010-01-30 21:08:26 +02:00
|
|
|
for (size_t j = 0; ((j<Heroes.size()) && (i<size));j++)
|
2010-01-26 13:56:29 +02:00
|
|
|
{
|
|
|
|
if (Heroes[j]->inTownGarrison && (!showHarrisoned))//if hero in garrison and we don't show them
|
|
|
|
continue;
|
|
|
|
if (cnt<pos)//skipping heroes
|
|
|
|
{
|
|
|
|
cnt++;
|
|
|
|
continue;
|
2010-01-31 14:10:13 +02:00
|
|
|
}//this hero will be added
|
2010-01-30 21:08:26 +02:00
|
|
|
heroes[i]->setHero(Heroes[j]);
|
2010-01-25 23:25:14 +02:00
|
|
|
i++;
|
2010-01-26 13:56:29 +02:00
|
|
|
}
|
|
|
|
for (i;i<size;i++)//if we still have empty pieces
|
2010-01-30 21:08:26 +02:00
|
|
|
heroes[i]->setHero(NULL);//empty pic
|
2010-01-26 13:56:29 +02:00
|
|
|
GH.totalRedraw();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CKingdomInterface::recreateTownList(int pos)
|
|
|
|
{
|
|
|
|
std::vector<const CGTownInstance*> Towns = LOCPLINT->cb->getTownsInfo(true);
|
2010-01-30 21:08:26 +02:00
|
|
|
for(size_t i=0;i<size;i++)
|
2010-01-26 13:56:29 +02:00
|
|
|
{
|
2010-01-25 23:25:14 +02:00
|
|
|
if (i+pos<Towns.size())
|
2010-01-30 21:08:26 +02:00
|
|
|
towns[i]->setTown(Towns[i+pos]);//replace town
|
2010-01-25 23:25:14 +02:00
|
|
|
else
|
2010-01-30 21:08:26 +02:00
|
|
|
towns[i]->setTown(NULL);//only empty pic
|
2010-01-26 13:56:29 +02:00
|
|
|
}
|
|
|
|
GH.totalRedraw();
|
|
|
|
}
|
2010-01-25 23:25:14 +02:00
|
|
|
|
|
|
|
void CKingdomInterface::listToTowns()
|
|
|
|
{
|
|
|
|
state = 1;
|
|
|
|
toHeroes->block(0);
|
|
|
|
toTowns->block(2);
|
|
|
|
heroPos = slider->value;
|
2010-01-26 13:56:29 +02:00
|
|
|
slider->setAmount(LOCPLINT->cb->howManyTowns());
|
|
|
|
slider->value=townPos;//moving slider
|
2010-01-31 14:10:13 +02:00
|
|
|
recreateTownList(townPos);
|
|
|
|
for (size_t i=0;i<size;i++)
|
|
|
|
{
|
|
|
|
heroes[i]->deactivate();
|
|
|
|
towns[i]->activate();
|
2010-01-25 23:25:14 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CKingdomInterface::listToHeroes()
|
|
|
|
{
|
|
|
|
state = 2;
|
|
|
|
toHeroes->block(2);
|
|
|
|
toTowns->block(0);
|
2010-01-26 13:56:29 +02:00
|
|
|
townPos = slider->value;
|
2010-01-25 23:25:14 +02:00
|
|
|
slider->setAmount(LOCPLINT->cb->howManyHeroes(showHarrisoned));
|
|
|
|
slider->value=heroPos;//moving slider
|
2010-01-31 14:10:13 +02:00
|
|
|
recreateHeroList(heroPos);
|
|
|
|
for (size_t i=0;i<size;i++)
|
|
|
|
{
|
|
|
|
towns[i]->deactivate();
|
|
|
|
heroes[i]->activate();
|
2010-01-25 23:25:14 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CKingdomInterface::sliderMoved(int newpos)
|
2010-01-31 14:10:13 +02:00
|
|
|
{
|
|
|
|
if (state == 0)
|
2010-01-25 23:25:14 +02:00
|
|
|
{
|
2010-01-26 13:56:29 +02:00
|
|
|
townPos = newpos;
|
2010-01-31 14:10:13 +02:00
|
|
|
recreateHeroList(newpos);
|
2010-01-30 21:08:26 +02:00
|
|
|
state = 2;
|
|
|
|
}
|
|
|
|
else if ( state == 1 )//towns
|
2010-01-31 14:10:13 +02:00
|
|
|
{
|
2010-01-30 21:08:26 +02:00
|
|
|
for (size_t i=0; i<size; i++)
|
|
|
|
towns[i]->deactivate();
|
|
|
|
townPos = newpos;
|
2010-01-31 14:10:13 +02:00
|
|
|
recreateTownList(newpos);
|
2010-01-30 21:08:26 +02:00
|
|
|
for (size_t i=0; i<size; i++)
|
|
|
|
towns[i]->activate();
|
2010-01-25 23:25:14 +02:00
|
|
|
}
|
2010-01-26 13:56:29 +02:00
|
|
|
else//heroes
|
2010-01-31 14:10:13 +02:00
|
|
|
{
|
2010-01-30 21:08:26 +02:00
|
|
|
for (size_t i=0; i<size; i++)
|
|
|
|
heroes[i]->deactivate();
|
2010-01-26 13:56:29 +02:00
|
|
|
heroPos = newpos;
|
2010-01-31 14:10:13 +02:00
|
|
|
recreateHeroList(newpos);
|
2010-01-30 21:08:26 +02:00
|
|
|
for (size_t i=0; i<size; i++)
|
|
|
|
heroes[i]->activate();
|
2010-01-26 13:56:29 +02:00
|
|
|
}
|
2010-01-25 23:25:14 +02:00
|
|
|
}
|
|
|
|
|
2010-02-01 01:30:47 +02:00
|
|
|
CKingdomInterface::CTownItem::CTownItem(int num, CKingdomInterface * Owner)
|
2010-01-26 13:56:29 +02:00
|
|
|
{
|
2010-02-01 01:30:47 +02:00
|
|
|
recActions = DISPOSE | SHARE_POS;
|
|
|
|
owner = Owner;
|
|
|
|
numb = num;
|
|
|
|
pos.x += 23;
|
|
|
|
pos.y += 25+num*116;
|
|
|
|
pos.w = 702;
|
|
|
|
pos.h = 114;
|
|
|
|
town = NULL;
|
|
|
|
garr = NULL;
|
2010-01-28 18:15:46 +02:00
|
|
|
|
2010-02-01 01:30:47 +02:00
|
|
|
garrHero = new HoverableArea();
|
|
|
|
garrHero->pos = genRect(64, 58, pos.x+244, pos.y + 6);
|
2010-01-26 13:56:29 +02:00
|
|
|
|
2010-02-01 01:30:47 +02:00
|
|
|
visitHero = new HoverableArea();
|
|
|
|
visitHero->pos = genRect(64, 58, pos.x+476, pos.y + 6);
|
2010-01-25 23:25:14 +02:00
|
|
|
|
2010-02-01 01:30:47 +02:00
|
|
|
for (int i=0; i<CREATURES_PER_TOWN;i++)
|
|
|
|
{//creatures info
|
|
|
|
creaGrowth.push_back(new HoverableArea());
|
|
|
|
creaGrowth[i]->pos = genRect(32, 32, pos.x+56+i*37, pos.y + 78);
|
2010-01-25 23:25:14 +02:00
|
|
|
|
2010-02-01 01:30:47 +02:00
|
|
|
creaCount.push_back(new CCreaPlace());
|
|
|
|
creaCount[i]->pos = genRect(32, 32, pos.x+409+i*37, pos.y + 78);
|
|
|
|
creaCount[i]->type = i;
|
2010-01-28 18:15:46 +02:00
|
|
|
}
|
2010-02-01 01:30:47 +02:00
|
|
|
hallArea = new HoverableArea();
|
|
|
|
hallArea->pos = genRect(38, 38, pos.x+69, pos.y + 31);
|
2010-01-25 23:25:14 +02:00
|
|
|
|
2010-02-01 01:30:47 +02:00
|
|
|
fortArea = new HoverableArea();
|
|
|
|
fortArea->pos = genRect(38, 38, pos.x+111, pos.y + 31);
|
2010-01-26 13:56:29 +02:00
|
|
|
|
2010-02-01 01:30:47 +02:00
|
|
|
townImage = new HoverableArea();
|
|
|
|
townImage->pos = genRect(64, 58, pos.x+5, pos.y + 6);
|
2010-01-25 23:25:14 +02:00
|
|
|
|
2010-02-01 01:30:47 +02:00
|
|
|
incomeArea = new HoverableArea();
|
|
|
|
incomeArea->pos = genRect(42, 64, pos.x+154, pos.y + 31);
|
|
|
|
incomeArea->hoverText = CGI->generaltexth->allTexts[255];
|
2010-01-25 23:25:14 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
CKingdomInterface::CTownItem::~CTownItem()
|
|
|
|
{
|
2010-02-01 01:30:47 +02:00
|
|
|
creaGrowth.clear();
|
|
|
|
creaCount.clear();
|
|
|
|
delete garr;
|
2010-01-25 23:25:14 +02:00
|
|
|
}
|
2010-01-31 14:10:13 +02:00
|
|
|
|
2010-01-30 21:08:26 +02:00
|
|
|
void CKingdomInterface::CTownItem::setTown(const CGTownInstance * newTown)
|
2010-01-31 14:10:13 +02:00
|
|
|
{
|
2010-02-01 01:30:47 +02:00
|
|
|
BLOCK_CAPTURING;
|
|
|
|
delete garr;
|
2010-01-30 21:08:26 +02:00
|
|
|
town = newTown;
|
2010-02-01 01:30:47 +02:00
|
|
|
if (!town)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
garr = NULL;
|
|
|
|
}
|
|
|
|
garr = new CGarrisonInt(pos.x+313,pos.y+3,4,Point(232,0),slots->ourImages[owner->PicCount+2].bitmap,Point(313,2),town,town->visitingHero,false,true, 4,Point(-126,37));
|
|
|
|
garr->update = false;
|
|
|
|
|
|
|
|
/*for (int i=4; i<7; i++)
|
|
|
|
{
|
|
|
|
garr->sup[0][i][0].pos.x -= 126;
|
|
|
|
garr->sup[0][i][0].pos.y += 37;
|
|
|
|
garr->sdown[0][i][0].pos.x -= 126;
|
|
|
|
garr->sdown[0][i][0].pos.y += 37;
|
|
|
|
}*/
|
|
|
|
|
|
|
|
for (int i=0; i<CREATURES_PER_TOWN;i++)
|
|
|
|
{
|
|
|
|
creaCount[i]->town = NULL;
|
|
|
|
|
|
|
|
int crid = -1;
|
|
|
|
if (!vstd::contains(town->builtBuildings,30+i))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (vstd::contains(town->builtBuildings,30+i+CREATURES_PER_TOWN))
|
|
|
|
crid = town->town->upgradedCreatures[i];
|
|
|
|
else
|
|
|
|
crid = town->town->basicCreatures[i];
|
|
|
|
|
|
|
|
std::string descr=CGI->generaltexth->allTexts[588];
|
|
|
|
boost::algorithm::replace_first(descr,"%s",CGI->creh->creatures[crid].namePl);
|
|
|
|
creaGrowth[i]->hoverText = descr;
|
|
|
|
|
|
|
|
descr=CGI->generaltexth->heroscrn[1];
|
|
|
|
boost::algorithm::replace_first(descr,"%s",CGI->creh->creatures[crid].namePl);
|
|
|
|
creaCount[i]->hoverText = descr;
|
|
|
|
creaCount[i]->town = town;
|
|
|
|
}
|
|
|
|
|
|
|
|
townImage->hoverText = town->name;
|
|
|
|
|
|
|
|
hallArea->hoverText = CGI->buildh->buildings[town->subID][10+town->hallLevel()]->Name();
|
|
|
|
if (town->hasFort())
|
|
|
|
fortArea->hoverText = CGI->buildh->buildings[town->subID][6+town->fortLevel()]->Name();
|
|
|
|
else
|
|
|
|
fortArea->hoverText = "";
|
2010-01-31 14:10:13 +02:00
|
|
|
}
|
2010-01-25 23:25:14 +02:00
|
|
|
|
|
|
|
void CKingdomInterface::CTownItem::activate()
|
|
|
|
{
|
2010-02-01 01:30:47 +02:00
|
|
|
if (!town)
|
|
|
|
return;
|
|
|
|
garr->activate();
|
|
|
|
hallArea->activate();
|
|
|
|
fortArea->activate();
|
|
|
|
incomeArea->activate();
|
|
|
|
townImage->activate();
|
|
|
|
|
|
|
|
if (town->garrisonHero)
|
|
|
|
garrHero->activate();
|
|
|
|
if (town->visitingHero)
|
|
|
|
visitHero->activate();
|
|
|
|
|
|
|
|
for (int i=0; i<CREATURES_PER_TOWN;i++)
|
|
|
|
if (vstd::contains(town->builtBuildings,30+i))
|
|
|
|
{
|
|
|
|
creaGrowth[i]->activate();
|
|
|
|
creaCount [i]->activate();
|
|
|
|
}
|
2010-01-25 23:25:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CKingdomInterface::CTownItem::deactivate()
|
|
|
|
{
|
2010-02-01 01:30:47 +02:00
|
|
|
if (!town)
|
|
|
|
return;
|
|
|
|
garr->deactivate();
|
|
|
|
hallArea->deactivate();
|
|
|
|
fortArea->deactivate();
|
|
|
|
incomeArea->deactivate();
|
|
|
|
townImage->deactivate();
|
|
|
|
|
|
|
|
if (town->garrisonHero)
|
|
|
|
garrHero->deactivate();
|
|
|
|
if (town->visitingHero)
|
|
|
|
visitHero->deactivate();
|
|
|
|
|
|
|
|
for (int i=0; i<CREATURES_PER_TOWN;i++)
|
|
|
|
if (vstd::contains(town->builtBuildings,30+i))
|
|
|
|
{
|
|
|
|
creaGrowth[i]->deactivate();
|
|
|
|
creaCount [i]->deactivate();
|
|
|
|
}
|
2010-01-25 23:25:14 +02:00
|
|
|
}
|
2010-01-31 14:10:13 +02:00
|
|
|
|
2010-01-30 21:08:26 +02:00
|
|
|
void CKingdomInterface::CTownItem::showAll(SDL_Surface * to)
|
2010-01-25 23:25:14 +02:00
|
|
|
{
|
|
|
|
if (!town)
|
|
|
|
{//if NULL - print background & exit
|
2010-01-30 21:08:26 +02:00
|
|
|
blitAt(slots->ourImages[numb % owner->PicCount].bitmap,pos.x,pos.y,to);
|
2010-01-25 23:25:14 +02:00
|
|
|
return;
|
|
|
|
}//background
|
2010-01-30 21:08:26 +02:00
|
|
|
blitAt(slots->ourImages[owner->PicCount+2].bitmap,pos.x,pos.y,to);
|
2010-01-25 23:25:14 +02:00
|
|
|
//town pic/name
|
|
|
|
int townPic = town->subID*2;
|
|
|
|
if (!town->hasFort())
|
|
|
|
townPic += F_NUMBER*2;
|
|
|
|
if(town->builded >= MAX_BUILDING_PER_TURN)
|
|
|
|
townPic++;
|
|
|
|
blitAt(graphics->bigTownPic->ourImages[townPic].bitmap,pos.x+5,pos.y+6,to);
|
|
|
|
CSDL_Ext::printAt(town->name,pos.x+73,pos.y+7,GEOR13,zwykly,to);
|
|
|
|
//fort pic
|
|
|
|
townPic = town->fortLevel()-1;
|
|
|
|
if (townPic==-1) townPic = 3;
|
|
|
|
blitAt(fort->ourImages[townPic].bitmap,pos.x+111,pos.y+31,to);
|
|
|
|
//hall pic
|
|
|
|
townPic = town->hallLevel();
|
|
|
|
blitAt(hall->ourImages[townPic].bitmap,pos.x+69,pos.y+31,to);
|
|
|
|
//income pic
|
|
|
|
std::ostringstream oss;
|
|
|
|
oss << town->dailyIncome();
|
|
|
|
CSDL_Ext::printAtMiddle(oss.str(),pos.x+188,pos.y+60,GEOR13,zwykly,to);
|
2010-01-30 21:08:26 +02:00
|
|
|
// Creature bonuses/ Creature available texts - need to find text wrapper thingy (have "\n" inside text)
|
2010-01-25 23:25:14 +02:00
|
|
|
// CSDL_Ext::printAtWR(CGI->generaltexth->allTexts[265],pos.x,pos.y+80,GEOR13,zwykly,to);
|
|
|
|
// CSDL_Ext::printTo(CGI->generaltexth->allTexts[266],pos.x+350,pos.y+80,GEOR13,zwykly,to);
|
|
|
|
for (int i=0; i<CREATURES_PER_TOWN;i++)
|
|
|
|
{//creatures info
|
|
|
|
int crid = -1;
|
|
|
|
int bid = 30+i;
|
|
|
|
if (!vstd::contains(town->builtBuildings,bid))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (vstd::contains(town->builtBuildings,bid+CREATURES_PER_TOWN))
|
|
|
|
{
|
|
|
|
crid = town->town->upgradedCreatures[i];
|
|
|
|
bid += CREATURES_PER_TOWN;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
crid = town->town->basicCreatures[i];
|
|
|
|
//creature growth
|
|
|
|
blitAt(graphics->smallImgs[crid],pos.x+56+i*37,pos.y+78,to);
|
|
|
|
std::ostringstream oss;
|
|
|
|
oss << '+' << town->creatureGrowth(i);
|
|
|
|
CSDL_Ext::printTo(oss.str(),pos.x+87+i*37,pos.y+110,GEORM,zwykly,to);
|
|
|
|
//creature available
|
|
|
|
blitAt(graphics->smallImgs[crid],pos.x+409+i*37,pos.y+78,to);
|
|
|
|
std::ostringstream ostrs;
|
|
|
|
ostrs << town->creatures[i].first;
|
|
|
|
CSDL_Ext::printTo(ostrs.str(),pos.x+440+i*37,pos.y+110,GEORM,zwykly,to);
|
|
|
|
}
|
2010-02-01 01:30:47 +02:00
|
|
|
|
|
|
|
garr->show(to);
|
|
|
|
if (town->garrisonHero)
|
|
|
|
blitAt(graphics->portraitLarge[town->garrisonHero->portrait],pos.x+244,pos.y+6,to);
|
|
|
|
|
|
|
|
if (town->visitingHero)
|
|
|
|
blitAt(graphics->portraitLarge[town->visitingHero->portrait],pos.x+476,pos.y+6,to);
|
2010-01-25 23:25:14 +02:00
|
|
|
}
|
|
|
|
|
2010-01-30 21:08:26 +02:00
|
|
|
CKingdomInterface::CHeroItem::CHeroItem(int num, CKingdomInterface * Owner)
|
2010-01-31 14:10:13 +02:00
|
|
|
{
|
|
|
|
OBJ_CONSTRUCTION_CAPTURING_ALL;
|
|
|
|
recActions = DISPOSE | SHARE_POS;
|
|
|
|
defActions = SHARE_POS;
|
|
|
|
owner = Owner;
|
2010-01-25 23:25:14 +02:00
|
|
|
numb = num;
|
2010-01-28 18:15:46 +02:00
|
|
|
pos.x += 23;
|
2010-02-01 01:30:47 +02:00
|
|
|
pos.y += 25+num*116;
|
2010-01-25 23:25:14 +02:00
|
|
|
pos.w = 702;
|
|
|
|
pos.h = 114;
|
2010-01-31 14:10:13 +02:00
|
|
|
hero = NULL;
|
2010-01-30 21:08:26 +02:00
|
|
|
garr = NULL;
|
2010-01-31 14:10:13 +02:00
|
|
|
artGroup = 0;
|
|
|
|
backpackPos = 0;
|
|
|
|
artButtons = new CHighlightableButtonsGroup(0);
|
|
|
|
for (size_t it = 0; it<3; it++)
|
|
|
|
{
|
|
|
|
artButtons->addButton(boost::assign::map_list_of(0,CGI->generaltexth->overview[13+it]),
|
|
|
|
CGI->generaltexth->overview[8+it], "OVBUTN3.DEF",364+it*112, 46, it);
|
|
|
|
std::string str = CGI->generaltexth->overview[8+it];//TODO:find function for this if any
|
|
|
|
str = str.substr(str.find_first_of("{"), str.find_first_of("}")-str.find_first_of("{"));
|
2010-01-30 21:08:26 +02:00
|
|
|
artButtons->buttons[it]->addTextOverlay(str, FONT_SMALL, tytulowy);
|
2010-01-31 14:10:13 +02:00
|
|
|
}
|
|
|
|
artButtons->onChange = boost::bind(&CKingdomInterface::CHeroItem::onArtChange, this, _1);
|
|
|
|
artButtons->select(0,0);
|
|
|
|
|
|
|
|
artLeft = new AdventureMapButton("", "", boost::bind
|
2010-01-30 21:08:26 +02:00
|
|
|
(&CKingdomInterface::CHeroItem::scrollArts,this,-1), 269, 66, "hsbtns3.def", SDLK_LEFT);
|
2010-01-31 14:10:13 +02:00
|
|
|
artRight = new AdventureMapButton("", "", boost::bind
|
|
|
|
(&CKingdomInterface::CHeroItem::scrollArts,this,+1), 675, 66, "hsbtns5.def", SDLK_RIGHT);
|
|
|
|
|
2010-01-30 21:08:26 +02:00
|
|
|
portrait = new LRClickableAreaWText();
|
|
|
|
portrait->pos = genRect(64, 58, pos.x+5, pos.y + 5);
|
|
|
|
char bufor[400];
|
2010-02-01 01:30:47 +02:00
|
|
|
for(int i=0; i<PRIMARY_SKILLS; i++)
|
2010-01-30 21:08:26 +02:00
|
|
|
{
|
|
|
|
primarySkills.push_back(new LRClickableAreaWTextComp());
|
|
|
|
primarySkills[i]->pos = genRect(45, 32, pos.x+77 + 36*i, pos.y+26);
|
|
|
|
primarySkills[i]->text = CGI->generaltexth->arraytxt[2+i];
|
|
|
|
primarySkills[i]->type = i;
|
2010-01-31 14:10:13 +02:00
|
|
|
primarySkills[i]->baseType = 0;
|
2010-01-30 21:08:26 +02:00
|
|
|
sprintf(bufor, CGI->generaltexth->heroscrn[1].c_str(), CGI->generaltexth->primarySkillNames[i].c_str());
|
|
|
|
primarySkills[i]->hoverText = std::string(bufor);
|
2010-01-31 14:10:13 +02:00
|
|
|
};
|
2010-01-30 21:08:26 +02:00
|
|
|
experience = new LRClickableAreaWText();
|
2010-02-01 01:30:47 +02:00
|
|
|
experience->pos = genRect(33, 49, pos.x+322, pos.y+5);
|
2010-01-30 21:08:26 +02:00
|
|
|
experience->hoverText = CGI->generaltexth->heroscrn[9];
|
|
|
|
|
|
|
|
morale = new LRClickableAreaWTextComp();
|
|
|
|
morale->pos = genRect(20,32,pos.x+221,pos.y+52);
|
|
|
|
|
|
|
|
luck = new LRClickableAreaWTextComp();
|
|
|
|
luck->pos = genRect(20,32,pos.x+221,pos.y+28);
|
|
|
|
|
|
|
|
spellPoints = new LRClickableAreaWText();
|
2010-02-01 01:30:47 +02:00
|
|
|
spellPoints->pos = genRect(33, 49, pos.x+270, pos.y+5);
|
2010-01-31 14:10:13 +02:00
|
|
|
spellPoints->hoverText = CGI->generaltexth->heroscrn[22];
|
|
|
|
|
2010-01-30 21:08:26 +02:00
|
|
|
speciality = new LRClickableAreaWText();
|
2010-02-01 01:30:47 +02:00
|
|
|
speciality->pos = genRect(32, 32, pos.x+374, pos.y+5);
|
2010-01-31 14:10:13 +02:00
|
|
|
speciality->hoverText = CGI->generaltexth->heroscrn[27];
|
2010-01-30 21:08:26 +02:00
|
|
|
|
2010-02-01 01:30:47 +02:00
|
|
|
for(int i=0; i<SKILL_PER_HERO; ++i)
|
2010-01-30 21:08:26 +02:00
|
|
|
{
|
2010-01-31 14:10:13 +02:00
|
|
|
secondarySkills.push_back(new LRClickableAreaWTextComp());
|
2010-02-01 01:30:47 +02:00
|
|
|
secondarySkills[i]->pos = genRect(32, 32, pos.x+410+i*37, pos.y+5);
|
2010-01-30 21:08:26 +02:00
|
|
|
secondarySkills[i]->baseType = 1;
|
2010-01-31 14:10:13 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
for (int i=0; i<18;i++)
|
|
|
|
{
|
|
|
|
artifacts.push_back(new CArtPlace(this));
|
|
|
|
artifacts[i]->pos = genRect(44, 44, pos.x+268+(i%9)*48, pos.y+66);
|
|
|
|
artifacts[i]->baseType = SComponent::artifact;
|
|
|
|
};
|
|
|
|
|
|
|
|
for (int i=0; i<8;i++)
|
|
|
|
{
|
|
|
|
backpack.push_back(new CArtPlace(this));
|
|
|
|
backpack[i]->pos = genRect(44, 44, pos.x+293+(i%9)*48, pos.y+66);
|
|
|
|
backpack[i]->baseType = SComponent::artifact;
|
|
|
|
};
|
|
|
|
|
2010-01-25 23:25:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
CKingdomInterface::CHeroItem::~CHeroItem()
|
2010-01-31 14:10:13 +02:00
|
|
|
{
|
2010-02-01 01:30:47 +02:00
|
|
|
delete garr;
|
2010-01-31 14:10:13 +02:00
|
|
|
delete artButtons;
|
2010-02-01 01:30:47 +02:00
|
|
|
primarySkills.clear();
|
|
|
|
secondarySkills.clear();
|
|
|
|
artifacts.clear();
|
|
|
|
backpack.clear();
|
2010-01-31 14:10:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CKingdomInterface::CHeroItem::setHero(const CGHeroInstance * newHero)
|
|
|
|
{
|
|
|
|
BLOCK_CAPTURING;
|
|
|
|
delete garr;
|
|
|
|
hero = newHero;
|
|
|
|
if (!hero)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
garr = NULL;
|
|
|
|
}
|
2010-02-01 01:30:47 +02:00
|
|
|
char bufor[4000];
|
2010-01-31 14:10:13 +02:00
|
|
|
artLeft->block(hero->artifacts.size() <= 8);
|
|
|
|
artRight->block(hero->artifacts.size() <= 8);
|
2010-02-01 01:30:47 +02:00
|
|
|
garr = new CGarrisonInt(pos.x+6, pos.y+78, 4, Point(), slots->ourImages[owner->PicCount].bitmap,
|
|
|
|
Point(6,78), hero, NULL, false, true);
|
2010-01-31 14:10:13 +02:00
|
|
|
garr->update = false;
|
|
|
|
|
|
|
|
for (int i=0; i<artifacts.size(); i++)
|
|
|
|
{
|
|
|
|
artifacts[i]->type = hero->getArtAtPos(i);
|
|
|
|
if (artifacts[i]->type<0)
|
|
|
|
artifacts[i]->hoverText = CGI->generaltexth->heroscrn[11];
|
|
|
|
else
|
|
|
|
{
|
|
|
|
artifacts[i]->text = CGI->generaltexth->artifDescriptions[artifacts[i]->type];
|
|
|
|
artifacts[i]->hoverText = boost::str(boost::format(CGI->generaltexth->heroscrn[1].c_str()) % CGI->arth->artifacts[artifacts[i]->type].Name());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (int i=0; i<backpack.size(); i++)
|
|
|
|
{
|
|
|
|
backpack[i]->type = hero->getArtAtPos(19+i);
|
|
|
|
if (backpack[i]->type<0)
|
|
|
|
backpack[i]->hoverText ="";
|
|
|
|
else
|
|
|
|
{
|
|
|
|
backpack[i]->text = CGI->generaltexth->artifDescriptions[backpack[i]->type];
|
|
|
|
backpack[i]->hoverText = boost::str(boost::format(CGI->generaltexth->heroscrn[1].c_str()) % CGI->arth->artifacts[backpack[i]->type].Name());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sprintf(bufor, CGI->generaltexth->allTexts[15].c_str(), hero->name.c_str(), hero->type->heroClass->name.c_str());
|
2010-01-30 21:08:26 +02:00
|
|
|
portrait->hoverText = std::string(bufor);
|
|
|
|
portrait->text = hero->getBiography();
|
|
|
|
|
2010-02-01 01:30:47 +02:00
|
|
|
speciality->text = CGI->generaltexth->hTxts[hero->subID].longBonus;
|
|
|
|
|
2010-01-30 21:08:26 +02:00
|
|
|
//primary skills
|
|
|
|
for(size_t g=0; g<primarySkills.size(); ++g)
|
|
|
|
primarySkills[g]->bonus = hero->getPrimSkillLevel(g);
|
|
|
|
|
2010-01-31 14:10:13 +02:00
|
|
|
//secondary skills
|
2010-01-30 21:08:26 +02:00
|
|
|
for(size_t g=0; g<std::min(secondarySkills.size(),hero->secSkills.size()); ++g)
|
|
|
|
{
|
|
|
|
int skill = hero->secSkills[g].first,
|
2010-01-31 14:10:13 +02:00
|
|
|
level = hero->secSkills[g].second;
|
2010-01-30 21:08:26 +02:00
|
|
|
secondarySkills[g]->type = skill;
|
|
|
|
secondarySkills[g]->bonus = level;
|
|
|
|
secondarySkills[g]->text = CGI->generaltexth->skillInfoTexts[skill][level-1];
|
|
|
|
sprintf(bufor, CGI->generaltexth->heroscrn[21].c_str(), CGI->generaltexth->levels[level-1].c_str(), CGI->generaltexth->skillName[skill].c_str());
|
|
|
|
secondarySkills[g]->hoverText = std::string(bufor);
|
2010-01-31 14:10:13 +02:00
|
|
|
}
|
2010-01-30 21:08:26 +02:00
|
|
|
//experience
|
|
|
|
experience->text = CGI->generaltexth->allTexts[2].c_str();
|
|
|
|
boost::replace_first(experience->text, "%d", boost::lexical_cast<std::string>(hero->level));
|
|
|
|
boost::replace_first(experience->text, "%d", boost::lexical_cast<std::string>(CGI->heroh->reqExp(hero->level+1)));
|
|
|
|
boost::replace_first(experience->text, "%d", boost::lexical_cast<std::string>(hero->exp));
|
|
|
|
|
2010-01-31 14:10:13 +02:00
|
|
|
//spell points
|
2010-01-30 21:08:26 +02:00
|
|
|
sprintf(bufor, CGI->generaltexth->allTexts[205].c_str(), hero->name.c_str(), hero->mana, hero->manaLimit());
|
|
|
|
spellPoints->text = std::string(bufor);
|
|
|
|
|
|
|
|
//setting morale
|
|
|
|
std::vector<std::pair<int,std::string> > mrl = hero->getCurrentMoraleModifiers();
|
|
|
|
int mrlv = hero->getCurrentMorale();
|
|
|
|
int mrlt = (mrlv>0)-(mrlv<0); //signum: -1 - bad morale, 0 - neutral, 1 - good
|
|
|
|
morale->hoverText = CGI->generaltexth->heroscrn[4 - mrlt];
|
|
|
|
morale->baseType = SComponent::morale;
|
|
|
|
morale->bonus = mrlv;
|
|
|
|
morale->text = CGI->generaltexth->arraytxt[88];
|
|
|
|
boost::algorithm::replace_first(morale->text,"%s",CGI->generaltexth->arraytxt[86-mrlt]);
|
2010-02-01 01:30:47 +02:00
|
|
|
if (!mrl.size())
|
|
|
|
morale->text += CGI->generaltexth->arraytxt[108];
|
|
|
|
else
|
|
|
|
for(int it=0; it < mrl.size(); it++)
|
|
|
|
morale->text += mrl[it].second;
|
2010-01-30 21:08:26 +02:00
|
|
|
|
|
|
|
//setting luck
|
|
|
|
mrl = hero->getCurrentLuckModifiers();
|
|
|
|
mrlv = hero->getCurrentLuck();
|
|
|
|
mrlt = (mrlv>0)-(mrlv<0); //signum: -1 - bad luck, 0 - neutral, 1 - good
|
|
|
|
luck->hoverText = CGI->generaltexth->heroscrn[7 - mrlt];
|
|
|
|
luck->baseType = SComponent::luck;
|
|
|
|
luck->bonus = mrlv;
|
|
|
|
luck->text = CGI->generaltexth->arraytxt[62];
|
|
|
|
boost::algorithm::replace_first(luck->text,"%s",CGI->generaltexth->arraytxt[60-mrlt]);
|
2010-02-01 01:30:47 +02:00
|
|
|
if (!mrl.size())
|
|
|
|
luck->text += CGI->generaltexth->arraytxt[77];
|
|
|
|
else
|
|
|
|
for(int it=0; it < mrl.size(); it++)
|
|
|
|
luck->text += mrl[it].second;
|
2010-01-31 14:10:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CKingdomInterface::CHeroItem::scrollArts(int move)
|
|
|
|
{
|
|
|
|
backpackPos = ( backpackPos + move + hero->artifacts.size()) % hero->artifacts.size();
|
|
|
|
for (int i=0; i<backpack.size(); i++)
|
|
|
|
{
|
|
|
|
backpack[i]->type = hero->getArtAtPos(19+(backpackPos + i)%hero->artifacts.size());
|
|
|
|
if (backpack[i]->type<0)
|
|
|
|
backpack[i]->hoverText ="";
|
|
|
|
else
|
|
|
|
{
|
|
|
|
backpack[i]->text = CGI->generaltexth->artifDescriptions[backpack[i]->type];
|
|
|
|
backpack[i]->hoverText = boost::str(boost::format(CGI->generaltexth->heroscrn[1].c_str()) % CGI->arth->artifacts[backpack[i]->type].Name());
|
|
|
|
}
|
|
|
|
}
|
2010-01-25 23:25:14 +02:00
|
|
|
}
|
|
|
|
|
2010-01-30 21:08:26 +02:00
|
|
|
void CKingdomInterface::CHeroItem::showAll(SDL_Surface * to)
|
2010-01-25 23:25:14 +02:00
|
|
|
{
|
|
|
|
if (!hero)
|
|
|
|
{//if we have no hero for this slot - print background & exit
|
2010-01-30 21:08:26 +02:00
|
|
|
blitAt(slots->ourImages[numb % owner->PicCount].bitmap,pos.x,pos.y,to);
|
2010-01-25 23:25:14 +02:00
|
|
|
return;
|
|
|
|
}//print background, different for arts view/backpack mode
|
2010-01-30 21:08:26 +02:00
|
|
|
blitAt(slots->ourImages[(artGroup!=2)?owner->PicCount:(owner->PicCount+1)].bitmap,pos.x,pos.y,to);
|
2010-01-25 23:25:14 +02:00
|
|
|
//text "Artifacts"
|
|
|
|
CSDL_Ext::printAtMiddle(CGI->generaltexth->overview[2],pos.x+320,pos.y+55,GEOR13,zwykly,to);
|
2010-01-31 14:10:13 +02:00
|
|
|
blitAt(graphics->portraitLarge[hero->portrait],pos.x+5,pos.y+6,to);
|
|
|
|
|
|
|
|
garr->show(to);
|
2010-01-30 21:08:26 +02:00
|
|
|
//hero name
|
2010-01-25 23:25:14 +02:00
|
|
|
CSDL_Ext::printAt(hero->name,pos.x+73,pos.y+7,GEOR13,zwykly,to);
|
|
|
|
for (int i = 0; i<6; i++)
|
|
|
|
{//primary skills, mana and exp. pics
|
|
|
|
blitAt(graphics->pskillst->ourImages[i].bitmap,(i<4)?(pos.x+78+36*i):(pos.x+539-52*i),
|
|
|
|
(i<4)?(pos.y+26):(pos.y+6),to);
|
|
|
|
if (i>3) continue;//primary skills text
|
|
|
|
std::ostringstream str;
|
|
|
|
str << (hero->primSkills[i]);
|
|
|
|
CSDL_Ext::printAtMiddle(str.str(),pos.x+95+36*i,pos.y+65,GEOR13,zwykly,to);
|
|
|
|
}
|
|
|
|
{//luck and morale pics, experience and mana text
|
|
|
|
blitAt(graphics->luck30->ourImages[hero->getCurrentLuck()+3].bitmap,pos.x+222,pos.y+30,to);
|
|
|
|
blitAt(graphics->morale30->ourImages[hero->getCurrentMorale()+3].bitmap,pos.x+222,pos.y+54,to);
|
|
|
|
std::ostringstream str;
|
|
|
|
str << (hero->exp);
|
|
|
|
CSDL_Ext::printAtMiddle(str.str(),(pos.x+348),(pos.y+31),GEORM,zwykly,to);
|
|
|
|
std::ostringstream strnew;
|
|
|
|
strnew << (hero->mana)<<"/"<<(hero->manaLimit());
|
|
|
|
CSDL_Ext::printAtMiddle(strnew.str(),(pos.x+298),(pos.y+31),GEORM,zwykly,to);
|
|
|
|
}
|
|
|
|
//hero speciality
|
2010-01-26 13:56:29 +02:00
|
|
|
blitAt(graphics->un32->ourImages[hero->subID].bitmap, pos.x+375, pos.y+6, to);
|
2010-01-25 23:25:14 +02:00
|
|
|
|
|
|
|
for(int i=0; i<hero->secSkills.size(); i++)
|
|
|
|
{//secondary skills
|
|
|
|
int skill = hero->secSkills[i].first,
|
2010-01-26 13:56:29 +02:00
|
|
|
level = hero->secSkills[i].second;
|
2010-01-25 23:25:14 +02:00
|
|
|
blitAt(graphics->abils32->ourImages[skill*3+level+2].bitmap,pos.x+411+i*36,pos.y+6,to);
|
|
|
|
}
|
2010-01-31 14:10:13 +02:00
|
|
|
|
|
|
|
artButtons->show(to);
|
2010-01-25 23:25:14 +02:00
|
|
|
|
|
|
|
int iter=0;
|
|
|
|
switch (artGroup)
|
|
|
|
{//arts
|
|
|
|
case 1:iter = 9;//misc. arts, spellbook, war machines
|
|
|
|
case 0://equipped arts
|
2010-01-30 21:08:26 +02:00
|
|
|
for (int i = iter ; i<iter+9;i++)
|
2010-01-25 23:25:14 +02:00
|
|
|
{
|
|
|
|
int artID = hero->getArtAtPos(i);
|
|
|
|
if (artID>=0)
|
|
|
|
blitAt(graphics->artDefs->ourImages[artID].bitmap,pos.x+268+48*(i%9),pos.y+66,to);
|
|
|
|
}
|
|
|
|
break;
|
2010-01-31 14:10:13 +02:00
|
|
|
case 2:
|
|
|
|
artLeft->show(to);
|
|
|
|
artRight->show(to);
|
|
|
|
int max = hero->artifacts.size();
|
|
|
|
iter = std::min(8, max);
|
|
|
|
for (size_t it = 0 ; it<iter;it++)
|
|
|
|
blitAt(graphics->artDefs->ourImages[hero->artifacts[(it+backpackPos)%max]].bitmap,pos.x+293+48*it,pos.y+66,to);
|
2010-01-25 23:25:14 +02:00
|
|
|
break;
|
2010-01-31 14:10:13 +02:00
|
|
|
}
|
2010-01-30 21:08:26 +02:00
|
|
|
show(to);
|
2010-01-31 14:10:13 +02:00
|
|
|
}
|
2010-01-25 23:25:14 +02:00
|
|
|
|
|
|
|
void CKingdomInterface::CHeroItem::onArtChange(int newstate)
|
2010-01-31 14:10:13 +02:00
|
|
|
{
|
|
|
|
if (!hero)
|
|
|
|
return;
|
|
|
|
deactivate();
|
|
|
|
artGroup = newstate;
|
|
|
|
activate();
|
2010-01-30 21:08:26 +02:00
|
|
|
GH.totalRedraw();
|
2010-01-25 23:25:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CKingdomInterface::CHeroItem::activate()
|
2010-01-31 14:10:13 +02:00
|
|
|
{
|
|
|
|
if (!hero)
|
|
|
|
return;
|
|
|
|
artButtons->activate();
|
|
|
|
garr->activate();
|
|
|
|
if ( artGroup == 2 )
|
|
|
|
{
|
|
|
|
artLeft->activate();
|
|
|
|
artRight->activate();
|
|
|
|
for (size_t i=0; i<8;i++)
|
|
|
|
backpack[i]->activate();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for (size_t i=artGroup*9; i<9+artGroup*9;i++)
|
|
|
|
artifacts[i]->activate();
|
|
|
|
}
|
|
|
|
portrait->activate();
|
|
|
|
experience->activate();
|
|
|
|
morale->activate();
|
|
|
|
luck->activate();
|
|
|
|
spellPoints->activate();
|
|
|
|
speciality->activate();
|
|
|
|
|
|
|
|
for (size_t i=0; i<primarySkills.size();i++)
|
|
|
|
primarySkills[i]->activate();
|
|
|
|
|
|
|
|
for (size_t i=0; i<std::min(secondarySkills.size(),hero->secSkills.size());i++)
|
|
|
|
secondarySkills[i]->activate();
|
2010-01-25 23:25:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CKingdomInterface::CHeroItem::deactivate()
|
2010-01-31 14:10:13 +02:00
|
|
|
{
|
|
|
|
if (!hero)
|
|
|
|
return;
|
|
|
|
artButtons->deactivate();
|
|
|
|
garr->deactivate();
|
|
|
|
if ( artGroup == 2 )
|
|
|
|
{
|
|
|
|
artLeft->deactivate();
|
|
|
|
artRight->deactivate();
|
|
|
|
for (size_t i=0; i<8;i++)
|
|
|
|
backpack[i]->deactivate();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for (size_t i=artGroup*9; i<9+artGroup*9;i++)
|
|
|
|
artifacts[i]->deactivate();
|
|
|
|
}
|
|
|
|
|
|
|
|
portrait->deactivate();
|
|
|
|
experience->deactivate();
|
|
|
|
morale->deactivate();
|
|
|
|
luck->deactivate();
|
|
|
|
spellPoints->deactivate();
|
|
|
|
speciality->deactivate();
|
|
|
|
for (size_t i=0; i<primarySkills.size();i++)
|
|
|
|
primarySkills[i]->deactivate();
|
|
|
|
|
|
|
|
for (size_t i=0; i<std::min(secondarySkills.size(),hero->secSkills.size());i++)
|
|
|
|
secondarySkills[i]->deactivate();
|
|
|
|
}
|
|
|
|
|
2010-01-30 21:08:26 +02:00
|
|
|
CKingdomInterface::CHeroItem::CArtPlace::CArtPlace(CHeroItem * owner)
|
2010-01-31 14:10:13 +02:00
|
|
|
{
|
|
|
|
hero = owner;
|
|
|
|
used = LCLICK | RCLICK | HOVER;
|
2010-01-30 21:08:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CKingdomInterface::CHeroItem::CArtPlace::activate()
|
2010-01-25 23:25:14 +02:00
|
|
|
{
|
2010-01-30 21:08:26 +02:00
|
|
|
LRClickableAreaWTextComp::activate();
|
2010-01-25 23:25:14 +02:00
|
|
|
}
|
2010-01-30 21:08:26 +02:00
|
|
|
|
|
|
|
void CKingdomInterface::CHeroItem::CArtPlace::clickLeft(tribool down, bool previousState)
|
2010-02-01 01:30:47 +02:00
|
|
|
{
|
2010-01-30 21:08:26 +02:00
|
|
|
if (!down && previousState && type>=0)
|
2010-01-31 14:10:13 +02:00
|
|
|
{
|
2010-01-30 21:08:26 +02:00
|
|
|
if(type == 0)
|
2010-01-31 14:10:13 +02:00
|
|
|
{
|
2010-01-30 21:08:26 +02:00
|
|
|
CSpellWindow * spellWindow = new CSpellWindow(genRect(595, 620, (screen->w - 620)/2, (screen->h - 595)/2), hero->hero);
|
|
|
|
GH.pushInt(spellWindow);
|
2010-01-31 14:10:13 +02:00
|
|
|
}
|
2010-01-30 21:08:26 +02:00
|
|
|
else
|
|
|
|
LRClickableAreaWTextComp::clickLeft(down,previousState);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CKingdomInterface::CHeroItem::CArtPlace::clickRight(tribool down, bool previousState)
|
|
|
|
{
|
|
|
|
if (type>=0)
|
|
|
|
LRClickableAreaWTextComp::clickRight(down, previousState);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CKingdomInterface::CHeroItem::CArtPlace::deactivate()
|
|
|
|
{
|
|
|
|
LRClickableAreaWTextComp::deactivate();
|
2010-01-31 14:10:13 +02:00
|
|
|
}
|
2010-02-01 01:30:47 +02:00
|
|
|
|
|
|
|
|
|
|
|
CKingdomInterface::CTownItem::CCreaPlace::CCreaPlace()
|
|
|
|
{
|
|
|
|
town = NULL;
|
|
|
|
used = LCLICK | RCLICK | HOVER;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CKingdomInterface::CTownItem::CCreaPlace::activate()
|
|
|
|
{
|
|
|
|
LRClickableAreaWTextComp::activate();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CKingdomInterface::CTownItem::CCreaPlace::clickLeft(tribool down, bool previousState)
|
|
|
|
{
|
|
|
|
if (!down && previousState && town)
|
|
|
|
{
|
|
|
|
GH.pushInt (new CRecruitmentWindow(town, type, town, boost::bind
|
|
|
|
(&CCallback::recruitCreatures,LOCPLINT->cb,town,_1,_2)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CKingdomInterface::CTownItem::CCreaPlace::clickRight(tribool down, bool previousState)
|
|
|
|
{
|
|
|
|
//TODO
|
|
|
|
}
|
|
|
|
|
|
|
|
void CKingdomInterface::CTownItem::CCreaPlace::deactivate()
|
|
|
|
{
|
|
|
|
LRClickableAreaWTextComp::deactivate();
|
|
|
|
}
|