1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

cleaned up spell window creation

This commit is contained in:
AlexVinS 2016-10-16 09:27:22 +03:00
parent 415bd8247a
commit 63cbf960df
8 changed files with 10 additions and 18 deletions

View File

@ -898,8 +898,7 @@ void CBattleInterface::bSpellf()
ESpellCastProblem::ESpellCastProblem spellCastProblem;
if (curInt->cb->battleCanCastSpell(&spellCastProblem))
{
auto spellWindow = new CSpellWindow(genRect(595, 620, (screen->w - 620)/2, (screen->h - 595)/2), myHero, curInt.get());
GH.pushInt(spellWindow);
GH.pushInt(new CSpellWindow(myHero, curInt.get()));
}
else if(spellCastProblem == ESpellCastProblem::MAGIC_IS_BLOCKED)
{

View File

@ -200,8 +200,7 @@ void CBattleHero::clickLeft(tribool down, bool previousState)
}
CCS->curh->changeGraphic(ECursor::ADVENTURE, 0);
auto spellWindow = new CSpellWindow(genRect(595, 620, (screen->w - 620)/2, (screen->h - 595)/2), myHero, myOwner->getCurrentPlayerInterface());
GH.pushInt(spellWindow);
GH.pushInt(new CSpellWindow(myHero, myOwner->getCurrentPlayerInterface()));
}
}

View File

@ -123,10 +123,7 @@ void CArtPlace::clickLeft(tribool down, bool previousState)
if(ourArt && !down && previousState && !ourOwner->commonInfo->src.AOH)
{
if(ourArt->artType->id == ArtifactID::SPELLBOOK)
{
auto spellWindow = new CSpellWindow(genRect(595, 620, (screen->w - 620)/2, (screen->h - 595)/2), ourOwner->curHero, LOCPLINT, LOCPLINT->battleInt);
GH.pushInt(spellWindow);
}
GH.pushInt(new CSpellWindow(ourOwner->curHero, LOCPLINT, LOCPLINT->battleInt));
}
if (!down && previousState)

View File

@ -714,8 +714,7 @@ void CAdvMapInt::fshowSpellbok()
centerOn(selection);
auto spellWindow = new CSpellWindow(genRect(595, 620, (screen->w - 620)/2, (screen->h - 595)/2), curHero(), LOCPLINT, false);
GH.pushInt(spellWindow);
GH.pushInt(new CSpellWindow(curHero(), LOCPLINT, false));
}
void CAdvMapInt::fadventureOPtions()

View File

@ -4,7 +4,6 @@
#include "CAdvmapInterface.h"
#include "CCreatureWindow.h"
#include "CKingdomInterface.h"
#include "CSpellWindow.h"
#include "GUIClasses.h"
#include "../CBitmapHandler.h"

View File

@ -74,7 +74,7 @@ void CSpellWindow::InteractiveArea::hover(bool on)
owner->statusBar->clear();
}
CSpellWindow::CSpellWindow(const SDL_Rect &, const CGHeroInstance * _myHero, CPlayerInterface * _myInt, bool openOnBattleSpells):
CSpellWindow::CSpellWindow(const CGHeroInstance * _myHero, CPlayerInterface * _myInt, bool openOnBattleSpells):
CWindowObject(PLAYER_COLORED, "SpelBack"),
battleSpellsOnly(openOnBattleSpells),
selectedTab(4),

View File

@ -92,7 +92,7 @@ private:
public:
CSpellWindow(const SDL_Rect & myRect, const CGHeroInstance * _myHero, CPlayerInterface * _myInt, bool openOnBattleSpells = true); //c-tor
CSpellWindow(const CGHeroInstance * _myHero, CPlayerInterface * _myInt, bool openOnBattleSpells = true); //c-tor
~CSpellWindow(); //d-tor
void fexitb();

View File

@ -5,7 +5,6 @@
#include "CCastleInterface.h"
#include "CCreatureWindow.h"
#include "CHeroWindow.h"
#include "CSpellWindow.h"
#include "../CBitmapHandler.h"
#include "../CGameInfo.h"