bool PlayAnimationTask::Perform(Subsystem& subsystem) { DM_LOG(LC_AI, LT_INFO)LOGSTRING("PlayAnimationTask performing.\r"); idAI* owner = _owner.GetEntity(); // This task may not be performed with an empty owner pointer assert(owner != NULL); // Exit when the waitstate is not "customAnim" anymore idStr waitState(owner->WaitState()); if (waitState != "customAnim") { // We're finished, what now? if (_playCycle) { // Starte the anim cycle again StartAnim(owner); } else { return true; } } return false; }
void CWaitingWindow::Show() { setVisible(true); StartAnim(); auto alphaAction = CCFadeIn::create(0.3f); auto spawn = Spawn::create(alphaAction,NULL); m_IsShow = true; runAction(spawn); }
void EventSetVisible(bool bVisible) { if(bVisible) { if(!m_bRealStop) StartAnim(); } else StopAnim(true); }
void PlayAnimationTask::Init(idAI* owner, Subsystem& subsystem) { // Just init the base class Task::Init(owner, subsystem); // Parse animation spawnargs here if (_animName.IsEmpty()) { gameLocal.Warning("%s cannot start PlayAnimationTask with empty animation name.",owner->name.c_str()); subsystem.FinishTask(); } StartAnim(owner); }
virtual void LoadGifImage() { CDuiString sImag = m_pOwer->GetBkImage(); m_bLoadImg = true; m_pGifImage = CRenderEngine::LoadGifImageX(STRINGorID(sImag),0, 0); if ( NULL == m_pGifImage ) return; m_nFrameCount = m_pGifImage->GetNumFrames(); m_nFramePosition = 0; m_nDelay = m_pGifImage->GetFrameDelay(); if (m_nDelay <= 0 ) m_nDelay = 100; if(!m_bAutoStart) m_bRealStop = true; if(m_bAutoStart && m_pOwer->IsVisible()) StartAnim(); }