DjWarmonger 14 lat temu
rodzic
commit
d29850a2fa
2 zmienionych plików z 18 dodań i 4 usunięć
  1. 17 4
      client/CCreatureWindow.cpp
  2. 1 0
      client/CCreatureWindow.h

+ 17 - 4
client/CCreatureWindow.cpp

@@ -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

+ 1 - 0
client/CCreatureWindow.h

@@ -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