1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-14 02:33:51 +02:00

* next part of thieves' guild window

This commit is contained in:
mateuszb 2010-02-07 17:56:06 +00:00
parent 53365af90e
commit ba51824710
3 changed files with 57 additions and 0 deletions

View File

@ -4956,6 +4956,19 @@ CThievesGuildWindow::CThievesGuildWindow(const CGObjectInstance * _owner)
{
blitAt(graphics->portraitSmall[it->second.portrait], 260 + 66 * counter, 360, background);
counter++;
//printing stats
if(it->second.details)
{
for (int i=0; i<it->second.details->primskills.size(); ++i)
{
printAt(CGI->generaltexth->allTexts[380+i], 191 + 66*counter, 394 + 11*i, FONT_SMALL, zwykly, background);
std::ostringstream skill;
skill << it->second.details->primskills[i];
printTo(skill.str(), 244 + 66 * counter, 410 + 11*i, FONT_SMALL, zwykly, background);
}
}
}
//printing best creature
@ -4966,6 +4979,25 @@ CThievesGuildWindow::CThievesGuildWindow(const CGObjectInstance * _owner)
counter++;
}
//printing personality
counter = 0;
for(std::map<ui8, si8>::const_iterator it = tgi.personality.begin(); it != tgi.personality.end(); ++it)
{
int toPrint = 0;
if(it->second == -1)
{
toPrint = 172;
}
else
{
toPrint = 168 + it->second;
}
printAtMiddle(CGI->generaltexth->arraytxt[toPrint], 283 + 66*counter, 459, FONT_SMALL, zwykly, background);
counter++;
}
}
CThievesGuildWindow::~CThievesGuildWindow()

View File

@ -3613,6 +3613,11 @@ InfoAboutHero::InfoAboutHero()
portrait = -1;
}
InfoAboutHero::InfoAboutHero( const InfoAboutHero & iah )
{
assign(iah);
}
InfoAboutHero::~InfoAboutHero()
{
delete details;
@ -3650,3 +3655,18 @@ void InfoAboutHero::initFromHero( const CGHeroInstance *h, bool detailed )
}
}
void InfoAboutHero::assign( const InfoAboutHero & iah )
{
army = iah.army;
details = (iah.details ? new Details(*iah.details) : NULL);
hclass = iah.hclass;
name = iah.name;
owner = iah.owner;
portrait = iah.portrait;
}
InfoAboutHero & InfoAboutHero::operator=( const InfoAboutHero & iah )
{
assign(iah);
return *this;
}

View File

@ -61,6 +61,9 @@ namespace boost
struct DLL_EXPORT InfoAboutHero
{
private:
void assign(const InfoAboutHero & iah);
public:
struct DLL_EXPORT Details
{
std::vector<int> primskills;
@ -74,6 +77,8 @@ struct DLL_EXPORT InfoAboutHero
CCreatureSet army; //numbers of creatures are exact numbers if detailed else they are quantity ids (0 - a few, 1 - several and so on)
InfoAboutHero();
InfoAboutHero(const InfoAboutHero & iah);
InfoAboutHero & operator=(const InfoAboutHero & iah);
~InfoAboutHero();
void initFromHero(const CGHeroInstance *h, bool detailed);
};