diff --git a/apps/openmw/mwmechanics/mechanicsmanager.cpp b/apps/openmw/mwmechanics/mechanicsmanager.cpp index 75418ffbd7..b417b34b93 100644 --- a/apps/openmw/mwmechanics/mechanicsmanager.cpp +++ b/apps/openmw/mwmechanics/mechanicsmanager.cpp @@ -137,6 +137,9 @@ namespace MWMechanics MWMechanics::CreatureStats& stats = MWWorld::Class::get (mWatched).getCreatureStats (mWatched); + MWMechanics::NpcStats& npcStats = + MWWorld::Class::get (mWatched).getNpcStats (mWatched); + static const char *attributeNames[8] = { "AttribVal1", "AttribVal2", "AttribVal3", "AttribVal4", "AttribVal5", @@ -148,6 +151,17 @@ namespace MWMechanics "HBar", "MBar", "FBar" }; + static const char *skillNames[27] = + { + "SkillBlock", "SkillArmorer", "SkillMediumArmor", "SkillHeavyArmor", + "SkillBluntWeapon", "SkillLongBlade", "SkillAxe", "SkillSpear", + "SkillAthletics", "SkillEnchant", "SkillDestruction", "SkillAlteration", + "SkillIllusion", "SkillConjuration", "SkillMysticism", "SkillRestoration", + "SkillAlchemy", "SkillUnarmored", "SkillSecurity", "SkillSneak", + "SkillAcrobatics", "SkillLightArmor", "SkillShortBlade", "SkillMarksman", + "SkillMercantile", "SkillSpeechcraft", "SkillHandToHand", + }; + for (int i=0; i<8; ++i) { if (stats.mAttributes[i]!=mWatchedCreature.mAttributes[i]) @@ -168,6 +182,24 @@ namespace MWMechanics } } + bool update = false; + + for (int i=0; i<27; ++i) + { + if (npcStats.mSkill[i]!=mWatchedNpc.mSkill[i]) + { + update = true; + + mWatchedNpc.mSkill[i] = npcStats.mSkill[i]; + + mEnvironment.mWindowManager->setValue (skillNames[i], npcStats.mSkill[i]); + + } + } + + if (update) + mEnvironment.mWindowManager->updateSkillArea(); + mEnvironment.mWindowManager->setValue ("level", stats.mLevel); } @@ -181,6 +213,17 @@ namespace MWMechanics mEnvironment.mWindowManager->setValue ("class", mEnvironment.mWorld->getPlayerPos().getClass().name); mUpdatePlayer = false; + + MWGui::WindowManager::SkillList majorSkills (5); + MWGui::WindowManager::SkillList minorSkills (5); + + for (int i=0; i<5; ++i) + { + minorSkills[i] = mEnvironment.mWorld->getPlayerPos().getClass().data.skills[i][0]; + majorSkills[i] = mEnvironment.mWorld->getPlayerPos().getClass().data.skills[i][1]; + } + + mEnvironment.mWindowManager->configureSkills (majorSkills, minorSkills); } } diff --git a/apps/openmw/mwmechanics/mechanicsmanager.hpp b/apps/openmw/mwmechanics/mechanicsmanager.hpp index 96ba00dd67..96c3188bda 100644 --- a/apps/openmw/mwmechanics/mechanicsmanager.hpp +++ b/apps/openmw/mwmechanics/mechanicsmanager.hpp @@ -6,6 +6,7 @@ #include "../mwworld/ptr.hpp" #include "creaturestats.hpp" +#include "npcstats.hpp" namespace MWWorld { @@ -20,6 +21,7 @@ namespace MWMechanics std::set mActors; MWWorld::Ptr mWatched; CreatureStats mWatchedCreature; + NpcStats mWatchedNpc; bool mUpdatePlayer; void buildPlayer();