1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-08 23:36:33 +02:00

Fixed compilation issues caused by merge

This commit is contained in:
Ivan Savenko 2014-07-14 17:44:15 +03:00
parent 92d22bae63
commit a69fcdd435
4 changed files with 9 additions and 10 deletions

View File

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

View File

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

View File

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

View File

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