Пример #1
0
void AnimationSelector::OnBtn(wxCommandEvent & e)
{
	if (e.GetId() == ID_BTN_PLAY)
	{
		if (!m_bPause)
		{
			return;
		}
	}
	else
	{
		if (m_bPause)
		{
			return;
		}
	}

	m_bPause = !m_bPause;

	m_btnPause->Enable(!m_bPause);
	m_btnPlay->Enable(m_bPause);

	Fairy::LogicModel* pObjModel = GetDataManipulator()->m_pObjTemplate;

	if ( pObjModel && !pObjModel->getCurrentAnimName().empty())
	{
		pObjModel->setAnimEditing(m_bPause);
	}	
}
Пример #2
0
void
AnimationSelector::OnAnimationListSelChanged(wxTreeEvent& e)
{
	// reset the state
	resetState();

    wxTreeItemId item = e.GetItem();

    wxASSERT(item.IsOk());

	wxTreeCtrl* tree = wxStaticCast(e.GetEventObject(), wxTreeCtrl);
    mActivedItem = e.GetItem();

    wxArrayTreeItemIds selections;
    int nCount = tree->GetSelections(selections);

	if(nCount <= 0)
		return;

	if (mIsMeshAnim)
	{
		GetDataManipulator()->changeMeshAnimation(DoActiveItem(item));
		return;
	}

	GetDataManipulator()->changeAnimation(DoActiveItem(item),0.0);

	Fairy::LogicModel* pObjModel = GetDataManipulator()->m_pObjTemplate;

	if ( pObjModel && !pObjModel->getCurrentAnimName().empty())
	{
		
		m_btnPause->Enable(true);
 
 		pObjModel->setAnimEditing(m_bPause);

		Ogre::String animationName = pObjModel->getCurrentAnimName();

		bool bLoop = pObjModel->getAnimationLoop();
		Ogre::Real timeTotal = pObjModel->getAnimationLength(animationName);

		m_endTimeText->SetValue(Ogre::StringConverter::toString(timeTotal));
		m_endFrameText->SetValue(Ogre::StringConverter::toString(timeTotal*STATIC_FPS));
	}
}
Пример #3
0
void SkillObjectEditor::InitSkillEditor(Fairy::Skill* pSkill,Ogre::String& templateName)
{
	mSkillTemplateName = templateName;
	mSkill = pSkill;

	GetParentFrame()->GetEffectObjectProperty()->InitSkillEditor(mSkill,templateName);

	m_SkillObjectTree->DeleteAllItems();
	m_SkillObjectTree->AddSkillToTree(mSkill);
	m_SkillObjectTree->SelectSkillSetting();

	Fairy::LogicModel* pDObject = m_Frame->GetActorSettingEditor()->GetActorObject();

	pDObject->setAnimEditing(false);
	m_Frame->GetGraphDialog()->InitSkillEditor(mSkill,mSkillTemplateName);
	m_Frame->GetGraphDialog()->InitAnimTimePosSlider();
	
	try
	{
		pDObject->createSkill( mSkill->getSkillName(), m_Frame->GetGraphDialog()->GetLoop());
		if(mSkill->getNumAnimationBulletFlows() > 0)
		{
			BulletFlowInfo* pInfo = new BulletFlowInfo;
			Fairy::AnimationBulletFlow* pAnimationFlow = mSkill->getAnimationBulletFlow(0);

			pInfo->attachPoint = pAnimationFlow->getAttachPoint();
			pInfo->offsetPoistion = pAnimationFlow->getOffsetPos();
			pInfo->offsetRotation = pAnimationFlow->getOffsetRotation();
			pInfo->casterModel = m_Frame->GetActorSettingEditor()->GetCurrentObject();
			pInfo->targetModel = m_Frame->GetActorSettingEditor()->GetTargetObject();
			pInfo->targetPoint = "身体中心点";

			pDObject->getCurrentSkill()->m_userData = pInfo;

		}
		
	}
	catch ( Ogre::Exception& e)
	{
		Ogre::String msg = "[Warning] Animation : " + mSkill->getSkillName() + "_getAnimationState Failed!";
		wxLogMessage(msg.c_str());		
	}
	mDObject = pDObject;
}
Пример #4
0
void AnimationSelector::pauseAnimation(bool bPause)
{
	if (!GetDataManipulator())
	{
		return;
	}

	Fairy::LogicModel* pObjModel = GetDataManipulator()->m_pObjTemplate;

	if ( !pObjModel || pObjModel->getCurrentAnimName().empty())
	{
		return;
	}	

	if (!bPause)
	{
		if (!m_bPause)
		{
			return;
		}
	}
	else
	{
		if (m_bPause)
		{
			return;
		}
	}

	m_bPause = !m_bPause;

	m_btnPause->Enable(!m_bPause);
	m_btnPlay->Enable(m_bPause);

	if ( pObjModel && !pObjModel->getCurrentAnimName().empty())
	{
		pObjModel->setAnimEditing(m_bPause);
	}	
}