1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Bugfix - it should work now.

This commit is contained in:
Michał W. Urbańczyk 2007-12-06 19:06:07 +00:00
parent 58f1a2169f
commit ae0be1f79e
4 changed files with 19 additions and 1 deletions

View File

@ -314,6 +314,12 @@ void CHeroList::hover (bool on)
void CHeroList::keyPressed (SDL_KeyboardEvent & key)
{
}
void CHeroList::updateMove(const CGHeroInstance* which) //draws move points bar
{
int ser = LOCPLINT->cb->getHeroSerial(which);
int pom = (which->movement)/100;
blitAtWR(mobile->ourImages[pom].bitmap,posmobx,posmoby+ser*32); //move point
}
void CHeroList::draw()
{
for (int iT=0+from;iT<5+from;iT++)

View File

@ -71,6 +71,7 @@ public:
void hover (bool on);
void keyPressed (SDL_KeyboardEvent & key);
void updateHList();
void updateMove(const CGHeroInstance* which); //draws move points bar
void redrawAllOne(int which);
void draw();
void init();

View File

@ -350,6 +350,15 @@ int CCallback::getMyColor()
{
return player;
}
int CCallback::getHeroSerial(const CGHeroInstance * hero)
{
for (int i=0; i<gs->players[player].heroes.size();i++)
{
if (gs->players[player].heroes[i]==hero)
return i;
}
return -1;
}
int CCallback::getMySerial()
{
return gs->players[player].serial;

View File

@ -27,10 +27,11 @@ public:
virtual const CGTownInstance * getTownInfo(int val, bool mode)=0; //mode = 0 -> val = serial; mode = 1 -> val = ID
virtual int howManyTowns()=0;
virtual std::vector < std::string > getObjDescriptions(int3 pos)=0; //returns descriptions of objects at pos in order from the lowest to the highest
virtual std::vector < const CGHeroInstance *> * getHeroesInfo(bool onlyOur=true)=0;
virtual std::vector < const CGHeroInstance *> getHeroesInfo(bool onlyOur=true)=0;
virtual bool isVisible(int3 pos)=0;
virtual int getMyColor()=0;
virtual int getMySerial()=0;
virtual int getHeroSerial(const CGHeroInstance * hero)=0;
};
struct HeroMoveDetails
@ -72,6 +73,7 @@ public:
std::vector < const CGHeroInstance *> getHeroesInfo(bool onlyOur=true);
bool isVisible(int3 pos);
int getMyColor();
int getHeroSerial(const CGHeroInstance * hero);
int getMySerial();
//friends