diff --git a/apps/openmw/mwgui/charactercreation.cpp b/apps/openmw/mwgui/charactercreation.cpp index 2c0b3de85..5e0df5cbd 100644 --- a/apps/openmw/mwgui/charactercreation.cpp +++ b/apps/openmw/mwgui/charactercreation.cpp @@ -268,20 +268,20 @@ void CharacterCreation::spawnDialog(const char id) mReviewDialog->setFatigue(mPlayerFatigue); { - std::map > attributes = mWM->getPlayerAttributeValues(); - for (std::map >::iterator it = attributes.begin(); + std::map > attributes = mWM->getPlayerAttributeValues(); + for (std::map >::iterator it = attributes.begin(); it != attributes.end(); ++it) { - mReviewDialog->setAttribute(it->first, it->second); + mReviewDialog->setAttribute(static_cast (it->first), it->second); } } { - std::map > skills = mWM->getPlayerSkillValues(); - for (std::map >::iterator it = skills.begin(); + std::map > skills = mWM->getPlayerSkillValues(); + for (std::map >::iterator it = skills.begin(); it != skills.end(); ++it) { - mReviewDialog->setSkillValue(it->first, it->second); + mReviewDialog->setSkillValue(static_cast (it->first), it->second); } mReviewDialog->configureSkills(mWM->getPlayerMajorSkills(), mWM->getPlayerMinorSkills()); } diff --git a/apps/openmw/mwgui/window_manager.cpp b/apps/openmw/mwgui/window_manager.cpp index 38ea74a57..94cad2818 100644 --- a/apps/openmw/mwgui/window_manager.cpp +++ b/apps/openmw/mwgui/window_manager.cpp @@ -338,10 +338,12 @@ void WindowManager::setValue (const std::string& id, const MWMechanics::Stat& value) +void WindowManager::setValue (int parSkill, const MWMechanics::Stat& value) { - mStatsWindow->setValue(parSkill, value); - mCharGen->setValue(parSkill, value); + /// \todo Don't use the skill enum as a parameter type (we will have to drop it anyway, once we + /// allow custom skills. + mStatsWindow->setValue(static_cast (parSkill), value); + mCharGen->setValue(static_cast (parSkill), value); mPlayerSkillValues[parSkill] = value; } @@ -800,12 +802,12 @@ MWGui::GuiMode WindowManager::getMode() const return mGuiModes.back(); } -std::map > WindowManager::getPlayerSkillValues() +std::map > WindowManager::getPlayerSkillValues() { return mPlayerSkillValues; } -std::map > WindowManager::getPlayerAttributeValues() +std::map > WindowManager::getPlayerAttributeValues() { return mPlayerAttributes; } diff --git a/apps/openmw/mwgui/window_manager.hpp b/apps/openmw/mwgui/window_manager.hpp index 60fc63c8c..de90037b9 100644 --- a/apps/openmw/mwgui/window_manager.hpp +++ b/apps/openmw/mwgui/window_manager.hpp @@ -131,7 +131,7 @@ namespace MWGui ///< Set value for the given ID. void setValue (const std::string& id, const MWMechanics::Stat& value); - void setValue(const ESM::Skill::SkillEnum parSkill, const MWMechanics::Stat& value); + void setValue (int parSkill, const MWMechanics::Stat& value); void setValue (const std::string& id, const MWMechanics::DynamicStat& value); void setValue (const std::string& id, const std::string& value); void setValue (const std::string& id, int value); @@ -184,8 +184,8 @@ namespace MWGui void onFrame (float frameDuration); - std::map > getPlayerSkillValues(); - std::map > getPlayerAttributeValues(); + std::map > getPlayerSkillValues(); + std::map > getPlayerAttributeValues(); SkillList getPlayerMinorSkills(); SkillList getPlayerMajorSkills(); @@ -233,9 +233,9 @@ namespace MWGui ESM::Class mPlayerClass; std::string mPlayerName; std::string mPlayerRaceId; - std::map > mPlayerAttributes; + std::map > mPlayerAttributes; SkillList mPlayerMajorSkills, mPlayerMinorSkills; - std::map > mPlayerSkillValues; + std::map > mPlayerSkillValues; MWMechanics::DynamicStat mPlayerHealth, mPlayerMagicka, mPlayerFatigue;