void CreateClassDialog::onSkillSelected() { ESM::Skill::SkillEnum id = skillDialog->getSkillId(); Widgets::MWSkillPtr skill = skillDialog->getAffectedWidget(); // Avoid duplicate skills by swapping any skill field that matches the selected one std::vector<Widgets::MWSkillPtr>::const_iterator end = skills.end(); for (std::vector<Widgets::MWSkillPtr>::const_iterator it = skills.begin(); it != end; ++it) { if (*it == skill) continue; if ((*it)->getSkillId() == id) { (*it)->setSkillId(skill->getSkillId()); break; } } skill->setSkillId(skillDialog->getSkillId()); skillDialog->setVisible(false); }
void SelectSkillDialog::onSkillClicked(Widgets::MWSkillPtr _sender) { mSkillId = _sender->getSkillId(); eventItemSelected(); }