|
@@ -47,11 +47,11 @@ void CInfoWindow::close()
|
|
|
}
|
|
}
|
|
|
components.clear();
|
|
components.clear();
|
|
|
okb.deactivate();
|
|
okb.deactivate();
|
|
|
- //SDL_FreeSurface(bitmap);
|
|
|
|
|
- //bitmap = NULL;
|
|
|
|
|
|
|
+ SDL_FreeSurface(bitmap);
|
|
|
|
|
+ bitmap = NULL;
|
|
|
LOCPLINT->removeObjToBlit(this);
|
|
LOCPLINT->removeObjToBlit(this);
|
|
|
|
|
+ //delete this;
|
|
|
LOCPLINT->adventureInt->show();
|
|
LOCPLINT->adventureInt->show();
|
|
|
- delete this;
|
|
|
|
|
}
|
|
}
|
|
|
CInfoWindow::~CInfoWindow()
|
|
CInfoWindow::~CInfoWindow()
|
|
|
{
|
|
{
|
|
@@ -68,10 +68,14 @@ SComponent::SComponent(Etype Type, int Subtype, int Val)
|
|
|
break;
|
|
break;
|
|
|
case resource:
|
|
case resource:
|
|
|
description = CGI->generaltexth->allTexts[242];
|
|
description = CGI->generaltexth->allTexts[242];
|
|
|
- std::ostringstream oss;
|
|
|
|
|
oss << Val;
|
|
oss << Val;
|
|
|
subtitle = oss.str();
|
|
subtitle = oss.str();
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case experience:
|
|
|
|
|
+ description = CGI->generaltexth->allTexts[241];
|
|
|
|
|
+ oss << Val ;
|
|
|
|
|
+ subtitle = oss.str();
|
|
|
|
|
+ break;
|
|
|
}
|
|
}
|
|
|
type = Type;
|
|
type = Type;
|
|
|
subtype = Subtype;
|
|
subtype = Subtype;
|
|
@@ -91,6 +95,9 @@ SDL_Surface * SComponent::getImg()
|
|
|
case resource:
|
|
case resource:
|
|
|
return CGI->heroh->resources->ourImages[subtype].bitmap;
|
|
return CGI->heroh->resources->ourImages[subtype].bitmap;
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case experience:
|
|
|
|
|
+ return CGI->heroh->pskillsb->ourImages[4].bitmap;
|
|
|
|
|
+ break;
|
|
|
}
|
|
}
|
|
|
return NULL;
|
|
return NULL;
|
|
|
}
|
|
}
|
|
@@ -113,10 +120,10 @@ void CSelectableComponent::clickLeft(tribool down)
|
|
|
if (down)
|
|
if (down)
|
|
|
{
|
|
{
|
|
|
select(true);
|
|
select(true);
|
|
|
-
|
|
|
|
|
|
|
+ owner->selectionChange(this);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-CSelectableComponent::CSelectableComponent(Etype Type, int Sub, int Val, CSelWindow * Owner=NULL, SDL_Surface * Border)
|
|
|
|
|
|
|
+CSelectableComponent::CSelectableComponent(Etype Type, int Sub, int Val, CSelWindow * Owner, SDL_Surface * Border)
|
|
|
:SComponent(Type,Sub,Val),owner(Owner)
|
|
:SComponent(Type,Sub,Val),owner(Owner)
|
|
|
{
|
|
{
|
|
|
if (Border) //use custom border
|
|
if (Border) //use custom border
|
|
@@ -236,9 +243,9 @@ template <typename T> void CSCButton<T>::clickLeft (tribool down)
|
|
|
state=0;
|
|
state=0;
|
|
|
}
|
|
}
|
|
|
show();
|
|
show();
|
|
|
- pressedL=state;
|
|
|
|
|
if (delg)
|
|
if (delg)
|
|
|
(delg->*func)(down);
|
|
(delg->*func)(down);
|
|
|
|
|
+ pressedL=state;
|
|
|
}
|
|
}
|
|
|
template <typename T> void CSCButton<typename T>::activate()
|
|
template <typename T> void CSCButton<typename T>::activate()
|
|
|
{
|
|
{
|
|
@@ -1142,7 +1149,7 @@ SDL_Surface * CPlayerInterface::drawPrimarySkill(const CGHeroInstance *curh, SDL
|
|
|
itoa(curh->primSkills[i],buf,10);
|
|
itoa(curh->primSkills[i],buf,10);
|
|
|
printAtMiddle(buf,84+28*i,68,GEOR13,zwykly,ret);
|
|
printAtMiddle(buf,84+28*i,68,GEOR13,zwykly,ret);
|
|
|
}
|
|
}
|
|
|
- delete[] buf;
|
|
|
|
|
|
|
+ delete buf;
|
|
|
return ret;
|
|
return ret;
|
|
|
}
|
|
}
|
|
|
SDL_Surface * CPlayerInterface::drawHeroInfoWin(const CGHeroInstance * curh)
|
|
SDL_Surface * CPlayerInterface::drawHeroInfoWin(const CGHeroInstance * curh)
|
|
@@ -1162,7 +1169,7 @@ SDL_Surface * CPlayerInterface::drawHeroInfoWin(const CGHeroInstance * curh)
|
|
|
blitAt(curh->type->portraitLarge,11,12,ret);
|
|
blitAt(curh->type->portraitLarge,11,12,ret);
|
|
|
itoa(curh->mana,buf,10);
|
|
itoa(curh->mana,buf,10);
|
|
|
printAtMiddle(buf,166,109,GEORM,zwykly,ret); //mana points
|
|
printAtMiddle(buf,166,109,GEORM,zwykly,ret); //mana points
|
|
|
- delete[] buf;
|
|
|
|
|
|
|
+ delete buf;
|
|
|
blitAt(morale22->ourImages[curh->getCurrentMorale()+3].bitmap,14,84,ret);
|
|
blitAt(morale22->ourImages[curh->getCurrentMorale()+3].bitmap,14,84,ret);
|
|
|
blitAt(luck22->ourImages[curh->getCurrentLuck()+3].bitmap,14,101,ret);
|
|
blitAt(luck22->ourImages[curh->getCurrentLuck()+3].bitmap,14,101,ret);
|
|
|
//SDL_SaveBMP(ret,"inf1.bmp");
|
|
//SDL_SaveBMP(ret,"inf1.bmp");
|
|
@@ -1448,6 +1455,10 @@ void CPlayerInterface::receivedResource(int type, int val)
|
|
|
adventureInt->resdatabar.draw();
|
|
adventureInt->resdatabar.draw();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+void CPlayerInterface::showSelDialog(std::string text, std::vector<SComponent*> & components, int askID)
|
|
|
|
|
+{
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
void CPlayerInterface::showComp(SComponent comp)
|
|
void CPlayerInterface::showComp(SComponent comp)
|
|
|
{
|
|
{
|
|
|
adventureInt->infoBar.showComp(&comp,4000);
|
|
adventureInt->infoBar.showComp(&comp,4000);
|