Переглянути джерело

* working info about collecting resources in infoBar
* minor fixes

Michał W. Urbańczyk 18 роки тому
батько
коміт
daa9217979
4 змінених файлів з 20 додано та 3 видалено
  1. 16 0
      CAdvmapInterface.cpp
  2. 1 1
      CPlayerInterface.cpp
  3. 1 1
      SDL_Extensions.cpp
  4. 2 1
      hch/CObjectHandler.cpp

+ 16 - 0
CAdvmapInterface.cpp

@@ -1283,6 +1283,15 @@ void CInfoBar::newDay(int Day)
 
 void CInfoBar::showComp(SComponent * comp, int time)
 {
+	SDL_Surface * b = CGI->bitmaph->loadBitmap("ADSTATOT.bmp");
+	blitAt(b,pos.x+8,pos.y+11);
+	blitAt(comp->getImg(),pos.x+52,pos.y+54);
+	printAtMiddle(comp->subtitle,pos.x+91,pos.y+158,GEOR13,zwykly);
+	printAtMiddleWB(comp->description,pos.x+94,pos.y+31,GEOR13,26,zwykly);
+	SDL_FreeSurface(b);
+	TimeInterested::activate();
+	mode = 6;
+	toNextTick = time;
 }
 
 void CInfoBar::tick()
@@ -1301,6 +1310,13 @@ void CInfoBar::tick()
 		toNextTick = 150;
 		blitAnim(mode);
 	}
+	else if (mode == 6)
+	{
+		TimeInterested::deactivate();
+		toNextTick = -1;
+		mode = 5;
+		draw();
+	}
 
 }
 

+ 1 - 1
CPlayerInterface.cpp

@@ -1450,7 +1450,7 @@ void CPlayerInterface::receivedResource(int type, int val)
 
 void CPlayerInterface::showComp(SComponent comp)
 {
-
+	adventureInt->infoBar.showComp(&comp,4000);
 }
 
 void CPlayerInterface::showInfoDialog(std::string text, std::vector<SComponent*> & components)

+ 1 - 1
SDL_Extensions.cpp

@@ -75,7 +75,7 @@ void CSDL_Ext::printAtMiddleWB(std::string text, int x, int y, TTF_Font * font,
 	for (int i=0;i<wesu.size();i++)
 	{
 		evx = (x - (tox/2)) + ((tox-wesu[i]->w)/2);
-		blitAt(wesu[i],evx,evy);
+		blitAt(wesu[i],evx,evy,dst);
 		evy+=wesu[i]->h;
 	}
 

+ 2 - 1
hch/CObjectHandler.cpp

@@ -29,7 +29,8 @@ void CObjectHandler::loadObjects()
 	while (it<buf.length()-1)
 	{
 		CGeneralTextHandler::loadToIt(temp,buf,it,3);
-		temp = temp.substr(1,temp.length()-2);
+		if (temp[0]=='\"')
+			temp = temp.substr(1,temp.length()-2);
 		boost::algorithm::replace_all(temp,"\"\"","\"");
 		advobtxt.push_back(temp);
 	}