Explorar el Código

Fixed compilation issues caused by merge

Ivan Savenko hace 11 años
padre
commit
a69fcdd435

+ 4 - 5
client/widgets/CGarrisonInt.cpp

@@ -120,7 +120,7 @@ void CGarrisonSlot::clickRight(tribool down, bool previousState)
 {
 	if(down && creature)
 	{
-		GH.pushInt(createCreWindow(myStack, CCreatureWindow::ARMY));
+		GH.pushInt(new CStackWindow(myStack, true));
 	}
 }
 void CGarrisonSlot::clickLeft(tribool down, bool previousState)
@@ -137,9 +137,9 @@ void CGarrisonSlot::clickLeft(tribool down, bool previousState)
 
 				bool canUpgrade = getObj()->tempOwner == LOCPLINT->playerID && pom.oldID>=0; //upgrade is possible
 				bool canDismiss = getObj()->tempOwner == LOCPLINT->playerID && (getObj()->stacksCount()>1  || !getObj()->needsLastStack());
-				std::function<void()> upgr = nullptr;
+				std::function<void(CreatureID)> upgr = nullptr;
 				std::function<void()> dism = nullptr;
-				if(canUpgrade) upgr = [=] { LOCPLINT->cb->upgradeCreature(getObj(), ID, pom.newID[0]); };
+				if(canUpgrade) upgr = [=] (CreatureID newID) { LOCPLINT->cb->upgradeCreature(getObj(), ID, newID); };
 				if(canDismiss) dism = [=] { LOCPLINT->cb->dismissCreature(getObj(), ID); };
 
 				owner->selectSlot(nullptr);
@@ -150,8 +150,7 @@ void CGarrisonSlot::clickLeft(tribool down, bool previousState)
 
 				redraw();
 				refr = true;
-				CIntObject *creWindow = createCreWindow(myStack, CCreatureWindow::HERO, upgr, dism, &pom);
-				GH.pushInt(creWindow);
+				GH.pushInt(new CStackWindow(myStack, dism, pom, upgr));
 			}
 			else
 			{

+ 3 - 3
client/windows/CCreatureWindow.cpp

@@ -3,6 +3,9 @@
 
 #include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
+#include "../gui/CGuiHandler.h"
+#include "../widgets/CIntObjectClasses.h"
+#include "../widgets/CAnimation.h"
 
 #include "../../CCallback.h"
 #include "../../lib/BattleState.h"
@@ -12,9 +15,6 @@
 #include "../../lib/CHeroHandler.h"
 #include "../../lib/CSpellHandler.h"
 
-#include "../gui/CGuiHandler.h"
-#include "../gui/CIntObjectClasses.h"
-
 using namespace CSDL_Ext;
 
 class CCreatureArtifactInstance;

+ 1 - 1
client/windows/CCreatureWindow.h

@@ -1,7 +1,7 @@
 #pragma once
 
 #include "../../lib/HeroBonus.h"
-#include "../gui/CIntObject.h"
+#include "../widgets/MiscWidgets.h"
 
 /*
  * CCreatureWindow.h, part of VCMI engine

+ 1 - 1
client/windows/GUIClasses.cpp

@@ -98,7 +98,7 @@ void CRecruitmentWindow::CCreatureCard::clickLeft(tribool down, bool previousSta
 void CRecruitmentWindow::CCreatureCard::clickRight(tribool down, bool previousState)
 {
 	if (down)
-		GH.pushInt(createCreWindow(creature->idNumber, CCreatureWindow::OTHER, 0));
+		GH.pushInt(new CStackWindow(creature, true));
 }
 
 void CRecruitmentWindow::CCreatureCard::showAll(SDL_Surface * to)