mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-03 23:56:43 +00:00 
			
		
		
		
	Issue #107: Fixing up the window manager interface
This commit is contained in:
		
							parent
							
								
									020fde70b8
								
							
						
					
					
						commit
						e0ba7cf952
					
				
					 3 changed files with 18 additions and 16 deletions
				
			
		| 
						 | 
				
			
			@ -268,20 +268,20 @@ void CharacterCreation::spawnDialog(const char id)
 | 
			
		|||
            mReviewDialog->setFatigue(mPlayerFatigue);
 | 
			
		||||
 | 
			
		||||
            {
 | 
			
		||||
                std::map<ESM::Attribute::AttributeID, MWMechanics::Stat<int> > attributes = mWM->getPlayerAttributeValues();
 | 
			
		||||
                for (std::map<ESM::Attribute::AttributeID, MWMechanics::Stat<int> >::iterator it = attributes.begin();
 | 
			
		||||
                std::map<int, MWMechanics::Stat<int> > attributes = mWM->getPlayerAttributeValues();
 | 
			
		||||
                for (std::map<int, MWMechanics::Stat<int> >::iterator it = attributes.begin();
 | 
			
		||||
                    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();
 | 
			
		||||
                for (std::map<ESM::Skill::SkillEnum, MWMechanics::Stat<float> >::iterator it = skills.begin();
 | 
			
		||||
                std::map<int, MWMechanics::Stat<float> > skills = mWM->getPlayerSkillValues();
 | 
			
		||||
                for (std::map<int, MWMechanics::Stat<float> >::iterator it = skills.begin();
 | 
			
		||||
                    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());
 | 
			
		||||
            }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
    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<ESM::Skill::SkillEnum> (parSkill), value);
 | 
			
		||||
    mCharGen->setValue(static_cast<ESM::Skill::SkillEnum> (parSkill), value);
 | 
			
		||||
    mPlayerSkillValues[parSkill] = value;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -800,12 +802,12 @@ MWGui::GuiMode WindowManager::getMode() const
 | 
			
		|||
    return mGuiModes.back();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
std::map<ESM::Skill::SkillEnum, MWMechanics::Stat<float> > WindowManager::getPlayerSkillValues()
 | 
			
		||||
std::map<int, MWMechanics::Stat<float> > WindowManager::getPlayerSkillValues()
 | 
			
		||||
{
 | 
			
		||||
    return mPlayerSkillValues;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
std::map<ESM::Attribute::AttributeID, MWMechanics::Stat<int> > WindowManager::getPlayerAttributeValues()
 | 
			
		||||
std::map<int, MWMechanics::Stat<int> > WindowManager::getPlayerAttributeValues()
 | 
			
		||||
{
 | 
			
		||||
    return mPlayerAttributes;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -131,7 +131,7 @@ namespace MWGui
 | 
			
		|||
 | 
			
		||||
    ///< Set value for the given ID.
 | 
			
		||||
    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 std::string& value);
 | 
			
		||||
    void setValue (const std::string& id, int value);
 | 
			
		||||
| 
						 | 
				
			
			@ -184,8 +184,8 @@ namespace MWGui
 | 
			
		|||
 | 
			
		||||
    void onFrame (float frameDuration);
 | 
			
		||||
 | 
			
		||||
    std::map<ESM::Skill::SkillEnum, MWMechanics::Stat<float> > getPlayerSkillValues();
 | 
			
		||||
    std::map<ESM::Attribute::AttributeID, MWMechanics::Stat<int> > getPlayerAttributeValues();
 | 
			
		||||
    std::map<int, MWMechanics::Stat<float> > getPlayerSkillValues();
 | 
			
		||||
    std::map<int, MWMechanics::Stat<int> > getPlayerAttributeValues();
 | 
			
		||||
    SkillList getPlayerMinorSkills();
 | 
			
		||||
    SkillList getPlayerMajorSkills();
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -233,9 +233,9 @@ namespace MWGui
 | 
			
		|||
    ESM::Class mPlayerClass;
 | 
			
		||||
    std::string mPlayerName;
 | 
			
		||||
    std::string mPlayerRaceId;
 | 
			
		||||
    std::map<ESM::Attribute::AttributeID, MWMechanics::Stat<int> > mPlayerAttributes;
 | 
			
		||||
    std::map<int, MWMechanics::Stat<int> > mPlayerAttributes;
 | 
			
		||||
    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;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue