mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-26 08:41:13 +02:00
Use label object for mana
This commit is contained in:
parent
bc2f0ba6f1
commit
e3ee51a28f
@ -21,6 +21,7 @@
|
||||
#include "../gui/SDL_Extensions.h"
|
||||
#include "../widgets/MiscWidgets.h"
|
||||
#include "../widgets/CComponent.h"
|
||||
#include "../widgets/TextControls.h"
|
||||
|
||||
#include "../../CCallback.h"
|
||||
|
||||
@ -184,7 +185,7 @@ CSpellWindow::CSpellWindow(const CGHeroInstance * _myHero, CPlayerInterface * _m
|
||||
|
||||
for(auto item : schoolBorders)
|
||||
item->load();
|
||||
|
||||
mana = new CLabel(435, 426, FONT_SMALL, CENTER, Colors::YELLOW, boost::lexical_cast<std::string>(myHero->mana));
|
||||
statusBar = new CGStatusBar(7, 569, "Spelroll.bmp");
|
||||
|
||||
SDL_Rect temp_rect = genRect(45, 35, 479 + pos.x, 405 + pos.y);
|
||||
@ -324,13 +325,6 @@ void CSpellWindow::fRcornerb()
|
||||
GH.breakEventHandling();
|
||||
}
|
||||
|
||||
void CSpellWindow::showAll(SDL_Surface * to)
|
||||
{
|
||||
CWindowObject::showAll(to);
|
||||
|
||||
printAtMiddleLoc(boost::lexical_cast<std::string>(myHero->mana), 435, 426, FONT_SMALL, Colors::YELLOW, to);
|
||||
}
|
||||
|
||||
void CSpellWindow::show(SDL_Surface * to)
|
||||
{
|
||||
statusBar->show(to);
|
||||
@ -417,6 +411,8 @@ void CSpellWindow::setCurrentPage(int value)
|
||||
schools->setFrame(selectedTab, 0);
|
||||
leftCorner->visible = currentPage != 0;
|
||||
rightCorner->visible = (currentPage+1) < pagesWithinCurrentTab();
|
||||
|
||||
mana->setText(boost::lexical_cast<std::string>(myHero->mana));//just in case, it will be possible to cast spell without closing book
|
||||
}
|
||||
|
||||
void CSpellWindow::turnPageLeft()
|
||||
|
@ -17,6 +17,7 @@ struct SDL_Rect;
|
||||
class IImage;
|
||||
class CAnimImage;
|
||||
class CPicture;
|
||||
class CLabel;
|
||||
class CGHeroInstance;
|
||||
class CGStatusBar;
|
||||
class CPlayerInterface;
|
||||
@ -73,6 +74,7 @@ private:
|
||||
std::array< std::shared_ptr<CAnimation>, 4> schoolBorders; //schools' 'borders': [0]: air, [1]: fire, [2]: water, [3]: earth
|
||||
|
||||
SpellArea * spellAreas[12];
|
||||
CLabel * mana;
|
||||
CGStatusBar * statusBar;
|
||||
|
||||
int sitesPerTabAdv[5];
|
||||
@ -107,7 +109,7 @@ public:
|
||||
|
||||
void selectSchool(int school); //schools: 0 - air magic, 1 - fire magic, 2 - water magic, 3 - earth magic, 4 - all schools
|
||||
int pagesWithinCurrentTab();
|
||||
void keyPressed(const SDL_KeyboardEvent & key);
|
||||
void showAll(SDL_Surface * to);
|
||||
void show(SDL_Surface * to);
|
||||
|
||||
void keyPressed(const SDL_KeyboardEvent & key) override;
|
||||
void show(SDL_Surface * to) override;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user