void SkillObjectEditor::OnNewSkill(wxCommandEvent &e) { AddSkillDialog *dlg = new AddSkillDialog(this, wxID_ANY, /*_("Add Skill")*/wxT("添加新技能") ); dlg->Centre(); bool ok = dlg->ShowModal() == wxID_OK; if(ok) { // 获取所选的动作名称 wxString selectedAnimName = dlg->mAnimComboBox->GetStringSelection(); wxString skillName = dlg->mSkillNameTextCtrl->GetValue(); Fairy::Skill *pSkill = Fairy::EffectManager::getSingleton().createSkillTemplate(skillName.c_str()); pSkill->setAnimationName(selectedAnimName.c_str()); mSkillTemplateName = pSkill->getSkillName(); //mDObject->createSkill(skill->getSkillName(),false, false,10.0f);// mAnimationFadeOutTime); // 刷新动作进度条 m_Frame->GetGraphDialog()->InitAnimTimePosSlider(); InitSkillEditor(pSkill,mSkillTemplateName); } dlg->Destroy(); }
void ActorAnimationSettingDialog::OnAddSkillButtonDown(wxCommandEvent &e) { AddSkillDialog *dlg = new AddSkillDialog(this, wxID_ANY, /*_("Add Skill")*/wxT("添加新技能") ); dlg->Centre(); bool ok = dlg->ShowModal() == wxID_OK; if(ok) { // 获取所选的动作名称 wxString selectedAnimName = dlg->mAnimComboBox->GetStringSelection(); wxString skillName = dlg->mSkillNameTextCtrl->GetValue(); Fairy::Skill *skill = Fairy::EffectManager::getSingleton().createSkillTemplate(skillName.c_str()); skill->setAnimationName(selectedAnimName.c_str()); mDObject->createSkill(skill->getSkillName(), mCheckBoxLoop->GetValue(), false, mAnimationFadeOutTime); // 刷新技能列表 FillAllSkillListBox(); // 刷新动作进度条 InitAnimTimePosSlider(); } dlg->Destroy(); }