Browse Source

Shipyard window fixed.

OnionKnight 16 năm trước cách đây
mục cha
commit
d8ddc4236b
2 tập tin đã thay đổi với 11 bổ sung3 xóa
  1. 10 2
      client/GUIClasses.cpp
  2. 1 1
      hch/CObjectHandler.cpp

+ 10 - 2
client/GUIClasses.cpp

@@ -4118,6 +4118,14 @@ CShipyardWindow::CShipyardWindow(const std::vector<si32> &cost, int state, const
 	blitAt(bgtemp, 100, 69, bg);
 	SDL_FreeSurface(bgtemp);
 
+	// Draw resource icons and costs.
+	std::string woodCost = boost::lexical_cast<std::string>(10);
+	std::string goldCost = boost::lexical_cast<std::string>(1000);
+	blitAt(graphics->resources32->ourImages[0].bitmap, 100, 244, bg);
+	printAtMiddle(woodCost.c_str(), 116, 290, GEOR13, zwykly, bg);
+	blitAt(graphics->resources32->ourImages[6].bitmap, 196, 244, bg);
+	printAtMiddle(goldCost.c_str(), 212, 290, GEOR13, zwykly, bg);
+
 	bool affordable = true;
 	for(int i = 0; i < cost.size(); i++)
 	{
@@ -4135,6 +4143,6 @@ CShipyardWindow::CShipyardWindow(const std::vector<si32> &cost, int state, const
 	if(!affordable)
 		build->block(true);
 
-	printAtMiddle(CGI->generaltexth->jktexts[15], 165, 26, GEOR13, zwykly, bg); //Resource cost:
-	printAtMiddle(CGI->generaltexth->jktexts[14], 165, 218, GEOR16, tytulowy, bg); //Build A New Ship
+	printAtMiddle(CGI->generaltexth->jktexts[13], 165, 28, GEORXX, tytulowy, bg);  //Build A New Ship
+	printAtMiddle(CGI->generaltexth->jktexts[14], 165, 218, GEOR16, zwykly, bg); //Resource cost:
 }

+ 1 - 1
hch/CObjectHandler.cpp

@@ -3969,7 +3969,7 @@ IShipyard * IShipyard::castFrom( CGObjectInstance *obj )
 	}
 	else
 	{
-		tlog1 << "Cannot cast to IShipyar object with ID " << obj->ID << std::endl;
+		tlog1 << "Cannot cast to IShipyard object with ID " << obj->ID << std::endl;
 		return NULL;
 	}
 }