1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-28 03:57:02 +02:00
This commit is contained in:
DjWarmonger 2011-08-05 07:59:15 +00:00
parent 56bf3dc8ab
commit d29850a2fa
2 changed files with 18 additions and 4 deletions

View File

@ -129,6 +129,9 @@ void CCreatureWindow::init(const CStackInstance *Stack, const CBonusSystemNode *
stackNode = StackNode;
heroOwner = HeroOwner;
if (Stack->count)
count = boost::lexical_cast<std::string>(Stack->count);
//Basic graphics - need to calculate size
BonusList bl, blTemp;
@ -326,16 +329,19 @@ void CCreatureWindow::showAll(SDL_Surface * to)
{
CIntObject::showAll(to);
count = boost::lexical_cast<std::string>(stack->count);
if (count.size()) //TODO
printTo(count, 117, 174, FONT_SMALL, tytulowy,*bitmap);
//count = boost::lexical_cast<std::string>(stack->count);
//if (count.size()) //TODO
// printTo(count, 117, 174, FONT_SMALL, tytulowy,*bitmap);
if(count.size())
printTo(count.c_str(), pos.x+114, pos.y+174, FONT_TIMES, zwykly, to);
printAtMiddle(c->namePl, 180, 30, FONT_SMALL, tytulowy,*bitmap); //creature name
printLine(0, CGI->generaltexth->primarySkillNames[0], c->valOfBonuses(Bonus::PRIMARY_SKILL, PrimarySkill::ATTACK), stackNode->Attack());
printLine(1, CGI->generaltexth->primarySkillNames[1], c->valOfBonuses(Bonus::PRIMARY_SKILL, PrimarySkill::DEFENSE), stackNode->Defense());
if(stackNode->valOfBonuses(Bonus::SHOTS) && stackNode->hasBonusOfType(Bonus::SHOOTER)) //only for shooting units - important with wog exp shooters
printLine(2, CGI->generaltexth->allTexts[198], stackNode->valOfBonuses(Bonus::SHOTS));
printLine(2, CGI->generaltexth->allTexts[198], stackNode->valOfBonuses(Bonus::SHOTS)); //TODO: change shot count for battle stack
//TODO
int dmgMultiply = 1;
@ -350,6 +356,13 @@ void CCreatureWindow::showAll(SDL_Surface * to)
b->showAll (to);
}
void CCreatureWindow::show(SDL_Surface * to)
{
if (count.size()) //army stack
printTo(count, pos.x + 114, pos.y + 174,FONT_TIMES, zwykly, to);
}
void CCreatureWindow::sliderMoved(int newpos)
{
recreateSkillList(newpos); //move components

View File

@ -56,6 +56,7 @@ public:
CCreatureWindow(int Cid, int Type, int creatureCount); //c-tor
void init(const CStackInstance *stack, const CBonusSystemNode *stackNode, const CGHeroInstance *heroOwner);
void showAll(SDL_Surface * to);
void show(SDL_Surface * to);
void printLine(int nr, const std::string &text, int baseVal, int val=-1, bool range=false);
void recreateSkillList(int pos);
~CCreatureWindow(); //d-tor