1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-20 06:53:52 +00:00

Issue #107: Fixing up the window manager interface

This commit is contained in:
Marc Zinnschlag 2012-08-12 13:46:14 +02:00
parent 020fde70b8
commit e0ba7cf952
3 changed files with 18 additions and 16 deletions

View file

@ -268,20 +268,20 @@ void CharacterCreation::spawnDialog(const char id)
mReviewDialog->setFatigue(mPlayerFatigue); mReviewDialog->setFatigue(mPlayerFatigue);
{ {
std::map<ESM::Attribute::AttributeID, MWMechanics::Stat<int> > attributes = mWM->getPlayerAttributeValues(); std::map<int, MWMechanics::Stat<int> > attributes = mWM->getPlayerAttributeValues();
for (std::map<ESM::Attribute::AttributeID, MWMechanics::Stat<int> >::iterator it = attributes.begin(); for (std::map<int, MWMechanics::Stat<int> >::iterator it = attributes.begin();
it != attributes.end(); ++it) it != attributes.end(); ++it)
{ {
mReviewDialog->setAttribute(it->first, it->second); mReviewDialog->setAttribute(static_cast<ESM::Attribute::AttributeID> (it->first), it->second);
} }
} }
{ {
std::map<ESM::Skill::SkillEnum, MWMechanics::Stat<float> > skills = mWM->getPlayerSkillValues(); std::map<int, MWMechanics::Stat<float> > skills = mWM->getPlayerSkillValues();
for (std::map<ESM::Skill::SkillEnum, MWMechanics::Stat<float> >::iterator it = skills.begin(); for (std::map<int, MWMechanics::Stat<float> >::iterator it = skills.begin();
it != skills.end(); ++it) it != skills.end(); ++it)
{ {
mReviewDialog->setSkillValue(it->first, it->second); mReviewDialog->setSkillValue(static_cast<ESM::Skill::SkillEnum> (it->first), it->second);
} }
mReviewDialog->configureSkills(mWM->getPlayerMajorSkills(), mWM->getPlayerMinorSkills()); mReviewDialog->configureSkills(mWM->getPlayerMajorSkills(), mWM->getPlayerMinorSkills());
} }

View file

@ -338,10 +338,12 @@ void WindowManager::setValue (const std::string& id, const MWMechanics::Stat<int
} }
void WindowManager::setValue(const ESM::Skill::SkillEnum parSkill, const MWMechanics::Stat<float>& value) void WindowManager::setValue (int parSkill, const MWMechanics::Stat<float>& value)
{ {
mStatsWindow->setValue(parSkill, value); /// \todo Don't use the skill enum as a parameter type (we will have to drop it anyway, once we
mCharGen->setValue(parSkill, value); /// allow custom skills.
mStatsWindow->setValue(static_cast<ESM::Skill::SkillEnum> (parSkill), value);
mCharGen->setValue(static_cast<ESM::Skill::SkillEnum> (parSkill), value);
mPlayerSkillValues[parSkill] = value; mPlayerSkillValues[parSkill] = value;
} }
@ -800,12 +802,12 @@ MWGui::GuiMode WindowManager::getMode() const
return mGuiModes.back(); return mGuiModes.back();
} }
std::map<ESM::Skill::SkillEnum, MWMechanics::Stat<float> > WindowManager::getPlayerSkillValues() std::map<int, MWMechanics::Stat<float> > WindowManager::getPlayerSkillValues()
{ {
return mPlayerSkillValues; return mPlayerSkillValues;
} }
std::map<ESM::Attribute::AttributeID, MWMechanics::Stat<int> > WindowManager::getPlayerAttributeValues() std::map<int, MWMechanics::Stat<int> > WindowManager::getPlayerAttributeValues()
{ {
return mPlayerAttributes; return mPlayerAttributes;
} }

View file

@ -131,7 +131,7 @@ namespace MWGui
///< Set value for the given ID. ///< Set value for the given ID.
void setValue (const std::string& id, const MWMechanics::Stat<int>& value); void setValue (const std::string& id, const MWMechanics::Stat<int>& value);
void setValue(const ESM::Skill::SkillEnum parSkill, const MWMechanics::Stat<float>& value); void setValue (int parSkill, const MWMechanics::Stat<float>& value);
void setValue (const std::string& id, const MWMechanics::DynamicStat<int>& value); void setValue (const std::string& id, const MWMechanics::DynamicStat<int>& value);
void setValue (const std::string& id, const std::string& value); void setValue (const std::string& id, const std::string& value);
void setValue (const std::string& id, int value); void setValue (const std::string& id, int value);
@ -184,8 +184,8 @@ namespace MWGui
void onFrame (float frameDuration); void onFrame (float frameDuration);
std::map<ESM::Skill::SkillEnum, MWMechanics::Stat<float> > getPlayerSkillValues(); std::map<int, MWMechanics::Stat<float> > getPlayerSkillValues();
std::map<ESM::Attribute::AttributeID, MWMechanics::Stat<int> > getPlayerAttributeValues(); std::map<int, MWMechanics::Stat<int> > getPlayerAttributeValues();
SkillList getPlayerMinorSkills(); SkillList getPlayerMinorSkills();
SkillList getPlayerMajorSkills(); SkillList getPlayerMajorSkills();
@ -233,9 +233,9 @@ namespace MWGui
ESM::Class mPlayerClass; ESM::Class mPlayerClass;
std::string mPlayerName; std::string mPlayerName;
std::string mPlayerRaceId; std::string mPlayerRaceId;
std::map<ESM::Attribute::AttributeID, MWMechanics::Stat<int> > mPlayerAttributes; std::map<int, MWMechanics::Stat<int> > mPlayerAttributes;
SkillList mPlayerMajorSkills, mPlayerMinorSkills; SkillList mPlayerMajorSkills, mPlayerMinorSkills;
std::map<ESM::Skill::SkillEnum, MWMechanics::Stat<float> > mPlayerSkillValues; std::map<int, MWMechanics::Stat<float> > mPlayerSkillValues;
MWMechanics::DynamicStat<int> mPlayerHealth, mPlayerMagicka, mPlayerFatigue; MWMechanics::DynamicStat<int> mPlayerHealth, mPlayerMagicka, mPlayerFatigue;