Sfoglia il codice sorgente

* added hints in town lists
* eliminated square from city hints
* version changed on 0.53c

Michał W. Urbańczyk 17 anni fa
parent
commit
83b5c78d5a
5 ha cambiato i file con 12 aggiunte e 9 eliminazioni
  1. 8 7
      AdventureMapButton.h
  2. 1 0
      CLua.h
  3. 1 1
      CMT.cpp
  4. 1 0
      hch/CTownHandler.cpp
  5. 1 1
      mapHandler.cpp

+ 8 - 7
AdventureMapButton.h

@@ -5,6 +5,7 @@
 #include "hch\CLodHandler.h"
 #include "hch\CPreGameTextHandler.h"
 #include "hch/CTownHandler.h"
+#include "CLua.h"
 template <typename T>
 AdventureMapButton<T>::AdventureMapButton ()
 {
@@ -177,30 +178,30 @@ void CTownList<T>::mouseMoved (SDL_MouseMotionEvent & sEvent)
 	if(isItIn(&arrupp,LOCPLINT->current->motion.x,LOCPLINT->current->motion.y))
 	{
 		if (from>0)
-			LOCPLINT->adventureInt->statusbar.print(CGI->preth->zelp[306].first);
+			LOCPLINT->statusbar->print(CGI->preth->zelp[306].first);
 		else
-			LOCPLINT->adventureInt->statusbar.clear();
+			LOCPLINT->statusbar->clear();
 		return;
 	}
 	else if(isItIn(&arrdop,LOCPLINT->current->motion.x,LOCPLINT->current->motion.y))
 	{
 		if ((items.size()-from)  >  SIZE)
-			LOCPLINT->adventureInt->statusbar.print(CGI->preth->zelp[307].first);
+			LOCPLINT->statusbar->print(CGI->preth->zelp[307].first);
 		else
-			LOCPLINT->adventureInt->statusbar.clear();
+			LOCPLINT->statusbar->clear();
 		return;
 	}
-	//if not buttons then heroes
+	//if not buttons then towns
 	int hx = LOCPLINT->current->motion.x, hy = LOCPLINT->current->motion.y;
 	hx-=pos.x;
 	hy-=pos.y; hy-=arrup->ourImages[0].bitmap->h;
 	float ny = (float)hy/(float)32;
 	if ((ny>SIZE || ny<0) || (from+ny>=items.size()))
 	{
-		LOCPLINT->adventureInt->statusbar.clear();
+		LOCPLINT->statusbar->clear();
 		return;
 	};
-	//LOCPLINT->adventureInt->statusbar.print( items[from+ny]->name + ", " + items[from+ny]->town->name ); //TODO - uncomment when pointer to the town type is initialized
+	LOCPLINT->statusbar->print(items[from+ny]->state->hoverText(const_cast<CGTownInstance*>(items[from+ny])));
 }
 template<typename T>
 void CTownList<T>::clickLeft(tribool down)

+ 1 - 0
CLua.h

@@ -1,3 +1,4 @@
+#pragma once
 #include "global.h"
 #include "lstate.h"
 #include <set>

+ 1 - 1
CMT.cpp

@@ -62,7 +62,7 @@
 CGameInfo* CGI;
 #endif
 #define CHUNK 16384
-const char * NAME = "VCMI 0.53b \"Tirion\" Techdemo";
+const char * NAME = "VCMI 0.53c \"Tirion\" Techdemo";
 
 SDL_Surface * ekran, * screen, * screen2;
 extern SDL_Surface * CSDL_Ext::std32bppSurface;

+ 1 - 0
hch/CTownHandler.cpp

@@ -25,6 +25,7 @@ void CTownHandler::loadNames()
 		CTown town;
 		ins.getline(bufname,50);
 		town.name = std::string(bufname);
+		town.name = town.name.substr(0,town.name.size()-1);
 		for (int i=0; i<NAMES_PER_TOWN; i++)
 		{
 			names.getline(bufname,50);

+ 1 - 1
mapHandler.cpp

@@ -1681,5 +1681,5 @@ unsigned char CMapHandler::getDir(const int3 &a, const int3 &b)
 	{
 		return 7;
 	}
-
+	return -2; //shouldn't happen
 }