Sfoglia il codice sorgente

* next part of thieves' guild window

mateuszb 15 anni fa
parent
commit
ba51824710
3 ha cambiato i file con 57 aggiunte e 0 eliminazioni
  1. 32 0
      client/GUIClasses.cpp
  2. 20 0
      lib/CGameState.cpp
  3. 5 0
      lib/CGameState.h

+ 32 - 0
client/GUIClasses.cpp

@@ -4956,6 +4956,19 @@ CThievesGuildWindow::CThievesGuildWindow(const CGObjectInstance * _owner)
 	{
 		blitAt(graphics->portraitSmall[it->second.portrait], 260 + 66 * counter, 360, background);
 		counter++;
+
+		//printing stats
+		if(it->second.details)
+		{
+			for (int i=0; i<it->second.details->primskills.size(); ++i)
+			{
+				printAt(CGI->generaltexth->allTexts[380+i], 191 + 66*counter, 394 + 11*i, FONT_SMALL, zwykly, background);
+				std::ostringstream skill;
+				skill << it->second.details->primskills[i];
+				printTo(skill.str(), 244 + 66 * counter, 410 + 11*i, FONT_SMALL, zwykly, background);
+			}
+		}
+
 	}
 
 	//printing best creature
@@ -4966,6 +4979,25 @@ CThievesGuildWindow::CThievesGuildWindow(const CGObjectInstance * _owner)
 		counter++;
 	}
 
+	//printing personality
+	counter = 0;
+	for(std::map<ui8, si8>::const_iterator it = tgi.personality.begin(); it !=  tgi.personality.end(); ++it)
+	{
+		int toPrint = 0;
+		if(it->second == -1)
+		{
+			toPrint = 172;
+		}
+		else
+		{
+			toPrint = 168 + it->second;
+		}
+
+		printAtMiddle(CGI->generaltexth->arraytxt[toPrint], 283 + 66*counter, 459, FONT_SMALL, zwykly, background);
+
+		counter++;
+	}
+
 }
 
 CThievesGuildWindow::~CThievesGuildWindow()

+ 20 - 0
lib/CGameState.cpp

@@ -3613,6 +3613,11 @@ InfoAboutHero::InfoAboutHero()
 	portrait = -1;
 }
 
+InfoAboutHero::InfoAboutHero( const InfoAboutHero & iah )
+{
+	assign(iah);
+}
+
 InfoAboutHero::~InfoAboutHero()
 {
 	delete details;
@@ -3650,3 +3655,18 @@ void InfoAboutHero::initFromHero( const CGHeroInstance *h, bool detailed )
 	}
 }
 
+void InfoAboutHero::assign( const InfoAboutHero & iah )
+{
+	army = iah.army;
+	details = (iah.details ? new Details(*iah.details) : NULL);
+	hclass = iah.hclass;
+	name = iah.name;
+	owner = iah.owner;
+	portrait = iah.portrait;
+}
+
+InfoAboutHero & InfoAboutHero::operator=( const InfoAboutHero & iah )
+{
+	assign(iah);
+	return *this;
+}

+ 5 - 0
lib/CGameState.h

@@ -61,6 +61,9 @@ namespace boost
 
 struct DLL_EXPORT InfoAboutHero
 {
+private:
+	void assign(const InfoAboutHero & iah);
+public:
 	struct DLL_EXPORT Details
 	{
 		std::vector<int> primskills;
@@ -74,6 +77,8 @@ struct DLL_EXPORT InfoAboutHero
 	CCreatureSet army; //numbers of creatures are exact numbers if detailed else they are quantity ids (0 - a few, 1 - several and so on)
 
 	InfoAboutHero();
+	InfoAboutHero(const InfoAboutHero & iah);
+	InfoAboutHero & operator=(const InfoAboutHero & iah);
 	~InfoAboutHero();
 	void initFromHero(const CGHeroInstance *h, bool detailed);
 };