mirror of
https://github.com/vcmi/vcmi.git
synced 2025-05-21 22:33:43 +02:00
* CHexFieldControl renamed to CClickableHex * CCreatureAnimation.cpp/.h moved to BattleInterface/CCreatureAnimation.cpp/.h * Removed unused project files * Added VCMI_client filters file for VS 2010 * Gathered common parts of StdInc.h in Global.h * Boost.Spirit has been included in PCH for ERM project * StopWatch renamed to CStopWatch * GuiBase.cpp split up in UIFramework/...
52 lines
1.1 KiB
C++
52 lines
1.1 KiB
C++
#include "StdInc.h"
|
|
#include "CMovementEndAnimation.h"
|
|
|
|
#include "CCreatureAnimation.h"
|
|
#include "../CMusicHandler.h"
|
|
#include "../CGameInfo.h"
|
|
#include "../../lib/BattleState.h"
|
|
#include "../CCursorHandler.h"
|
|
|
|
bool CMovementEndAnimation::init()
|
|
{
|
|
if( !isEarliest(true) )
|
|
return false;
|
|
|
|
if(!stack || myAnim()->framesInGroup(CCreatureAnim::MOVE_END) == 0 ||
|
|
myAnim()->getType() == CCreatureAnim::DEATH)
|
|
{
|
|
endAnim();
|
|
|
|
return false;
|
|
}
|
|
|
|
CCS->soundh->playSound(battle_sound(stack->getCreature(), endMoving));
|
|
|
|
myAnim()->setType(CCreatureAnim::MOVE_END);
|
|
|
|
return true;
|
|
}
|
|
|
|
void CMovementEndAnimation::nextFrame()
|
|
{
|
|
if(myAnim()->onLastFrameInGroup())
|
|
{
|
|
endAnim();
|
|
}
|
|
}
|
|
|
|
void CMovementEndAnimation::endAnim()
|
|
{
|
|
CBattleAnimation::endAnim();
|
|
|
|
if(myAnim()->getType() != CCreatureAnim::DEATH)
|
|
myAnim()->setType(CCreatureAnim::HOLDING); //resetting to default
|
|
|
|
CCS->curh->show();
|
|
delete this;
|
|
}
|
|
|
|
CMovementEndAnimation::CMovementEndAnimation(CBattleInterface * _owner, const CStack * _stack, SBattleHex destTile)
|
|
: CBattleStackAnimation(_owner, _stack), destinationTile(destTile)
|
|
{
|
|
} |