From 6546c05428bb4820a337b079aa728b62adaaab5e Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 6 Jan 2016 12:46:06 +0100 Subject: [PATCH 01/26] Move Fallback map to components/ --- apps/openmw/main.cpp | 34 +------------ apps/openmw/mwbase/world.hpp | 8 +++- apps/openmw/mwgui/charactercreation.cpp | 5 +- apps/openmw/mwgui/levelupdialog.cpp | 3 +- apps/openmw/mwrender/animation.cpp | 5 +- apps/openmw/mwrender/renderingmanager.cpp | 4 +- apps/openmw/mwrender/renderingmanager.hpp | 6 +-- apps/openmw/mwrender/ripplesimulation.cpp | 7 ++- apps/openmw/mwrender/ripplesimulation.hpp | 6 +-- apps/openmw/mwrender/sky.cpp | 7 ++- apps/openmw/mwrender/water.cpp | 5 +- apps/openmw/mwrender/water.hpp | 10 ++-- apps/openmw/mwworld/weather.cpp | 10 ++-- apps/openmw/mwworld/weather.hpp | 14 ++++-- apps/openmw/mwworld/worldimp.cpp | 2 +- apps/openmw/mwworld/worldimp.hpp | 15 +++--- components/CMakeLists.txt | 4 ++ .../fallback}/fallback.cpp | 14 +++--- .../fallback}/fallback.hpp | 11 +++-- components/fallback/validate.hpp | 48 +++++++++++++++++++ 20 files changed, 127 insertions(+), 91 deletions(-) rename {apps/openmw/mwworld => components/fallback}/fallback.cpp (75%) rename {apps/openmw/mwworld => components/fallback}/fallback.hpp (67%) create mode 100644 components/fallback/validate.hpp diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp index c3f0f8688..a4bf1fe5b 100644 --- a/apps/openmw/main.cpp +++ b/apps/openmw/main.cpp @@ -3,6 +3,7 @@ #include #include +#include #include #include @@ -52,39 +53,8 @@ inline boost::filesystem::path lexical_cast mMap; -}; - -void validate(boost::any &v, std::vector const &tokens, FallbackMap*, int) -{ - if(v.empty()) - { - v = boost::any(FallbackMap()); - } - - FallbackMap *map = boost::any_cast(&v); - - for(std::vector::const_iterator it=tokens.begin(); it != tokens.end(); ++it) - { - int sep = it->find(","); - if(sep < 1 || sep == (int)it->length()-1) -#if (BOOST_VERSION < 104200) - throw boost::program_options::validation_error("invalid value"); -#else - throw boost::program_options::validation_error(boost::program_options::validation_error::invalid_option_value); -#endif - - std::string key(it->substr(0,sep)); - std::string value(it->substr(sep+1)); - - if(map->mMap.find(key) == map->mMap.end()) - { - map->mMap.insert(std::make_pair (key,value)); - } - } -} +using namespace Fallback; /** * \brief Parses application command line and calls \ref Cfg::ConfigurationManager diff --git a/apps/openmw/mwbase/world.hpp b/apps/openmw/mwbase/world.hpp index ebce2e1bf..801016e06 100644 --- a/apps/openmw/mwbase/world.hpp +++ b/apps/openmw/mwbase/world.hpp @@ -56,7 +56,6 @@ namespace MWMechanics namespace MWWorld { - class Fallback; class CellStore; class Player; class LocalScripts; @@ -67,6 +66,11 @@ namespace MWWorld typedef std::vector > PtrMovementList; } +namespace Fallback +{ + class Map; +} + namespace MWBase { /// \brief Interface for the World (implemented in MWWorld) @@ -119,7 +123,7 @@ namespace MWBase virtual void adjustSky() = 0; - virtual const MWWorld::Fallback *getFallback () const = 0; + virtual const Fallback::Map *getFallback () const = 0; virtual MWWorld::Player& getPlayer() = 0; virtual MWWorld::Ptr getPlayerPtr() = 0; diff --git a/apps/openmw/mwgui/charactercreation.cpp b/apps/openmw/mwgui/charactercreation.cpp index d2ce35509..8c2ec6881 100644 --- a/apps/openmw/mwgui/charactercreation.cpp +++ b/apps/openmw/mwgui/charactercreation.cpp @@ -1,5 +1,7 @@ #include "charactercreation.hpp" +#include + #include "../mwbase/environment.hpp" #include "../mwbase/soundmanager.hpp" #include "../mwbase/mechanicsmanager.hpp" @@ -10,7 +12,6 @@ #include "../mwmechanics/actorutil.hpp" #include "../mwworld/class.hpp" -#include "../mwworld/fallback.hpp" #include "../mwworld/esmstore.hpp" #include "textinput.hpp" @@ -32,7 +33,7 @@ namespace const ESM::Class::Specialization mSpecializations[3]={ESM::Class::Combat, ESM::Class::Magic, ESM::Class::Stealth}; // The specialization for each answer Step sGenerateClassSteps(int number) { number++; - const MWWorld::Fallback* fallback=MWBase::Environment::get().getWorld()->getFallback(); + const Fallback::Map* fallback=MWBase::Environment::get().getWorld()->getFallback(); Step step = {fallback->getFallbackString("Question_"+MyGUI::utility::toString(number)+"_Question"), {fallback->getFallbackString("Question_"+MyGUI::utility::toString(number)+"_AnswerOne"), fallback->getFallbackString("Question_"+MyGUI::utility::toString(number)+"_AnswerTwo"), diff --git a/apps/openmw/mwgui/levelupdialog.cpp b/apps/openmw/mwgui/levelupdialog.cpp index c832a7879..4e8d0a02c 100644 --- a/apps/openmw/mwgui/levelupdialog.cpp +++ b/apps/openmw/mwgui/levelupdialog.cpp @@ -4,13 +4,14 @@ #include #include +#include + #include "../mwbase/windowmanager.hpp" #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" #include "../mwbase/soundmanager.hpp" #include "../mwworld/class.hpp" -#include "../mwworld/fallback.hpp" #include "../mwworld/esmstore.hpp" #include "../mwworld/cellstore.hpp" diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index 68a073731..c2fc82881 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -35,11 +35,12 @@ #include #include +#include + #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" #include "../mwworld/esmstore.hpp" #include "../mwworld/class.hpp" -#include "../mwworld/fallback.hpp" #include "../mwworld/cellstore.hpp" #include "../mwmechanics/character.hpp" // FIXME: for MWMechanics::Priority @@ -1113,7 +1114,7 @@ namespace MWRender osg::ref_ptr light (new osg::Light); lightSource->setNodeMask(Mask_Lighting); - const MWWorld::Fallback* fallback = MWBase::Environment::get().getWorld()->getFallback(); + const Fallback::Map* fallback = MWBase::Environment::get().getWorld()->getFallback(); float radius = esmLight->mData.mRadius; lightSource->setRadius(radius); diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index ee9d93c0f..61ce626fd 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -30,8 +30,8 @@ #include #include +#include -#include "../mwworld/fallback.hpp" #include "../mwworld/cellstore.hpp" #include "sky.hpp" @@ -126,7 +126,7 @@ namespace MWRender }; RenderingManager::RenderingManager(osgViewer::Viewer* viewer, osg::ref_ptr rootNode, Resource::ResourceSystem* resourceSystem, - const MWWorld::Fallback* fallback, const std::string& resourcePath) + const Fallback::Map* fallback, const std::string& resourcePath) : mViewer(viewer) , mRootNode(rootNode) , mResourceSystem(resourceSystem) diff --git a/apps/openmw/mwrender/renderingmanager.hpp b/apps/openmw/mwrender/renderingmanager.hpp index 58012078c..3b583af89 100644 --- a/apps/openmw/mwrender/renderingmanager.hpp +++ b/apps/openmw/mwrender/renderingmanager.hpp @@ -37,9 +37,9 @@ namespace Terrain class World; } -namespace MWWorld +namespace Fallback { - class Fallback; + class Map; } namespace MWRender @@ -58,7 +58,7 @@ namespace MWRender { public: RenderingManager(osgViewer::Viewer* viewer, osg::ref_ptr rootNode, Resource::ResourceSystem* resourceSystem, - const MWWorld::Fallback* fallback, const std::string& resourcePath); + const Fallback::Map* fallback, const std::string& resourcePath); ~RenderingManager(); MWRender::Objects& getObjects(); diff --git a/apps/openmw/mwrender/ripplesimulation.cpp b/apps/openmw/mwrender/ripplesimulation.cpp index f232ea475..f74631c4a 100644 --- a/apps/openmw/mwrender/ripplesimulation.cpp +++ b/apps/openmw/mwrender/ripplesimulation.cpp @@ -15,19 +15,18 @@ #include #include #include +#include #include "vismask.hpp" #include "../mwbase/world.hpp" #include "../mwbase/environment.hpp" -#include "../mwworld/fallback.hpp" - #include "../mwmechanics/actorutil.hpp" namespace { - void createWaterRippleStateSet(Resource::ResourceSystem* resourceSystem, const MWWorld::Fallback* fallback, osg::Node* node) + void createWaterRippleStateSet(Resource::ResourceSystem* resourceSystem, const Fallback::Map* fallback, osg::Node* node) { int rippleFrameCount = fallback->getFallbackInt("Water_RippleFrameCount"); if (rippleFrameCount <= 0) @@ -78,7 +77,7 @@ namespace namespace MWRender { -RippleSimulation::RippleSimulation(osg::Group *parent, Resource::ResourceSystem* resourceSystem, const MWWorld::Fallback* fallback) +RippleSimulation::RippleSimulation(osg::Group *parent, Resource::ResourceSystem* resourceSystem, const Fallback::Map* fallback) : mParent(parent) { osg::ref_ptr geode (new osg::Geode); diff --git a/apps/openmw/mwrender/ripplesimulation.hpp b/apps/openmw/mwrender/ripplesimulation.hpp index a4e12f275..bca81c59b 100644 --- a/apps/openmw/mwrender/ripplesimulation.hpp +++ b/apps/openmw/mwrender/ripplesimulation.hpp @@ -21,9 +21,9 @@ namespace Resource class ResourceSystem; } -namespace MWWorld +namespace Fallback { - class Fallback; + class Map; } namespace MWRender @@ -40,7 +40,7 @@ namespace MWRender class RippleSimulation { public: - RippleSimulation(osg::Group* parent, Resource::ResourceSystem* resourceSystem, const MWWorld::Fallback* fallback); + RippleSimulation(osg::Group* parent, Resource::ResourceSystem* resourceSystem, const Fallback::Map* fallback); ~RippleSimulation(); /// @param dt Time since the last frame diff --git a/apps/openmw/mwrender/sky.cpp b/apps/openmw/mwrender/sky.cpp index 635116db0..efe797336 100644 --- a/apps/openmw/mwrender/sky.cpp +++ b/apps/openmw/mwrender/sky.cpp @@ -33,6 +33,7 @@ #include #include +#include #include #include @@ -42,8 +43,6 @@ #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" -#include "../mwworld/fallback.hpp" - #include "vismask.hpp" #include "renderbin.hpp" @@ -827,7 +826,7 @@ private: , mTimeOfDayFade(1.f) , mGlareView(1.f) { - const MWWorld::Fallback* fallback = MWBase::Environment::get().getWorld()->getFallback(); + const Fallback::Map* fallback = MWBase::Environment::get().getWorld()->getFallback(); mColor = fallback->getFallbackColour("Weather_Sun_Glare_Fader_Color"); mSunGlareFaderMax = fallback->getFallbackFloat("Weather_Sun_Glare_Fader_Max"); mSunGlareFaderAngleMax = fallback->getFallbackFloat("Weather_Sun_Glare_Fader_Angle_Max"); @@ -1161,7 +1160,7 @@ void SkyManager::create() mSun.reset(new Sun(mEarlyRenderBinRoot, *mSceneManager->getTextureManager())); - const MWWorld::Fallback* fallback=MWBase::Environment::get().getWorld()->getFallback(); + const Fallback::Map* fallback=MWBase::Environment::get().getWorld()->getFallback(); mMasser.reset(new Moon(mEarlyRenderBinRoot, *mSceneManager->getTextureManager(), fallback->getFallbackFloat("Moons_Masser_Size")/125, Moon::Type_Masser)); mSecunda.reset(new Moon(mEarlyRenderBinRoot, *mSceneManager->getTextureManager(), fallback->getFallbackFloat("Moons_Secunda_Size")/125, Moon::Type_Secunda)); diff --git a/apps/openmw/mwrender/water.cpp b/apps/openmw/mwrender/water.cpp index cd1f4c511..1b19246f5 100644 --- a/apps/openmw/mwrender/water.cpp +++ b/apps/openmw/mwrender/water.cpp @@ -34,8 +34,9 @@ #include +#include + #include "../mwworld/cellstore.hpp" -#include "../mwworld/fallback.hpp" #include "vismask.hpp" #include "ripplesimulation.hpp" @@ -457,7 +458,7 @@ public: }; Water::Water(osg::Group *parent, osg::Group* sceneRoot, Resource::ResourceSystem *resourceSystem, osgUtil::IncrementalCompileOperation *ico, - const MWWorld::Fallback* fallback, const std::string& resourcePath) + const Fallback::Map* fallback, const std::string& resourcePath) : mParent(parent) , mSceneRoot(sceneRoot) , mResourceSystem(resourceSystem) diff --git a/apps/openmw/mwrender/water.hpp b/apps/openmw/mwrender/water.hpp index b26782873..b02ee392c 100644 --- a/apps/openmw/mwrender/water.hpp +++ b/apps/openmw/mwrender/water.hpp @@ -28,11 +28,15 @@ namespace Resource namespace MWWorld { - class Fallback; class CellStore; class Ptr; } +namespace Fallback +{ + class Map; +} + namespace MWRender { @@ -50,7 +54,7 @@ namespace MWRender osg::ref_ptr mWaterNode; osg::ref_ptr mWaterGeode; Resource::ResourceSystem* mResourceSystem; - const MWWorld::Fallback* mFallback; + const Fallback::Map* mFallback; osg::ref_ptr mIncrementalCompileOperation; std::auto_ptr mSimulation; @@ -77,7 +81,7 @@ namespace MWRender public: Water(osg::Group* parent, osg::Group* sceneRoot, - Resource::ResourceSystem* resourceSystem, osgUtil::IncrementalCompileOperation* ico, const MWWorld::Fallback* fallback, + Resource::ResourceSystem* resourceSystem, osgUtil::IncrementalCompileOperation* ico, const Fallback::Map* fallback, const std::string& resourcePath); ~Water(); diff --git a/apps/openmw/mwworld/weather.cpp b/apps/openmw/mwworld/weather.cpp index 5ce3d5c2f..c40913ff1 100644 --- a/apps/openmw/mwworld/weather.cpp +++ b/apps/openmw/mwworld/weather.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" @@ -20,7 +21,6 @@ #include "player.hpp" #include "esmstore.hpp" -#include "fallback.hpp" #include "cellstore.hpp" #include @@ -100,7 +100,7 @@ template class TimeOfDayInterpolator; template class TimeOfDayInterpolator; Weather::Weather(const std::string& name, - const MWWorld::Fallback& fallback, + const Fallback::Map& fallback, float stormWindSpeed, float rainSpeed, const std::string& particleEffect) @@ -327,7 +327,7 @@ void RegionWeather::chooseNewWeather() mWeather = i; } -MoonModel::MoonModel(const std::string& name, const MWWorld::Fallback& fallback) +MoonModel::MoonModel(const std::string& name, const Fallback::Map& fallback) : mFadeInStart(fallback.getFallbackFloat("Moons_" + name + "_Fade_In_Start")) , mFadeInFinish(fallback.getFallbackFloat("Moons_" + name + "_Fade_In_Finish")) , mFadeOutStart(fallback.getFallbackFloat("Moons_" + name + "_Fade_Out_Start")) @@ -496,7 +496,7 @@ inline float MoonModel::earlyMoonShadowAlpha(float angle) const return 0.0f; } -WeatherManager::WeatherManager(MWRender::RenderingManager& rendering, const MWWorld::Fallback& fallback, MWWorld::ESMStore& store) +WeatherManager::WeatherManager(MWRender::RenderingManager& rendering, const Fallback::Map& fallback, MWWorld::ESMStore& store) : mStore(store) , mRendering(rendering) , mSunriseTime(fallback.getFallbackFloat("Weather_Sunrise_Time")) @@ -862,7 +862,7 @@ void WeatherManager::clear() } inline void WeatherManager::addWeather(const std::string& name, - const MWWorld::Fallback& fallback, + const Fallback::Map& fallback, const std::string& particleEffect) { static const float fStromWindSpeed = mStore.get().find("fStromWindSpeed")->getFloat(); diff --git a/apps/openmw/mwworld/weather.hpp b/apps/openmw/mwworld/weather.hpp index a5627a507..044200757 100644 --- a/apps/openmw/mwworld/weather.hpp +++ b/apps/openmw/mwworld/weather.hpp @@ -29,9 +29,13 @@ namespace Loading class Listener; } +namespace Fallback +{ + class Map; +} + namespace MWWorld { - class Fallback; class TimeStamp; @@ -66,7 +70,7 @@ namespace MWWorld { public: Weather(const std::string& name, - const MWWorld::Fallback& fallback, + const Fallback::Map& fallback, float stormWindSpeed, float rainSpeed, const std::string& particleEffect); @@ -172,7 +176,7 @@ namespace MWWorld class MoonModel { public: - MoonModel(const std::string& name, const MWWorld::Fallback& fallback); + MoonModel(const std::string& name, const Fallback::Map& fallback); MWRender::MoonState calculateState(const TimeStamp& gameTime) const; @@ -203,7 +207,7 @@ namespace MWWorld public: // Have to pass fallback and Store, can't use singleton since World isn't fully constructed yet at the time WeatherManager(MWRender::RenderingManager& rendering, - const MWWorld::Fallback& fallback, + const Fallback::Map& fallback, MWWorld::ESMStore& store); ~WeatherManager(); @@ -288,7 +292,7 @@ namespace MWWorld std::string mPlayingSoundID; void addWeather(const std::string& name, - const MWWorld::Fallback& fallback, + const Fallback::Map& fallback, const std::string& particleEffect = ""); void importRegions(); diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 15826009d..789b1b64f 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -511,7 +511,7 @@ namespace MWWorld return 0; } - const MWWorld::Fallback *World::getFallback() const + const Fallback::Map *World::getFallback() const { return &mFallback; } diff --git a/apps/openmw/mwworld/worldimp.hpp b/apps/openmw/mwworld/worldimp.hpp index 4ed97759e..53d640871 100644 --- a/apps/openmw/mwworld/worldimp.hpp +++ b/apps/openmw/mwworld/worldimp.hpp @@ -5,21 +5,20 @@ #include +#include +#include + +#include "../mwbase/world.hpp" + #include "ptr.hpp" #include "scene.hpp" #include "esmstore.hpp" #include "cells.hpp" #include "localscripts.hpp" #include "timestamp.hpp" -#include "fallback.hpp" #include "globals.hpp" - -#include "../mwbase/world.hpp" - #include "contentloader.hpp" -#include - namespace osg { class Group; @@ -71,7 +70,7 @@ namespace MWWorld { Resource::ResourceSystem* mResourceSystem; - MWWorld::Fallback mFallback; + Fallback::Map mFallback; MWRender::RenderingManager* mRendering; MWWorld::WeatherManager* mWeatherManager; @@ -210,7 +209,7 @@ namespace MWWorld virtual void adjustSky(); - virtual const Fallback *getFallback() const; + virtual const Fallback::Map *getFallback() const; virtual Player& getPlayer(); virtual MWWorld::Ptr getPlayerPtr(); diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index bbbff234c..af26fc998 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -138,6 +138,10 @@ add_component_dir (version version ) +add_component_dir (fallback + fallback validate + ) + set (ESM_UI ${CMAKE_SOURCE_DIR}/files/ui/contentselector.ui ) diff --git a/apps/openmw/mwworld/fallback.cpp b/components/fallback/fallback.cpp similarity index 75% rename from apps/openmw/mwworld/fallback.cpp rename to components/fallback/fallback.cpp index e810f8241..354595660 100644 --- a/apps/openmw/mwworld/fallback.cpp +++ b/components/fallback/fallback.cpp @@ -2,12 +2,12 @@ #include -namespace MWWorld +namespace Fallback { - Fallback::Fallback(const std::map& fallback):mFallbackMap(fallback) + Map::Map(const std::map& fallback):mFallbackMap(fallback) {} - std::string Fallback::getFallbackString(const std::string& fall) const + std::string Map::getFallbackString(const std::string& fall) const { std::map::const_iterator it; if((it = mFallbackMap.find(fall)) == mFallbackMap.end()) @@ -16,7 +16,7 @@ namespace MWWorld } return it->second; } - float Fallback::getFallbackFloat(const std::string& fall) const + float Map::getFallbackFloat(const std::string& fall) const { std::string fallback=getFallbackString(fall); if(fallback.empty()) @@ -24,7 +24,7 @@ namespace MWWorld else return boost::lexical_cast(fallback); } - int Fallback::getFallbackInt(const std::string& fall) const + int Map::getFallbackInt(const std::string& fall) const { std::string fallback=getFallbackString(fall); if(fallback.empty()) @@ -33,7 +33,7 @@ namespace MWWorld return boost::lexical_cast(fallback); } - bool Fallback::getFallbackBool(const std::string& fall) const + bool Map::getFallbackBool(const std::string& fall) const { std::string fallback=getFallbackString(fall); if(fallback.empty()) @@ -41,7 +41,7 @@ namespace MWWorld else return boost::lexical_cast(fallback); } - osg::Vec4f Fallback::getFallbackColour(const std::string& fall) const + osg::Vec4f Map::getFallbackColour(const std::string& fall) const { std::string sum=getFallbackString(fall); if(sum.empty()) diff --git a/apps/openmw/mwworld/fallback.hpp b/components/fallback/fallback.hpp similarity index 67% rename from apps/openmw/mwworld/fallback.hpp rename to components/fallback/fallback.hpp index af47063ee..b44483fbc 100644 --- a/apps/openmw/mwworld/fallback.hpp +++ b/components/fallback/fallback.hpp @@ -1,18 +1,19 @@ -#ifndef GAME_MWWORLD_FALLBACK_H -#define GAME_MWWORLD_FALLBACK_H +#ifndef OPENMW_COMPONENTS_FALLBACK_H +#define OPENMW_COMPONENTS_FALLBACK_H #include #include #include -namespace MWWorld +namespace Fallback { - class Fallback + /// @brief contains settings imported from the Morrowind INI file. + class Map { const std::map mFallbackMap; public: - Fallback(const std::map& fallback); + Map(const std::map& fallback); std::string getFallbackString(const std::string& fall) const; float getFallbackFloat(const std::string& fall) const; int getFallbackInt(const std::string& fall) const; diff --git a/components/fallback/validate.hpp b/components/fallback/validate.hpp new file mode 100644 index 000000000..3b6398d6a --- /dev/null +++ b/components/fallback/validate.hpp @@ -0,0 +1,48 @@ +#ifndef OPENMW_COMPONENTS_FALLBACK_VALIDATE_H +#define OPENMW_COMPONENTS_FALLBACK_VALIDATE_H + +#include + +// Parses and validates a fallback map from boost program_options. +// Note: for boost to pick up the validate function, you need to pull in the namespace e.g. +// by using namespace Fallback; + +namespace Fallback +{ + + struct FallbackMap { + std::map mMap; + }; + + void validate(boost::any &v, std::vector const &tokens, FallbackMap*, int) + { + if(v.empty()) + { + v = boost::any(FallbackMap()); + } + + FallbackMap *map = boost::any_cast(&v); + + for(std::vector::const_iterator it=tokens.begin(); it != tokens.end(); ++it) + { + int sep = it->find(","); + if(sep < 1 || sep == (int)it->length()-1) + #if (BOOST_VERSION < 104200) + throw boost::program_options::validation_error("invalid value"); + #else + throw boost::program_options::validation_error(boost::program_options::validation_error::invalid_option_value); + #endif + + std::string key(it->substr(0,sep)); + std::string value(it->substr(sep+1)); + + if(map->mMap.find(key) == map->mMap.end()) + { + map->mMap.insert(std::make_pair (key,value)); + } + } + } + +} + +#endif From 11496b8075afeee21c93d0837f71ccec47c6d08f Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 6 Jan 2016 12:58:36 +0100 Subject: [PATCH 02/26] Read fallback settings in OpenCS --- apps/opencs/editor.cpp | 8 ++++++++ apps/opencs/model/doc/document.cpp | 3 ++- apps/opencs/model/doc/document.hpp | 8 +++++++- apps/opencs/model/doc/documentmanager.cpp | 7 ++++++- apps/opencs/model/doc/documentmanager.hpp | 4 ++++ components/fallback/fallback.hpp | 4 +++- 6 files changed, 30 insertions(+), 4 deletions(-) diff --git a/apps/opencs/editor.cpp b/apps/opencs/editor.cpp index 92f1082b7..54e323956 100644 --- a/apps/opencs/editor.cpp +++ b/apps/opencs/editor.cpp @@ -8,6 +8,8 @@ #include #include +#include + #include #include "model/doc/document.hpp" @@ -17,6 +19,8 @@ #include #endif +using namespace Fallback; + CS::Editor::Editor () : mSettingsState (mCfgMgr), mDocumentManager (mCfgMgr), mViewManager (mDocumentManager), mPid(""), @@ -100,6 +104,8 @@ std::pair > CS::Editor::readConfi ("resources", boost::program_options::value()->default_value("resources")) ("fallback-archive", boost::program_options::value >()-> default_value(std::vector(), "fallback-archive")->multitoken()) + ("fallback", boost::program_options::value()->default_value(FallbackMap(), "") + ->multitoken()->composing(), "fallback values") ("script-blacklist", boost::program_options::value >()->default_value(std::vector(), "") ->multitoken(), "exclude specified script from the verifier (if the use of the blacklist is enabled)") ("script-blacklist-use", boost::program_options::value()->implicit_value(true) @@ -114,6 +120,8 @@ std::pair > CS::Editor::readConfi mDocumentManager.setResourceDir (mResources = variables["resources"].as()); + mDocumentManager.setFallbackMap (variables["fallback"].as().mMap); + if (variables["script-blacklist-use"].as()) mDocumentManager.setBlacklistedScripts ( variables["script-blacklist"].as >()); diff --git a/apps/opencs/model/doc/document.cpp b/apps/opencs/model/doc/document.cpp index 8cafa7ae1..59d66f36c 100644 --- a/apps/opencs/model/doc/document.cpp +++ b/apps/opencs/model/doc/document.cpp @@ -2247,6 +2247,7 @@ void CSMDoc::Document::createBase() CSMDoc::Document::Document (const VFS::Manager* vfs, const Files::ConfigurationManager& configuration, const std::vector< boost::filesystem::path >& files, bool new_, const boost::filesystem::path& savePath, const boost::filesystem::path& resDir, + const Fallback::Map* fallback, ToUTF8::FromType encoding, const CSMWorld::ResourcesManager& resourcesManager, const std::vector& blacklistedScripts) : mVFS(vfs), mSavePath (savePath), mContentFiles (files), mNew (new_), mData (encoding, resourcesManager), @@ -2255,7 +2256,7 @@ CSMDoc::Document::Document (const VFS::Manager* vfs, const Files::ConfigurationM (savePath.filename().string() + ".project")), mSavingOperation (*this, mProjectPath, encoding), mSaving (&mSavingOperation), - mResDir(resDir), + mResDir(resDir), mFallbackMap(fallback), mRunner (mProjectPath), mDirty (false), mIdCompletionManager(mData) { if (mContentFiles.empty()) diff --git a/apps/opencs/model/doc/document.hpp b/apps/opencs/model/doc/document.hpp index 0e8ae6d45..41640f66d 100644 --- a/apps/opencs/model/doc/document.hpp +++ b/apps/opencs/model/doc/document.hpp @@ -25,9 +25,13 @@ class QAbstractItemModel; -namespace VFS +namespace Fallback { + class Map; +} +namespace VFS +{ class Manager; } @@ -66,6 +70,7 @@ namespace CSMDoc Saving mSavingOperation; OperationHolder mSaving; boost::filesystem::path mResDir; + const Fallback::Map* mFallbackMap; Blacklist mBlacklist; Runner mRunner; bool mDirty; @@ -101,6 +106,7 @@ namespace CSMDoc Document (const VFS::Manager* vfs, const Files::ConfigurationManager& configuration, const std::vector< boost::filesystem::path >& files, bool new_, const boost::filesystem::path& savePath, const boost::filesystem::path& resDir, + const Fallback::Map* fallback, ToUTF8::FromType encoding, const CSMWorld::ResourcesManager& resourcesManager, const std::vector& blacklistedScripts); diff --git a/apps/opencs/model/doc/documentmanager.cpp b/apps/opencs/model/doc/documentmanager.cpp index 407a608ca..cbb255ebb 100644 --- a/apps/opencs/model/doc/documentmanager.cpp +++ b/apps/opencs/model/doc/documentmanager.cpp @@ -64,7 +64,7 @@ CSMDoc::Document *CSMDoc::DocumentManager::makeDocument ( const std::vector< boost::filesystem::path >& files, const boost::filesystem::path& savePath, bool new_) { - return new Document (mVFS, mConfiguration, files, new_, savePath, mResDir, mEncoding, mResourcesManager, mBlacklistedScripts); + return new Document (mVFS, mConfiguration, files, new_, savePath, mResDir, &mFallbackMap, mEncoding, mResourcesManager, mBlacklistedScripts); } void CSMDoc::DocumentManager::insertDocument (CSMDoc::Document *document) @@ -100,6 +100,11 @@ void CSMDoc::DocumentManager::setResourceDir (const boost::filesystem::path& par mResDir = boost::filesystem::system_complete(parResDir); } +void CSMDoc::DocumentManager::setFallbackMap(const std::map& fallbackMap) +{ + mFallbackMap = Fallback::Map(fallbackMap); +} + void CSMDoc::DocumentManager::setEncoding (ToUTF8::FromType encoding) { mEncoding = encoding; diff --git a/apps/opencs/model/doc/documentmanager.hpp b/apps/opencs/model/doc/documentmanager.hpp index 4f6b2b2c9..ed8e327d7 100644 --- a/apps/opencs/model/doc/documentmanager.hpp +++ b/apps/opencs/model/doc/documentmanager.hpp @@ -10,6 +10,7 @@ #include #include +#include #include "../world/resourcesmanager.hpp" @@ -67,6 +68,8 @@ namespace CSMDoc void setResourceDir (const boost::filesystem::path& parResDir); + void setFallbackMap (const std::map& fallbackMap); + void setEncoding (ToUTF8::FromType encoding); void setBlacklistedScripts (const std::vector& scriptIds); @@ -78,6 +81,7 @@ namespace CSMDoc private: boost::filesystem::path mResDir; + Fallback::Map mFallbackMap; private slots: diff --git a/components/fallback/fallback.hpp b/components/fallback/fallback.hpp index b44483fbc..e64936531 100644 --- a/components/fallback/fallback.hpp +++ b/components/fallback/fallback.hpp @@ -11,9 +11,11 @@ namespace Fallback /// @brief contains settings imported from the Morrowind INI file. class Map { - const std::map mFallbackMap; + std::map mFallbackMap; public: Map(const std::map& fallback); + Map() {} + std::string getFallbackString(const std::string& fall) const; float getFallbackFloat(const std::string& fall) const; int getFallbackInt(const std::string& fall) const; From fb849014bd2c413fe8bb9114ab99f5e31ada73b7 Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 6 Jan 2016 13:09:53 +0100 Subject: [PATCH 03/26] Pass the fallback map to CSMWorld::Data --- apps/opencs/model/doc/document.cpp | 2 +- apps/opencs/model/world/data.cpp | 10 ++++++++-- apps/opencs/model/world/data.hpp | 10 +++++++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/apps/opencs/model/doc/document.cpp b/apps/opencs/model/doc/document.cpp index 59d66f36c..80c14bd98 100644 --- a/apps/opencs/model/doc/document.cpp +++ b/apps/opencs/model/doc/document.cpp @@ -2250,7 +2250,7 @@ CSMDoc::Document::Document (const VFS::Manager* vfs, const Files::ConfigurationM const Fallback::Map* fallback, ToUTF8::FromType encoding, const CSMWorld::ResourcesManager& resourcesManager, const std::vector& blacklistedScripts) -: mVFS(vfs), mSavePath (savePath), mContentFiles (files), mNew (new_), mData (encoding, resourcesManager), +: mVFS(vfs), mSavePath (savePath), mContentFiles (files), mNew (new_), mData (encoding, resourcesManager, fallback), mTools (*this, encoding), mProjectPath ((configuration.getUserDataPath() / "projects") / (savePath.filename().string() + ".project")), diff --git a/apps/opencs/model/world/data.cpp b/apps/opencs/model/world/data.cpp index 1f98b2475..6eccb7483 100644 --- a/apps/opencs/model/world/data.cpp +++ b/apps/opencs/model/world/data.cpp @@ -59,9 +59,10 @@ int CSMWorld::Data::count (RecordBase::State state, const CollectionBase& collec return number; } -CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourcesManager) +CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourcesManager, const Fallback::Map* fallback) : mEncoder (encoding), mPathgrids (mCells), mRefs (mCells), - mResourcesManager (resourcesManager), mReader (0), mDialogue (0), mReaderIndex(0), mResourceSystem(new Resource::ResourceSystem(resourcesManager.getVFS())) + mResourcesManager (resourcesManager), mFallbackMap(fallback), + mReader (0), mDialogue (0), mReaderIndex(0), mResourceSystem(new Resource::ResourceSystem(resourcesManager.getVFS())) { int index = 0; @@ -1201,3 +1202,8 @@ const VFS::Manager* CSMWorld::Data::getVFS() const { return mResourcesManager.getVFS(); } + +const Fallback::Map* CSMWorld::Data::getFallbackMap() const +{ + return mFallbackMap; +} diff --git a/apps/opencs/model/world/data.hpp b/apps/opencs/model/world/data.hpp index c6623279a..e5b8229c4 100644 --- a/apps/opencs/model/world/data.hpp +++ b/apps/opencs/model/world/data.hpp @@ -58,6 +58,11 @@ namespace VFS class Manager; } +namespace Fallback +{ + class Map; +} + namespace ESM { class ESMReader; @@ -104,6 +109,7 @@ namespace CSMWorld IdCollection mFilters; Collection mMetaData; const ResourcesManager& mResourcesManager; + const Fallback::Map* mFallbackMap; std::vector mModels; std::map mModelIndex; ESM::ESMReader *mReader; @@ -132,12 +138,14 @@ namespace CSMWorld public: - Data (ToUTF8::FromType encoding, const ResourcesManager& resourcesManager); + Data (ToUTF8::FromType encoding, const ResourcesManager& resourcesManager, const Fallback::Map* fallback); virtual ~Data(); const VFS::Manager* getVFS() const; + const Fallback::Map* getFallbackMap() const; + boost::shared_ptr getResourceSystem(); boost::shared_ptr getResourceSystem() const; From 438b30d6f0a1d6726a80df7ef24e49fd5623c85a Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 6 Jan 2016 13:19:15 +0100 Subject: [PATCH 04/26] Move configureLight to a separate file --- apps/openmw/mwrender/animation.cpp | 3 ++- components/CMakeLists.txt | 3 ++- components/sceneutil/lightmanager.cpp | 24 -------------------- components/sceneutil/lightmanager.hpp | 4 ---- components/sceneutil/lightutil.cpp | 32 +++++++++++++++++++++++++++ components/sceneutil/lightutil.hpp | 19 ++++++++++++++++ 6 files changed, 55 insertions(+), 30 deletions(-) create mode 100644 components/sceneutil/lightutil.cpp create mode 100644 components/sceneutil/lightutil.hpp diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index c2fc82881..6300d28cf 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -30,8 +30,9 @@ #include #include #include -#include +#include #include +#include #include #include diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index af26fc998..089779eda 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -45,7 +45,8 @@ add_component_dir (resource ) add_component_dir (sceneutil - clone attach lightmanager visitor util statesetupdater controller skeleton riggeometry lightcontroller positionattitudetransform + clone attach visitor util statesetupdater controller skeleton riggeometry lightcontroller + lightmanager lightutil positionattitudetransform # not used yet #workqueue ) diff --git a/components/sceneutil/lightmanager.cpp b/components/sceneutil/lightmanager.cpp index 1706bb2b1..f9182c1d2 100644 --- a/components/sceneutil/lightmanager.cpp +++ b/components/sceneutil/lightmanager.cpp @@ -371,28 +371,4 @@ namespace SceneUtil traverse(node, nv); } - void configureLight(osg::Light *light, float radius, bool isExterior, bool outQuadInLin, bool useQuadratic, - float quadraticValue, float quadraticRadiusMult, bool useLinear, float linearRadiusMult, float linearValue) - { - bool quadratic = useQuadratic && (!outQuadInLin || isExterior); - - float quadraticAttenuation = 0; - float linearAttenuation = 0; - if (quadratic) - { - float r = radius * quadraticRadiusMult; - quadraticAttenuation = quadraticValue / std::pow(r, 2); - } - if (useLinear) - { - float r = radius * linearRadiusMult; - linearAttenuation = linearValue / r; - } - - light->setLinearAttenuation(linearAttenuation); - light->setQuadraticAttenuation(quadraticAttenuation); - light->setConstantAttenuation(0.f); - - } - } diff --git a/components/sceneutil/lightmanager.hpp b/components/sceneutil/lightmanager.hpp index 3e6d3251b..07b3b4a62 100644 --- a/components/sceneutil/lightmanager.hpp +++ b/components/sceneutil/lightmanager.hpp @@ -168,10 +168,6 @@ namespace SceneUtil LightManager::LightList mLightList; }; - /// @brief Configures a light's attenuation according to vanilla Morrowind attenuation settings. - void configureLight(osg::Light* light, float radius, bool isExterior, bool outQuadInLin, bool useQuadratic, float quadraticValue, - float quadraticRadiusMult, bool useLinear, float linearRadiusMult, float linearValue); - } #endif diff --git a/components/sceneutil/lightutil.cpp b/components/sceneutil/lightutil.cpp new file mode 100644 index 000000000..711a94ba8 --- /dev/null +++ b/components/sceneutil/lightutil.cpp @@ -0,0 +1,32 @@ +#include "lightutil.hpp" + +#include + +namespace SceneUtil +{ + + void configureLight(osg::Light *light, float radius, bool isExterior, bool outQuadInLin, bool useQuadratic, + float quadraticValue, float quadraticRadiusMult, bool useLinear, float linearRadiusMult, float linearValue) + { + bool quadratic = useQuadratic && (!outQuadInLin || isExterior); + + float quadraticAttenuation = 0; + float linearAttenuation = 0; + if (quadratic) + { + float r = radius * quadraticRadiusMult; + quadraticAttenuation = quadraticValue / std::pow(r, 2); + } + if (useLinear) + { + float r = radius * linearRadiusMult; + linearAttenuation = linearValue / r; + } + + light->setLinearAttenuation(linearAttenuation); + light->setQuadraticAttenuation(quadraticAttenuation); + light->setConstantAttenuation(0.f); + + } + +} diff --git a/components/sceneutil/lightutil.hpp b/components/sceneutil/lightutil.hpp new file mode 100644 index 000000000..09d23d4a2 --- /dev/null +++ b/components/sceneutil/lightutil.hpp @@ -0,0 +1,19 @@ +#ifndef OPENMW_COMPONENTS_LIGHTUTIL_H +#define OPENMW_COMPONENTS_LIGHTUTIL_H + +namespace osg +{ + class Light; +} + +namespace SceneUtil +{ + + /// @brief Configures a light's attenuation according to vanilla Morrowind attenuation settings. + void configureLight(osg::Light* light, float radius, bool isExterior, bool outQuadInLin, bool useQuadratic, + float quadraticValue, float quadraticRadiusMult, bool useLinear, float linearRadiusMult, + float linearValue); + +} + +#endif From 3089aeccc4f82aebd9d5ae1801b3d9adcf5621eb Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 6 Jan 2016 13:37:55 +0100 Subject: [PATCH 05/26] Factor out SceneUtil::addLight --- apps/openmw/mwrender/animation.cpp | 66 +------------------------- components/sceneutil/lightutil.cpp | 75 ++++++++++++++++++++++++++++++ components/sceneutil/lightutil.hpp | 21 +++++++-- 3 files changed, 94 insertions(+), 68 deletions(-) diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index 6300d28cf..549d0eb8e 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include @@ -31,8 +30,6 @@ #include #include #include -#include -#include #include #include @@ -1088,38 +1085,7 @@ namespace MWRender void Animation::addExtraLight(osg::ref_ptr parent, const ESM::Light *esmLight) { - SceneUtil::FindByNameVisitor visitor("AttachLight"); - parent->accept(visitor); - - osg::Group* attachTo = NULL; - if (visitor.mFoundNode) - { - attachTo = visitor.mFoundNode; - } - else - { - osg::ComputeBoundsVisitor computeBound; - computeBound.setTraversalMask(~Mask_ParticleSystem); - parent->accept(computeBound); - - // PositionAttitudeTransform seems to be slightly faster than MatrixTransform - osg::ref_ptr trans(new osg::PositionAttitudeTransform); - trans->setPosition(computeBound.getBoundingBox().center()); - - parent->addChild(trans); - - attachTo = trans; - } - - osg::ref_ptr lightSource = new SceneUtil::LightSource; - osg::ref_ptr light (new osg::Light); - lightSource->setNodeMask(Mask_Lighting); - const Fallback::Map* fallback = MWBase::Environment::get().getWorld()->getFallback(); - - float radius = esmLight->mData.mRadius; - lightSource->setRadius(radius); - static bool outQuadInLin = fallback->getFallbackBool("LightAttenuation_OutQuadInLin"); static bool useQuadratic = fallback->getFallbackBool("LightAttenuation_UseQuadratic"); static float quadraticValue = fallback->getFallbackFloat("LightAttenuation_QuadraticValue"); @@ -1127,38 +1093,10 @@ namespace MWRender static bool useLinear = fallback->getFallbackBool("LightAttenuation_UseLinear"); static float linearRadiusMult = fallback->getFallbackFloat("LightAttenuation_LinearRadiusMult"); static float linearValue = fallback->getFallbackFloat("LightAttenuation_LinearValue"); - bool exterior = mPtr.isInCell() && mPtr.getCell()->getCell()->isExterior(); - SceneUtil::configureLight(light, radius, exterior, outQuadInLin, useQuadratic, quadraticValue, - quadraticRadiusMult, useLinear, linearRadiusMult, linearValue); - - osg::Vec4f diffuse = SceneUtil::colourFromRGB(esmLight->mData.mColor); - if (esmLight->mData.mFlags & ESM::Light::Negative) - { - diffuse *= -1; - diffuse.a() = 1; - } - light->setDiffuse(diffuse); - light->setAmbient(osg::Vec4f(0,0,0,1)); - light->setSpecular(osg::Vec4f(0,0,0,0)); - - lightSource->setLight(light); - - osg::ref_ptr ctrl (new SceneUtil::LightController); - ctrl->setDiffuse(light->getDiffuse()); - if (esmLight->mData.mFlags & ESM::Light::Flicker) - ctrl->setType(SceneUtil::LightController::LT_Flicker); - if (esmLight->mData.mFlags & ESM::Light::FlickerSlow) - ctrl->setType(SceneUtil::LightController::LT_FlickerSlow); - if (esmLight->mData.mFlags & ESM::Light::Pulse) - ctrl->setType(SceneUtil::LightController::LT_Pulse); - if (esmLight->mData.mFlags & ESM::Light::PulseSlow) - ctrl->setType(SceneUtil::LightController::LT_PulseSlow); - - lightSource->addUpdateCallback(ctrl); - - attachTo->addChild(lightSource); + SceneUtil::addLight(parent, esmLight, Mask_ParticleSystem, Mask_Lighting, exterior, outQuadInLin, + useQuadratic, quadraticValue, quadraticRadiusMult, useLinear, linearRadiusMult, linearValue); } void Animation::addEffect (const std::string& model, int effectId, bool loop, const std::string& bonename, std::string texture) diff --git a/components/sceneutil/lightutil.cpp b/components/sceneutil/lightutil.cpp index 711a94ba8..00f7f4d13 100644 --- a/components/sceneutil/lightutil.cpp +++ b/components/sceneutil/lightutil.cpp @@ -1,6 +1,16 @@ #include "lightutil.hpp" #include +#include +#include + +#include + +#include "lightmanager.hpp" +#include "lightcontroller.hpp" +#include "util.hpp" +#include "visitor.hpp" +#include "positionattitudetransform.hpp" namespace SceneUtil { @@ -29,4 +39,69 @@ namespace SceneUtil } + void addLight (osg::Group* node, const ESM::Light* esmLight, int partsysMask, int lightMask, bool isExterior, bool outQuadInLin, bool useQuadratic, + float quadraticValue, float quadraticRadiusMult, bool useLinear, float linearRadiusMult, + float linearValue) + { + SceneUtil::FindByNameVisitor visitor("AttachLight"); + node->accept(visitor); + + osg::Group* attachTo = NULL; + if (visitor.mFoundNode) + { + attachTo = visitor.mFoundNode; + } + else + { + osg::ComputeBoundsVisitor computeBound; + computeBound.setTraversalMask(~partsysMask); + node->accept(computeBound); + + // PositionAttitudeTransform seems to be slightly faster than MatrixTransform + osg::ref_ptr trans(new SceneUtil::PositionAttitudeTransform); + trans->setPosition(computeBound.getBoundingBox().center()); + + node->addChild(trans); + + attachTo = trans; + } + + osg::ref_ptr lightSource (new SceneUtil::LightSource); + osg::ref_ptr light (new osg::Light); + lightSource->setNodeMask(lightMask); + + float radius = esmLight->mData.mRadius; + lightSource->setRadius(radius); + + configureLight(light, radius, isExterior, outQuadInLin, useQuadratic, quadraticValue, + quadraticRadiusMult, useLinear, linearRadiusMult, linearValue); + + osg::Vec4f diffuse = SceneUtil::colourFromRGB(esmLight->mData.mColor); + if (esmLight->mData.mFlags & ESM::Light::Negative) + { + diffuse *= -1; + diffuse.a() = 1; + } + light->setDiffuse(diffuse); + light->setAmbient(osg::Vec4f(0,0,0,1)); + light->setSpecular(osg::Vec4f(0,0,0,0)); + + lightSource->setLight(light); + + osg::ref_ptr ctrl (new SceneUtil::LightController); + ctrl->setDiffuse(light->getDiffuse()); + if (esmLight->mData.mFlags & ESM::Light::Flicker) + ctrl->setType(SceneUtil::LightController::LT_Flicker); + if (esmLight->mData.mFlags & ESM::Light::FlickerSlow) + ctrl->setType(SceneUtil::LightController::LT_FlickerSlow); + if (esmLight->mData.mFlags & ESM::Light::Pulse) + ctrl->setType(SceneUtil::LightController::LT_Pulse); + if (esmLight->mData.mFlags & ESM::Light::PulseSlow) + ctrl->setType(SceneUtil::LightController::LT_PulseSlow); + + lightSource->addUpdateCallback(ctrl); + + attachTo->addChild(lightSource); + } + } diff --git a/components/sceneutil/lightutil.hpp b/components/sceneutil/lightutil.hpp index 09d23d4a2..f7879cd72 100644 --- a/components/sceneutil/lightutil.hpp +++ b/components/sceneutil/lightutil.hpp @@ -2,6 +2,11 @@ #define OPENMW_COMPONENTS_LIGHTUTIL_H namespace osg +{ + class Group; +} + +namespace ESM { class Light; } @@ -9,10 +14,18 @@ namespace osg namespace SceneUtil { - /// @brief Configures a light's attenuation according to vanilla Morrowind attenuation settings. - void configureLight(osg::Light* light, float radius, bool isExterior, bool outQuadInLin, bool useQuadratic, - float quadraticValue, float quadraticRadiusMult, bool useLinear, float linearRadiusMult, - float linearValue); + /// @brief Convert an ESM::Light to a SceneUtil::LightSource, and add it to a sub graph. + /// @note If the sub graph contains a node named "AttachLight" (case insensitive), then the light is added to that. + /// Otherwise, the light is added in the center of the node's bounds. + /// @param node The sub graph to add a light to + /// @param esmLight The light definition coming from the game files containing radius, color, flicker, etc. + /// @param partsysMask Node mask to ignore when computing the sub graph's bounding box. + /// @param lightMask Mask to assign to the newly created LightSource. + /// @param isExterior Is the light outside? May be used for deciding which attenuation settings to use. + /// @par Attenuation parameters come from the game INI file. + void addLight (osg::Group* node, const ESM::Light* esmLight, int partsysMask, int lightMask, bool isExterior, bool outQuadInLin, bool useQuadratic, + float quadraticValue, float quadraticRadiusMult, bool useLinear, float linearRadiusMult, + float linearValue); } From ad2145b4634def65c7e7f8b7d2a2e5da15458242 Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 6 Jan 2016 14:34:39 +0100 Subject: [PATCH 06/26] OpenCS: use a separate enum for the toggle buttons --- apps/opencs/CMakeLists.txt | 2 +- apps/opencs/view/render/cell.cpp | 6 ++--- apps/opencs/view/render/cellarrow.cpp | 7 +++-- apps/opencs/view/render/elements.hpp | 23 ---------------- apps/opencs/view/render/instancemode.cpp | 6 ++--- apps/opencs/view/render/mask.hpp | 27 +++++++++++++++++++ apps/opencs/view/render/object.cpp | 7 +++-- .../view/render/pagedworldspacewidget.cpp | 26 +++++++++--------- apps/opencs/view/render/scenewidget.cpp | 6 ++--- apps/opencs/view/render/tagbase.cpp | 6 ++--- apps/opencs/view/render/tagbase.hpp | 8 +++--- .../view/render/unpagedworldspacewidget.cpp | 6 ++--- apps/opencs/view/render/worldspacewidget.cpp | 18 ++++++------- apps/opencs/view/render/worldspacewidget.hpp | 2 +- apps/opencs/view/widget/scenetooltoggle.cpp | 14 +++++----- apps/opencs/view/widget/scenetooltoggle.hpp | 10 +++---- apps/opencs/view/widget/scenetooltoggle2.cpp | 24 +++++++++++------ apps/opencs/view/widget/scenetooltoggle2.hpp | 21 +++++++++++---- 18 files changed, 120 insertions(+), 99 deletions(-) delete mode 100644 apps/opencs/view/render/elements.hpp create mode 100644 apps/opencs/view/render/mask.hpp diff --git a/apps/opencs/CMakeLists.txt b/apps/opencs/CMakeLists.txt index 0e9a49432..8bb624704 100644 --- a/apps/opencs/CMakeLists.txt +++ b/apps/opencs/CMakeLists.txt @@ -94,7 +94,7 @@ opencs_units_noqt (view/render ) opencs_hdrs_noqt (view/render - elements + mask ) diff --git a/apps/opencs/view/render/cell.cpp b/apps/opencs/view/render/cell.cpp index da40f7e7c..40981164d 100644 --- a/apps/opencs/view/render/cell.cpp +++ b/apps/opencs/view/render/cell.cpp @@ -11,7 +11,7 @@ #include "../../model/world/refcollection.hpp" #include "../../model/world/cellcoordinates.hpp" -#include "elements.hpp" +#include "mask.hpp" #include "terrainstorage.hpp" bool CSVRender::Cell::removeObject (const std::string& id) @@ -80,7 +80,7 @@ CSVRender::Cell::Cell (CSMWorld::Data& data, osg::Group* rootNode, const std::st if (esmLand.getLandData (ESM::Land::DATA_VHGT)) { - mTerrain.reset(new Terrain::TerrainGrid(mCellNode, data.getResourceSystem().get(), NULL, new TerrainStorage(mData), Element_Terrain<<1)); + mTerrain.reset(new Terrain::TerrainGrid(mCellNode, data.getResourceSystem().get(), NULL, new TerrainStorage(mData), Mask_Terrain)); mTerrain->loadCell(esmLand.mX, esmLand.mY); } @@ -230,7 +230,7 @@ bool CSVRender::Cell::referenceAdded (const QModelIndex& parent, int start, int void CSVRender::Cell::setSelection (int elementMask, Selection mode) { - if (elementMask & Element_Reference) + if (elementMask & Mask_Reference) { for (std::map::const_iterator iter (mObjects.begin()); iter!=mObjects.end(); ++iter) diff --git a/apps/opencs/view/render/cellarrow.cpp b/apps/opencs/view/render/cellarrow.cpp index 1356aa0fb..6d8fa1c6c 100644 --- a/apps/opencs/view/render/cellarrow.cpp +++ b/apps/opencs/view/render/cellarrow.cpp @@ -7,10 +7,10 @@ #include #include -#include "elements.hpp" +#include "mask.hpp" CSVRender::CellArrowTag::CellArrowTag (CellArrow *arrow) -: TagBase (Element_CellArrow), mArrow (arrow) +: TagBase (Mask_CellArrow), mArrow (arrow) {} CSVRender::CellArrow *CSVRender::CellArrowTag::getCellArrow() const @@ -165,8 +165,7 @@ CSVRender::CellArrow::CellArrow (osg::Group *cellNode, Direction direction, mParentNode->addChild (mBaseNode); - // 0x1 reserved for separating cull and update visitors - mBaseNode->setNodeMask (Element_CellArrow<<1); + mBaseNode->setNodeMask (Mask_CellArrow); adjustTransform(); buildShape(); diff --git a/apps/opencs/view/render/elements.hpp b/apps/opencs/view/render/elements.hpp deleted file mode 100644 index 5a37956e9..000000000 --- a/apps/opencs/view/render/elements.hpp +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef CSV_RENDER_ELEMENTS_H -#define CSV_RENDER_ELEMENTS_H - -namespace CSVRender -{ - /// Visual elements in a scene - enum Elements - { - // elements that are part of the actual scene - Element_Reference = 0x1, - Element_Pathgrid = 0x2, - Element_Water = 0x4, - Element_Fog = 0x8, - Element_Terrain = 0x10, - - // control elements - Element_CellMarker = 0x10000, - Element_CellArrow = 0x20000, - Element_CellBorder = 0x40000 - }; -} - -#endif diff --git a/apps/opencs/view/render/instancemode.cpp b/apps/opencs/view/render/instancemode.cpp index a4d147bb4..7f9e426c7 100644 --- a/apps/opencs/view/render/instancemode.cpp +++ b/apps/opencs/view/render/instancemode.cpp @@ -3,12 +3,12 @@ #include "../../model/prefs/state.hpp" -#include "elements.hpp" +#include "mask.hpp" #include "object.hpp" #include "worldspacewidget.hpp" CSVRender::InstanceMode::InstanceMode (WorldspaceWidget *worldspaceWidget, QWidget *parent) -: EditMode (worldspaceWidget, QIcon (":placeholder"), Element_Reference, "Instance editing", +: EditMode (worldspaceWidget, QIcon (":placeholder"), Mask_Reference, "Instance editing", parent) { @@ -28,7 +28,7 @@ void CSVRender::InstanceMode::secondaryEditPressed (osg::ref_ptr tag) void CSVRender::InstanceMode::primarySelectPressed (osg::ref_ptr tag) { - getWorldspaceWidget().clearSelection (Element_Reference); + getWorldspaceWidget().clearSelection (Mask_Reference); if (tag) { diff --git a/apps/opencs/view/render/mask.hpp b/apps/opencs/view/render/mask.hpp new file mode 100644 index 000000000..9e63cc977 --- /dev/null +++ b/apps/opencs/view/render/mask.hpp @@ -0,0 +1,27 @@ +#ifndef CSV_RENDER_ELEMENTS_H +#define CSV_RENDER_ELEMENTS_H + +namespace CSVRender +{ + + /// @note Enumeration values can be changed freely, as long as they do not collide. + enum Mask + { + // internal use within NifLoader, do not change + Mask_UpdateVisitor = 0x1, + + // elements that are part of the actual scene + Mask_Reference = 0x2, + Mask_Pathgrid = 0x4, + Mask_Water = 0x8, + Mask_Fog = 0x10, + Mask_Terrain = 0x20, + + // control elements + Mask_CellMarker = 0x10000, + Mask_CellArrow = 0x20000, + Mask_CellBorder = 0x40000 + }; +} + +#endif diff --git a/apps/opencs/view/render/object.cpp b/apps/opencs/view/render/object.cpp index c295a023a..2ff80b38b 100644 --- a/apps/opencs/view/render/object.cpp +++ b/apps/opencs/view/render/object.cpp @@ -19,7 +19,7 @@ #include #include -#include "elements.hpp" +#include "mask.hpp" namespace { @@ -39,7 +39,7 @@ namespace CSVRender::ObjectTag::ObjectTag (Object* object) -: TagBase (Element_Reference), mObject (object) +: TagBase (Mask_Reference), mObject (object) {} QString CSVRender::ObjectTag::getToolTip (bool hideBasics) const @@ -138,8 +138,7 @@ CSVRender::Object::Object (CSMWorld::Data& data, osg::Group* parentNode, parentNode->addChild(mBaseNode); - // 0x1 reserved for separating cull and update visitors - mBaseNode->setNodeMask(Element_Reference<<1); + mBaseNode->setNodeMask(Mask_Reference); if (referenceable) { diff --git a/apps/opencs/view/render/pagedworldspacewidget.cpp b/apps/opencs/view/render/pagedworldspacewidget.cpp index dae5990e6..e0707524d 100644 --- a/apps/opencs/view/render/pagedworldspacewidget.cpp +++ b/apps/opencs/view/render/pagedworldspacewidget.cpp @@ -18,7 +18,7 @@ #include "../widget/scenetooltoggle2.hpp" #include "editmode.hpp" -#include "elements.hpp" +#include "mask.hpp" bool CSVRender::PagedWorldspaceWidget::adjustCells() { @@ -126,8 +126,8 @@ void CSVRender::PagedWorldspaceWidget::addVisibilitySelectorButtons ( CSVWidget::SceneToolToggle2 *tool) { WorldspaceWidget::addVisibilitySelectorButtons (tool); - tool->addButton (Element_Terrain, "Terrain"); - tool->addButton (Element_Fog, "Fog", "", true); + tool->addButton (CSVWidget::SceneToolToggle2::Button_Terrain, Mask_Terrain, "Terrain"); + tool->addButton (CSVWidget::SceneToolToggle2::Button_Fog, Mask_Fog, "Fog", "", true); } void CSVRender::PagedWorldspaceWidget::addEditModeSelectorButtons ( @@ -137,22 +137,22 @@ void CSVRender::PagedWorldspaceWidget::addEditModeSelectorButtons ( /// \todo replace EditMode with suitable subclasses tool->addButton ( - new EditMode (this, QIcon (":placeholder"), Element_Reference, "Terrain shape editing"), + new EditMode (this, QIcon (":placeholder"), Mask_Reference, "Terrain shape editing"), "terrain-shape"); tool->addButton ( - new EditMode (this, QIcon (":placeholder"), Element_Reference, "Terrain texture editing"), + new EditMode (this, QIcon (":placeholder"), Mask_Reference, "Terrain texture editing"), "terrain-texture"); tool->addButton ( - new EditMode (this, QIcon (":placeholder"), Element_Reference, "Terrain vertex paint editing"), + new EditMode (this, QIcon (":placeholder"), Mask_Reference, "Terrain vertex paint editing"), "terrain-vertex"); tool->addButton ( - new EditMode (this, QIcon (":placeholder"), Element_Reference, "Terrain movement"), + new EditMode (this, QIcon (":placeholder"), Mask_Reference, "Terrain movement"), "terrain-move"); } void CSVRender::PagedWorldspaceWidget::handleMouseClick (osg::ref_ptr tag, const std::string& button, bool shift) { - if (tag && tag->getElement()==Element_CellArrow) + if (tag && tag->getMask()==Mask_CellArrow) { if (button=="p-edit" || button=="s-edit") { @@ -492,7 +492,7 @@ CSVRender::WorldspaceWidget::dropRequirments CSVRender::PagedWorldspaceWidget::g unsigned int CSVRender::PagedWorldspaceWidget::getVisibilityMask() const { - return WorldspaceWidget::getVisibilityMask() | mControlElements->getSelection(); + return WorldspaceWidget::getVisibilityMask() | mControlElements->getSelectionMask(); } void CSVRender::PagedWorldspaceWidget::clearSelection (int elementMask) @@ -510,12 +510,12 @@ CSVWidget::SceneToolToggle *CSVRender::PagedWorldspaceWidget::makeControlVisibil mControlElements = new CSVWidget::SceneToolToggle (parent, "Controls & Guides Visibility", ":placeholder"); - mControlElements->addButton (":placeholder", Element_CellMarker, ":placeholder", + mControlElements->addButton (":placeholder", Mask_CellMarker, ":placeholder", "Cell marker"); - mControlElements->addButton (":placeholder", Element_CellArrow, ":placeholder", "Cell arrows"); - mControlElements->addButton (":placeholder", Element_CellBorder, ":placeholder", "Cell border"); + mControlElements->addButton (":placeholder", Mask_CellArrow, ":placeholder", "Cell arrows"); + mControlElements->addButton (":placeholder", Mask_CellBorder, ":placeholder", "Cell border"); - mControlElements->setSelection (0xffffffff); + mControlElements->setSelectionMask (0xffffffff); connect (mControlElements, SIGNAL (selectionChanged()), this, SLOT (elementSelectionChanged())); diff --git a/apps/opencs/view/render/scenewidget.cpp b/apps/opencs/view/render/scenewidget.cpp index b1300a991..d06a6b001 100644 --- a/apps/opencs/view/render/scenewidget.cpp +++ b/apps/opencs/view/render/scenewidget.cpp @@ -18,6 +18,7 @@ #include "../widget/scenetoolmode.hpp" #include "lighting.hpp" +#include "mask.hpp" namespace CSVRender { @@ -73,7 +74,7 @@ RenderWidget::RenderWidget(QWidget *parent, Qt::WindowFlags f) // Press S to reveal profiling stats mView->addEventHandler(new osgViewer::StatsHandler); - mView->getCamera()->setCullMask(~(0x1)); + mView->getCamera()->setCullMask(~(Mask_UpdateVisitor)); viewer.addView(mView); viewer.setDone(false); @@ -92,8 +93,7 @@ void RenderWidget::flagAsModified() void RenderWidget::setVisibilityMask(int mask) { - // 0x1 reserved for separating cull and update visitors - mView->getCamera()->setCullMask(mask<<1); + mView->getCamera()->setCullMask(mask); } bool RenderWidget::eventFilter(QObject* obj, QEvent* event) diff --git a/apps/opencs/view/render/tagbase.cpp b/apps/opencs/view/render/tagbase.cpp index 79412c132..3ddd68690 100644 --- a/apps/opencs/view/render/tagbase.cpp +++ b/apps/opencs/view/render/tagbase.cpp @@ -1,11 +1,11 @@ #include "tagbase.hpp" -CSVRender::TagBase::TagBase (Elements element) : mElement (element) {} +CSVRender::TagBase::TagBase (Mask mask) : mMask (mask) {} -CSVRender::Elements CSVRender::TagBase::getElement() const +CSVRender::Mask CSVRender::TagBase::getMask() const { - return mElement; + return mMask; } QString CSVRender::TagBase::getToolTip (bool hideBasics) const diff --git a/apps/opencs/view/render/tagbase.hpp b/apps/opencs/view/render/tagbase.hpp index 9f169c3b1..d1ecd2cfd 100644 --- a/apps/opencs/view/render/tagbase.hpp +++ b/apps/opencs/view/render/tagbase.hpp @@ -5,19 +5,19 @@ #include -#include "elements.hpp" +#include "mask.hpp" namespace CSVRender { class TagBase : public osg::Referenced { - Elements mElement; + Mask mMask; public: - TagBase (Elements element); + TagBase (Mask mask); - Elements getElement() const; + Mask getMask() const; virtual QString getToolTip (bool hideBasics) const; diff --git a/apps/opencs/view/render/unpagedworldspacewidget.cpp b/apps/opencs/view/render/unpagedworldspacewidget.cpp index 68f068dac..4b2ff9a5f 100644 --- a/apps/opencs/view/render/unpagedworldspacewidget.cpp +++ b/apps/opencs/view/render/unpagedworldspacewidget.cpp @@ -17,7 +17,7 @@ #include "../widget/scenetooltoggle.hpp" #include "../widget/scenetooltoggle2.hpp" -#include "elements.hpp" +#include "mask.hpp" void CSVRender::UnpagedWorldspaceWidget::update() { @@ -166,8 +166,8 @@ void CSVRender::UnpagedWorldspaceWidget::addVisibilitySelectorButtons ( CSVWidget::SceneToolToggle2 *tool) { WorldspaceWidget::addVisibilitySelectorButtons (tool); - tool->addButton (Element_Terrain, "Terrain", "", true); - tool->addButton (Element_Fog, "Fog"); + tool->addButton (CSVWidget::SceneToolToggle2::Button_Terrain, Mask_Terrain, "Terrain", "", true); + tool->addButton (CSVWidget::SceneToolToggle2::Button_Fog, Mask_Fog, "Fog"); } std::string CSVRender::UnpagedWorldspaceWidget::getStartupInstruction() diff --git a/apps/opencs/view/render/worldspacewidget.cpp b/apps/opencs/view/render/worldspacewidget.cpp index f0d398641..3b169b5c2 100644 --- a/apps/opencs/view/render/worldspacewidget.cpp +++ b/apps/opencs/view/render/worldspacewidget.cpp @@ -27,7 +27,7 @@ #include "../widget/scenetoolrun.hpp" #include "object.hpp" -#include "elements.hpp" +#include "mask.hpp" #include "editmode.hpp" #include "instancemode.hpp" @@ -160,7 +160,7 @@ CSVWidget::SceneToolToggle2 *CSVRender::WorldspaceWidget::makeSceneVisibilitySel addVisibilitySelectorButtons (mSceneElements); - mSceneElements->setSelection (0xffffffff); + mSceneElements->setSelectionMask (0xffffffff); connect (mSceneElements, SIGNAL (selectionChanged()), this, SLOT (elementSelectionChanged())); @@ -275,12 +275,12 @@ bool CSVRender::WorldspaceWidget::handleDrop (const std::vectorgetSelection(); + return mSceneElements->getSelectionMask(); } void CSVRender::WorldspaceWidget::setInteractionMask (unsigned int mask) { - mInteractionMask = mask | Element_CellMarker | Element_CellArrow; + mInteractionMask = mask | Mask_CellMarker | Mask_CellArrow; } unsigned int CSVRender::WorldspaceWidget::getInteractionMask() const @@ -296,9 +296,9 @@ void CSVRender::WorldspaceWidget::setEditLock (bool locked) void CSVRender::WorldspaceWidget::addVisibilitySelectorButtons ( CSVWidget::SceneToolToggle2 *tool) { - tool->addButton (Element_Reference, "Instances"); - tool->addButton (Element_Water, "Water"); - tool->addButton (Element_Pathgrid, "Pathgrid"); + tool->addButton (CSVWidget::SceneToolToggle2::Button_Reference, Mask_Reference, "Instances"); + tool->addButton (CSVWidget::SceneToolToggle2::Button_Water, Mask_Water, "Water"); + tool->addButton (CSVWidget::SceneToolToggle2::Button_Pathgrid, Mask_Pathgrid, "Pathgrid"); } void CSVRender::WorldspaceWidget::addEditModeSelectorButtons (CSVWidget::SceneToolMode *tool) @@ -306,7 +306,7 @@ void CSVRender::WorldspaceWidget::addEditModeSelectorButtons (CSVWidget::SceneTo /// \todo replace EditMode with suitable subclasses tool->addButton (new InstanceMode (this, tool), "object"); tool->addButton ( - new EditMode (this, QIcon (":placeholder"), Element_Pathgrid, "Pathgrid editing"), + new EditMode (this, QIcon (":placeholder"), Mask_Pathgrid, "Pathgrid editing"), "pathgrid"); } @@ -404,7 +404,7 @@ osg::ref_ptr CSVRender::WorldspaceWidget::mousePick (const Q intersector->setIntersectionLimit(osgUtil::LineSegmentIntersector::NO_LIMIT); osgUtil::IntersectionVisitor visitor(intersector); - visitor.setTraversalMask(getInteractionMask() << 1); + visitor.setTraversalMask(getInteractionMask()); mView->getCamera()->accept(visitor); diff --git a/apps/opencs/view/render/worldspacewidget.hpp b/apps/opencs/view/render/worldspacewidget.hpp index 54376cee4..07e505fe2 100644 --- a/apps/opencs/view/render/worldspacewidget.hpp +++ b/apps/opencs/view/render/worldspacewidget.hpp @@ -11,7 +11,7 @@ #include "../../model/world/tablemimedata.hpp" #include "scenewidget.hpp" -#include "elements.hpp" +#include "mask.hpp" namespace CSMPrefs { diff --git a/apps/opencs/view/widget/scenetooltoggle.cpp b/apps/opencs/view/widget/scenetooltoggle.cpp index d7251882a..5919a280a 100644 --- a/apps/opencs/view/widget/scenetooltoggle.cpp +++ b/apps/opencs/view/widget/scenetooltoggle.cpp @@ -40,7 +40,7 @@ void CSVWidget::SceneToolToggle::adjustToolTip() void CSVWidget::SceneToolToggle::adjustIcon() { - unsigned int selection = getSelection(); + unsigned int selection = getSelectionMask(); if (!selection) setIcon (QIcon (QString::fromUtf8 (mEmptyIcon.c_str()))); else @@ -135,7 +135,7 @@ void CSVWidget::SceneToolToggle::showPanel (const QPoint& position) mFirst->setFocus (Qt::OtherFocusReason); } -void CSVWidget::SceneToolToggle::addButton (const std::string& icon, unsigned int id, +void CSVWidget::SceneToolToggle::addButton (const std::string& icon, unsigned int mask, const std::string& smallIcon, const QString& name, const QString& tooltip) { if (mButtons.size()>=9) @@ -151,7 +151,7 @@ void CSVWidget::SceneToolToggle::addButton (const std::string& icon, unsigned in mLayout->addWidget (button); ButtonDesc desc; - desc.mId = id; + desc.mMask = mask; desc.mSmallIcon = smallIcon; desc.mName = name; desc.mIndex = mButtons.size(); @@ -164,23 +164,23 @@ void CSVWidget::SceneToolToggle::addButton (const std::string& icon, unsigned in mFirst = button; } -unsigned int CSVWidget::SceneToolToggle::getSelection() const +unsigned int CSVWidget::SceneToolToggle::getSelectionMask() const { unsigned int selection = 0; for (std::map::const_iterator iter (mButtons.begin()); iter!=mButtons.end(); ++iter) if (iter->first->isChecked()) - selection |= iter->second.mId; + selection |= iter->second.mMask; return selection; } -void CSVWidget::SceneToolToggle::setSelection (unsigned int selection) +void CSVWidget::SceneToolToggle::setSelectionMask (unsigned int selection) { for (std::map::iterator iter (mButtons.begin()); iter!=mButtons.end(); ++iter) - iter->first->setChecked (selection & iter->second.mId); + iter->first->setChecked (selection & iter->second.mMask); adjustToolTip(); adjustIcon(); diff --git a/apps/opencs/view/widget/scenetooltoggle.hpp b/apps/opencs/view/widget/scenetooltoggle.hpp index 55e697524..68cd2362e 100644 --- a/apps/opencs/view/widget/scenetooltoggle.hpp +++ b/apps/opencs/view/widget/scenetooltoggle.hpp @@ -20,7 +20,7 @@ namespace CSVWidget struct ButtonDesc { - unsigned int mId; + unsigned int mMask; std::string mSmallIcon; QString mName; int mIndex; @@ -54,13 +54,13 @@ namespace CSVWidget /// \note The layout algorithm can not handle more than 9 buttons. To prevent this An /// attempt to add more will result in an exception being thrown. /// The small icons will be sized at (x-4)/3 (where x is the main icon size). - void addButton (const std::string& icon, unsigned int id, + void addButton (const std::string& icon, unsigned int mask, const std::string& smallIcon, const QString& name, const QString& tooltip = ""); - unsigned int getSelection() const; + unsigned int getSelectionMask() const; - /// \param or'ed button IDs. IDs that do not exist will be ignored. - void setSelection (unsigned int selection); + /// \param or'ed button masks. buttons that do not exist will be ignored. + void setSelectionMask (unsigned int selection); signals: diff --git a/apps/opencs/view/widget/scenetooltoggle2.cpp b/apps/opencs/view/widget/scenetooltoggle2.cpp index e0431476e..3972aadaa 100644 --- a/apps/opencs/view/widget/scenetooltoggle2.cpp +++ b/apps/opencs/view/widget/scenetooltoggle2.cpp @@ -41,8 +41,15 @@ void CSVWidget::SceneToolToggle2::adjustToolTip() void CSVWidget::SceneToolToggle2::adjustIcon() { + unsigned int buttonIds = 0; + + for (std::map::const_iterator iter (mButtons.begin()); + iter!=mButtons.end(); ++iter) + if (iter->first->isChecked()) + buttonIds |= iter->second.mButtonId; + std::ostringstream stream; - stream << mCompositeIcon << getSelection(); + stream << mCompositeIcon << buttonIds; setIcon (QIcon (QString::fromUtf8 (stream.str().c_str()))); } @@ -70,11 +77,11 @@ void CSVWidget::SceneToolToggle2::showPanel (const QPoint& position) mFirst->setFocus (Qt::OtherFocusReason); } -void CSVWidget::SceneToolToggle2::addButton (unsigned int id, +void CSVWidget::SceneToolToggle2::addButton (ButtonId id, unsigned int mask, const QString& name, const QString& tooltip, bool disabled) { std::ostringstream stream; - stream << mSingleIcon << id; + stream << mSingleIcon << static_cast(id); PushButton *button = new PushButton (QIcon (QPixmap (stream.str().c_str())), PushButton::Type_Toggle, tooltip.isEmpty() ? name: tooltip, mPanel); @@ -89,7 +96,8 @@ void CSVWidget::SceneToolToggle2::addButton (unsigned int id, mLayout->addWidget (button); ButtonDesc desc; - desc.mId = id; + desc.mButtonId = id; + desc.mMask = mask; desc.mName = name; desc.mIndex = mButtons.size(); @@ -101,23 +109,23 @@ void CSVWidget::SceneToolToggle2::addButton (unsigned int id, mFirst = button; } -unsigned int CSVWidget::SceneToolToggle2::getSelection() const +unsigned int CSVWidget::SceneToolToggle2::getSelectionMask() const { unsigned int selection = 0; for (std::map::const_iterator iter (mButtons.begin()); iter!=mButtons.end(); ++iter) if (iter->first->isChecked()) - selection |= iter->second.mId; + selection |= iter->second.mMask; return selection; } -void CSVWidget::SceneToolToggle2::setSelection (unsigned int selection) +void CSVWidget::SceneToolToggle2::setSelectionMask (unsigned int selection) { for (std::map::iterator iter (mButtons.begin()); iter!=mButtons.end(); ++iter) - iter->first->setChecked (selection & iter->second.mId); + iter->first->setChecked (selection & iter->second.mMask); adjustToolTip(); adjustIcon(); diff --git a/apps/opencs/view/widget/scenetooltoggle2.hpp b/apps/opencs/view/widget/scenetooltoggle2.hpp index 0bae780f9..eea9c3ebc 100644 --- a/apps/opencs/view/widget/scenetooltoggle2.hpp +++ b/apps/opencs/view/widget/scenetooltoggle2.hpp @@ -22,7 +22,8 @@ namespace CSVWidget struct ButtonDesc { - unsigned int mId; + unsigned int mButtonId; + unsigned int mMask; QString mName; int mIndex; }; @@ -53,15 +54,25 @@ namespace CSVWidget virtual void showPanel (const QPoint& position); + /// Visual elements in a scene + /// @note do not change the enumeration values, they are used in pre-existing button file names! + enum ButtonId + { + Button_Reference = 0x1, + Button_Pathgrid = 0x2, + Button_Water = 0x4, + Button_Fog = 0x8, + Button_Terrain = 0x10 + }; /// \attention After the last button has been added, setSelection must be called at /// least once to finalise the layout. - void addButton (unsigned int id, + void addButton (ButtonId buttonId, unsigned int mask, const QString& name, const QString& tooltip = "", bool disabled = false); - unsigned int getSelection() const; + unsigned int getSelectionMask() const; - /// \param or'ed button IDs. IDs that do not exist will be ignored. - void setSelection (unsigned int selection); + /// \param or'ed button masks. buttons that do not exist will be ignored. + void setSelectionMask (unsigned int selection); signals: From e7bb8878f3f0a162e89f804e49014615a1894251 Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 6 Jan 2016 14:39:48 +0100 Subject: [PATCH 07/26] OpenCS: add a mask for particle systems --- apps/opencs/view/render/mask.hpp | 3 +++ apps/opencs/view/render/scenewidget.cpp | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/opencs/view/render/mask.hpp b/apps/opencs/view/render/mask.hpp index 9e63cc977..984dccae4 100644 --- a/apps/opencs/view/render/mask.hpp +++ b/apps/opencs/view/render/mask.hpp @@ -17,6 +17,9 @@ namespace CSVRender Mask_Fog = 0x10, Mask_Terrain = 0x20, + // used within models + Mask_ParticleSystem = 0x100, + // control elements Mask_CellMarker = 0x10000, Mask_CellArrow = 0x20000, diff --git a/apps/opencs/view/render/scenewidget.cpp b/apps/opencs/view/render/scenewidget.cpp index d06a6b001..d7138b392 100644 --- a/apps/opencs/view/render/scenewidget.cpp +++ b/apps/opencs/view/render/scenewidget.cpp @@ -93,7 +93,7 @@ void RenderWidget::flagAsModified() void RenderWidget::setVisibilityMask(int mask) { - mView->getCamera()->setCullMask(mask); + mView->getCamera()->setCullMask(mask | Mask_ParticleSystem); } bool RenderWidget::eventFilter(QObject* obj, QEvent* event) @@ -167,6 +167,8 @@ SceneWidget::SceneWidget(boost::shared_ptr resourceSys setLighting(&mLightingDay); + mResourceSystem->getSceneManager()->setParticleSystemMask(Mask_ParticleSystem); + /// \todo make shortcut configurable QShortcut *focusToolbar = new QShortcut (Qt::Key_T, this, 0, 0, Qt::WidgetWithChildrenShortcut); connect (focusToolbar, SIGNAL (activated()), this, SIGNAL (focusToolbarRequest())); From 7f967153ef993752c65bcda70bb4724eb76025af Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 6 Jan 2016 15:00:58 +0100 Subject: [PATCH 08/26] OpenCS: create light sources --- apps/opencs/view/render/object.cpp | 30 ++++++++++++++++++++++++- apps/opencs/view/render/scenewidget.cpp | 5 ++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/apps/opencs/view/render/object.cpp b/apps/opencs/view/render/object.cpp index 2ff80b38b..f202be4bc 100644 --- a/apps/opencs/view/render/object.cpp +++ b/apps/opencs/view/render/object.cpp @@ -17,7 +17,9 @@ #include "../../model/world/refidcollection.hpp" #include -#include +#include +#include +#include #include "mask.hpp" @@ -62,6 +64,7 @@ void CSVRender::Object::update() const CSMWorld::RefIdCollection& referenceables = mData.getReferenceables(); int index = referenceables.searchId (mReferenceableId); + const ESM::Light* light = NULL; if (index==-1) error = 1; @@ -73,6 +76,14 @@ void CSVRender::Object::update() referenceables.findColumnIndex (CSMWorld::Columns::ColumnId_Model)). toString().toUtf8().constData(); + int recordType = + referenceables.getData (index, + referenceables.findColumnIndex(CSMWorld::Columns::ColumnId_RecordType)).toInt(); + if (recordType == CSMWorld::UniversalId::Type_Light) + { + light = &dynamic_cast& >(referenceables.getRecord(index)).get(); + } + if (model.empty()) error = 2; } @@ -97,6 +108,21 @@ void CSVRender::Object::update() std::cerr << e.what() << std::endl; } } + + if (light) + { + const Fallback::Map* fallback = mData.getFallbackMap(); + static bool outQuadInLin = fallback->getFallbackBool("LightAttenuation_OutQuadInLin"); + static bool useQuadratic = fallback->getFallbackBool("LightAttenuation_UseQuadratic"); + static float quadraticValue = fallback->getFallbackFloat("LightAttenuation_QuadraticValue"); + static float quadraticRadiusMult = fallback->getFallbackFloat("LightAttenuation_QuadraticRadiusMult"); + static bool useLinear = fallback->getFallbackBool("LightAttenuation_UseLinear"); + static float linearRadiusMult = fallback->getFallbackFloat("LightAttenuation_LinearRadiusMult"); + static float linearValue = fallback->getFallbackFloat("LightAttenuation_LinearValue"); + bool isExterior = false; // FIXME + SceneUtil::addLight(mBaseNode, light, Mask_ParticleSystem, ~0u, isExterior, outQuadInLin, useQuadratic, + quadraticValue, quadraticRadiusMult, useLinear, linearRadiusMult, linearValue); + } } void CSVRender::Object::adjustTransform() @@ -131,6 +157,8 @@ CSVRender::Object::Object (CSMWorld::Data& data, osg::Group* parentNode, : mData (data), mBaseNode(0), mSelected(false), mParentNode(parentNode), mResourceSystem(data.getResourceSystem().get()), mForceBaseToZero (forceBaseToZero) { mBaseNode = new osg::PositionAttitudeTransform; + mBaseNode->addCullCallback(new SceneUtil::LightListCallback); + mOutline = new osgFX::Scribe; mOutline->addChild(mBaseNode); diff --git a/apps/opencs/view/render/scenewidget.cpp b/apps/opencs/view/render/scenewidget.cpp index d7138b392..c51b22e09 100644 --- a/apps/opencs/view/render/scenewidget.cpp +++ b/apps/opencs/view/render/scenewidget.cpp @@ -14,6 +14,7 @@ #include #include +#include #include "../widget/scenetoolmode.hpp" @@ -64,7 +65,9 @@ RenderWidget::RenderWidget(QWidget *parent, Qt::WindowFlags f) mView->getCamera()->setViewport( new osg::Viewport(0, 0, traits->width, traits->height) ); mView->getCamera()->setProjectionMatrixAsPerspective(30.0f, static_cast(traits->width)/static_cast(traits->height), 1.0f, 10000.0f ); - mRootNode = new osg::Group; + SceneUtil::LightManager* lightMgr = new SceneUtil::LightManager; + lightMgr->setStartLight(1); + mRootNode = lightMgr; mView->getCamera()->getOrCreateStateSet()->setMode(GL_NORMALIZE, osg::StateAttribute::ON); mView->getCamera()->getOrCreateStateSet()->setMode(GL_CULL_FACE, osg::StateAttribute::ON); From 93cc08a09cd5f132e7e79ad28737c33df7852d9d Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 6 Jan 2016 23:14:32 +0100 Subject: [PATCH 09/26] Lighting fix for LightListCallbacks attached to a Transform node --- components/sceneutil/lightmanager.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/components/sceneutil/lightmanager.cpp b/components/sceneutil/lightmanager.cpp index f9182c1d2..64448e73e 100644 --- a/components/sceneutil/lightmanager.cpp +++ b/components/sceneutil/lightmanager.cpp @@ -309,8 +309,15 @@ namespace SceneUtil const osg::RefMatrix* viewMatrix = cv->getCurrentRenderStage()->getInitialViewMatrix(); const std::vector& lights = mLightManager->getLightsInViewSpace(cv->getCurrentCamera(), viewMatrix); - // we do the intersections in view space - osg::BoundingSphere nodeBound = node->getBound(); + // get the node bounds in view space + // NB do not node->getBound() * modelView, that would apply the node's transformation twice + osg::BoundingSphere nodeBound; + osg::Group* group = node->asGroup(); + if (group) + { + for (unsigned int i=0; igetNumChildren(); ++i) + nodeBound.expandBy(group->getChild(i)->getBound()); + } osg::Matrixf mat = *cv->getModelViewMatrix(); transformBoundingSphere(mat, nodeBound); From e1c7165bfb37c881aeb753dd67479501620d14fb Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 6 Jan 2016 23:16:47 +0100 Subject: [PATCH 10/26] Fix bounds calculation for addLight to a transform node --- components/sceneutil/lightutil.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/sceneutil/lightutil.cpp b/components/sceneutil/lightutil.cpp index 00f7f4d13..725157e23 100644 --- a/components/sceneutil/lightutil.cpp +++ b/components/sceneutil/lightutil.cpp @@ -55,7 +55,9 @@ namespace SceneUtil { osg::ComputeBoundsVisitor computeBound; computeBound.setTraversalMask(~partsysMask); - node->accept(computeBound); + // We want the bounds of all children of the node, ignoring the node's local transformation + // So do a traverse(), not accept() + computeBound.traverse(*node); // PositionAttitudeTransform seems to be slightly faster than MatrixTransform osg::ref_ptr trans(new SceneUtil::PositionAttitudeTransform); From 458a305bff2bcdd9d82d347a13539c537cf14628 Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 6 Jan 2016 23:20:26 +0100 Subject: [PATCH 11/26] OpenCS: add lighting mask --- apps/opencs/view/render/mask.hpp | 2 ++ apps/opencs/view/render/object.cpp | 2 +- apps/opencs/view/render/scenewidget.cpp | 3 ++- components/sceneutil/lightutil.cpp | 2 +- components/sceneutil/lightutil.hpp | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/opencs/view/render/mask.hpp b/apps/opencs/view/render/mask.hpp index 984dccae4..d2dfef7b4 100644 --- a/apps/opencs/view/render/mask.hpp +++ b/apps/opencs/view/render/mask.hpp @@ -20,6 +20,8 @@ namespace CSVRender // used within models Mask_ParticleSystem = 0x100, + Mask_Lighting = 0x200, + // control elements Mask_CellMarker = 0x10000, Mask_CellArrow = 0x20000, diff --git a/apps/opencs/view/render/object.cpp b/apps/opencs/view/render/object.cpp index f202be4bc..1821da059 100644 --- a/apps/opencs/view/render/object.cpp +++ b/apps/opencs/view/render/object.cpp @@ -120,7 +120,7 @@ void CSVRender::Object::update() static float linearRadiusMult = fallback->getFallbackFloat("LightAttenuation_LinearRadiusMult"); static float linearValue = fallback->getFallbackFloat("LightAttenuation_LinearValue"); bool isExterior = false; // FIXME - SceneUtil::addLight(mBaseNode, light, Mask_ParticleSystem, ~0u, isExterior, outQuadInLin, useQuadratic, + SceneUtil::addLight(mBaseNode, light, Mask_ParticleSystem, Mask_Lighting, isExterior, outQuadInLin, useQuadratic, quadraticValue, quadraticRadiusMult, useLinear, linearRadiusMult, linearValue); } } diff --git a/apps/opencs/view/render/scenewidget.cpp b/apps/opencs/view/render/scenewidget.cpp index c51b22e09..e5b9171e0 100644 --- a/apps/opencs/view/render/scenewidget.cpp +++ b/apps/opencs/view/render/scenewidget.cpp @@ -67,6 +67,7 @@ RenderWidget::RenderWidget(QWidget *parent, Qt::WindowFlags f) SceneUtil::LightManager* lightMgr = new SceneUtil::LightManager; lightMgr->setStartLight(1); + lightMgr->setLightingMask(Mask_Lighting); mRootNode = lightMgr; mView->getCamera()->getOrCreateStateSet()->setMode(GL_NORMALIZE, osg::StateAttribute::ON); @@ -96,7 +97,7 @@ void RenderWidget::flagAsModified() void RenderWidget::setVisibilityMask(int mask) { - mView->getCamera()->setCullMask(mask | Mask_ParticleSystem); + mView->getCamera()->setCullMask(mask | Mask_ParticleSystem | Mask_Lighting); } bool RenderWidget::eventFilter(QObject* obj, QEvent* event) diff --git a/components/sceneutil/lightutil.cpp b/components/sceneutil/lightutil.cpp index 725157e23..6499c54b1 100644 --- a/components/sceneutil/lightutil.cpp +++ b/components/sceneutil/lightutil.cpp @@ -39,7 +39,7 @@ namespace SceneUtil } - void addLight (osg::Group* node, const ESM::Light* esmLight, int partsysMask, int lightMask, bool isExterior, bool outQuadInLin, bool useQuadratic, + void addLight (osg::Group* node, const ESM::Light* esmLight, unsigned int partsysMask, unsigned int lightMask, bool isExterior, bool outQuadInLin, bool useQuadratic, float quadraticValue, float quadraticRadiusMult, bool useLinear, float linearRadiusMult, float linearValue) { diff --git a/components/sceneutil/lightutil.hpp b/components/sceneutil/lightutil.hpp index f7879cd72..810ffa318 100644 --- a/components/sceneutil/lightutil.hpp +++ b/components/sceneutil/lightutil.hpp @@ -23,7 +23,7 @@ namespace SceneUtil /// @param lightMask Mask to assign to the newly created LightSource. /// @param isExterior Is the light outside? May be used for deciding which attenuation settings to use. /// @par Attenuation parameters come from the game INI file. - void addLight (osg::Group* node, const ESM::Light* esmLight, int partsysMask, int lightMask, bool isExterior, bool outQuadInLin, bool useQuadratic, + void addLight (osg::Group* node, const ESM::Light* esmLight, unsigned int partsysMask, unsigned int lightMask, bool isExterior, bool outQuadInLin, bool useQuadratic, float quadraticValue, float quadraticRadiusMult, bool useLinear, float linearRadiusMult, float linearValue); From 62fe47b144d8312f90b5d773c31712d876f76779 Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 13 Jan 2016 15:37:43 +0100 Subject: [PATCH 12/26] Load default terrain if there is none defined --- components/esmterrain/storage.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/components/esmterrain/storage.cpp b/components/esmterrain/storage.cpp index f0865a0a9..4be56d5e6 100644 --- a/components/esmterrain/storage.cpp +++ b/components/esmterrain/storage.cpp @@ -14,6 +14,8 @@ namespace ESMTerrain { + const float defaultHeight = -2048; + Storage::Storage(const VFS::Manager *vfs) : mVFS(vfs) { @@ -62,7 +64,9 @@ namespace ESMTerrain return true; } - return false; + min = defaultHeight; + max = defaultHeight; + return true; } void Storage::fixNormal (osg::Vec3f& normal, int cellX, int cellY, int col, int row) @@ -203,7 +207,7 @@ namespace ESMTerrain assert (vertX < numVerts); assert (vertY < numVerts); - float height = -2048; + float height = defaultHeight; if (heightData) height = heightData->mHeights[col*ESM::Land::LAND_SIZE + row]; @@ -412,7 +416,7 @@ namespace ESMTerrain const ESM::Land* land = getLand(cellX, cellY); if (!land || !(land->mDataTypes&ESM::Land::DATA_VHGT)) - return -2048; + return defaultHeight; // Mostly lifted from Ogre::Terrain::getHeightAtTerrainPosition From 091ca9743e97f16368c028d15ab00ec113e50b64 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 14 Jan 2016 16:41:29 +0100 Subject: [PATCH 13/26] Do not write LandData twice (Fixes #3140) --- apps/opencs/model/doc/savingstages.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/apps/opencs/model/doc/savingstages.cpp b/apps/opencs/model/doc/savingstages.cpp index db38c4779..af9c380a3 100644 --- a/apps/opencs/model/doc/savingstages.cpp +++ b/apps/opencs/model/doc/savingstages.cpp @@ -394,10 +394,6 @@ void CSMDoc::WriteLandCollectionStage::perform (int stage, Messages& messages) CSMWorld::Land record = land.get(); writer.startRecord (record.sRecordId); record.save (writer, land.mState == CSMWorld::RecordBase::State_Deleted); - - if (const ESM::Land::LandData *data = record.getLandData (record.mDataTypes)) - data->save (mState.getWriter()); - writer.endRecord (record.sRecordId); } } From 0b84b3c2cf3253b0cf6c514485fd4601677859a4 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 14 Jan 2016 17:41:39 +0100 Subject: [PATCH 14/26] Don't crash when region weather chances don't add to 100 The invalid weather ID was resulting in out-of-bounds vector access later in the code. --- apps/openmw/mwworld/weather.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwworld/weather.cpp b/apps/openmw/mwworld/weather.cpp index 5ce3d5c2f..321637194 100644 --- a/apps/openmw/mwworld/weather.cpp +++ b/apps/openmw/mwworld/weather.cpp @@ -321,10 +321,14 @@ void RegionWeather::chooseNewWeather() { sum += mChances[i]; if(chance <= sum) - break; + { + mWeather = i; + return; + } } - mWeather = i; + // if we hit this path then the chances don't add to 100, choose a default weather instead + mWeather = 0; } MoonModel::MoonModel(const std::string& name, const MWWorld::Fallback& fallback) From 4f2a031f4e66e50946ada6b20ada8f03d981fc6c Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 14 Jan 2016 18:34:47 +0100 Subject: [PATCH 15/26] Improve error message --- apps/openmw/mwworld/containerstore.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwworld/containerstore.cpp b/apps/openmw/mwworld/containerstore.cpp index 45390405e..d8c37061f 100644 --- a/apps/openmw/mwworld/containerstore.cpp +++ b/apps/openmw/mwworld/containerstore.cpp @@ -627,7 +627,7 @@ int MWWorld::ContainerStore::getType (const ConstPtr& ptr) return Type_Weapon; throw std::runtime_error ( - "Object of type " + ptr.getTypeName() + " can not be placed into a container"); + "Object '" + ptr.getCellRef().getRefId() + "' of type " + ptr.getTypeName() + " can not be placed into a container"); } MWWorld::Ptr MWWorld::ContainerStore::search (const std::string& id) From 18320b2cd03052dc70d8d710a91d8dd1e8bd2080 Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 15 Jan 2016 15:49:10 +0100 Subject: [PATCH 16/26] Move the Button enum to WorldSpaceWidget --- apps/opencs/view/render/pagedworldspacewidget.cpp | 4 ++-- .../opencs/view/render/unpagedworldspacewidget.cpp | 4 ++-- apps/opencs/view/render/worldspacewidget.cpp | 6 +++--- apps/opencs/view/render/worldspacewidget.hpp | 11 +++++++++++ apps/opencs/view/widget/scenetooltoggle2.cpp | 4 ++-- apps/opencs/view/widget/scenetooltoggle2.hpp | 14 +++----------- 6 files changed, 23 insertions(+), 20 deletions(-) diff --git a/apps/opencs/view/render/pagedworldspacewidget.cpp b/apps/opencs/view/render/pagedworldspacewidget.cpp index c6e422bd1..1880beab8 100644 --- a/apps/opencs/view/render/pagedworldspacewidget.cpp +++ b/apps/opencs/view/render/pagedworldspacewidget.cpp @@ -126,8 +126,8 @@ void CSVRender::PagedWorldspaceWidget::addVisibilitySelectorButtons ( CSVWidget::SceneToolToggle2 *tool) { WorldspaceWidget::addVisibilitySelectorButtons (tool); - tool->addButton (CSVWidget::SceneToolToggle2::Button_Terrain, Mask_Terrain, "Terrain"); - tool->addButton (CSVWidget::SceneToolToggle2::Button_Fog, Mask_Fog, "Fog", "", true); + tool->addButton (Button_Terrain, Mask_Terrain, "Terrain"); + tool->addButton (Button_Fog, Mask_Fog, "Fog", "", true); } void CSVRender::PagedWorldspaceWidget::addEditModeSelectorButtons ( diff --git a/apps/opencs/view/render/unpagedworldspacewidget.cpp b/apps/opencs/view/render/unpagedworldspacewidget.cpp index e203a250b..dad37c946 100644 --- a/apps/opencs/view/render/unpagedworldspacewidget.cpp +++ b/apps/opencs/view/render/unpagedworldspacewidget.cpp @@ -171,8 +171,8 @@ void CSVRender::UnpagedWorldspaceWidget::addVisibilitySelectorButtons ( CSVWidget::SceneToolToggle2 *tool) { WorldspaceWidget::addVisibilitySelectorButtons (tool); - tool->addButton (CSVWidget::SceneToolToggle2::Button_Terrain, Mask_Terrain, "Terrain", "", true); - tool->addButton (CSVWidget::SceneToolToggle2::Button_Fog, Mask_Fog, "Fog"); + tool->addButton (Button_Terrain, Mask_Terrain, "Terrain", "", true); + tool->addButton (Button_Fog, Mask_Fog, "Fog"); } std::string CSVRender::UnpagedWorldspaceWidget::getStartupInstruction() diff --git a/apps/opencs/view/render/worldspacewidget.cpp b/apps/opencs/view/render/worldspacewidget.cpp index 800fd3d6e..184477d6b 100644 --- a/apps/opencs/view/render/worldspacewidget.cpp +++ b/apps/opencs/view/render/worldspacewidget.cpp @@ -296,9 +296,9 @@ void CSVRender::WorldspaceWidget::setEditLock (bool locked) void CSVRender::WorldspaceWidget::addVisibilitySelectorButtons ( CSVWidget::SceneToolToggle2 *tool) { - tool->addButton (CSVWidget::SceneToolToggle2::Button_Reference, Mask_Reference, "Instances"); - tool->addButton (CSVWidget::SceneToolToggle2::Button_Water, Mask_Water, "Water"); - tool->addButton (CSVWidget::SceneToolToggle2::Button_Pathgrid, Mask_Pathgrid, "Pathgrid"); + tool->addButton (Button_Reference, Mask_Reference, "Instances"); + tool->addButton (Button_Water, Mask_Water, "Water"); + tool->addButton (Button_Pathgrid, Mask_Pathgrid, "Pathgrid"); } void CSVRender::WorldspaceWidget::addEditModeSelectorButtons (CSVWidget::SceneToolMode *tool) diff --git a/apps/opencs/view/render/worldspacewidget.hpp b/apps/opencs/view/render/worldspacewidget.hpp index 142ed04ca..7a77edad4 100644 --- a/apps/opencs/view/render/worldspacewidget.hpp +++ b/apps/opencs/view/render/worldspacewidget.hpp @@ -142,6 +142,17 @@ namespace CSVRender protected: + /// Visual elements in a scene + /// @note do not change the enumeration values, they are used in pre-existing button file names! + enum ButtonId + { + Button_Reference = 0x1, + Button_Pathgrid = 0x2, + Button_Water = 0x4, + Button_Fog = 0x8, + Button_Terrain = 0x10 + }; + virtual void addVisibilitySelectorButtons (CSVWidget::SceneToolToggle2 *tool); virtual void addEditModeSelectorButtons (CSVWidget::SceneToolMode *tool); diff --git a/apps/opencs/view/widget/scenetooltoggle2.cpp b/apps/opencs/view/widget/scenetooltoggle2.cpp index 3972aadaa..720da6a96 100644 --- a/apps/opencs/view/widget/scenetooltoggle2.cpp +++ b/apps/opencs/view/widget/scenetooltoggle2.cpp @@ -77,11 +77,11 @@ void CSVWidget::SceneToolToggle2::showPanel (const QPoint& position) mFirst->setFocus (Qt::OtherFocusReason); } -void CSVWidget::SceneToolToggle2::addButton (ButtonId id, unsigned int mask, +void CSVWidget::SceneToolToggle2::addButton (unsigned int id, unsigned int mask, const QString& name, const QString& tooltip, bool disabled) { std::ostringstream stream; - stream << mSingleIcon << static_cast(id); + stream << mSingleIcon << id; PushButton *button = new PushButton (QIcon (QPixmap (stream.str().c_str())), PushButton::Type_Toggle, tooltip.isEmpty() ? name: tooltip, mPanel); diff --git a/apps/opencs/view/widget/scenetooltoggle2.hpp b/apps/opencs/view/widget/scenetooltoggle2.hpp index eea9c3ebc..50337ac11 100644 --- a/apps/opencs/view/widget/scenetooltoggle2.hpp +++ b/apps/opencs/view/widget/scenetooltoggle2.hpp @@ -54,19 +54,11 @@ namespace CSVWidget virtual void showPanel (const QPoint& position); - /// Visual elements in a scene - /// @note do not change the enumeration values, they are used in pre-existing button file names! - enum ButtonId - { - Button_Reference = 0x1, - Button_Pathgrid = 0x2, - Button_Water = 0x4, - Button_Fog = 0x8, - Button_Terrain = 0x10 - }; + /// \param buttonId used to compose the icon filename + /// \param mask used for the reported getSelectionMask() / setSelectionMask() /// \attention After the last button has been added, setSelection must be called at /// least once to finalise the layout. - void addButton (ButtonId buttonId, unsigned int mask, + void addButton (unsigned int buttonId, unsigned int mask, const QString& name, const QString& tooltip = "", bool disabled = false); unsigned int getSelectionMask() const; From fbf07133ead40924b7ed57191505627fb632279c Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 15 Jan 2016 16:31:24 +0100 Subject: [PATCH 17/26] Document usage of node masks --- apps/opencs/view/render/mask.hpp | 5 ++++- apps/openmw/mwrender/vismask.hpp | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/apps/opencs/view/render/mask.hpp b/apps/opencs/view/render/mask.hpp index d2dfef7b4..55b7c823f 100644 --- a/apps/opencs/view/render/mask.hpp +++ b/apps/opencs/view/render/mask.hpp @@ -4,7 +4,10 @@ namespace CSVRender { - /// @note Enumeration values can be changed freely, as long as they do not collide. + /// Node masks used on the OSG scene graph in OpenMW-CS. + /// @note See the respective file in OpenMW (apps/openmw/mwrender/vismask.hpp) + /// for general usage hints about node masks. + /// @copydoc MWRender::VisMask enum Mask { // internal use within NifLoader, do not change diff --git a/apps/openmw/mwrender/vismask.hpp b/apps/openmw/mwrender/vismask.hpp index dd6e85e2c..81bb2f344 100644 --- a/apps/openmw/mwrender/vismask.hpp +++ b/apps/openmw/mwrender/vismask.hpp @@ -5,6 +5,20 @@ namespace MWRender { /// Node masks used for controlling visibility of game objects. + /// @par Any node in the OSG scene graph can have a node mask. When traversing the scene graph, + /// the node visitor's traversal mask is OR'ed with the node mask. If the result of this test is + /// 0, then the node and all its child nodes are not processed. + /// @par Important traversal masks are the camera's cull mask (determines what is visible), + /// the update visitor mask (what is updated) and the intersection visitor mask (what is + /// selectable through mouse clicks or other intersection tests). + /// @par In practice, it can be useful to make a "hierarchy" out of the node masks - e.g. in OpenMW, + /// all 3D rendering nodes are child of a Scene Root node with Mask_Scene. When we do not want 3D rendering, + /// we can just omit Mask_Scene from the traversal mask, and do not need to omit all the individual + /// element masks (water, sky, terrain, etc.) since the traversal will already have stopped at the Scene root node. + /// @par The comments within the VisMask enum should give some hints as to what masks are commonly "child" of + /// another mask, or what type of node this mask is usually set on. + /// @note The mask values are not serialized within models, nor used in any other way that would break backwards + /// compatibility if the enumeration values were to be changed. Feel free to change them when it makes sense. enum VisMask { Mask_UpdateVisitor = 0x1, // reserved for separating UpdateVisitors from CullVisitors @@ -24,8 +38,6 @@ namespace MWRender Mask_Sun = (1<<10), Mask_WeatherParticles = (1<<11), - // child of Water - // top level masks Mask_Scene = (1<<12), Mask_GUI = (1<<13), From 87beb7397070d65c3bf37d6b864f2bb904df69f5 Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 15 Jan 2016 16:34:57 +0100 Subject: [PATCH 18/26] Correction --- apps/openmw/mwrender/vismask.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwrender/vismask.hpp b/apps/openmw/mwrender/vismask.hpp index 81bb2f344..ce13758e3 100644 --- a/apps/openmw/mwrender/vismask.hpp +++ b/apps/openmw/mwrender/vismask.hpp @@ -6,7 +6,7 @@ namespace MWRender /// Node masks used for controlling visibility of game objects. /// @par Any node in the OSG scene graph can have a node mask. When traversing the scene graph, - /// the node visitor's traversal mask is OR'ed with the node mask. If the result of this test is + /// the node visitor's traversal mask is bitwise AND'ed with the node mask. If the result of this test is /// 0, then the node and all its child nodes are not processed. /// @par Important traversal masks are the camera's cull mask (determines what is visible), /// the update visitor mask (what is updated) and the intersection visitor mask (what is From a5411c1ec2551c4789a9ac17c84d147b3bea8d41 Mon Sep 17 00:00:00 2001 From: Rob Cutmore Date: Fri, 15 Jan 2016 20:51:39 -0500 Subject: [PATCH 19/26] Remove unused code --- apps/launcher/main.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/apps/launcher/main.cpp b/apps/launcher/main.cpp index 282b3fb89..eadec64d0 100644 --- a/apps/launcher/main.cpp +++ b/apps/launcher/main.cpp @@ -51,10 +51,6 @@ int main(int argc, char *argv[]) if (result == Launcher::FirstRunDialogResultFailure) return 0; - // if (!mainWin.setup()) { - // return 0; - // } - if (result == Launcher::FirstRunDialogResultContinue) mainWin.show(); From e30a38a4c1cd13c1312112a44800d2222f99d367 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sat, 16 Jan 2016 10:55:05 +0100 Subject: [PATCH 20/26] updated credits file --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index d4927ea92..ce2728010 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -96,6 +96,7 @@ Programmers Pieter van der Kloet (pvdk) pkubik Radu-Marius Popovici (rpopovici) + rcutmore rdimesio riothamus Robert MacGregor (Ragora) From 21d13a48faeb91a42634a288e66fd25e82ea00aa Mon Sep 17 00:00:00 2001 From: Rob Cutmore Date: Sat, 16 Jan 2016 06:43:45 -0500 Subject: [PATCH 21/26] Make setup method of MainDialog class private --- apps/launcher/maindialog.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/launcher/maindialog.hpp b/apps/launcher/maindialog.hpp index 0dfea4865..96b5c0b97 100644 --- a/apps/launcher/maindialog.hpp +++ b/apps/launcher/maindialog.hpp @@ -50,7 +50,6 @@ namespace Launcher explicit MainDialog(QWidget *parent = 0); ~MainDialog(); - bool setup(); FirstRunDialogResult showFirstRunDialog(); bool reloadSettings(); @@ -65,6 +64,8 @@ namespace Launcher void wizardFinished(int exitCode, QProcess::ExitStatus exitStatus); private: + bool setup(); + void createIcons(); void createPages(); From 97bcdf7904e2146ff0167710c7ebd658a2f5696b Mon Sep 17 00:00:00 2001 From: "Hristos N. Triantafillou" Date: Sat, 16 Jan 2016 15:57:03 -0600 Subject: [PATCH 22/26] Properly find MyGUI in /usr/local/lib --- cmake/FindMyGUI.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/FindMyGUI.cmake b/cmake/FindMyGUI.cmake index 61a39e4d3..85a1055f6 100644 --- a/cmake/FindMyGUI.cmake +++ b/cmake/FindMyGUI.cmake @@ -101,7 +101,7 @@ ELSE (WIN32) #Unix SET(MYGUI_LIBRARIES ${MYGUI_LIBRARIES} CACHE STRING "") ELSE (MYGUI_INCLUDE_DIRS) FIND_PATH(MYGUI_INCLUDE_DIRS MyGUI.h PATHS /usr/local/include /usr/include PATH_SUFFIXES MyGUI MYGUI) - FIND_LIBRARY(MYGUI_LIBRARIES mygui PATHS /usr/lib /usr/local/lib) + FIND_LIBRARY(MYGUI_LIBRARIES MyGUIEngine PATHS /usr/local/lib /usr/lib) SET(MYGUI_LIB_DIR ${MYGUI_LIBRARIES}) STRING(REGEX REPLACE "(.*)/.*" "\\1" MYGUI_LIB_DIR "${MYGUI_LIB_DIR}") STRING(REGEX REPLACE ".*/" "" MYGUI_LIBRARIES "${MYGUI_LIBRARIES}") From 259d51058a7cad81e4a121a14765e23290e91289 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 17 Jan 2016 00:09:58 +0100 Subject: [PATCH 23/26] Update AUTHORS.md --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index ce2728010..bfbd14a5b 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -48,6 +48,7 @@ Programmers Gašper Sedej gugus/gus Hallfaer Tuilinn + hristoast Internecine Jacob Essex (Yacoby) Jannik Heller (scrawl) From 08b469c0d004cb87c9a5f90e32ca098a7e43f635 Mon Sep 17 00:00:00 2001 From: Rob Cutmore Date: Sun, 17 Jan 2016 14:18:49 -0500 Subject: [PATCH 24/26] Remove unused forward declarations in filedialog.hpp --- apps/opencs/view/doc/filedialog.hpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/apps/opencs/view/doc/filedialog.hpp b/apps/opencs/view/doc/filedialog.hpp index 648836565..ca6145b9c 100644 --- a/apps/opencs/view/doc/filedialog.hpp +++ b/apps/opencs/view/doc/filedialog.hpp @@ -14,9 +14,6 @@ Q_DECLARE_METATYPE (boost::filesystem::path) #include "ui_filedialog.h" -class DataFilesModel; -class PluginsProxyModel; - namespace ContentSelectorView { class ContentSelector; From 1d86f705baab74a592c4711689cc307a41e2518c Mon Sep 17 00:00:00 2001 From: Aesylwinn Date: Sun, 17 Jan 2016 21:55:03 -0500 Subject: [PATCH 25/26] gmst verifier --- apps/opencs/CMakeLists.txt | 4 +- apps/opencs/model/doc/document.cpp | 2008 +------------------ apps/opencs/model/tools/gmstcheck.cpp | 91 + apps/opencs/model/tools/gmstcheck.hpp | 32 + apps/opencs/model/tools/tools.cpp | 3 + apps/opencs/model/world/defaultgmsts.cpp | 2336 ++++++++++++++++++++++ apps/opencs/model/world/defaultgmsts.hpp | 34 + 7 files changed, 2514 insertions(+), 1994 deletions(-) create mode 100644 apps/opencs/model/tools/gmstcheck.cpp create mode 100644 apps/opencs/model/tools/gmstcheck.hpp create mode 100644 apps/opencs/model/world/defaultgmsts.cpp create mode 100644 apps/opencs/model/world/defaultgmsts.hpp diff --git a/apps/opencs/CMakeLists.txt b/apps/opencs/CMakeLists.txt index 8bb624704..0d621c83e 100644 --- a/apps/opencs/CMakeLists.txt +++ b/apps/opencs/CMakeLists.txt @@ -26,7 +26,7 @@ opencs_units_noqt (model/world universalid record commands columnbase columnimp scriptcontext cell refidcollection refidadapter refiddata refidadapterimp ref collectionbase refcollection columns infocollection tablemimedata cellcoordinates cellselection resources resourcesmanager scope pathgrid landtexture land nestedtablewrapper nestedcollection nestedcoladapterimp nestedinfocollection - idcompletionmanager metadata + idcompletionmanager metadata defaultgmsts ) opencs_hdrs_noqt (model/world @@ -42,7 +42,7 @@ opencs_units_noqt (model/tools mandatoryid skillcheck classcheck factioncheck racecheck soundcheck regioncheck birthsigncheck spellcheck referencecheck referenceablecheck scriptcheck bodypartcheck startscriptcheck search searchoperation searchstage pathgridcheck soundgencheck magiceffectcheck - mergestages + mergestages gmstcheck ) opencs_hdrs_noqt (model/tools diff --git a/apps/opencs/model/doc/document.cpp b/apps/opencs/model/doc/document.cpp index 80c14bd98..ea1fbb330 100644 --- a/apps/opencs/model/doc/document.cpp +++ b/apps/opencs/model/doc/document.cpp @@ -6,1925 +6,36 @@ #include +#include "../world/defaultgmsts.hpp" + #ifndef Q_MOC_RUN #include #endif void CSMDoc::Document::addGmsts() { - static const char *gmstFloats[] = - { - "fAIFleeFleeMult", - "fAIFleeHealthMult", - "fAIMagicSpellMult", - "fAIMeleeArmorMult", - "fAIMeleeSummWeaponMult", - "fAIMeleeWeaponMult", - "fAIRangeMagicSpellMult", - "fAIRangeMeleeWeaponMult", - "fAlarmRadius", - "fAthleticsRunBonus", - "fAudioDefaultMaxDistance", - "fAudioDefaultMinDistance", - "fAudioMaxDistanceMult", - "fAudioMinDistanceMult", - "fAudioVoiceDefaultMaxDistance", - "fAudioVoiceDefaultMinDistance", - "fAutoPCSpellChance", - "fAutoSpellChance", - "fBargainOfferBase", - "fBargainOfferMulti", - "fBarterGoldResetDelay", - "fBaseRunMultiplier", - "fBlockStillBonus", - "fBribe1000Mod", - "fBribe100Mod", - "fBribe10Mod", - "fCombatAngleXY", - "fCombatAngleZ", - "fCombatArmorMinMult", - "fCombatBlockLeftAngle", - "fCombatBlockRightAngle", - "fCombatCriticalStrikeMult", - "fCombatDelayCreature", - "fCombatDelayNPC", - "fCombatDistance", - "fCombatDistanceWerewolfMod", - "fCombatForceSideAngle", - "fCombatInvisoMult", - "fCombatKODamageMult", - "fCombatTorsoSideAngle", - "fCombatTorsoStartPercent", - "fCombatTorsoStopPercent", - "fConstantEffectMult", - "fCorpseClearDelay", - "fCorpseRespawnDelay", - "fCrimeGoldDiscountMult", - "fCrimeGoldTurnInMult", - "fCrimeStealing", - "fDamageStrengthBase", - "fDamageStrengthMult", - "fDifficultyMult", - "fDiseaseXferChance", - "fDispAttacking", - "fDispBargainFailMod", - "fDispBargainSuccessMod", - "fDispCrimeMod", - "fDispDiseaseMod", - "fDispFactionMod", - "fDispFactionRankBase", - "fDispFactionRankMult", - "fDispositionMod", - "fDispPersonalityBase", - "fDispPersonalityMult", - "fDispPickPocketMod", - "fDispRaceMod", - "fDispStealing", - "fDispWeaponDrawn", - "fEffectCostMult", - "fElementalShieldMult", - "fEnchantmentChanceMult", - "fEnchantmentConstantChanceMult", - "fEnchantmentConstantDurationMult", - "fEnchantmentMult", - "fEnchantmentValueMult", - "fEncumberedMoveEffect", - "fEncumbranceStrMult", - "fEndFatigueMult", - "fFallAcroBase", - "fFallAcroMult", - "fFallDamageDistanceMin", - "fFallDistanceBase", - "fFallDistanceMult", - "fFatigueAttackBase", - "fFatigueAttackMult", - "fFatigueBase", - "fFatigueBlockBase", - "fFatigueBlockMult", - "fFatigueJumpBase", - "fFatigueJumpMult", - "fFatigueMult", - "fFatigueReturnBase", - "fFatigueReturnMult", - "fFatigueRunBase", - "fFatigueRunMult", - "fFatigueSneakBase", - "fFatigueSneakMult", - "fFatigueSpellBase", - "fFatigueSpellCostMult", - "fFatigueSpellMult", - "fFatigueSwimRunBase", - "fFatigueSwimRunMult", - "fFatigueSwimWalkBase", - "fFatigueSwimWalkMult", - "fFightDispMult", - "fFightDistanceMultiplier", - "fFightStealing", - "fFleeDistance", - "fGreetDistanceReset", - "fHandtoHandHealthPer", - "fHandToHandReach", - "fHoldBreathEndMult", - "fHoldBreathTime", - "fIdleChanceMultiplier", - "fIngredientMult", - "fInteriorHeadTrackMult", - "fJumpAcrobaticsBase", - "fJumpAcroMultiplier", - "fJumpEncumbranceBase", - "fJumpEncumbranceMultiplier", - "fJumpMoveBase", - "fJumpMoveMult", - "fJumpRunMultiplier", - "fKnockDownMult", - "fLevelMod", - "fLevelUpHealthEndMult", - "fLightMaxMod", - "fLuckMod", - "fMagesGuildTravel", - "fMagicCreatureCastDelay", - "fMagicDetectRefreshRate", - "fMagicItemConstantMult", - "fMagicItemCostMult", - "fMagicItemOnceMult", - "fMagicItemPriceMult", - "fMagicItemRechargePerSecond", - "fMagicItemStrikeMult", - "fMagicItemUsedMult", - "fMagicStartIconBlink", - "fMagicSunBlockedMult", - "fMajorSkillBonus", - "fMaxFlySpeed", - "fMaxHandToHandMult", - "fMaxHeadTrackDistance", - "fMaxWalkSpeed", - "fMaxWalkSpeedCreature", - "fMedMaxMod", - "fMessageTimePerChar", - "fMinFlySpeed", - "fMinHandToHandMult", - "fMinorSkillBonus", - "fMinWalkSpeed", - "fMinWalkSpeedCreature", - "fMiscSkillBonus", - "fNPCbaseMagickaMult", - "fNPCHealthBarFade", - "fNPCHealthBarTime", - "fPCbaseMagickaMult", - "fPerDieRollMult", - "fPersonalityMod", - "fPerTempMult", - "fPickLockMult", - "fPickPocketMod", - "fPotionMinUsefulDuration", - "fPotionStrengthMult", - "fPotionT1DurMult", - "fPotionT1MagMult", - "fPotionT4BaseStrengthMult", - "fPotionT4EquipStrengthMult", - "fProjectileMaxSpeed", - "fProjectileMinSpeed", - "fProjectileThrownStoreChance", - "fRepairAmountMult", - "fRepairMult", - "fReputationMod", - "fRestMagicMult", - "fSeriousWoundMult", - "fSleepRandMod", - "fSleepRestMod", - "fSneakBootMult", - "fSneakDistanceBase", - "fSneakDistanceMultiplier", - "fSneakNoViewMult", - "fSneakSkillMult", - "fSneakSpeedMultiplier", - "fSneakUseDelay", - "fSneakUseDist", - "fSneakViewMult", - "fSoulGemMult", - "fSpecialSkillBonus", - "fSpellMakingValueMult", - "fSpellPriceMult", - "fSpellValueMult", - "fStromWalkMult", - "fStromWindSpeed", - "fSuffocationDamage", - "fSwimHeightScale", - "fSwimRunAthleticsMult", - "fSwimRunBase", - "fSwimWalkAthleticsMult", - "fSwimWalkBase", - "fSwingBlockBase", - "fSwingBlockMult", - "fTargetSpellMaxSpeed", - "fThrownWeaponMaxSpeed", - "fThrownWeaponMinSpeed", - "fTrapCostMult", - "fTravelMult", - "fTravelTimeMult", - "fUnarmoredBase1", - "fUnarmoredBase2", - "fVanityDelay", - "fVoiceIdleOdds", - "fWaterReflectUpdateAlways", - "fWaterReflectUpdateSeldom", - "fWeaponDamageMult", - "fWeaponFatigueBlockMult", - "fWeaponFatigueMult", - "fWereWolfAcrobatics", - "fWereWolfAgility", - "fWereWolfAlchemy", - "fWereWolfAlteration", - "fWereWolfArmorer", - "fWereWolfAthletics", - "fWereWolfAxe", - "fWereWolfBlock", - "fWereWolfBluntWeapon", - "fWereWolfConjuration", - "fWereWolfDestruction", - "fWereWolfEnchant", - "fWereWolfEndurance", - "fWereWolfFatigue", - "fWereWolfHandtoHand", - "fWereWolfHealth", - "fWereWolfHeavyArmor", - "fWereWolfIllusion", - "fWereWolfIntellegence", - "fWereWolfLightArmor", - "fWereWolfLongBlade", - "fWereWolfLuck", - "fWereWolfMagicka", - "fWereWolfMarksman", - "fWereWolfMediumArmor", - "fWereWolfMerchantile", - "fWereWolfMysticism", - "fWereWolfPersonality", - "fWereWolfRestoration", - "fWereWolfRunMult", - "fWereWolfSecurity", - "fWereWolfShortBlade", - "fWereWolfSilverWeaponDamageMult", - "fWereWolfSneak", - "fWereWolfSpear", - "fWereWolfSpeechcraft", - "fWereWolfSpeed", - "fWereWolfStrength", - "fWereWolfUnarmored", - "fWereWolfWillPower", - "fWortChanceValue", - 0 - }; - - static const float gmstFloatsValues[] = - { - 0.3, // fAIFleeFleeMult - 7.0, // fAIFleeHealthMult - 3.0, // fAIMagicSpellMult - 1.0, // fAIMeleeArmorMult - 1.0, // fAIMeleeSummWeaponMult - 2.0, // fAIMeleeWeaponMult - 5.0, // fAIRangeMagicSpellMult - 5.0, // fAIRangeMeleeWeaponMult - 2000.0, // fAlarmRadius - 1.0, // fAthleticsRunBonus - 40.0, // fAudioDefaultMaxDistance - 5.0, // fAudioDefaultMinDistance - 50.0, // fAudioMaxDistanceMult - 20.0, // fAudioMinDistanceMult - 60.0, // fAudioVoiceDefaultMaxDistance - 10.0, // fAudioVoiceDefaultMinDistance - 50.0, // fAutoPCSpellChance - 80.0, // fAutoSpellChance - 50.0, // fBargainOfferBase - -4.0, // fBargainOfferMulti - 24.0, // fBarterGoldResetDelay - 1.75, // fBaseRunMultiplier - 1.25, // fBlockStillBonus - 150.0, // fBribe1000Mod - 75.0, // fBribe100Mod - 35.0, // fBribe10Mod - 60.0, // fCombatAngleXY - 60.0, // fCombatAngleZ - 0.25, // fCombatArmorMinMult - -90.0, // fCombatBlockLeftAngle - 30.0, // fCombatBlockRightAngle - 4.0, // fCombatCriticalStrikeMult - 0.1, // fCombatDelayCreature - 0.1, // fCombatDelayNPC - 128.0, // fCombatDistance - 0.3, // fCombatDistanceWerewolfMod - 30.0, // fCombatForceSideAngle - 0.2, // fCombatInvisoMult - 1.5, // fCombatKODamageMult - 45.0, // fCombatTorsoSideAngle - 0.3, // fCombatTorsoStartPercent - 0.8, // fCombatTorsoStopPercent - 15.0, // fConstantEffectMult - 72.0, // fCorpseClearDelay - 72.0, // fCorpseRespawnDelay - 0.5, // fCrimeGoldDiscountMult - 0.9, // fCrimeGoldTurnInMult - 1.0, // fCrimeStealing - 0.5, // fDamageStrengthBase - 0.1, // fDamageStrengthMult - 5.0, // fDifficultyMult - 2.5, // fDiseaseXferChance - -10.0, // fDispAttacking - -1.0, // fDispBargainFailMod - 1.0, // fDispBargainSuccessMod - 0.0, // fDispCrimeMod - -10.0, // fDispDiseaseMod - 3.0, // fDispFactionMod - 1.0, // fDispFactionRankBase - 0.5, // fDispFactionRankMult - 1.0, // fDispositionMod - 50.0, // fDispPersonalityBase - 0.5, // fDispPersonalityMult - -25.0, // fDispPickPocketMod - 5.0, // fDispRaceMod - -0.5, // fDispStealing - -5.0, // fDispWeaponDrawn - 0.5, // fEffectCostMult - 0.1, // fElementalShieldMult - 3.0, // fEnchantmentChanceMult - 0.5, // fEnchantmentConstantChanceMult - 100.0, // fEnchantmentConstantDurationMult - 0.1, // fEnchantmentMult - 1000.0, // fEnchantmentValueMult - 0.3, // fEncumberedMoveEffect - 5.0, // fEncumbranceStrMult - 0.04, // fEndFatigueMult - 0.25, // fFallAcroBase - 0.01, // fFallAcroMult - 400.0, // fFallDamageDistanceMin - 0.0, // fFallDistanceBase - 0.07, // fFallDistanceMult - 2.0, // fFatigueAttackBase - 0.0, // fFatigueAttackMult - 1.25, // fFatigueBase - 4.0, // fFatigueBlockBase - 0.0, // fFatigueBlockMult - 5.0, // fFatigueJumpBase - 0.0, // fFatigueJumpMult - 0.5, // fFatigueMult - 2.5, // fFatigueReturnBase - 0.02, // fFatigueReturnMult - 5.0, // fFatigueRunBase - 2.0, // fFatigueRunMult - 1.5, // fFatigueSneakBase - 1.5, // fFatigueSneakMult - 0.0, // fFatigueSpellBase - 0.0, // fFatigueSpellCostMult - 0.0, // fFatigueSpellMult - 7.0, // fFatigueSwimRunBase - 0.0, // fFatigueSwimRunMult - 2.5, // fFatigueSwimWalkBase - 0.0, // fFatigueSwimWalkMult - 0.2, // fFightDispMult - 0.005, // fFightDistanceMultiplier - 50.0, // fFightStealing - 3000.0, // fFleeDistance - 512.0, // fGreetDistanceReset - 0.1, // fHandtoHandHealthPer - 1.0, // fHandToHandReach - 0.5, // fHoldBreathEndMult - 20.0, // fHoldBreathTime - 0.75, // fIdleChanceMultiplier - 1.0, // fIngredientMult - 0.5, // fInteriorHeadTrackMult - 128.0, // fJumpAcrobaticsBase - 4.0, // fJumpAcroMultiplier - 0.5, // fJumpEncumbranceBase - 1.0, // fJumpEncumbranceMultiplier - 0.5, // fJumpMoveBase - 0.5, // fJumpMoveMult - 1.0, // fJumpRunMultiplier - 0.5, // fKnockDownMult - 5.0, // fLevelMod - 0.1, // fLevelUpHealthEndMult - 0.6, // fLightMaxMod - 10.0, // fLuckMod - 10.0, // fMagesGuildTravel - 1.5, // fMagicCreatureCastDelay - 0.0167, // fMagicDetectRefreshRate - 1.0, // fMagicItemConstantMult - 1.0, // fMagicItemCostMult - 1.0, // fMagicItemOnceMult - 1.0, // fMagicItemPriceMult - 0.05, // fMagicItemRechargePerSecond - 1.0, // fMagicItemStrikeMult - 1.0, // fMagicItemUsedMult - 3.0, // fMagicStartIconBlink - 0.5, // fMagicSunBlockedMult - 0.75, // fMajorSkillBonus - 300.0, // fMaxFlySpeed - 0.5, // fMaxHandToHandMult - 400.0, // fMaxHeadTrackDistance - 200.0, // fMaxWalkSpeed - 300.0, // fMaxWalkSpeedCreature - 0.9, // fMedMaxMod - 0.1, // fMessageTimePerChar - 5.0, // fMinFlySpeed - 0.1, // fMinHandToHandMult - 1.0, // fMinorSkillBonus - 100.0, // fMinWalkSpeed - 5.0, // fMinWalkSpeedCreature - 1.25, // fMiscSkillBonus - 2.0, // fNPCbaseMagickaMult - 0.5, // fNPCHealthBarFade - 3.0, // fNPCHealthBarTime - 1.0, // fPCbaseMagickaMult - 0.3, // fPerDieRollMult - 5.0, // fPersonalityMod - 1.0, // fPerTempMult - -1.0, // fPickLockMult - 0.3, // fPickPocketMod - 20.0, // fPotionMinUsefulDuration - 0.5, // fPotionStrengthMult - 0.5, // fPotionT1DurMult - 1.5, // fPotionT1MagMult - 20.0, // fPotionT4BaseStrengthMult - 12.0, // fPotionT4EquipStrengthMult - 3000.0, // fProjectileMaxSpeed - 400.0, // fProjectileMinSpeed - 25.0, // fProjectileThrownStoreChance - 3.0, // fRepairAmountMult - 1.0, // fRepairMult - 1.0, // fReputationMod - 0.15, // fRestMagicMult - 0.0, // fSeriousWoundMult - 0.25, // fSleepRandMod - 0.3, // fSleepRestMod - -1.0, // fSneakBootMult - 0.5, // fSneakDistanceBase - 0.002, // fSneakDistanceMultiplier - 0.5, // fSneakNoViewMult - 1.0, // fSneakSkillMult - 0.75, // fSneakSpeedMultiplier - 1.0, // fSneakUseDelay - 500.0, // fSneakUseDist - 1.5, // fSneakViewMult - 3.0, // fSoulGemMult - 0.8, // fSpecialSkillBonus - 7.0, // fSpellMakingValueMult - 2.0, // fSpellPriceMult - 10.0, // fSpellValueMult - 0.25, // fStromWalkMult - 0.7, // fStromWindSpeed - 3.0, // fSuffocationDamage - 0.9, // fSwimHeightScale - 0.1, // fSwimRunAthleticsMult - 0.5, // fSwimRunBase - 0.02, // fSwimWalkAthleticsMult - 0.5, // fSwimWalkBase - 1.0, // fSwingBlockBase - 1.0, // fSwingBlockMult - 1000.0, // fTargetSpellMaxSpeed - 1000.0, // fThrownWeaponMaxSpeed - 300.0, // fThrownWeaponMinSpeed - 0.0, // fTrapCostMult - 4000.0, // fTravelMult - 16000.0,// fTravelTimeMult - 0.1, // fUnarmoredBase1 - 0.065, // fUnarmoredBase2 - 30.0, // fVanityDelay - 10.0, // fVoiceIdleOdds - 0.0, // fWaterReflectUpdateAlways - 10.0, // fWaterReflectUpdateSeldom - 0.1, // fWeaponDamageMult - 1.0, // fWeaponFatigueBlockMult - 0.25, // fWeaponFatigueMult - 150.0, // fWereWolfAcrobatics - 150.0, // fWereWolfAgility - 1.0, // fWereWolfAlchemy - 1.0, // fWereWolfAlteration - 1.0, // fWereWolfArmorer - 150.0, // fWereWolfAthletics - 1.0, // fWereWolfAxe - 1.0, // fWereWolfBlock - 1.0, // fWereWolfBluntWeapon - 1.0, // fWereWolfConjuration - 1.0, // fWereWolfDestruction - 1.0, // fWereWolfEnchant - 150.0, // fWereWolfEndurance - 400.0, // fWereWolfFatigue - 100.0, // fWereWolfHandtoHand - 2.0, // fWereWolfHealth - 1.0, // fWereWolfHeavyArmor - 1.0, // fWereWolfIllusion - 1.0, // fWereWolfIntellegence - 1.0, // fWereWolfLightArmor - 1.0, // fWereWolfLongBlade - 1.0, // fWereWolfLuck - 100.0, // fWereWolfMagicka - 1.0, // fWereWolfMarksman - 1.0, // fWereWolfMediumArmor - 1.0, // fWereWolfMerchantile - 1.0, // fWereWolfMysticism - 1.0, // fWereWolfPersonality - 1.0, // fWereWolfRestoration - 1.5, // fWereWolfRunMult - 1.0, // fWereWolfSecurity - 1.0, // fWereWolfShortBlade - 1.5, // fWereWolfSilverWeaponDamageMult - 1.0, // fWereWolfSneak - 1.0, // fWereWolfSpear - 1.0, // fWereWolfSpeechcraft - 150.0, // fWereWolfSpeed - 150.0, // fWereWolfStrength - 100.0, // fWereWolfUnarmored - 1.0, // fWereWolfWillPower - 15.0, // fWortChanceValue - }; - - static const char *gmstIntegers[] = - { - "i1stPersonSneakDelta", - "iAlarmAttack", - "iAlarmKilling", - "iAlarmPickPocket", - "iAlarmStealing", - "iAlarmTresspass", - "iAlchemyMod", - "iAutoPCSpellMax", - "iAutoRepFacMod", - "iAutoRepLevMod", - "iAutoSpellAlterationMax", - "iAutoSpellAttSkillMin", - "iAutoSpellConjurationMax", - "iAutoSpellDestructionMax", - "iAutoSpellIllusionMax", - "iAutoSpellMysticismMax", - "iAutoSpellRestorationMax", - "iAutoSpellTimesCanCast", - "iBarterFailDisposition", - "iBarterSuccessDisposition", - "iBaseArmorSkill", - "iBlockMaxChance", - "iBlockMinChance", - "iBootsWeight", - "iCrimeAttack", - "iCrimeKilling", - "iCrimePickPocket", - "iCrimeThreshold", - "iCrimeThresholdMultiplier", - "iCrimeTresspass", - "iCuirassWeight", - "iDaysinPrisonMod", - "iDispAttackMod", - "iDispKilling", - "iDispTresspass", - "iFightAlarmMult", - "iFightAttack", - "iFightAttacking", - "iFightDistanceBase", - "iFightKilling", - "iFightPickpocket", - "iFightTrespass", - "iFlee", - "iGauntletWeight", - "iGreavesWeight", - "iGreetDistanceMultiplier", - "iGreetDuration", - "iHelmWeight", - "iKnockDownOddsBase", - "iKnockDownOddsMult", - "iLevelUp01Mult", - "iLevelUp02Mult", - "iLevelUp03Mult", - "iLevelUp04Mult", - "iLevelUp05Mult", - "iLevelUp06Mult", - "iLevelUp07Mult", - "iLevelUp08Mult", - "iLevelUp09Mult", - "iLevelUp10Mult", - "iLevelupMajorMult", - "iLevelupMajorMultAttribute", - "iLevelupMinorMult", - "iLevelupMinorMultAttribute", - "iLevelupMiscMultAttriubte", - "iLevelupSpecialization", - "iLevelupTotal", - "iMagicItemChargeConst", - "iMagicItemChargeOnce", - "iMagicItemChargeStrike", - "iMagicItemChargeUse", - "iMaxActivateDist", - "iMaxInfoDist", - "iMonthsToRespawn", - "iNumberCreatures", - "iPauldronWeight", - "iPerMinChance", - "iPerMinChange", - "iPickMaxChance", - "iPickMinChance", - "iShieldWeight", - "iSoulAmountForConstantEffect", - "iTrainingMod", - "iVoiceAttackOdds", - "iVoiceHitOdds", - "iWereWolfBounty", - "iWereWolfFightMod", - "iWereWolfFleeMod", - "iWereWolfLevelToAttack", - 0 - }; - - static const int gmstIntegersValues[] = - { - 10, // i1stPersonSneakDelta - 50, // iAlarmAttack - 90, // iAlarmKilling - 20, // iAlarmPickPocket - 1, // iAlarmStealing - 5, // iAlarmTresspass - 2, // iAlchemyMod - 100, // iAutoPCSpellMax - 2, // iAutoRepFacMod - 0, // iAutoRepLevMod - 5, // iAutoSpellAlterationMax - 70, // iAutoSpellAttSkillMin - 2, // iAutoSpellConjurationMax - 5, // iAutoSpellDestructionMax - 5, // iAutoSpellIllusionMax - 5, // iAutoSpellMysticismMax - 5, // iAutoSpellRestorationMax - 3, // iAutoSpellTimesCanCast - -1, // iBarterFailDisposition - 1, // iBarterSuccessDisposition - 30, // iBaseArmorSkill - 50, // iBlockMaxChance - 10, // iBlockMinChance - 20, // iBootsWeight - 40, // iCrimeAttack - 1000, // iCrimeKilling - 25, // iCrimePickPocket - 1000, // iCrimeThreshold - 10, // iCrimeThresholdMultiplier - 5, // iCrimeTresspass - 30, // iCuirassWeight - 100, // iDaysinPrisonMod - -50, // iDispAttackMod - -50, // iDispKilling - -20, // iDispTresspass - 1, // iFightAlarmMult - 100, // iFightAttack - 50, // iFightAttacking - 20, // iFightDistanceBase - 50, // iFightKilling - 25, // iFightPickpocket - 25, // iFightTrespass - 0, // iFlee - 5, // iGauntletWeight - 15, // iGreavesWeight - 6, // iGreetDistanceMultiplier - 4, // iGreetDuration - 5, // iHelmWeight - 50, // iKnockDownOddsBase - 50, // iKnockDownOddsMult - 2, // iLevelUp01Mult - 2, // iLevelUp02Mult - 2, // iLevelUp03Mult - 2, // iLevelUp04Mult - 3, // iLevelUp05Mult - 3, // iLevelUp06Mult - 3, // iLevelUp07Mult - 4, // iLevelUp08Mult - 4, // iLevelUp09Mult - 5, // iLevelUp10Mult - 1, // iLevelupMajorMult - 1, // iLevelupMajorMultAttribute - 1, // iLevelupMinorMult - 1, // iLevelupMinorMultAttribute - 1, // iLevelupMiscMultAttriubte - 1, // iLevelupSpecialization - 10, // iLevelupTotal - 10, // iMagicItemChargeConst - 1, // iMagicItemChargeOnce - 10, // iMagicItemChargeStrike - 5, // iMagicItemChargeUse - 192, // iMaxActivateDist - 192, // iMaxInfoDist - 4, // iMonthsToRespawn - 1, // iNumberCreatures - 10, // iPauldronWeight - 5, // iPerMinChance - 10, // iPerMinChange - 75, // iPickMaxChance - 5, // iPickMinChance - 15, // iShieldWeight - 400, // iSoulAmountForConstantEffect - 10, // iTrainingMod - 10, // iVoiceAttackOdds - 30, // iVoiceHitOdds - 10000, // iWereWolfBounty - 100, // iWereWolfFightMod - 100, // iWereWolfFleeMod - 20, // iWereWolfLevelToAttack - }; - - static const char *gmstStrings[] = - { - "s3dAudio", - "s3dHardware", - "s3dSoftware", - "sAbsorb", - "sAcrobat", - "sActivate", - "sActivateXbox", - "sActorInCombat", - "sAdmire", - "sAdmireFail", - "sAdmireSuccess", - "sAgent", - "sAgiDesc", - "sAIDistance", - "sAlembic", - "sAllTab", - "sAlways", - "sAlways_Run", - "sand", - "sApparatus", - "sApparelTab", - "sArcher", - "sArea", - "sAreaDes", - "sArmor", - "sArmorRating", - "sAsk", - "sAssassin", - "sAt", - "sAttack", - "sAttributeAgility", - "sAttributeEndurance", - "sAttributeIntelligence", - "sAttributeListTitle", - "sAttributeLuck", - "sAttributePersonality", - "sAttributesMenu1", - "sAttributeSpeed", - "sAttributeStrength", - "sAttributeWillpower", - "sAudio", - "sAuto_Run", - "sBack", - "sBackspace", - "sBackXbox", - "sBarbarian", - "sBard", - "sBarter", - "sBarterDialog1", - "sBarterDialog10", - "sBarterDialog11", - "sBarterDialog12", - "sBarterDialog2", - "sBarterDialog3", - "sBarterDialog4", - "sBarterDialog5", - "sBarterDialog6", - "sBarterDialog7", - "sBarterDialog8", - "sBarterDialog9", - "sBattlemage", - "sBestAttack", - "sBirthSign", - "sBirthsignmenu1", - "sBirthsignmenu2", - "sBlocks", - "sBonusSkillTitle", - "sBookPageOne", - "sBookPageTwo", - "sBookSkillMessage", - "sBounty", - "sBreath", - "sBribe 10 Gold", - "sBribe 100 Gold", - "sBribe 1000 Gold", - "sBribeFail", - "sBribeSuccess", - "sBuy", - "sBye", - "sCalcinator", - "sCancel", - "sCantEquipWeapWarning", - "sCastCost", - "sCaughtStealingMessage", - "sCenter", - "sChangedMastersMsg", - "sCharges", - "sChooseClassMenu1", - "sChooseClassMenu2", - "sChooseClassMenu3", - "sChooseClassMenu4", - "sChop", - "sClass", - "sClassChoiceMenu1", - "sClassChoiceMenu2", - "sClassChoiceMenu3", - "sClose", - "sCompanionShare", - "sCompanionWarningButtonOne", - "sCompanionWarningButtonTwo", - "sCompanionWarningMessage", - "sCondition", - "sConsoleTitle", - "sContainer", - "sContentsMessage1", - "sContentsMessage2", - "sContentsMessage3", - "sControlerVibration", - "sControls", - "sControlsMenu1", - "sControlsMenu2", - "sControlsMenu3", - "sControlsMenu4", - "sControlsMenu5", - "sControlsMenu6", - "sCostChance", - "sCostCharge", - "sCreate", - "sCreateClassMenu1", - "sCreateClassMenu2", - "sCreateClassMenu3", - "sCreateClassMenuHelp1", - "sCreateClassMenuHelp2", - "sCreateClassMenuWarning", - "sCreatedEffects", - "sCrimeHelp", - "sCrimeMessage", - "sCrouch_Sneak", - "sCrouchXbox", - "sCrusader", - "sCursorOff", - "sCustom", - "sCustomClassName", - "sDamage", - "sDark_Gamma", - "sDay", - "sDefaultCellname", - "sDelete", - "sDeleteGame", - "sDeleteNote", - "sDeleteSpell", - "sDeleteSpellError", - "sDetail_Level", - "sDialogMenu1", - "sDialogText1Xbox", - "sDialogText2Xbox", - "sDialogText3Xbox", - "sDifficulty", - "sDisposeCorpseFail", - "sDisposeofCorpse", - "sDone", - "sDoYouWantTo", - "sDrain", - "sDrop", - "sDuration", - "sDurationDes", - "sEasy", - "sEditNote", - "sEffectAbsorbAttribute", - "sEffectAbsorbFatigue", - "sEffectAbsorbHealth", - "sEffectAbsorbSkill", - "sEffectAbsorbSpellPoints", - "sEffectAlmsiviIntervention", - "sEffectBlind", - "sEffectBoundBattleAxe", - "sEffectBoundBoots", - "sEffectBoundCuirass", - "sEffectBoundDagger", - "sEffectBoundGloves", - "sEffectBoundHelm", - "sEffectBoundLongbow", - "sEffectBoundLongsword", - "sEffectBoundMace", - "sEffectBoundShield", - "sEffectBoundSpear", - "sEffectBurden", - "sEffectCalmCreature", - "sEffectCalmHumanoid", - "sEffectChameleon", - "sEffectCharm", - "sEffectCommandCreatures", - "sEffectCommandHumanoids", - "sEffectCorpus", - "sEffectCureBlightDisease", - "sEffectCureCommonDisease", - "sEffectCureCorprusDisease", - "sEffectCureParalyzation", - "sEffectCurePoison", - "sEffectDamageAttribute", - "sEffectDamageFatigue", - "sEffectDamageHealth", - "sEffectDamageMagicka", - "sEffectDamageSkill", - "sEffectDemoralizeCreature", - "sEffectDemoralizeHumanoid", - "sEffectDetectAnimal", - "sEffectDetectEnchantment", - "sEffectDetectKey", - "sEffectDisintegrateArmor", - "sEffectDisintegrateWeapon", - "sEffectDispel", - "sEffectDivineIntervention", - "sEffectDrainAttribute", - "sEffectDrainFatigue", - "sEffectDrainHealth", - "sEffectDrainSkill", - "sEffectDrainSpellpoints", - "sEffectExtraSpell", - "sEffectFeather", - "sEffectFireDamage", - "sEffectFireShield", - "sEffectFortifyAttackBonus", - "sEffectFortifyAttribute", - "sEffectFortifyFatigue", - "sEffectFortifyHealth", - "sEffectFortifyMagickaMultiplier", - "sEffectFortifySkill", - "sEffectFortifySpellpoints", - "sEffectFrenzyCreature", - "sEffectFrenzyHumanoid", - "sEffectFrostDamage", - "sEffectFrostShield", - "sEffectInvisibility", - "sEffectJump", - "sEffectLevitate", - "sEffectLight", - "sEffectLightningShield", - "sEffectLock", - "sEffectMark", - "sEffectNightEye", - "sEffectOpen", - "sEffectParalyze", - "sEffectPoison", - "sEffectRallyCreature", - "sEffectRallyHumanoid", - "sEffectRecall", - "sEffectReflect", - "sEffectRemoveCurse", - "sEffectResistBlightDisease", - "sEffectResistCommonDisease", - "sEffectResistCorprusDisease", - "sEffectResistFire", - "sEffectResistFrost", - "sEffectResistMagicka", - "sEffectResistNormalWeapons", - "sEffectResistParalysis", - "sEffectResistPoison", - "sEffectResistShock", - "sEffectRestoreAttribute", - "sEffectRestoreFatigue", - "sEffectRestoreHealth", - "sEffectRestoreSkill", - "sEffectRestoreSpellPoints", - "sEffects", - "sEffectSanctuary", - "sEffectShield", - "sEffectShockDamage", - "sEffectSilence", - "sEffectSlowFall", - "sEffectSoultrap", - "sEffectSound", - "sEffectSpellAbsorption", - "sEffectStuntedMagicka", - "sEffectSummonAncestralGhost", - "sEffectSummonBonelord", - "sEffectSummonCenturionSphere", - "sEffectSummonClannfear", - "sEffectSummonCreature01", - "sEffectSummonCreature02", - "sEffectSummonCreature03", - "sEffectSummonCreature04", - "sEffectSummonCreature05", - "sEffectSummonDaedroth", - "sEffectSummonDremora", - "sEffectSummonFabricant", - "sEffectSummonFlameAtronach", - "sEffectSummonFrostAtronach", - "sEffectSummonGoldensaint", - "sEffectSummonGreaterBonewalker", - "sEffectSummonHunger", - "sEffectSummonLeastBonewalker", - "sEffectSummonScamp", - "sEffectSummonSkeletalMinion", - "sEffectSummonStormAtronach", - "sEffectSummonWingedTwilight", - "sEffectSunDamage", - "sEffectSwiftSwim", - "sEffectTelekinesis", - "sEffectTurnUndead", - "sEffectVampirism", - "sEffectWaterBreathing", - "sEffectWaterWalking", - "sEffectWeaknessToBlightDisease", - "sEffectWeaknessToCommonDisease", - "sEffectWeaknessToCorprusDisease", - "sEffectWeaknessToFire", - "sEffectWeaknessToFrost", - "sEffectWeaknessToMagicka", - "sEffectWeaknessToNormalWeapons", - "sEffectWeaknessToPoison", - "sEffectWeaknessToShock", - "sEnableJoystick", - "sEnchanting", - "sEnchantItems", - "sEnchantmentHelp1", - "sEnchantmentHelp10", - "sEnchantmentHelp2", - "sEnchantmentHelp3", - "sEnchantmentHelp4", - "sEnchantmentHelp5", - "sEnchantmentHelp6", - "sEnchantmentHelp7", - "sEnchantmentHelp8", - "sEnchantmentHelp9", - "sEnchantmentMenu1", - "sEnchantmentMenu10", - "sEnchantmentMenu11", - "sEnchantmentMenu12", - "sEnchantmentMenu2", - "sEnchantmentMenu3", - "sEnchantmentMenu4", - "sEnchantmentMenu5", - "sEnchantmentMenu6", - "sEnchantmentMenu7", - "sEnchantmentMenu8", - "sEnchantmentMenu9", - "sEncumbrance", - "sEndDesc", - "sEquip", - "sExitGame", - "sExpelled", - "sExpelledMessage", - "sFace", - "sFaction", - "sFar", - "sFast", - "sFatDesc", - "sFatigue", - "sFavoriteSkills", - "sfeet", - "sFileSize", - "sfootarea", - "sFootsteps", - "sfor", - "sFortify", - "sForward", - "sForwardXbox", - "sFull", - "sGame", - "sGameWithoutLauncherXbox", - "sGamma_Correction", - "sGeneralMastPlugMismatchMsg", - "sGold", - "sGoodbye", - "sGoverningAttribute", - "sgp", - "sHair", - "sHard", - "sHeal", - "sHealer", - "sHealth", - "sHealthDesc", - "sHealthPerHourOfRest", - "sHealthPerLevel", - "sHeavy", - "sHigh", - "sin", - "sInfo", - "sInfoRefusal", - "sIngredients", - "sInPrisonTitle", - "sInputMenu1", - "sIntDesc", - "sIntimidate", - "sIntimidateFail", - "sIntimidateSuccess", - "sInvalidSaveGameMsg", - "sInvalidSaveGameMsgXBOX", - "sInventory", - "sInventoryMenu1", - "sInventoryMessage1", - "sInventoryMessage2", - "sInventoryMessage3", - "sInventoryMessage4", - "sInventoryMessage5", - "sInventorySelectNoIngredients", - "sInventorySelectNoItems", - "sInventorySelectNoSoul", - "sItem", - "sItemCastConstant", - "sItemCastOnce", - "sItemCastWhenStrikes", - "sItemCastWhenUsed", - "sItemName", - "sJournal", - "sJournalCmd", - "sJournalEntry", - "sJournalXbox", - "sJoystickHatShort", - "sJoystickNotFound", - "sJoystickShort", - "sJump", - "sJumpXbox", - "sKeyName_00", - "sKeyName_01", - "sKeyName_02", - "sKeyName_03", - "sKeyName_04", - "sKeyName_05", - "sKeyName_06", - "sKeyName_07", - "sKeyName_08", - "sKeyName_09", - "sKeyName_0A", - "sKeyName_0B", - "sKeyName_0C", - "sKeyName_0D", - "sKeyName_0E", - "sKeyName_0F", - "sKeyName_10", - "sKeyName_11", - "sKeyName_12", - "sKeyName_13", - "sKeyName_14", - "sKeyName_15", - "sKeyName_16", - "sKeyName_17", - "sKeyName_18", - "sKeyName_19", - "sKeyName_1A", - "sKeyName_1B", - "sKeyName_1C", - "sKeyName_1D", - "sKeyName_1E", - "sKeyName_1F", - "sKeyName_20", - "sKeyName_21", - "sKeyName_22", - "sKeyName_23", - "sKeyName_24", - "sKeyName_25", - "sKeyName_26", - "sKeyName_27", - "sKeyName_28", - "sKeyName_29", - "sKeyName_2A", - "sKeyName_2B", - "sKeyName_2C", - "sKeyName_2D", - "sKeyName_2E", - "sKeyName_2F", - "sKeyName_30", - "sKeyName_31", - "sKeyName_32", - "sKeyName_33", - "sKeyName_34", - "sKeyName_35", - "sKeyName_36", - "sKeyName_37", - "sKeyName_38", - "sKeyName_39", - "sKeyName_3A", - "sKeyName_3B", - "sKeyName_3C", - "sKeyName_3D", - "sKeyName_3E", - "sKeyName_3F", - "sKeyName_40", - "sKeyName_41", - "sKeyName_42", - "sKeyName_43", - "sKeyName_44", - "sKeyName_45", - "sKeyName_46", - "sKeyName_47", - "sKeyName_48", - "sKeyName_49", - "sKeyName_4A", - "sKeyName_4B", - "sKeyName_4C", - "sKeyName_4D", - "sKeyName_4E", - "sKeyName_4F", - "sKeyName_50", - "sKeyName_51", - "sKeyName_52", - "sKeyName_53", - "sKeyName_54", - "sKeyName_55", - "sKeyName_56", - "sKeyName_57", - "sKeyName_58", - "sKeyName_59", - "sKeyName_5A", - "sKeyName_5B", - "sKeyName_5C", - "sKeyName_5D", - "sKeyName_5E", - "sKeyName_5F", - "sKeyName_60", - "sKeyName_61", - "sKeyName_62", - "sKeyName_63", - "sKeyName_64", - "sKeyName_65", - "sKeyName_66", - "sKeyName_67", - "sKeyName_68", - "sKeyName_69", - "sKeyName_6A", - "sKeyName_6B", - "sKeyName_6C", - "sKeyName_6D", - "sKeyName_6E", - "sKeyName_6F", - "sKeyName_70", - "sKeyName_71", - "sKeyName_72", - "sKeyName_73", - "sKeyName_74", - "sKeyName_75", - "sKeyName_76", - "sKeyName_77", - "sKeyName_78", - "sKeyName_79", - "sKeyName_7A", - "sKeyName_7B", - "sKeyName_7C", - "sKeyName_7D", - "sKeyName_7E", - "sKeyName_7F", - "sKeyName_80", - "sKeyName_81", - "sKeyName_82", - "sKeyName_83", - "sKeyName_84", - "sKeyName_85", - "sKeyName_86", - "sKeyName_87", - "sKeyName_88", - "sKeyName_89", - "sKeyName_8A", - "sKeyName_8B", - "sKeyName_8C", - "sKeyName_8D", - "sKeyName_8E", - "sKeyName_8F", - "sKeyName_90", - "sKeyName_91", - "sKeyName_92", - "sKeyName_93", - "sKeyName_94", - "sKeyName_95", - "sKeyName_96", - "sKeyName_97", - "sKeyName_98", - "sKeyName_99", - "sKeyName_9A", - "sKeyName_9B", - "sKeyName_9C", - "sKeyName_9D", - "sKeyName_9E", - "sKeyName_9F", - "sKeyName_A0", - "sKeyName_A1", - "sKeyName_A2", - "sKeyName_A3", - "sKeyName_A4", - "sKeyName_A5", - "sKeyName_A6", - "sKeyName_A7", - "sKeyName_A8", - "sKeyName_A9", - "sKeyName_AA", - "sKeyName_AB", - "sKeyName_AC", - "sKeyName_AD", - "sKeyName_AE", - "sKeyName_AF", - "sKeyName_B0", - "sKeyName_B1", - "sKeyName_B2", - "sKeyName_B3", - "sKeyName_B4", - "sKeyName_B5", - "sKeyName_B6", - "sKeyName_B7", - "sKeyName_B8", - "sKeyName_B9", - "sKeyName_BA", - "sKeyName_BB", - "sKeyName_BC", - "sKeyName_BD", - "sKeyName_BE", - "sKeyName_BF", - "sKeyName_C0", - "sKeyName_C1", - "sKeyName_C2", - "sKeyName_C3", - "sKeyName_C4", - "sKeyName_C5", - "sKeyName_C6", - "sKeyName_C7", - "sKeyName_C8", - "sKeyName_C9", - "sKeyName_CA", - "sKeyName_CB", - "sKeyName_CC", - "sKeyName_CD", - "sKeyName_CE", - "sKeyName_CF", - "sKeyName_D0", - "sKeyName_D1", - "sKeyName_D2", - "sKeyName_D3", - "sKeyName_D4", - "sKeyName_D5", - "sKeyName_D6", - "sKeyName_D7", - "sKeyName_D8", - "sKeyName_D9", - "sKeyName_DA", - "sKeyName_DB", - "sKeyName_DC", - "sKeyName_DD", - "sKeyName_DE", - "sKeyName_DF", - "sKeyName_E0", - "sKeyName_E1", - "sKeyName_E2", - "sKeyName_E3", - "sKeyName_E4", - "sKeyName_E5", - "sKeyName_E6", - "sKeyName_E7", - "sKeyName_E8", - "sKeyName_E9", - "sKeyName_EA", - "sKeyName_EB", - "sKeyName_EC", - "sKeyName_ED", - "sKeyName_EE", - "sKeyName_EF", - "sKeyName_F0", - "sKeyName_F1", - "sKeyName_F2", - "sKeyName_F3", - "sKeyName_F4", - "sKeyName_F5", - "sKeyName_F6", - "sKeyName_F7", - "sKeyName_F8", - "sKeyName_F9", - "sKeyName_FA", - "sKeyName_FB", - "sKeyName_FC", - "sKeyName_FD", - "sKeyName_FE", - "sKeyName_FF", - "sKeyUsed", - "sKilledEssential", - "sKnight", - "sLeft", - "sLess", - "sLevel", - "sLevelProgress", - "sLevels", - "sLevelUp", - "sLevelUpMenu1", - "sLevelUpMenu2", - "sLevelUpMenu3", - "sLevelUpMenu4", - "sLevelUpMsg", - "sLevitateDisabled", - "sLight", - "sLight_Gamma", - "sLoadFailedMessage", - "sLoadGame", - "sLoadingErrorsMsg", - "sLoadingMessage1", - "sLoadingMessage14", - "sLoadingMessage15", - "sLoadingMessage2", - "sLoadingMessage3", - "sLoadingMessage4", - "sLoadingMessage5", - "sLoadingMessage9", - "sLoadLastSaveMsg", - "sLocal", - "sLockFail", - "sLockImpossible", - "sLockLevel", - "sLockSuccess", - "sLookDownXbox", - "sLookUpXbox", - "sLow", - "sLucDesc", - "sMagDesc", - "sMage", - "sMagic", - "sMagicAncestralGhostID", - "sMagicBonelordID", - "sMagicBoundBattleAxeID", - "sMagicBoundBootsID", - "sMagicBoundCuirassID", - "sMagicBoundDaggerID", - "sMagicBoundHelmID", - "sMagicBoundLeftGauntletID", - "sMagicBoundLongbowID", - "sMagicBoundLongswordID", - "sMagicBoundMaceID", - "sMagicBoundRightGauntletID", - "sMagicBoundShieldID", - "sMagicBoundSpearID", - "sMagicCannotRecast", - "sMagicCenturionSphereID", - "sMagicClannfearID", - "sMagicContractDisease", - "sMagicCorprusWorsens", - "sMagicCreature01ID", - "sMagicCreature02ID", - "sMagicCreature03ID", - "sMagicCreature04ID", - "sMagicCreature05ID", - "sMagicDaedrothID", - "sMagicDremoraID", - "sMagicEffects", - "sMagicFabricantID", - "sMagicFlameAtronachID", - "sMagicFrostAtronachID", - "sMagicGoldenSaintID", - "sMagicGreaterBonewalkerID", - "sMagicHungerID", - "sMagicInsufficientCharge", - "sMagicInsufficientSP", - "sMagicInvalidEffect", - "sMagicInvalidTarget", - "sMagicItem", - "sMagicLeastBonewalkerID", - "sMagicLockSuccess", - "sMagicMenu", - "sMagicOpenSuccess", - "sMagicPCResisted", - "sMagicScampID", - "sMagicSelectTitle", - "sMagicSkeletalMinionID", - "sMagicSkillFail", - "sMagicStormAtronachID", - "sMagicTab", - "sMagicTargetResisted", - "sMagicTargetResistsWeapons", - "sMagicWingedTwilightID", - "sMagnitude", - "sMagnitudeDes", - "sMake Enchantment", - "sMap", - "sMaster", - "sMastPlugMismatchMsg", - "sMaximumSaveGameMessage", - "sMaxSale", - "sMedium", - "sMenu_Help_Delay", - "sMenu_Mode", - "sMenuModeXbox", - "sMenuNextXbox", - "sMenuPrevXbox", - "sMenus", - "sMessage1", - "sMessage2", - "sMessage3", - "sMessage4", - "sMessage5", - "sMessageQuestionAnswer1", - "sMessageQuestionAnswer2", - "sMessageQuestionAnswer3", - "sMiscTab", - "sMissingMastersMsg", - "sMonk", - "sMonthEveningstar", - "sMonthFirstseed", - "sMonthFrostfall", - "sMonthHeartfire", - "sMonthLastseed", - "sMonthMidyear", - "sMonthMorningstar", - "sMonthRainshand", - "sMonthSecondseed", - "sMonthSunsdawn", - "sMonthSunsdusk", - "sMonthSunsheight", - "sMore", - "sMortar", - "sMouse", - "sMouseFlip", - "sMouseWheelDownShort", - "sMouseWheelUpShort", - "sMove", - "sMoveDownXbox", - "sMoveUpXbox", - "sMusic", - "sName", - "sNameTitle", - "sNear", - "sNeedOneSkill", - "sNeedTwoSkills", - "sNewGame", - "sNext", - "sNextRank", - "sNextSpell", - "sNextSpellXbox", - "sNextWeapon", - "sNextWeaponXbox", - "sNightblade", - "sNo", - "sNoName", - "sNone", - "sNotifyMessage1", - "sNotifyMessage10", - "sNotifyMessage11", - "sNotifyMessage12", - "sNotifyMessage13", - "sNotifyMessage14", - "sNotifyMessage15", - "sNotifyMessage16", - "sNotifyMessage16_a", - "sNotifyMessage17", - "sNotifyMessage18", - "sNotifyMessage19", - "sNotifyMessage2", - "sNotifyMessage20", - "sNotifyMessage21", - "sNotifyMessage22", - "sNotifyMessage23", - "sNotifyMessage24", - "sNotifyMessage25", - "sNotifyMessage26", - "sNotifyMessage27", - "sNotifyMessage28", - "sNotifyMessage29", - "sNotifyMessage3", - "sNotifyMessage30", - "sNotifyMessage31", - "sNotifyMessage32", - "sNotifyMessage33", - "sNotifyMessage34", - "sNotifyMessage35", - "sNotifyMessage36", - "sNotifyMessage37", - "sNotifyMessage38", - "sNotifyMessage39", - "sNotifyMessage4", - "sNotifyMessage40", - "sNotifyMessage41", - "sNotifyMessage42", - "sNotifyMessage43", - "sNotifyMessage44", - "sNotifyMessage45", - "sNotifyMessage46", - "sNotifyMessage47", - "sNotifyMessage48", - "sNotifyMessage49", - "sNotifyMessage4XBOX", - "sNotifyMessage5", - "sNotifyMessage50", - "sNotifyMessage51", - "sNotifyMessage52", - "sNotifyMessage53", - "sNotifyMessage54", - "sNotifyMessage55", - "sNotifyMessage56", - "sNotifyMessage57", - "sNotifyMessage58", - "sNotifyMessage59", - "sNotifyMessage6", - "sNotifyMessage60", - "sNotifyMessage61", - "sNotifyMessage62", - "sNotifyMessage63", - "sNotifyMessage64", - "sNotifyMessage65", - "sNotifyMessage66", - "sNotifyMessage67", - "sNotifyMessage6a", - "sNotifyMessage7", - "sNotifyMessage8", - "sNotifyMessage9", - "sOff", - "sOffer", - "sOfferMenuTitle", - "sOK", - "sOn", - "sOnce", - "sOneHanded", - "sOnetypeEffectMessage", - "sonword", - "sOptions", - "sOptionsMenuXbox", - "spercent", - "sPerDesc", - "sPersuasion", - "sPersuasionMenuTitle", - "sPickUp", - "sPilgrim", - "spoint", - "spoints", - "sPotionSuccess", - "sPowerAlreadyUsed", - "sPowers", - "sPreferences", - "sPrefs", - "sPrev", - "sPrevSpell", - "sPrevSpellXbox", - "sPrevWeapon", - "sPrevWeaponXbox", - "sProfitValue", - "sQuality", - "sQuanityMenuMessage01", - "sQuanityMenuMessage02", - "sQuestionDeleteSpell", - "sQuestionMark", - "sQuick0Xbox", - "sQuick10Cmd", - "sQuick1Cmd", - "sQuick2Cmd", - "sQuick3Cmd", - "sQuick4Cmd", - "sQuick4Xbox", - "sQuick5Cmd", - "sQuick5Xbox", - "sQuick6Cmd", - "sQuick6Xbox", - "sQuick7Cmd", - "sQuick7Xbox", - "sQuick8Cmd", - "sQuick8Xbox", - "sQuick9Cmd", - "sQuick9Xbox", - "sQuick_Save", - "sQuickLoadCmd", - "sQuickLoadXbox", - "sQuickMenu", - "sQuickMenu1", - "sQuickMenu2", - "sQuickMenu3", - "sQuickMenu4", - "sQuickMenu5", - "sQuickMenu6", - "sQuickMenuInstruc", - "sQuickMenuTitle", - "sQuickSaveCmd", - "sQuickSaveXbox", - "sRace", - "sRaceMenu1", - "sRaceMenu2", - "sRaceMenu3", - "sRaceMenu4", - "sRaceMenu5", - "sRaceMenu6", - "sRaceMenu7", - "sRacialTraits", - "sRange", - "sRangeDes", - "sRangeSelf", - "sRangeTarget", - "sRangeTouch", - "sReady_Magic", - "sReady_Weapon", - "sReadyItemXbox", - "sReadyMagicXbox", - "sRechargeEnchantment", - "sRender_Distance", - "sRepair", - "sRepairFailed", - "sRepairServiceTitle", - "sRepairSuccess", - "sReputation", - "sResChangeWarning", - "sRest", - "sRestIllegal", - "sRestKey", - "sRestMenu1", - "sRestMenu2", - "sRestMenu3", - "sRestMenu4", - "sRestMenuXbox", - "sRestore", - "sRetort", - "sReturnToGame", - "sRight", - "sRogue", - "sRun", - "sRunXbox", - "sSave", - "sSaveGame", - "sSaveGameDenied", - "sSaveGameFailed", - "sSaveGameNoMemory", - "sSaveGameTooBig", - "sSaveMenu1", - "sSaveMenuHelp01", - "sSaveMenuHelp02", - "sSaveMenuHelp03", - "sSaveMenuHelp04", - "sSaveMenuHelp05", - "sSaveMenuHelp06", - "sSchool", - "sSchoolAlteration", - "sSchoolConjuration", - "sSchoolDestruction", - "sSchoolIllusion", - "sSchoolMysticism", - "sSchoolRestoration", - "sScout", - "sScrolldown", - "sScrollup", - "ssecond", - "sseconds", - "sSeldom", - "sSelect", - "sSell", - "sSellerGold", - "sService", - "sServiceRefusal", - "sServiceRepairTitle", - "sServiceSpellsTitle", - "sServiceTrainingTitle", - "sServiceTrainingWords", - "sServiceTravelTitle", - "sSetValueMessage01", - "sSex", - "sShadows", - "sShadowText", - "sShift", - "sSkill", - "sSkillAcrobatics", - "sSkillAlchemy", - "sSkillAlteration", - "sSkillArmorer", - "sSkillAthletics", - "sSkillAxe", - "sSkillBlock", - "sSkillBluntweapon", - "sSkillClassMajor", - "sSkillClassMinor", - "sSkillClassMisc", - "sSkillConjuration", - "sSkillDestruction", - "sSkillEnchant", - "sSkillHandtohand", - "sSkillHeavyarmor", - "sSkillIllusion", - "sSkillLightarmor", - "sSkillLongblade", - "sSkillMarksman", - "sSkillMaxReached", - "sSkillMediumarmor", - "sSkillMercantile", - "sSkillMysticism", - "sSkillProgress", - "sSkillRestoration", - "sSkillSecurity", - "sSkillShortblade", - "sSkillsMenu1", - "sSkillsMenuReputationHelp", - "sSkillSneak", - "sSkillSpear", - "sSkillSpeechcraft", - "sSkillUnarmored", - "sSlash", - "sSleepInterrupt", - "sSlideLeftXbox", - "sSlideRightXbox", - "sSlow", - "sSorceror", - "sSoulGem", - "sSoulGemsWithSouls", - "sSoultrapSuccess", - "sSpace", - "sSpdDesc", - "sSpecialization", - "sSpecializationCombat", - "sSpecializationMagic", - "sSpecializationMenu1", - "sSpecializationStealth", - "sSpellmaking", - "sSpellmakingHelp1", - "sSpellmakingHelp2", - "sSpellmakingHelp3", - "sSpellmakingHelp4", - "sSpellmakingHelp5", - "sSpellmakingHelp6", - "sSpellmakingMenu1", - "sSpellmakingMenuTitle", - "sSpells", - "sSpellServiceTitle", - "sSpellsword", - "sStartCell", - "sStartCellError", - "sStartError", - "sStats", - "sStrafe", - "sStrDesc", - "sStrip", - "sSubtitles", - "sSystemMenuXbox", - "sTake", - "sTakeAll", - "sTargetCriticalStrike", - "sTaunt", - "sTauntFail", - "sTauntSuccess", - "sTeleportDisabled", - "sThief", - "sThrust", - "sTo", - "sTogglePOVCmd", - "sTogglePOVXbox", - "sToggleRunXbox", - "sTopics", - "sTotalCost", - "sTotalSold", - "sTraining", - "sTrainingServiceTitle", - "sTraits", - "sTransparency_Menu", - "sTrapFail", - "sTrapImpossible", - "sTrapped", - "sTrapSuccess", - "sTravel", - "sTravelServiceTitle", - "sTurn", - "sTurnLeftXbox", - "sTurnRightXbox", - "sTwoHanded", - "sType", - "sTypeAbility", - "sTypeBlightDisease", - "sTypeCurse", - "sTypeDisease", - "sTypePower", - "sTypeSpell", - "sUnequip", - "sUnlocked", - "sUntilHealed", - "sUse", - "sUserDefinedClass", - "sUses", - "sUseXbox", - "sValue", - "sVideo", - "sVideoWarning", - "sVoice", - "sWait", - "sWarrior", - "sWaterReflectUpdate", - "sWaterTerrainReflect", - "sWeaponTab", - "sWeight", - "sWerewolfAlarmMessage", - "sWerewolfPopup", - "sWerewolfRefusal", - "sWerewolfRestMessage", - "sWilDesc", - "sWitchhunter", - "sWorld", - "sWornTab", - "sXStrafe", - "sXTimes", - "sXTimesINT", - "sYes", - "sYourGold", - 0 - }; - - for (int i=0; gmstFloats[i]; i++) + for (size_t i=0; i < CSMWorld::DefaultGMSTs::FloatCount; ++i) { ESM::GameSetting gmst; - gmst.mId = gmstFloats[i]; + gmst.mId = CSMWorld::DefaultGMSTs::Floats[i]; gmst.mValue.setType (ESM::VT_Float); - gmst.mValue.setFloat (gmstFloatsValues[i]); + gmst.mValue.setFloat (CSMWorld::DefaultGMSTs::FloatsDefaultValues[i]); getData().getGmsts().add (gmst); } - for (int i=0; gmstIntegers[i]; i++) + for (size_t i=0; i < CSMWorld::DefaultGMSTs::IntCount; ++i) { ESM::GameSetting gmst; - gmst.mId = gmstIntegers[i]; + gmst.mId = CSMWorld::DefaultGMSTs::Ints[i]; gmst.mValue.setType (ESM::VT_Int); - gmst.mValue.setInteger (gmstIntegersValues[i]); + gmst.mValue.setInteger (CSMWorld::DefaultGMSTs::IntsDefaultValues[i]); getData().getGmsts().add (gmst); } - for (int i=0; gmstStrings[i]; i++) + for (size_t i=0; i < CSMWorld::DefaultGMSTs::StringCount; ++i) { ESM::GameSetting gmst; - gmst.mId = gmstStrings[i]; + gmst.mId = CSMWorld::DefaultGMSTs::Strings[i]; gmst.mValue.setType (ESM::VT_String); gmst.mValue.setString (""); getData().getGmsts().add (gmst); @@ -1933,115 +44,28 @@ void CSMDoc::Document::addGmsts() void CSMDoc::Document::addOptionalGmsts() { - static const char *sFloats[] = - { - "fCombatDistanceWerewolfMod", - "fFleeDistance", - "fWereWolfAcrobatics", - "fWereWolfAgility", - "fWereWolfAlchemy", - "fWereWolfAlteration", - "fWereWolfArmorer", - "fWereWolfAthletics", - "fWereWolfAxe", - "fWereWolfBlock", - "fWereWolfBluntWeapon", - "fWereWolfConjuration", - "fWereWolfDestruction", - "fWereWolfEnchant", - "fWereWolfEndurance", - "fWereWolfFatigue", - "fWereWolfHandtoHand", - "fWereWolfHealth", - "fWereWolfHeavyArmor", - "fWereWolfIllusion", - "fWereWolfIntellegence", - "fWereWolfLightArmor", - "fWereWolfLongBlade", - "fWereWolfLuck", - "fWereWolfMagicka", - "fWereWolfMarksman", - "fWereWolfMediumArmor", - "fWereWolfMerchantile", - "fWereWolfMysticism", - "fWereWolfPersonality", - "fWereWolfRestoration", - "fWereWolfRunMult", - "fWereWolfSecurity", - "fWereWolfShortBlade", - "fWereWolfSilverWeaponDamageMult", - "fWereWolfSneak", - "fWereWolfSpear", - "fWereWolfSpeechcraft", - "fWereWolfSpeed", - "fWereWolfStrength", - "fWereWolfUnarmored", - "fWereWolfWillPower", - 0 - }; - - static const char *sIntegers[] = - { - "iWereWolfBounty", - "iWereWolfFightMod", - "iWereWolfFleeMod", - "iWereWolfLevelToAttack", - 0 - }; - - static const char *sStrings[] = - { - "sCompanionShare", - "sCompanionWarningButtonOne", - "sCompanionWarningButtonTwo", - "sCompanionWarningMessage", - "sDeleteNote", - "sEditNote", - "sEffectSummonCreature01", - "sEffectSummonCreature02", - "sEffectSummonCreature03", - "sEffectSummonCreature04", - "sEffectSummonCreature05", - "sEffectSummonFabricant", - "sLevitateDisabled", - "sMagicCreature01ID", - "sMagicCreature02ID", - "sMagicCreature03ID", - "sMagicCreature04ID", - "sMagicCreature05ID", - "sMagicFabricantID", - "sMaxSale", - "sProfitValue", - "sTeleportDisabled", - "sWerewolfAlarmMessage", - "sWerewolfPopup", - "sWerewolfRefusal", - "sWerewolfRestMessage", - 0 - }; - - for (int i=0; sFloats[i]; ++i) + for (size_t i=0; i < CSMWorld::DefaultGMSTs::OptionalFloatCount; ++i) { ESM::GameSetting gmst; - gmst.mId = sFloats[i]; + gmst.mId = CSMWorld::DefaultGMSTs::OptionalFloats[i]; gmst.blank(); gmst.mValue.setType (ESM::VT_Float); addOptionalGmst (gmst); } - for (int i=0; sIntegers[i]; ++i) + for (size_t i=0; i < CSMWorld::DefaultGMSTs::OptionalIntCount; ++i) { ESM::GameSetting gmst; - gmst.mId = sIntegers[i]; + gmst.mId = CSMWorld::DefaultGMSTs::OptionalInts[i]; gmst.blank(); gmst.mValue.setType (ESM::VT_Int); addOptionalGmst (gmst); } - for (int i=0; sStrings[i]; ++i) + for (size_t i=0; i < CSMWorld::DefaultGMSTs::OptionalStringCount; ++i) { ESM::GameSetting gmst; - gmst.mId = sStrings[i]; + gmst.mId = CSMWorld::DefaultGMSTs::OptionalStrings[i]; gmst.blank(); gmst.mValue.setType (ESM::VT_String); gmst.mValue.setString (""); diff --git a/apps/opencs/model/tools/gmstcheck.cpp b/apps/opencs/model/tools/gmstcheck.cpp new file mode 100644 index 000000000..6c17ff3a5 --- /dev/null +++ b/apps/opencs/model/tools/gmstcheck.cpp @@ -0,0 +1,91 @@ +#include "gmstcheck.hpp" + +#include "../world/defaultgmsts.hpp" + +CSMTools::GMSTCheckStage::GMSTCheckStage(const CSMWorld::IdCollection& gameSettings) + : mGameSettings(gameSettings) +{} + +int CSMTools::GMSTCheckStage::setup() +{ + return mGameSettings.getSize(); +} + +void CSMTools::GMSTCheckStage::perform(int stage, CSMDoc::Messages& messages) +{ + const CSMWorld::Record& record = mGameSettings.getRecord (stage); + + if (record.isDeleted()) + return; + + const ESM::GameSetting& gmst = record.get(); + + CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Gmst, gmst.mId); + + // Test for empty string + if (gmst.mValue.getType() == ESM::VT_String && gmst.mValue.getString().empty()) + messages.add(id, gmst.mId + " is an empty string", "", CSMDoc::Message::Severity_Warning); + + // Checking type and limits + // optimization - compare it to lists based on naming convention (f-float,i-int,s-string) + if (gmst.mId[0] == 'f') + { + for (size_t i = 0; i < CSMWorld::DefaultGMSTs::FloatCount; ++i) + { + if (gmst.mId == CSMWorld::DefaultGMSTs::Floats[i]) + { + if (gmst.mValue.getType() != ESM::VT_Float) + messages.add(id, "The type of " + gmst.mId + " is incorrect", + "Change the GMST type to a float", CSMDoc::Message::Severity_Error); + + if (gmst.mValue.getFloat() < CSMWorld::DefaultGMSTs::FloatLimits[i*2]) + messages.add(id, gmst.mId + " is less than the suggested range", "Change the value", + CSMDoc::Message::Severity_Warning); + + if (gmst.mValue.getFloat() > CSMWorld::DefaultGMSTs::FloatLimits[i*2+1]) + messages.add(id, gmst.mId + " is more than the suggested range", "Change the value", + CSMDoc::Message::Severity_Warning); + + break; // for loop + } + } + } + else if (gmst.mId[0] == 'i') + { + for (size_t i = 0; i < CSMWorld::DefaultGMSTs::IntCount; ++i) + { + if (gmst.mId == CSMWorld::DefaultGMSTs::Ints[i]) + { + if (gmst.mValue.getType() != ESM::VT_Int) + messages.add(id, "The type of " + gmst.mId + " is incorrect", + "Change the GMST type to an int", CSMDoc::Message::Severity_Error); + + if (gmst.mValue.getInteger() < CSMWorld::DefaultGMSTs::IntLimits[i*2]) + messages.add(id, gmst.mId + " is less than the suggested range", "Change the value", + CSMDoc::Message::Severity_Warning); + + if (gmst.mValue.getInteger() > CSMWorld::DefaultGMSTs::IntLimits[i*2+1]) + messages.add(id, gmst.mId + " is more than the suggested range", "Change the value", + CSMDoc::Message::Severity_Warning); + + break; // for loop + } + } + } + else if (gmst.mId[0] == 's') + { + for (size_t i = 0; i < CSMWorld::DefaultGMSTs::StringCount; ++i) + { + if (gmst.mId == CSMWorld::DefaultGMSTs::Strings[i]) + { + ESM::VarType type = gmst.mValue.getType(); + + if (type != ESM::VT_String && type != ESM::VT_None) + messages.add(id, "The type of " + gmst.mId + " is incorrect", + "Change the GMST type to a string", CSMDoc::Message::Severity_Error); + + break; // for loop + } + } + } +} diff --git a/apps/opencs/model/tools/gmstcheck.hpp b/apps/opencs/model/tools/gmstcheck.hpp new file mode 100644 index 000000000..ca1564d9e --- /dev/null +++ b/apps/opencs/model/tools/gmstcheck.hpp @@ -0,0 +1,32 @@ +#ifndef CSM_TOOLS_GMSTCHECK_H +#define CSM_TOOLS_GMSTCHECK_H + +#include + +#include "../world/idcollection.hpp" + +#include "../doc/stage.hpp" + +namespace CSMTools +{ + /// \brief VerifyStage: make sure that GMSTs are alright + class GMSTCheckStage : public CSMDoc::Stage + { + public: + + GMSTCheckStage(const CSMWorld::IdCollection& gameSettings); + + virtual int setup(); + ///< \return number of steps + + virtual void perform(int stage, CSMDoc::Messages& messages); + ///< Messages resulting from this stage will be appended to \a messages + + private: + + const CSMWorld::IdCollection& mGameSettings; + + }; +} + +#endif diff --git a/apps/opencs/model/tools/tools.cpp b/apps/opencs/model/tools/tools.cpp index 608ed9922..9f36193ef 100644 --- a/apps/opencs/model/tools/tools.cpp +++ b/apps/opencs/model/tools/tools.cpp @@ -29,6 +29,7 @@ #include "soundgencheck.hpp" #include "magiceffectcheck.hpp" #include "mergeoperation.hpp" +#include "gmstcheck.hpp" CSMDoc::OperationHolder *CSMTools::Tools::get (int type) { @@ -110,6 +111,8 @@ CSMDoc::OperationHolder *CSMTools::Tools::getVerifier() mData.getReferenceables(), mData.getResources (CSMWorld::UniversalId::Type_Icons), mData.getResources (CSMWorld::UniversalId::Type_Textures))); + + mVerifierOperation->appendStage (new GMSTCheckStage (mData.getGmsts())); mVerifier.setOperation (mVerifierOperation); } diff --git a/apps/opencs/model/world/defaultgmsts.cpp b/apps/opencs/model/world/defaultgmsts.cpp new file mode 100644 index 000000000..ef3d536b1 --- /dev/null +++ b/apps/opencs/model/world/defaultgmsts.cpp @@ -0,0 +1,2336 @@ +#include "defaultgmsts.hpp" + +#include + +const float FInf = std::numeric_limits::infinity(); +const float FEps = std::numeric_limits::epsilon(); + +const int IMax = std::numeric_limits::max(); +const int IMin = std::numeric_limits::min(); + +const char* CSMWorld::DefaultGMSTs::Floats[CSMWorld::DefaultGMSTs::FloatCount] = +{ + "fAIFleeFleeMult", + "fAIFleeHealthMult", + "fAIMagicSpellMult", + "fAIMeleeArmorMult", + "fAIMeleeSummWeaponMult", + "fAIMeleeWeaponMult", + "fAIRangeMagicSpellMult", + "fAIRangeMeleeWeaponMult", + "fAlarmRadius", + "fAthleticsRunBonus", + "fAudioDefaultMaxDistance", + "fAudioDefaultMinDistance", + "fAudioMaxDistanceMult", + "fAudioMinDistanceMult", + "fAudioVoiceDefaultMaxDistance", + "fAudioVoiceDefaultMinDistance", + "fAutoPCSpellChance", + "fAutoSpellChance", + "fBargainOfferBase", + "fBargainOfferMulti", + "fBarterGoldResetDelay", + "fBaseRunMultiplier", + "fBlockStillBonus", + "fBribe1000Mod", + "fBribe100Mod", + "fBribe10Mod", + "fCombatAngleXY", + "fCombatAngleZ", + "fCombatArmorMinMult", + "fCombatBlockLeftAngle", + "fCombatBlockRightAngle", + "fCombatCriticalStrikeMult", + "fCombatDelayCreature", + "fCombatDelayNPC", + "fCombatDistance", + "fCombatDistanceWerewolfMod", + "fCombatForceSideAngle", + "fCombatInvisoMult", + "fCombatKODamageMult", + "fCombatTorsoSideAngle", + "fCombatTorsoStartPercent", + "fCombatTorsoStopPercent", + "fConstantEffectMult", + "fCorpseClearDelay", + "fCorpseRespawnDelay", + "fCrimeGoldDiscountMult", + "fCrimeGoldTurnInMult", + "fCrimeStealing", + "fDamageStrengthBase", + "fDamageStrengthMult", + "fDifficultyMult", + "fDiseaseXferChance", + "fDispAttacking", + "fDispBargainFailMod", + "fDispBargainSuccessMod", + "fDispCrimeMod", + "fDispDiseaseMod", + "fDispFactionMod", + "fDispFactionRankBase", + "fDispFactionRankMult", + "fDispositionMod", + "fDispPersonalityBase", + "fDispPersonalityMult", + "fDispPickPocketMod", + "fDispRaceMod", + "fDispStealing", + "fDispWeaponDrawn", + "fEffectCostMult", + "fElementalShieldMult", + "fEnchantmentChanceMult", + "fEnchantmentConstantChanceMult", + "fEnchantmentConstantDurationMult", + "fEnchantmentMult", + "fEnchantmentValueMult", + "fEncumberedMoveEffect", + "fEncumbranceStrMult", + "fEndFatigueMult", + "fFallAcroBase", + "fFallAcroMult", + "fFallDamageDistanceMin", + "fFallDistanceBase", + "fFallDistanceMult", + "fFatigueAttackBase", + "fFatigueAttackMult", + "fFatigueBase", + "fFatigueBlockBase", + "fFatigueBlockMult", + "fFatigueJumpBase", + "fFatigueJumpMult", + "fFatigueMult", + "fFatigueReturnBase", + "fFatigueReturnMult", + "fFatigueRunBase", + "fFatigueRunMult", + "fFatigueSneakBase", + "fFatigueSneakMult", + "fFatigueSpellBase", + "fFatigueSpellCostMult", + "fFatigueSpellMult", + "fFatigueSwimRunBase", + "fFatigueSwimRunMult", + "fFatigueSwimWalkBase", + "fFatigueSwimWalkMult", + "fFightDispMult", + "fFightDistanceMultiplier", + "fFightStealing", + "fFleeDistance", + "fGreetDistanceReset", + "fHandtoHandHealthPer", + "fHandToHandReach", + "fHoldBreathEndMult", + "fHoldBreathTime", + "fIdleChanceMultiplier", + "fIngredientMult", + "fInteriorHeadTrackMult", + "fJumpAcrobaticsBase", + "fJumpAcroMultiplier", + "fJumpEncumbranceBase", + "fJumpEncumbranceMultiplier", + "fJumpMoveBase", + "fJumpMoveMult", + "fJumpRunMultiplier", + "fKnockDownMult", + "fLevelMod", + "fLevelUpHealthEndMult", + "fLightMaxMod", + "fLuckMod", + "fMagesGuildTravel", + "fMagicCreatureCastDelay", + "fMagicDetectRefreshRate", + "fMagicItemConstantMult", + "fMagicItemCostMult", + "fMagicItemOnceMult", + "fMagicItemPriceMult", + "fMagicItemRechargePerSecond", + "fMagicItemStrikeMult", + "fMagicItemUsedMult", + "fMagicStartIconBlink", + "fMagicSunBlockedMult", + "fMajorSkillBonus", + "fMaxFlySpeed", + "fMaxHandToHandMult", + "fMaxHeadTrackDistance", + "fMaxWalkSpeed", + "fMaxWalkSpeedCreature", + "fMedMaxMod", + "fMessageTimePerChar", + "fMinFlySpeed", + "fMinHandToHandMult", + "fMinorSkillBonus", + "fMinWalkSpeed", + "fMinWalkSpeedCreature", + "fMiscSkillBonus", + "fNPCbaseMagickaMult", + "fNPCHealthBarFade", + "fNPCHealthBarTime", + "fPCbaseMagickaMult", + "fPerDieRollMult", + "fPersonalityMod", + "fPerTempMult", + "fPickLockMult", + "fPickPocketMod", + "fPotionMinUsefulDuration", + "fPotionStrengthMult", + "fPotionT1DurMult", + "fPotionT1MagMult", + "fPotionT4BaseStrengthMult", + "fPotionT4EquipStrengthMult", + "fProjectileMaxSpeed", + "fProjectileMinSpeed", + "fProjectileThrownStoreChance", + "fRepairAmountMult", + "fRepairMult", + "fReputationMod", + "fRestMagicMult", + "fSeriousWoundMult", + "fSleepRandMod", + "fSleepRestMod", + "fSneakBootMult", + "fSneakDistanceBase", + "fSneakDistanceMultiplier", + "fSneakNoViewMult", + "fSneakSkillMult", + "fSneakSpeedMultiplier", + "fSneakUseDelay", + "fSneakUseDist", + "fSneakViewMult", + "fSoulGemMult", + "fSpecialSkillBonus", + "fSpellMakingValueMult", + "fSpellPriceMult", + "fSpellValueMult", + "fStromWalkMult", + "fStromWindSpeed", + "fSuffocationDamage", + "fSwimHeightScale", + "fSwimRunAthleticsMult", + "fSwimRunBase", + "fSwimWalkAthleticsMult", + "fSwimWalkBase", + "fSwingBlockBase", + "fSwingBlockMult", + "fTargetSpellMaxSpeed", + "fThrownWeaponMaxSpeed", + "fThrownWeaponMinSpeed", + "fTrapCostMult", + "fTravelMult", + "fTravelTimeMult", + "fUnarmoredBase1", + "fUnarmoredBase2", + "fVanityDelay", + "fVoiceIdleOdds", + "fWaterReflectUpdateAlways", + "fWaterReflectUpdateSeldom", + "fWeaponDamageMult", + "fWeaponFatigueBlockMult", + "fWeaponFatigueMult", + "fWereWolfAcrobatics", + "fWereWolfAgility", + "fWereWolfAlchemy", + "fWereWolfAlteration", + "fWereWolfArmorer", + "fWereWolfAthletics", + "fWereWolfAxe", + "fWereWolfBlock", + "fWereWolfBluntWeapon", + "fWereWolfConjuration", + "fWereWolfDestruction", + "fWereWolfEnchant", + "fWereWolfEndurance", + "fWereWolfFatigue", + "fWereWolfHandtoHand", + "fWereWolfHealth", + "fWereWolfHeavyArmor", + "fWereWolfIllusion", + "fWereWolfIntellegence", + "fWereWolfLightArmor", + "fWereWolfLongBlade", + "fWereWolfLuck", + "fWereWolfMagicka", + "fWereWolfMarksman", + "fWereWolfMediumArmor", + "fWereWolfMerchantile", + "fWereWolfMysticism", + "fWereWolfPersonality", + "fWereWolfRestoration", + "fWereWolfRunMult", + "fWereWolfSecurity", + "fWereWolfShortBlade", + "fWereWolfSilverWeaponDamageMult", + "fWereWolfSneak", + "fWereWolfSpear", + "fWereWolfSpeechcraft", + "fWereWolfSpeed", + "fWereWolfStrength", + "fWereWolfUnarmored", + "fWereWolfWillPower", + "fWortChanceValue" +}; + +const char * CSMWorld::DefaultGMSTs::Ints[CSMWorld::DefaultGMSTs::IntCount] = +{ + "i1stPersonSneakDelta", + "iAlarmAttack", + "iAlarmKilling", + "iAlarmPickPocket", + "iAlarmStealing", + "iAlarmTresspass", + "iAlchemyMod", + "iAutoPCSpellMax", + "iAutoRepFacMod", + "iAutoRepLevMod", + "iAutoSpellAlterationMax", + "iAutoSpellAttSkillMin", + "iAutoSpellConjurationMax", + "iAutoSpellDestructionMax", + "iAutoSpellIllusionMax", + "iAutoSpellMysticismMax", + "iAutoSpellRestorationMax", + "iAutoSpellTimesCanCast", + "iBarterFailDisposition", + "iBarterSuccessDisposition", + "iBaseArmorSkill", + "iBlockMaxChance", + "iBlockMinChance", + "iBootsWeight", + "iCrimeAttack", + "iCrimeKilling", + "iCrimePickPocket", + "iCrimeThreshold", + "iCrimeThresholdMultiplier", + "iCrimeTresspass", + "iCuirassWeight", + "iDaysinPrisonMod", + "iDispAttackMod", + "iDispKilling", + "iDispTresspass", + "iFightAlarmMult", + "iFightAttack", + "iFightAttacking", + "iFightDistanceBase", + "iFightKilling", + "iFightPickpocket", + "iFightTrespass", + "iFlee", + "iGauntletWeight", + "iGreavesWeight", + "iGreetDistanceMultiplier", + "iGreetDuration", + "iHelmWeight", + "iKnockDownOddsBase", + "iKnockDownOddsMult", + "iLevelUp01Mult", + "iLevelUp02Mult", + "iLevelUp03Mult", + "iLevelUp04Mult", + "iLevelUp05Mult", + "iLevelUp06Mult", + "iLevelUp07Mult", + "iLevelUp08Mult", + "iLevelUp09Mult", + "iLevelUp10Mult", + "iLevelupMajorMult", + "iLevelupMajorMultAttribute", + "iLevelupMinorMult", + "iLevelupMinorMultAttribute", + "iLevelupMiscMultAttriubte", + "iLevelupSpecialization", + "iLevelupTotal", + "iMagicItemChargeConst", + "iMagicItemChargeOnce", + "iMagicItemChargeStrike", + "iMagicItemChargeUse", + "iMaxActivateDist", + "iMaxInfoDist", + "iMonthsToRespawn", + "iNumberCreatures", + "iPauldronWeight", + "iPerMinChance", + "iPerMinChange", + "iPickMaxChance", + "iPickMinChance", + "iShieldWeight", + "iSoulAmountForConstantEffect", + "iTrainingMod", + "iVoiceAttackOdds", + "iVoiceHitOdds", + "iWereWolfBounty", + "iWereWolfFightMod", + "iWereWolfFleeMod", + "iWereWolfLevelToAttack" +}; + +const char * CSMWorld::DefaultGMSTs::Strings[CSMWorld::DefaultGMSTs::StringCount] = +{ + "s3dAudio", + "s3dHardware", + "s3dSoftware", + "sAbsorb", + "sAcrobat", + "sActivate", + "sActivateXbox", + "sActorInCombat", + "sAdmire", + "sAdmireFail", + "sAdmireSuccess", + "sAgent", + "sAgiDesc", + "sAIDistance", + "sAlembic", + "sAllTab", + "sAlways", + "sAlways_Run", + "sand", + "sApparatus", + "sApparelTab", + "sArcher", + "sArea", + "sAreaDes", + "sArmor", + "sArmorRating", + "sAsk", + "sAssassin", + "sAt", + "sAttack", + "sAttributeAgility", + "sAttributeEndurance", + "sAttributeIntelligence", + "sAttributeListTitle", + "sAttributeLuck", + "sAttributePersonality", + "sAttributesMenu1", + "sAttributeSpeed", + "sAttributeStrength", + "sAttributeWillpower", + "sAudio", + "sAuto_Run", + "sBack", + "sBackspace", + "sBackXbox", + "sBarbarian", + "sBard", + "sBarter", + "sBarterDialog1", + "sBarterDialog10", + "sBarterDialog11", + "sBarterDialog12", + "sBarterDialog2", + "sBarterDialog3", + "sBarterDialog4", + "sBarterDialog5", + "sBarterDialog6", + "sBarterDialog7", + "sBarterDialog8", + "sBarterDialog9", + "sBattlemage", + "sBestAttack", + "sBirthSign", + "sBirthsignmenu1", + "sBirthsignmenu2", + "sBlocks", + "sBonusSkillTitle", + "sBookPageOne", + "sBookPageTwo", + "sBookSkillMessage", + "sBounty", + "sBreath", + "sBribe 10 Gold", + "sBribe 100 Gold", + "sBribe 1000 Gold", + "sBribeFail", + "sBribeSuccess", + "sBuy", + "sBye", + "sCalcinator", + "sCancel", + "sCantEquipWeapWarning", + "sCastCost", + "sCaughtStealingMessage", + "sCenter", + "sChangedMastersMsg", + "sCharges", + "sChooseClassMenu1", + "sChooseClassMenu2", + "sChooseClassMenu3", + "sChooseClassMenu4", + "sChop", + "sClass", + "sClassChoiceMenu1", + "sClassChoiceMenu2", + "sClassChoiceMenu3", + "sClose", + "sCompanionShare", + "sCompanionWarningButtonOne", + "sCompanionWarningButtonTwo", + "sCompanionWarningMessage", + "sCondition", + "sConsoleTitle", + "sContainer", + "sContentsMessage1", + "sContentsMessage2", + "sContentsMessage3", + "sControlerVibration", + "sControls", + "sControlsMenu1", + "sControlsMenu2", + "sControlsMenu3", + "sControlsMenu4", + "sControlsMenu5", + "sControlsMenu6", + "sCostChance", + "sCostCharge", + "sCreate", + "sCreateClassMenu1", + "sCreateClassMenu2", + "sCreateClassMenu3", + "sCreateClassMenuHelp1", + "sCreateClassMenuHelp2", + "sCreateClassMenuWarning", + "sCreatedEffects", + "sCrimeHelp", + "sCrimeMessage", + "sCrouch_Sneak", + "sCrouchXbox", + "sCrusader", + "sCursorOff", + "sCustom", + "sCustomClassName", + "sDamage", + "sDark_Gamma", + "sDay", + "sDefaultCellname", + "sDelete", + "sDeleteGame", + "sDeleteNote", + "sDeleteSpell", + "sDeleteSpellError", + "sDetail_Level", + "sDialogMenu1", + "sDialogText1Xbox", + "sDialogText2Xbox", + "sDialogText3Xbox", + "sDifficulty", + "sDisposeCorpseFail", + "sDisposeofCorpse", + "sDone", + "sDoYouWantTo", + "sDrain", + "sDrop", + "sDuration", + "sDurationDes", + "sEasy", + "sEditNote", + "sEffectAbsorbAttribute", + "sEffectAbsorbFatigue", + "sEffectAbsorbHealth", + "sEffectAbsorbSkill", + "sEffectAbsorbSpellPoints", + "sEffectAlmsiviIntervention", + "sEffectBlind", + "sEffectBoundBattleAxe", + "sEffectBoundBoots", + "sEffectBoundCuirass", + "sEffectBoundDagger", + "sEffectBoundGloves", + "sEffectBoundHelm", + "sEffectBoundLongbow", + "sEffectBoundLongsword", + "sEffectBoundMace", + "sEffectBoundShield", + "sEffectBoundSpear", + "sEffectBurden", + "sEffectCalmCreature", + "sEffectCalmHumanoid", + "sEffectChameleon", + "sEffectCharm", + "sEffectCommandCreatures", + "sEffectCommandHumanoids", + "sEffectCorpus", + "sEffectCureBlightDisease", + "sEffectCureCommonDisease", + "sEffectCureCorprusDisease", + "sEffectCureParalyzation", + "sEffectCurePoison", + "sEffectDamageAttribute", + "sEffectDamageFatigue", + "sEffectDamageHealth", + "sEffectDamageMagicka", + "sEffectDamageSkill", + "sEffectDemoralizeCreature", + "sEffectDemoralizeHumanoid", + "sEffectDetectAnimal", + "sEffectDetectEnchantment", + "sEffectDetectKey", + "sEffectDisintegrateArmor", + "sEffectDisintegrateWeapon", + "sEffectDispel", + "sEffectDivineIntervention", + "sEffectDrainAttribute", + "sEffectDrainFatigue", + "sEffectDrainHealth", + "sEffectDrainSkill", + "sEffectDrainSpellpoints", + "sEffectExtraSpell", + "sEffectFeather", + "sEffectFireDamage", + "sEffectFireShield", + "sEffectFortifyAttackBonus", + "sEffectFortifyAttribute", + "sEffectFortifyFatigue", + "sEffectFortifyHealth", + "sEffectFortifyMagickaMultiplier", + "sEffectFortifySkill", + "sEffectFortifySpellpoints", + "sEffectFrenzyCreature", + "sEffectFrenzyHumanoid", + "sEffectFrostDamage", + "sEffectFrostShield", + "sEffectInvisibility", + "sEffectJump", + "sEffectLevitate", + "sEffectLight", + "sEffectLightningShield", + "sEffectLock", + "sEffectMark", + "sEffectNightEye", + "sEffectOpen", + "sEffectParalyze", + "sEffectPoison", + "sEffectRallyCreature", + "sEffectRallyHumanoid", + "sEffectRecall", + "sEffectReflect", + "sEffectRemoveCurse", + "sEffectResistBlightDisease", + "sEffectResistCommonDisease", + "sEffectResistCorprusDisease", + "sEffectResistFire", + "sEffectResistFrost", + "sEffectResistMagicka", + "sEffectResistNormalWeapons", + "sEffectResistParalysis", + "sEffectResistPoison", + "sEffectResistShock", + "sEffectRestoreAttribute", + "sEffectRestoreFatigue", + "sEffectRestoreHealth", + "sEffectRestoreSkill", + "sEffectRestoreSpellPoints", + "sEffects", + "sEffectSanctuary", + "sEffectShield", + "sEffectShockDamage", + "sEffectSilence", + "sEffectSlowFall", + "sEffectSoultrap", + "sEffectSound", + "sEffectSpellAbsorption", + "sEffectStuntedMagicka", + "sEffectSummonAncestralGhost", + "sEffectSummonBonelord", + "sEffectSummonCenturionSphere", + "sEffectSummonClannfear", + "sEffectSummonCreature01", + "sEffectSummonCreature02", + "sEffectSummonCreature03", + "sEffectSummonCreature04", + "sEffectSummonCreature05", + "sEffectSummonDaedroth", + "sEffectSummonDremora", + "sEffectSummonFabricant", + "sEffectSummonFlameAtronach", + "sEffectSummonFrostAtronach", + "sEffectSummonGoldensaint", + "sEffectSummonGreaterBonewalker", + "sEffectSummonHunger", + "sEffectSummonLeastBonewalker", + "sEffectSummonScamp", + "sEffectSummonSkeletalMinion", + "sEffectSummonStormAtronach", + "sEffectSummonWingedTwilight", + "sEffectSunDamage", + "sEffectSwiftSwim", + "sEffectTelekinesis", + "sEffectTurnUndead", + "sEffectVampirism", + "sEffectWaterBreathing", + "sEffectWaterWalking", + "sEffectWeaknessToBlightDisease", + "sEffectWeaknessToCommonDisease", + "sEffectWeaknessToCorprusDisease", + "sEffectWeaknessToFire", + "sEffectWeaknessToFrost", + "sEffectWeaknessToMagicka", + "sEffectWeaknessToNormalWeapons", + "sEffectWeaknessToPoison", + "sEffectWeaknessToShock", + "sEnableJoystick", + "sEnchanting", + "sEnchantItems", + "sEnchantmentHelp1", + "sEnchantmentHelp10", + "sEnchantmentHelp2", + "sEnchantmentHelp3", + "sEnchantmentHelp4", + "sEnchantmentHelp5", + "sEnchantmentHelp6", + "sEnchantmentHelp7", + "sEnchantmentHelp8", + "sEnchantmentHelp9", + "sEnchantmentMenu1", + "sEnchantmentMenu10", + "sEnchantmentMenu11", + "sEnchantmentMenu12", + "sEnchantmentMenu2", + "sEnchantmentMenu3", + "sEnchantmentMenu4", + "sEnchantmentMenu5", + "sEnchantmentMenu6", + "sEnchantmentMenu7", + "sEnchantmentMenu8", + "sEnchantmentMenu9", + "sEncumbrance", + "sEndDesc", + "sEquip", + "sExitGame", + "sExpelled", + "sExpelledMessage", + "sFace", + "sFaction", + "sFar", + "sFast", + "sFatDesc", + "sFatigue", + "sFavoriteSkills", + "sfeet", + "sFileSize", + "sfootarea", + "sFootsteps", + "sfor", + "sFortify", + "sForward", + "sForwardXbox", + "sFull", + "sGame", + "sGameWithoutLauncherXbox", + "sGamma_Correction", + "sGeneralMastPlugMismatchMsg", + "sGold", + "sGoodbye", + "sGoverningAttribute", + "sgp", + "sHair", + "sHard", + "sHeal", + "sHealer", + "sHealth", + "sHealthDesc", + "sHealthPerHourOfRest", + "sHealthPerLevel", + "sHeavy", + "sHigh", + "sin", + "sInfo", + "sInfoRefusal", + "sIngredients", + "sInPrisonTitle", + "sInputMenu1", + "sIntDesc", + "sIntimidate", + "sIntimidateFail", + "sIntimidateSuccess", + "sInvalidSaveGameMsg", + "sInvalidSaveGameMsgXBOX", + "sInventory", + "sInventoryMenu1", + "sInventoryMessage1", + "sInventoryMessage2", + "sInventoryMessage3", + "sInventoryMessage4", + "sInventoryMessage5", + "sInventorySelectNoIngredients", + "sInventorySelectNoItems", + "sInventorySelectNoSoul", + "sItem", + "sItemCastConstant", + "sItemCastOnce", + "sItemCastWhenStrikes", + "sItemCastWhenUsed", + "sItemName", + "sJournal", + "sJournalCmd", + "sJournalEntry", + "sJournalXbox", + "sJoystickHatShort", + "sJoystickNotFound", + "sJoystickShort", + "sJump", + "sJumpXbox", + "sKeyName_00", + "sKeyName_01", + "sKeyName_02", + "sKeyName_03", + "sKeyName_04", + "sKeyName_05", + "sKeyName_06", + "sKeyName_07", + "sKeyName_08", + "sKeyName_09", + "sKeyName_0A", + "sKeyName_0B", + "sKeyName_0C", + "sKeyName_0D", + "sKeyName_0E", + "sKeyName_0F", + "sKeyName_10", + "sKeyName_11", + "sKeyName_12", + "sKeyName_13", + "sKeyName_14", + "sKeyName_15", + "sKeyName_16", + "sKeyName_17", + "sKeyName_18", + "sKeyName_19", + "sKeyName_1A", + "sKeyName_1B", + "sKeyName_1C", + "sKeyName_1D", + "sKeyName_1E", + "sKeyName_1F", + "sKeyName_20", + "sKeyName_21", + "sKeyName_22", + "sKeyName_23", + "sKeyName_24", + "sKeyName_25", + "sKeyName_26", + "sKeyName_27", + "sKeyName_28", + "sKeyName_29", + "sKeyName_2A", + "sKeyName_2B", + "sKeyName_2C", + "sKeyName_2D", + "sKeyName_2E", + "sKeyName_2F", + "sKeyName_30", + "sKeyName_31", + "sKeyName_32", + "sKeyName_33", + "sKeyName_34", + "sKeyName_35", + "sKeyName_36", + "sKeyName_37", + "sKeyName_38", + "sKeyName_39", + "sKeyName_3A", + "sKeyName_3B", + "sKeyName_3C", + "sKeyName_3D", + "sKeyName_3E", + "sKeyName_3F", + "sKeyName_40", + "sKeyName_41", + "sKeyName_42", + "sKeyName_43", + "sKeyName_44", + "sKeyName_45", + "sKeyName_46", + "sKeyName_47", + "sKeyName_48", + "sKeyName_49", + "sKeyName_4A", + "sKeyName_4B", + "sKeyName_4C", + "sKeyName_4D", + "sKeyName_4E", + "sKeyName_4F", + "sKeyName_50", + "sKeyName_51", + "sKeyName_52", + "sKeyName_53", + "sKeyName_54", + "sKeyName_55", + "sKeyName_56", + "sKeyName_57", + "sKeyName_58", + "sKeyName_59", + "sKeyName_5A", + "sKeyName_5B", + "sKeyName_5C", + "sKeyName_5D", + "sKeyName_5E", + "sKeyName_5F", + "sKeyName_60", + "sKeyName_61", + "sKeyName_62", + "sKeyName_63", + "sKeyName_64", + "sKeyName_65", + "sKeyName_66", + "sKeyName_67", + "sKeyName_68", + "sKeyName_69", + "sKeyName_6A", + "sKeyName_6B", + "sKeyName_6C", + "sKeyName_6D", + "sKeyName_6E", + "sKeyName_6F", + "sKeyName_70", + "sKeyName_71", + "sKeyName_72", + "sKeyName_73", + "sKeyName_74", + "sKeyName_75", + "sKeyName_76", + "sKeyName_77", + "sKeyName_78", + "sKeyName_79", + "sKeyName_7A", + "sKeyName_7B", + "sKeyName_7C", + "sKeyName_7D", + "sKeyName_7E", + "sKeyName_7F", + "sKeyName_80", + "sKeyName_81", + "sKeyName_82", + "sKeyName_83", + "sKeyName_84", + "sKeyName_85", + "sKeyName_86", + "sKeyName_87", + "sKeyName_88", + "sKeyName_89", + "sKeyName_8A", + "sKeyName_8B", + "sKeyName_8C", + "sKeyName_8D", + "sKeyName_8E", + "sKeyName_8F", + "sKeyName_90", + "sKeyName_91", + "sKeyName_92", + "sKeyName_93", + "sKeyName_94", + "sKeyName_95", + "sKeyName_96", + "sKeyName_97", + "sKeyName_98", + "sKeyName_99", + "sKeyName_9A", + "sKeyName_9B", + "sKeyName_9C", + "sKeyName_9D", + "sKeyName_9E", + "sKeyName_9F", + "sKeyName_A0", + "sKeyName_A1", + "sKeyName_A2", + "sKeyName_A3", + "sKeyName_A4", + "sKeyName_A5", + "sKeyName_A6", + "sKeyName_A7", + "sKeyName_A8", + "sKeyName_A9", + "sKeyName_AA", + "sKeyName_AB", + "sKeyName_AC", + "sKeyName_AD", + "sKeyName_AE", + "sKeyName_AF", + "sKeyName_B0", + "sKeyName_B1", + "sKeyName_B2", + "sKeyName_B3", + "sKeyName_B4", + "sKeyName_B5", + "sKeyName_B6", + "sKeyName_B7", + "sKeyName_B8", + "sKeyName_B9", + "sKeyName_BA", + "sKeyName_BB", + "sKeyName_BC", + "sKeyName_BD", + "sKeyName_BE", + "sKeyName_BF", + "sKeyName_C0", + "sKeyName_C1", + "sKeyName_C2", + "sKeyName_C3", + "sKeyName_C4", + "sKeyName_C5", + "sKeyName_C6", + "sKeyName_C7", + "sKeyName_C8", + "sKeyName_C9", + "sKeyName_CA", + "sKeyName_CB", + "sKeyName_CC", + "sKeyName_CD", + "sKeyName_CE", + "sKeyName_CF", + "sKeyName_D0", + "sKeyName_D1", + "sKeyName_D2", + "sKeyName_D3", + "sKeyName_D4", + "sKeyName_D5", + "sKeyName_D6", + "sKeyName_D7", + "sKeyName_D8", + "sKeyName_D9", + "sKeyName_DA", + "sKeyName_DB", + "sKeyName_DC", + "sKeyName_DD", + "sKeyName_DE", + "sKeyName_DF", + "sKeyName_E0", + "sKeyName_E1", + "sKeyName_E2", + "sKeyName_E3", + "sKeyName_E4", + "sKeyName_E5", + "sKeyName_E6", + "sKeyName_E7", + "sKeyName_E8", + "sKeyName_E9", + "sKeyName_EA", + "sKeyName_EB", + "sKeyName_EC", + "sKeyName_ED", + "sKeyName_EE", + "sKeyName_EF", + "sKeyName_F0", + "sKeyName_F1", + "sKeyName_F2", + "sKeyName_F3", + "sKeyName_F4", + "sKeyName_F5", + "sKeyName_F6", + "sKeyName_F7", + "sKeyName_F8", + "sKeyName_F9", + "sKeyName_FA", + "sKeyName_FB", + "sKeyName_FC", + "sKeyName_FD", + "sKeyName_FE", + "sKeyName_FF", + "sKeyUsed", + "sKilledEssential", + "sKnight", + "sLeft", + "sLess", + "sLevel", + "sLevelProgress", + "sLevels", + "sLevelUp", + "sLevelUpMenu1", + "sLevelUpMenu2", + "sLevelUpMenu3", + "sLevelUpMenu4", + "sLevelUpMsg", + "sLevitateDisabled", + "sLight", + "sLight_Gamma", + "sLoadFailedMessage", + "sLoadGame", + "sLoadingErrorsMsg", + "sLoadingMessage1", + "sLoadingMessage14", + "sLoadingMessage15", + "sLoadingMessage2", + "sLoadingMessage3", + "sLoadingMessage4", + "sLoadingMessage5", + "sLoadingMessage9", + "sLoadLastSaveMsg", + "sLocal", + "sLockFail", + "sLockImpossible", + "sLockLevel", + "sLockSuccess", + "sLookDownXbox", + "sLookUpXbox", + "sLow", + "sLucDesc", + "sMagDesc", + "sMage", + "sMagic", + "sMagicAncestralGhostID", + "sMagicBonelordID", + "sMagicBoundBattleAxeID", + "sMagicBoundBootsID", + "sMagicBoundCuirassID", + "sMagicBoundDaggerID", + "sMagicBoundHelmID", + "sMagicBoundLeftGauntletID", + "sMagicBoundLongbowID", + "sMagicBoundLongswordID", + "sMagicBoundMaceID", + "sMagicBoundRightGauntletID", + "sMagicBoundShieldID", + "sMagicBoundSpearID", + "sMagicCannotRecast", + "sMagicCenturionSphereID", + "sMagicClannfearID", + "sMagicContractDisease", + "sMagicCorprusWorsens", + "sMagicCreature01ID", + "sMagicCreature02ID", + "sMagicCreature03ID", + "sMagicCreature04ID", + "sMagicCreature05ID", + "sMagicDaedrothID", + "sMagicDremoraID", + "sMagicEffects", + "sMagicFabricantID", + "sMagicFlameAtronachID", + "sMagicFrostAtronachID", + "sMagicGoldenSaintID", + "sMagicGreaterBonewalkerID", + "sMagicHungerID", + "sMagicInsufficientCharge", + "sMagicInsufficientSP", + "sMagicInvalidEffect", + "sMagicInvalidTarget", + "sMagicItem", + "sMagicLeastBonewalkerID", + "sMagicLockSuccess", + "sMagicMenu", + "sMagicOpenSuccess", + "sMagicPCResisted", + "sMagicScampID", + "sMagicSelectTitle", + "sMagicSkeletalMinionID", + "sMagicSkillFail", + "sMagicStormAtronachID", + "sMagicTab", + "sMagicTargetResisted", + "sMagicTargetResistsWeapons", + "sMagicWingedTwilightID", + "sMagnitude", + "sMagnitudeDes", + "sMake Enchantment", + "sMap", + "sMaster", + "sMastPlugMismatchMsg", + "sMaximumSaveGameMessage", + "sMaxSale", + "sMedium", + "sMenu_Help_Delay", + "sMenu_Mode", + "sMenuModeXbox", + "sMenuNextXbox", + "sMenuPrevXbox", + "sMenus", + "sMessage1", + "sMessage2", + "sMessage3", + "sMessage4", + "sMessage5", + "sMessageQuestionAnswer1", + "sMessageQuestionAnswer2", + "sMessageQuestionAnswer3", + "sMiscTab", + "sMissingMastersMsg", + "sMonk", + "sMonthEveningstar", + "sMonthFirstseed", + "sMonthFrostfall", + "sMonthHeartfire", + "sMonthLastseed", + "sMonthMidyear", + "sMonthMorningstar", + "sMonthRainshand", + "sMonthSecondseed", + "sMonthSunsdawn", + "sMonthSunsdusk", + "sMonthSunsheight", + "sMore", + "sMortar", + "sMouse", + "sMouseFlip", + "sMouseWheelDownShort", + "sMouseWheelUpShort", + "sMove", + "sMoveDownXbox", + "sMoveUpXbox", + "sMusic", + "sName", + "sNameTitle", + "sNear", + "sNeedOneSkill", + "sNeedTwoSkills", + "sNewGame", + "sNext", + "sNextRank", + "sNextSpell", + "sNextSpellXbox", + "sNextWeapon", + "sNextWeaponXbox", + "sNightblade", + "sNo", + "sNoName", + "sNone", + "sNotifyMessage1", + "sNotifyMessage10", + "sNotifyMessage11", + "sNotifyMessage12", + "sNotifyMessage13", + "sNotifyMessage14", + "sNotifyMessage15", + "sNotifyMessage16", + "sNotifyMessage16_a", + "sNotifyMessage17", + "sNotifyMessage18", + "sNotifyMessage19", + "sNotifyMessage2", + "sNotifyMessage20", + "sNotifyMessage21", + "sNotifyMessage22", + "sNotifyMessage23", + "sNotifyMessage24", + "sNotifyMessage25", + "sNotifyMessage26", + "sNotifyMessage27", + "sNotifyMessage28", + "sNotifyMessage29", + "sNotifyMessage3", + "sNotifyMessage30", + "sNotifyMessage31", + "sNotifyMessage32", + "sNotifyMessage33", + "sNotifyMessage34", + "sNotifyMessage35", + "sNotifyMessage36", + "sNotifyMessage37", + "sNotifyMessage38", + "sNotifyMessage39", + "sNotifyMessage4", + "sNotifyMessage40", + "sNotifyMessage41", + "sNotifyMessage42", + "sNotifyMessage43", + "sNotifyMessage44", + "sNotifyMessage45", + "sNotifyMessage46", + "sNotifyMessage47", + "sNotifyMessage48", + "sNotifyMessage49", + "sNotifyMessage4XBOX", + "sNotifyMessage5", + "sNotifyMessage50", + "sNotifyMessage51", + "sNotifyMessage52", + "sNotifyMessage53", + "sNotifyMessage54", + "sNotifyMessage55", + "sNotifyMessage56", + "sNotifyMessage57", + "sNotifyMessage58", + "sNotifyMessage59", + "sNotifyMessage6", + "sNotifyMessage60", + "sNotifyMessage61", + "sNotifyMessage62", + "sNotifyMessage63", + "sNotifyMessage64", + "sNotifyMessage65", + "sNotifyMessage66", + "sNotifyMessage67", + "sNotifyMessage6a", + "sNotifyMessage7", + "sNotifyMessage8", + "sNotifyMessage9", + "sOff", + "sOffer", + "sOfferMenuTitle", + "sOK", + "sOn", + "sOnce", + "sOneHanded", + "sOnetypeEffectMessage", + "sonword", + "sOptions", + "sOptionsMenuXbox", + "spercent", + "sPerDesc", + "sPersuasion", + "sPersuasionMenuTitle", + "sPickUp", + "sPilgrim", + "spoint", + "spoints", + "sPotionSuccess", + "sPowerAlreadyUsed", + "sPowers", + "sPreferences", + "sPrefs", + "sPrev", + "sPrevSpell", + "sPrevSpellXbox", + "sPrevWeapon", + "sPrevWeaponXbox", + "sProfitValue", + "sQuality", + "sQuanityMenuMessage01", + "sQuanityMenuMessage02", + "sQuestionDeleteSpell", + "sQuestionMark", + "sQuick0Xbox", + "sQuick10Cmd", + "sQuick1Cmd", + "sQuick2Cmd", + "sQuick3Cmd", + "sQuick4Cmd", + "sQuick4Xbox", + "sQuick5Cmd", + "sQuick5Xbox", + "sQuick6Cmd", + "sQuick6Xbox", + "sQuick7Cmd", + "sQuick7Xbox", + "sQuick8Cmd", + "sQuick8Xbox", + "sQuick9Cmd", + "sQuick9Xbox", + "sQuick_Save", + "sQuickLoadCmd", + "sQuickLoadXbox", + "sQuickMenu", + "sQuickMenu1", + "sQuickMenu2", + "sQuickMenu3", + "sQuickMenu4", + "sQuickMenu5", + "sQuickMenu6", + "sQuickMenuInstruc", + "sQuickMenuTitle", + "sQuickSaveCmd", + "sQuickSaveXbox", + "sRace", + "sRaceMenu1", + "sRaceMenu2", + "sRaceMenu3", + "sRaceMenu4", + "sRaceMenu5", + "sRaceMenu6", + "sRaceMenu7", + "sRacialTraits", + "sRange", + "sRangeDes", + "sRangeSelf", + "sRangeTarget", + "sRangeTouch", + "sReady_Magic", + "sReady_Weapon", + "sReadyItemXbox", + "sReadyMagicXbox", + "sRechargeEnchantment", + "sRender_Distance", + "sRepair", + "sRepairFailed", + "sRepairServiceTitle", + "sRepairSuccess", + "sReputation", + "sResChangeWarning", + "sRest", + "sRestIllegal", + "sRestKey", + "sRestMenu1", + "sRestMenu2", + "sRestMenu3", + "sRestMenu4", + "sRestMenuXbox", + "sRestore", + "sRetort", + "sReturnToGame", + "sRight", + "sRogue", + "sRun", + "sRunXbox", + "sSave", + "sSaveGame", + "sSaveGameDenied", + "sSaveGameFailed", + "sSaveGameNoMemory", + "sSaveGameTooBig", + "sSaveMenu1", + "sSaveMenuHelp01", + "sSaveMenuHelp02", + "sSaveMenuHelp03", + "sSaveMenuHelp04", + "sSaveMenuHelp05", + "sSaveMenuHelp06", + "sSchool", + "sSchoolAlteration", + "sSchoolConjuration", + "sSchoolDestruction", + "sSchoolIllusion", + "sSchoolMysticism", + "sSchoolRestoration", + "sScout", + "sScrolldown", + "sScrollup", + "ssecond", + "sseconds", + "sSeldom", + "sSelect", + "sSell", + "sSellerGold", + "sService", + "sServiceRefusal", + "sServiceRepairTitle", + "sServiceSpellsTitle", + "sServiceTrainingTitle", + "sServiceTrainingWords", + "sServiceTravelTitle", + "sSetValueMessage01", + "sSex", + "sShadows", + "sShadowText", + "sShift", + "sSkill", + "sSkillAcrobatics", + "sSkillAlchemy", + "sSkillAlteration", + "sSkillArmorer", + "sSkillAthletics", + "sSkillAxe", + "sSkillBlock", + "sSkillBluntweapon", + "sSkillClassMajor", + "sSkillClassMinor", + "sSkillClassMisc", + "sSkillConjuration", + "sSkillDestruction", + "sSkillEnchant", + "sSkillHandtohand", + "sSkillHeavyarmor", + "sSkillIllusion", + "sSkillLightarmor", + "sSkillLongblade", + "sSkillMarksman", + "sSkillMaxReached", + "sSkillMediumarmor", + "sSkillMercantile", + "sSkillMysticism", + "sSkillProgress", + "sSkillRestoration", + "sSkillSecurity", + "sSkillShortblade", + "sSkillsMenu1", + "sSkillsMenuReputationHelp", + "sSkillSneak", + "sSkillSpear", + "sSkillSpeechcraft", + "sSkillUnarmored", + "sSlash", + "sSleepInterrupt", + "sSlideLeftXbox", + "sSlideRightXbox", + "sSlow", + "sSorceror", + "sSoulGem", + "sSoulGemsWithSouls", + "sSoultrapSuccess", + "sSpace", + "sSpdDesc", + "sSpecialization", + "sSpecializationCombat", + "sSpecializationMagic", + "sSpecializationMenu1", + "sSpecializationStealth", + "sSpellmaking", + "sSpellmakingHelp1", + "sSpellmakingHelp2", + "sSpellmakingHelp3", + "sSpellmakingHelp4", + "sSpellmakingHelp5", + "sSpellmakingHelp6", + "sSpellmakingMenu1", + "sSpellmakingMenuTitle", + "sSpells", + "sSpellServiceTitle", + "sSpellsword", + "sStartCell", + "sStartCellError", + "sStartError", + "sStats", + "sStrafe", + "sStrDesc", + "sStrip", + "sSubtitles", + "sSystemMenuXbox", + "sTake", + "sTakeAll", + "sTargetCriticalStrike", + "sTaunt", + "sTauntFail", + "sTauntSuccess", + "sTeleportDisabled", + "sThief", + "sThrust", + "sTo", + "sTogglePOVCmd", + "sTogglePOVXbox", + "sToggleRunXbox", + "sTopics", + "sTotalCost", + "sTotalSold", + "sTraining", + "sTrainingServiceTitle", + "sTraits", + "sTransparency_Menu", + "sTrapFail", + "sTrapImpossible", + "sTrapped", + "sTrapSuccess", + "sTravel", + "sTravelServiceTitle", + "sTurn", + "sTurnLeftXbox", + "sTurnRightXbox", + "sTwoHanded", + "sType", + "sTypeAbility", + "sTypeBlightDisease", + "sTypeCurse", + "sTypeDisease", + "sTypePower", + "sTypeSpell", + "sUnequip", + "sUnlocked", + "sUntilHealed", + "sUse", + "sUserDefinedClass", + "sUses", + "sUseXbox", + "sValue", + "sVideo", + "sVideoWarning", + "sVoice", + "sWait", + "sWarrior", + "sWaterReflectUpdate", + "sWaterTerrainReflect", + "sWeaponTab", + "sWeight", + "sWerewolfAlarmMessage", + "sWerewolfPopup", + "sWerewolfRefusal", + "sWerewolfRestMessage", + "sWilDesc", + "sWitchhunter", + "sWorld", + "sWornTab", + "sXStrafe", + "sXTimes", + "sXTimesINT", + "sYes", + "sYourGold" +}; + +const char * CSMWorld::DefaultGMSTs::OptionalFloats[CSMWorld::DefaultGMSTs::OptionalFloatCount] = +{ + "fCombatDistanceWerewolfMod", + "fFleeDistance", + "fWereWolfAcrobatics", + "fWereWolfAgility", + "fWereWolfAlchemy", + "fWereWolfAlteration", + "fWereWolfArmorer", + "fWereWolfAthletics", + "fWereWolfAxe", + "fWereWolfBlock", + "fWereWolfBluntWeapon", + "fWereWolfConjuration", + "fWereWolfDestruction", + "fWereWolfEnchant", + "fWereWolfEndurance", + "fWereWolfFatigue", + "fWereWolfHandtoHand", + "fWereWolfHealth", + "fWereWolfHeavyArmor", + "fWereWolfIllusion", + "fWereWolfIntellegence", + "fWereWolfLightArmor", + "fWereWolfLongBlade", + "fWereWolfLuck", + "fWereWolfMagicka", + "fWereWolfMarksman", + "fWereWolfMediumArmor", + "fWereWolfMerchantile", + "fWereWolfMysticism", + "fWereWolfPersonality", + "fWereWolfRestoration", + "fWereWolfRunMult", + "fWereWolfSecurity", + "fWereWolfShortBlade", + "fWereWolfSilverWeaponDamageMult", + "fWereWolfSneak", + "fWereWolfSpear", + "fWereWolfSpeechcraft", + "fWereWolfSpeed", + "fWereWolfStrength", + "fWereWolfUnarmored", + "fWereWolfWillPower" +}; + +const char * CSMWorld::DefaultGMSTs::OptionalInts[CSMWorld::DefaultGMSTs::OptionalIntCount] = +{ + "iWereWolfBounty", + "iWereWolfFightMod", + "iWereWolfFleeMod", + "iWereWolfLevelToAttack" +}; + +const char * CSMWorld::DefaultGMSTs::OptionalStrings[CSMWorld::DefaultGMSTs::OptionalStringCount] = +{ + "sCompanionShare", + "sCompanionWarningButtonOne", + "sCompanionWarningButtonTwo", + "sCompanionWarningMessage", + "sDeleteNote", + "sEditNote", + "sEffectSummonCreature01", + "sEffectSummonCreature02", + "sEffectSummonCreature03", + "sEffectSummonCreature04", + "sEffectSummonCreature05", + "sEffectSummonFabricant", + "sLevitateDisabled", + "sMagicCreature01ID", + "sMagicCreature02ID", + "sMagicCreature03ID", + "sMagicCreature04ID", + "sMagicCreature05ID", + "sMagicFabricantID", + "sMaxSale", + "sProfitValue", + "sTeleportDisabled", + "sWerewolfAlarmMessage", + "sWerewolfPopup", + "sWerewolfRefusal", + "sWerewolfRestMessage" +}; + +const float CSMWorld::DefaultGMSTs::FloatsDefaultValues[CSMWorld::DefaultGMSTs::FloatCount] = +{ + 0.3, // fAIFleeFleeMult + 7.0, // fAIFleeHealthMult + 3.0, // fAIMagicSpellMult + 1.0, // fAIMeleeArmorMult + 1.0, // fAIMeleeSummWeaponMult + 2.0, // fAIMeleeWeaponMult + 5.0, // fAIRangeMagicSpellMult + 5.0, // fAIRangeMeleeWeaponMult + 2000.0, // fAlarmRadius + 1.0, // fAthleticsRunBonus + 40.0, // fAudioDefaultMaxDistance + 5.0, // fAudioDefaultMinDistance + 50.0, // fAudioMaxDistanceMult + 20.0, // fAudioMinDistanceMult + 60.0, // fAudioVoiceDefaultMaxDistance + 10.0, // fAudioVoiceDefaultMinDistance + 50.0, // fAutoPCSpellChance + 80.0, // fAutoSpellChance + 50.0, // fBargainOfferBase + -4.0, // fBargainOfferMulti + 24.0, // fBarterGoldResetDelay + 1.75, // fBaseRunMultiplier + 1.25, // fBlockStillBonus + 150.0, // fBribe1000Mod + 75.0, // fBribe100Mod + 35.0, // fBribe10Mod + 60.0, // fCombatAngleXY + 60.0, // fCombatAngleZ + 0.25, // fCombatArmorMinMult + -90.0, // fCombatBlockLeftAngle + 30.0, // fCombatBlockRightAngle + 4.0, // fCombatCriticalStrikeMult + 0.1, // fCombatDelayCreature + 0.1, // fCombatDelayNPC + 128.0, // fCombatDistance + 0.3, // fCombatDistanceWerewolfMod + 30.0, // fCombatForceSideAngle + 0.2, // fCombatInvisoMult + 1.5, // fCombatKODamageMult + 45.0, // fCombatTorsoSideAngle + 0.3, // fCombatTorsoStartPercent + 0.8, // fCombatTorsoStopPercent + 15.0, // fConstantEffectMult + 72.0, // fCorpseClearDelay + 72.0, // fCorpseRespawnDelay + 0.5, // fCrimeGoldDiscountMult + 0.9, // fCrimeGoldTurnInMult + 1.0, // fCrimeStealing + 0.5, // fDamageStrengthBase + 0.1, // fDamageStrengthMult + 5.0, // fDifficultyMult + 2.5, // fDiseaseXferChance + -10.0, // fDispAttacking + -1.0, // fDispBargainFailMod + 1.0, // fDispBargainSuccessMod + 0.0, // fDispCrimeMod + -10.0, // fDispDiseaseMod + 3.0, // fDispFactionMod + 1.0, // fDispFactionRankBase + 0.5, // fDispFactionRankMult + 1.0, // fDispositionMod + 50.0, // fDispPersonalityBase + 0.5, // fDispPersonalityMult + -25.0, // fDispPickPocketMod + 5.0, // fDispRaceMod + -0.5, // fDispStealing + -5.0, // fDispWeaponDrawn + 0.5, // fEffectCostMult + 0.1, // fElementalShieldMult + 3.0, // fEnchantmentChanceMult + 0.5, // fEnchantmentConstantChanceMult + 100.0, // fEnchantmentConstantDurationMult + 0.1, // fEnchantmentMult + 1000.0, // fEnchantmentValueMult + 0.3, // fEncumberedMoveEffect + 5.0, // fEncumbranceStrMult + 0.04, // fEndFatigueMult + 0.25, // fFallAcroBase + 0.01, // fFallAcroMult + 400.0, // fFallDamageDistanceMin + 0.0, // fFallDistanceBase + 0.07, // fFallDistanceMult + 2.0, // fFatigueAttackBase + 0.0, // fFatigueAttackMult + 1.25, // fFatigueBase + 4.0, // fFatigueBlockBase + 0.0, // fFatigueBlockMult + 5.0, // fFatigueJumpBase + 0.0, // fFatigueJumpMult + 0.5, // fFatigueMult + 2.5, // fFatigueReturnBase + 0.02, // fFatigueReturnMult + 5.0, // fFatigueRunBase + 2.0, // fFatigueRunMult + 1.5, // fFatigueSneakBase + 1.5, // fFatigueSneakMult + 0.0, // fFatigueSpellBase + 0.0, // fFatigueSpellCostMult + 0.0, // fFatigueSpellMult + 7.0, // fFatigueSwimRunBase + 0.0, // fFatigueSwimRunMult + 2.5, // fFatigueSwimWalkBase + 0.0, // fFatigueSwimWalkMult + 0.2, // fFightDispMult + 0.005, // fFightDistanceMultiplier + 50.0, // fFightStealing + 3000.0, // fFleeDistance + 512.0, // fGreetDistanceReset + 0.1, // fHandtoHandHealthPer + 1.0, // fHandToHandReach + 0.5, // fHoldBreathEndMult + 20.0, // fHoldBreathTime + 0.75, // fIdleChanceMultiplier + 1.0, // fIngredientMult + 0.5, // fInteriorHeadTrackMult + 128.0, // fJumpAcrobaticsBase + 4.0, // fJumpAcroMultiplier + 0.5, // fJumpEncumbranceBase + 1.0, // fJumpEncumbranceMultiplier + 0.5, // fJumpMoveBase + 0.5, // fJumpMoveMult + 1.0, // fJumpRunMultiplier + 0.5, // fKnockDownMult + 5.0, // fLevelMod + 0.1, // fLevelUpHealthEndMult + 0.6, // fLightMaxMod + 10.0, // fLuckMod + 10.0, // fMagesGuildTravel + 1.5, // fMagicCreatureCastDelay + 0.0167, // fMagicDetectRefreshRate + 1.0, // fMagicItemConstantMult + 1.0, // fMagicItemCostMult + 1.0, // fMagicItemOnceMult + 1.0, // fMagicItemPriceMult + 0.05, // fMagicItemRechargePerSecond + 1.0, // fMagicItemStrikeMult + 1.0, // fMagicItemUsedMult + 3.0, // fMagicStartIconBlink + 0.5, // fMagicSunBlockedMult + 0.75, // fMajorSkillBonus + 300.0, // fMaxFlySpeed + 0.5, // fMaxHandToHandMult + 400.0, // fMaxHeadTrackDistance + 200.0, // fMaxWalkSpeed + 300.0, // fMaxWalkSpeedCreature + 0.9, // fMedMaxMod + 0.1, // fMessageTimePerChar + 5.0, // fMinFlySpeed + 0.1, // fMinHandToHandMult + 1.0, // fMinorSkillBonus + 100.0, // fMinWalkSpeed + 5.0, // fMinWalkSpeedCreature + 1.25, // fMiscSkillBonus + 2.0, // fNPCbaseMagickaMult + 0.5, // fNPCHealthBarFade + 3.0, // fNPCHealthBarTime + 1.0, // fPCbaseMagickaMult + 0.3, // fPerDieRollMult + 5.0, // fPersonalityMod + 1.0, // fPerTempMult + -1.0, // fPickLockMult + 0.3, // fPickPocketMod + 20.0, // fPotionMinUsefulDuration + 0.5, // fPotionStrengthMult + 0.5, // fPotionT1DurMult + 1.5, // fPotionT1MagMult + 20.0, // fPotionT4BaseStrengthMult + 12.0, // fPotionT4EquipStrengthMult + 3000.0, // fProjectileMaxSpeed + 400.0, // fProjectileMinSpeed + 25.0, // fProjectileThrownStoreChance + 3.0, // fRepairAmountMult + 1.0, // fRepairMult + 1.0, // fReputationMod + 0.15, // fRestMagicMult + 0.0, // fSeriousWoundMult + 0.25, // fSleepRandMod + 0.3, // fSleepRestMod + -1.0, // fSneakBootMult + 0.5, // fSneakDistanceBase + 0.002, // fSneakDistanceMultiplier + 0.5, // fSneakNoViewMult + 1.0, // fSneakSkillMult + 0.75, // fSneakSpeedMultiplier + 1.0, // fSneakUseDelay + 500.0, // fSneakUseDist + 1.5, // fSneakViewMult + 3.0, // fSoulGemMult + 0.8, // fSpecialSkillBonus + 7.0, // fSpellMakingValueMult + 2.0, // fSpellPriceMult + 10.0, // fSpellValueMult + 0.25, // fStromWalkMult + 0.7, // fStromWindSpeed + 3.0, // fSuffocationDamage + 0.9, // fSwimHeightScale + 0.1, // fSwimRunAthleticsMult + 0.5, // fSwimRunBase + 0.02, // fSwimWalkAthleticsMult + 0.5, // fSwimWalkBase + 1.0, // fSwingBlockBase + 1.0, // fSwingBlockMult + 1000.0, // fTargetSpellMaxSpeed + 1000.0, // fThrownWeaponMaxSpeed + 300.0, // fThrownWeaponMinSpeed + 0.0, // fTrapCostMult + 4000.0, // fTravelMult + 16000.0,// fTravelTimeMult + 0.1, // fUnarmoredBase1 + 0.065, // fUnarmoredBase2 + 30.0, // fVanityDelay + 10.0, // fVoiceIdleOdds + 0.0, // fWaterReflectUpdateAlways + 10.0, // fWaterReflectUpdateSeldom + 0.1, // fWeaponDamageMult + 1.0, // fWeaponFatigueBlockMult + 0.25, // fWeaponFatigueMult + 150.0, // fWereWolfAcrobatics + 150.0, // fWereWolfAgility + 1.0, // fWereWolfAlchemy + 1.0, // fWereWolfAlteration + 1.0, // fWereWolfArmorer + 150.0, // fWereWolfAthletics + 1.0, // fWereWolfAxe + 1.0, // fWereWolfBlock + 1.0, // fWereWolfBluntWeapon + 1.0, // fWereWolfConjuration + 1.0, // fWereWolfDestruction + 1.0, // fWereWolfEnchant + 150.0, // fWereWolfEndurance + 400.0, // fWereWolfFatigue + 100.0, // fWereWolfHandtoHand + 2.0, // fWereWolfHealth + 1.0, // fWereWolfHeavyArmor + 1.0, // fWereWolfIllusion + 1.0, // fWereWolfIntellegence + 1.0, // fWereWolfLightArmor + 1.0, // fWereWolfLongBlade + 1.0, // fWereWolfLuck + 100.0, // fWereWolfMagicka + 1.0, // fWereWolfMarksman + 1.0, // fWereWolfMediumArmor + 1.0, // fWereWolfMerchantile + 1.0, // fWereWolfMysticism + 1.0, // fWereWolfPersonality + 1.0, // fWereWolfRestoration + 1.5, // fWereWolfRunMult + 1.0, // fWereWolfSecurity + 1.0, // fWereWolfShortBlade + 1.5, // fWereWolfSilverWeaponDamageMult + 1.0, // fWereWolfSneak + 1.0, // fWereWolfSpear + 1.0, // fWereWolfSpeechcraft + 150.0, // fWereWolfSpeed + 150.0, // fWereWolfStrength + 100.0, // fWereWolfUnarmored + 1.0, // fWereWolfWillPower + 15.0 // fWortChanceValue +}; + +const int CSMWorld::DefaultGMSTs::IntsDefaultValues[CSMWorld::DefaultGMSTs::IntCount] = +{ + 10, // i1stPersonSneakDelta + 50, // iAlarmAttack + 90, // iAlarmKilling + 20, // iAlarmPickPocket + 1, // iAlarmStealing + 5, // iAlarmTresspass + 2, // iAlchemyMod + 100, // iAutoPCSpellMax + 2, // iAutoRepFacMod + 0, // iAutoRepLevMod + 5, // iAutoSpellAlterationMax + 70, // iAutoSpellAttSkillMin + 2, // iAutoSpellConjurationMax + 5, // iAutoSpellDestructionMax + 5, // iAutoSpellIllusionMax + 5, // iAutoSpellMysticismMax + 5, // iAutoSpellRestorationMax + 3, // iAutoSpellTimesCanCast + -1, // iBarterFailDisposition + 1, // iBarterSuccessDisposition + 30, // iBaseArmorSkill + 50, // iBlockMaxChance + 10, // iBlockMinChance + 20, // iBootsWeight + 40, // iCrimeAttack + 1000, // iCrimeKilling + 25, // iCrimePickPocket + 1000, // iCrimeThreshold + 10, // iCrimeThresholdMultiplier + 5, // iCrimeTresspass + 30, // iCuirassWeight + 100, // iDaysinPrisonMod + -50, // iDispAttackMod + -50, // iDispKilling + -20, // iDispTresspass + 1, // iFightAlarmMult + 100, // iFightAttack + 50, // iFightAttacking + 20, // iFightDistanceBase + 50, // iFightKilling + 25, // iFightPickpocket + 25, // iFightTrespass + 0, // iFlee + 5, // iGauntletWeight + 15, // iGreavesWeight + 6, // iGreetDistanceMultiplier + 4, // iGreetDuration + 5, // iHelmWeight + 50, // iKnockDownOddsBase + 50, // iKnockDownOddsMult + 2, // iLevelUp01Mult + 2, // iLevelUp02Mult + 2, // iLevelUp03Mult + 2, // iLevelUp04Mult + 3, // iLevelUp05Mult + 3, // iLevelUp06Mult + 3, // iLevelUp07Mult + 4, // iLevelUp08Mult + 4, // iLevelUp09Mult + 5, // iLevelUp10Mult + 1, // iLevelupMajorMult + 1, // iLevelupMajorMultAttribute + 1, // iLevelupMinorMult + 1, // iLevelupMinorMultAttribute + 1, // iLevelupMiscMultAttriubte + 1, // iLevelupSpecialization + 10, // iLevelupTotal + 10, // iMagicItemChargeConst + 1, // iMagicItemChargeOnce + 10, // iMagicItemChargeStrike + 5, // iMagicItemChargeUse + 192, // iMaxActivateDist + 192, // iMaxInfoDist + 4, // iMonthsToRespawn + 1, // iNumberCreatures + 10, // iPauldronWeight + 5, // iPerMinChance + 10, // iPerMinChange + 75, // iPickMaxChance + 5, // iPickMinChance + 15, // iShieldWeight + 400, // iSoulAmountForConstantEffect + 10, // iTrainingMod + 10, // iVoiceAttackOdds + 30, // iVoiceHitOdds + 10000, // iWereWolfBounty + 100, // iWereWolfFightMod + 100, // iWereWolfFleeMod + 20 // iWereWolfLevelToAttack +}; + +const float CSMWorld::DefaultGMSTs::FloatLimits[CSMWorld::DefaultGMSTs::FloatCount * 2] = +{ + -FInf, FInf, // fAIFleeFleeMult + -FInf, FInf, // fAIFleeHealthMult + -FInf, FInf, // fAIMagicSpellMult + -FInf, FInf, // fAIMeleeArmorMult + -FInf, FInf, // fAIMeleeSummWeaponMult + -FInf, FInf, // fAIMeleeWeaponMult + -FInf, FInf, // fAIRangeMagicSpellMult + -FInf, FInf, // fAIRangeMeleeWeaponMult + 0, FInf, // fAlarmRadius + -FInf, FInf, // fAthleticsRunBonus + 0, FInf, // fAudioDefaultMaxDistance + 0, FInf, // fAudioDefaultMinDistance + 0, FInf, // fAudioMaxDistanceMult + 0, FInf, // fAudioMinDistanceMult + 0, FInf, // fAudioVoiceDefaultMaxDistance + 0, FInf, // fAudioVoiceDefaultMinDistance + 0, FInf, // fAutoPCSpellChance + 0, FInf, // fAutoSpellChance + -FInf, FInf, // fBargainOfferBase + -FInf, 0, // fBargainOfferMulti + -FInf, FInf, // fBarterGoldResetDelay + 0, FInf, // fBaseRunMultiplier + -FInf, FInf, // fBlockStillBonus + 0, FInf, // fBribe1000Mod + 0, FInf, // fBribe100Mod + 0, FInf, // fBribe10Mod + 0, FInf, // fCombatAngleXY + 0, FInf, // fCombatAngleZ + 0, 1, // fCombatArmorMinMult + -180, 0, // fCombatBlockLeftAngle + 0, 180, // fCombatBlockRightAngle + 0, FInf, // fCombatCriticalStrikeMult + 0, FInf, // fCombatDelayCreature + 0, FInf, // fCombatDelayNPC + 0, FInf, // fCombatDistance + -FInf, FInf, // fCombatDistanceWerewolfMod + -FInf, FInf, // fCombatForceSideAngle + 0, FInf, // fCombatInvisoMult + 0, FInf, // fCombatKODamageMult + -FInf, FInf, // fCombatTorsoSideAngle + -FInf, FInf, // fCombatTorsoStartPercent + -FInf, FInf, // fCombatTorsoStopPercent + -FInf, FInf, // fConstantEffectMult + -FInf, FInf, // fCorpseClearDelay + -FInf, FInf, // fCorpseRespawnDelay + 0, 1, // fCrimeGoldDiscountMult + 0, FInf, // fCrimeGoldTurnInMult + 0, FInf, // fCrimeStealing + 0, FInf, // fDamageStrengthBase + 0, FInf, // fDamageStrengthMult + -FInf, FInf, // fDifficultyMult + 0, FInf, // fDiseaseXferChance + -FInf, 0, // fDispAttacking + -FInf, FInf, // fDispBargainFailMod + -FInf, FInf, // fDispBargainSuccessMod + -FInf, 0, // fDispCrimeMod + -FInf, 0, // fDispDiseaseMod + 0, FInf, // fDispFactionMod + 0, FInf, // fDispFactionRankBase + 0, FInf, // fDispFactionRankMult + 0, FInf, // fDispositionMod + 0, FInf, // fDispPersonalityBase + 0, FInf, // fDispPersonalityMult + -FInf, 0, // fDispPickPocketMod + 0, FInf, // fDispRaceMod + -FInf, 0, // fDispStealing + -FInf, 0, // fDispWeaponDrawn + 0, FInf, // fEffectCostMult + 0, FInf, // fElementalShieldMult + FEps, FInf, // fEnchantmentChanceMult + 0, FInf, // fEnchantmentConstantChanceMult + 0, FInf, // fEnchantmentConstantDurationMult + 0, FInf, // fEnchantmentMult + 0, FInf, // fEnchantmentValueMult + 0, FInf, // fEncumberedMoveEffect + 0, FInf, // fEncumbranceStrMult + 0, FInf, // fEndFatigueMult + -FInf, FInf, // fFallAcroBase + 0, FInf, // fFallAcroMult + 0, FInf, // fFallDamageDistanceMin + -FInf, FInf, // fFallDistanceBase + 0, FInf, // fFallDistanceMult + -FInf, FInf, // fFatigueAttackBase + 0, FInf, // fFatigueAttackMult + 0, FInf, // fFatigueBase + 0, FInf, // fFatigueBlockBase + 0, FInf, // fFatigueBlockMult + 0, FInf, // fFatigueJumpBase + 0, FInf, // fFatigueJumpMult + 0, FInf, // fFatigueMult + -FInf, FInf, // fFatigueReturnBase + 0, FInf, // fFatigueReturnMult + -FInf, FInf, // fFatigueRunBase + 0, FInf, // fFatigueRunMult + -FInf, FInf, // fFatigueSneakBase + 0, FInf, // fFatigueSneakMult + -FInf, FInf, // fFatigueSpellBase + -FInf, FInf, // fFatigueSpellCostMult + 0, FInf, // fFatigueSpellMult + -FInf, FInf, // fFatigueSwimRunBase + 0, FInf, // fFatigueSwimRunMult + -FInf, FInf, // fFatigueSwimWalkBase + 0, FInf, // fFatigueSwimWalkMult + -FInf, FInf, // fFightDispMult + -FInf, FInf, // fFightDistanceMultiplier + -FInf, FInf, // fFightStealing + -FInf, FInf, // fFleeDistance + -FInf, FInf, // fGreetDistanceReset + 0, FInf, // fHandtoHandHealthPer + 0, FInf, // fHandToHandReach + -FInf, FInf, // fHoldBreathEndMult + 0, FInf, // fHoldBreathTime + 0, FInf, // fIdleChanceMultiplier + -FInf, FInf, // fIngredientMult + 0, FInf, // fInteriorHeadTrackMult + -FInf, FInf, // fJumpAcrobaticsBase + 0, FInf, // fJumpAcroMultiplier + -FInf, FInf, // fJumpEncumbranceBase + 0, FInf, // fJumpEncumbranceMultiplier + -FInf, FInf, // fJumpMoveBase + 0, FInf, // fJumpMoveMult + 0, FInf, // fJumpRunMultiplier + -FInf, FInf, // fKnockDownMult + 0, FInf, // fLevelMod + 0, FInf, // fLevelUpHealthEndMult + 0, FInf, // fLightMaxMod + 0, FInf, // fLuckMod + 0, FInf, // fMagesGuildTravel + -FInf, FInf, // fMagicCreatureCastDelay + -FInf, FInf, // fMagicDetectRefreshRate + -FInf, FInf, // fMagicItemConstantMult + -FInf, FInf, // fMagicItemCostMult + -FInf, FInf, // fMagicItemOnceMult + -FInf, FInf, // fMagicItemPriceMult + 0, FInf, // fMagicItemRechargePerSecond + -FInf, FInf, // fMagicItemStrikeMult + -FInf, FInf, // fMagicItemUsedMult + 0, FInf, // fMagicStartIconBlink + 0, FInf, // fMagicSunBlockedMult + FEps, FInf, // fMajorSkillBonus + 0, FInf, // fMaxFlySpeed + 0, FInf, // fMaxHandToHandMult + 0, FInf, // fMaxHeadTrackDistance + 0, FInf, // fMaxWalkSpeed + 0, FInf, // fMaxWalkSpeedCreature + 0, FInf, // fMedMaxMod + 0, FInf, // fMessageTimePerChar + 0, FInf, // fMinFlySpeed + 0, FInf, // fMinHandToHandMult + FEps, FInf, // fMinorSkillBonus + 0, FInf, // fMinWalkSpeed + 0, FInf, // fMinWalkSpeedCreature + FEps, FInf, // fMiscSkillBonus + 0, FInf, // fNPCbaseMagickaMult + 0, FInf, // fNPCHealthBarFade + 0, FInf, // fNPCHealthBarTime + 0, FInf, // fPCbaseMagickaMult + 0, FInf, // fPerDieRollMult + 0, FInf, // fPersonalityMod + 0, FInf, // fPerTempMult + -FInf, 0, // fPickLockMult + 0, FInf, // fPickPocketMod + -FInf, FInf, // fPotionMinUsefulDuration + 0, FInf, // fPotionStrengthMult + FEps, FInf, // fPotionT1DurMult + FEps, FInf, // fPotionT1MagMult + -FInf, FInf, // fPotionT4BaseStrengthMult + -FInf, FInf, // fPotionT4EquipStrengthMult + 0, FInf, // fProjectileMaxSpeed + 0, FInf, // fProjectileMinSpeed + 0, FInf, // fProjectileThrownStoreChance + 0, FInf, // fRepairAmountMult + 0, FInf, // fRepairMult + 0, FInf, // fReputationMod + 0, FInf, // fRestMagicMult + -FInf, FInf, // fSeriousWoundMult + 0, FInf, // fSleepRandMod + 0, FInf, // fSleepRestMod + -FInf, 0, // fSneakBootMult + -FInf, FInf, // fSneakDistanceBase + 0, FInf, // fSneakDistanceMultiplier + 0, FInf, // fSneakNoViewMult + 0, FInf, // fSneakSkillMult + 0, FInf, // fSneakSpeedMultiplier + 0, FInf, // fSneakUseDelay + 0, FInf, // fSneakUseDist + 0, FInf, // fSneakViewMult + 0, FInf, // fSoulGemMult + 0, FInf, // fSpecialSkillBonus + 0, FInf, // fSpellMakingValueMult + -FInf, FInf, // fSpellPriceMult + 0, FInf, // fSpellValueMult + 0, FInf, // fStromWalkMult + 0, FInf, // fStromWindSpeed + 0, FInf, // fSuffocationDamage + 0, FInf, // fSwimHeightScale + 0, FInf, // fSwimRunAthleticsMult + 0, FInf, // fSwimRunBase + -FInf, FInf, // fSwimWalkAthleticsMult + -FInf, FInf, // fSwimWalkBase + 0, FInf, // fSwingBlockBase + 0, FInf, // fSwingBlockMult + 0, FInf, // fTargetSpellMaxSpeed + 0, FInf, // fThrownWeaponMaxSpeed + 0, FInf, // fThrownWeaponMinSpeed + 0, FInf, // fTrapCostMult + 0, FInf, // fTravelMult + 0, FInf, // fTravelTimeMult + 0, FInf, // fUnarmoredBase1 + 0, FInf, // fUnarmoredBase2 + 0, FInf, // fVanityDelay + 0, FInf, // fVoiceIdleOdds + -FInf, FInf, // fWaterReflectUpdateAlways + -FInf, FInf, // fWaterReflectUpdateSeldom + 0, FInf, // fWeaponDamageMult + 0, FInf, // fWeaponFatigueBlockMult + 0, FInf, // fWeaponFatigueMult + 0, FInf, // fWereWolfAcrobatics + -FInf, FInf, // fWereWolfAgility + -FInf, FInf, // fWereWolfAlchemy + -FInf, FInf, // fWereWolfAlteration + -FInf, FInf, // fWereWolfArmorer + -FInf, FInf, // fWereWolfAthletics + -FInf, FInf, // fWereWolfAxe + -FInf, FInf, // fWereWolfBlock + -FInf, FInf, // fWereWolfBluntWeapon + -FInf, FInf, // fWereWolfConjuration + -FInf, FInf, // fWereWolfDestruction + -FInf, FInf, // fWereWolfEnchant + -FInf, FInf, // fWereWolfEndurance + -FInf, FInf, // fWereWolfFatigue + -FInf, FInf, // fWereWolfHandtoHand + -FInf, FInf, // fWereWolfHealth + -FInf, FInf, // fWereWolfHeavyArmor + -FInf, FInf, // fWereWolfIllusion + -FInf, FInf, // fWereWolfIntellegence + -FInf, FInf, // fWereWolfLightArmor + -FInf, FInf, // fWereWolfLongBlade + -FInf, FInf, // fWereWolfLuck + -FInf, FInf, // fWereWolfMagicka + -FInf, FInf, // fWereWolfMarksman + -FInf, FInf, // fWereWolfMediumArmor + -FInf, FInf, // fWereWolfMerchantile + -FInf, FInf, // fWereWolfMysticism + -FInf, FInf, // fWereWolfPersonality + -FInf, FInf, // fWereWolfRestoration + 0, FInf, // fWereWolfRunMult + -FInf, FInf, // fWereWolfSecurity + -FInf, FInf, // fWereWolfShortBlade + -FInf, FInf, // fWereWolfSilverWeaponDamageMult + -FInf, FInf, // fWereWolfSneak + -FInf, FInf, // fWereWolfSpear + -FInf, FInf, // fWereWolfSpeechcraft + -FInf, FInf, // fWereWolfSpeed + -FInf, FInf, // fWereWolfStrength + -FInf, FInf, // fWereWolfUnarmored + -FInf, FInf, // fWereWolfWillPower + 0, FInf // fWortChanceValue +}; + +const int CSMWorld::DefaultGMSTs::IntLimits[CSMWorld::DefaultGMSTs::IntCount * 2] = +{ + IMin, IMax, // i1stPersonSneakDelta + IMin, IMax, // iAlarmAttack + IMin, IMax, // iAlarmKilling + IMin, IMax, // iAlarmPickPocket + IMin, IMax, // iAlarmStealing + IMin, IMax, // iAlarmTresspass + IMin, IMax, // iAlchemyMod + 0, IMax, // iAutoPCSpellMax + IMin, IMax, // iAutoRepFacMod + IMin, IMax, // iAutoRepLevMod + IMin, IMax, // iAutoSpellAlterationMax + 0, IMax, // iAutoSpellAttSkillMin + IMin, IMax, // iAutoSpellConjurationMax + IMin, IMax, // iAutoSpellDestructionMax + IMin, IMax, // iAutoSpellIllusionMax + IMin, IMax, // iAutoSpellMysticismMax + IMin, IMax, // iAutoSpellRestorationMax + 0, IMax, // iAutoSpellTimesCanCast + IMin, 0, // iBarterFailDisposition + 0, IMax, // iBarterSuccessDisposition + 1, IMax, // iBaseArmorSkill + 0, IMax, // iBlockMaxChance + 0, IMax, // iBlockMinChance + 0, IMax, // iBootsWeight + IMin, IMax, // iCrimeAttack + IMin, IMax, // iCrimeKilling + IMin, IMax, // iCrimePickPocket + 0, IMax, // iCrimeThreshold + 0, IMax, // iCrimeThresholdMultiplier + IMin, IMax, // iCrimeTresspass + 0, IMax, // iCuirassWeight + 1, IMax, // iDaysinPrisonMod + IMin, 0, // iDispAttackMod + IMin, 0, // iDispKilling + IMin, 0, // iDispTresspass + IMin, IMax, // iFightAlarmMult + IMin, IMax, // iFightAttack + IMin, IMax, // iFightAttacking + 0, IMax, // iFightDistanceBase + IMin, IMax, // iFightKilling + IMin, IMax, // iFightPickpocket + IMin, IMax, // iFightTrespass + IMin, IMax, // iFlee + 0, IMax, // iGauntletWeight + 0, IMax, // iGreavesWeight + 0, IMax, // iGreetDistanceMultiplier + 0, IMax, // iGreetDuration + 0, IMax, // iHelmWeight + IMin, IMax, // iKnockDownOddsBase + IMin, IMax, // iKnockDownOddsMult + IMin, IMax, // iLevelUp01Mult + IMin, IMax, // iLevelUp02Mult + IMin, IMax, // iLevelUp03Mult + IMin, IMax, // iLevelUp04Mult + IMin, IMax, // iLevelUp05Mult + IMin, IMax, // iLevelUp06Mult + IMin, IMax, // iLevelUp07Mult + IMin, IMax, // iLevelUp08Mult + IMin, IMax, // iLevelUp09Mult + IMin, IMax, // iLevelUp10Mult + IMin, IMax, // iLevelupMajorMult + IMin, IMax, // iLevelupMajorMultAttribute + IMin, IMax, // iLevelupMinorMult + IMin, IMax, // iLevelupMinorMultAttribute + IMin, IMax, // iLevelupMiscMultAttriubte + IMin, IMax, // iLevelupSpecialization + IMin, IMax, // iLevelupTotal + IMin, IMax, // iMagicItemChargeConst + IMin, IMax, // iMagicItemChargeOnce + IMin, IMax, // iMagicItemChargeStrike + IMin, IMax, // iMagicItemChargeUse + IMin, IMax, // iMaxActivateDist + IMin, IMax, // iMaxInfoDist + 0, IMax, // iMonthsToRespawn + 0, IMax, // iNumberCreatures + 0, IMax, // iPauldronWeight + 0, IMax, // iPerMinChance + 0, IMax, // iPerMinChange + 0, IMax, // iPickMaxChance + 0, IMax, // iPickMinChance + 0, IMax, // iShieldWeight + 0, IMax, // iSoulAmountForConstantEffect + 0, IMax, // iTrainingMod + 0, IMax, // iVoiceAttackOdds + 0, IMax, // iVoiceHitOdds + IMin, IMax, // iWereWolfBounty + IMin, IMax, // iWereWolfFightMod + IMin, IMax, // iWereWolfFleeMod + IMin, IMax // iWereWolfLevelToAttack +}; diff --git a/apps/opencs/model/world/defaultgmsts.hpp b/apps/opencs/model/world/defaultgmsts.hpp new file mode 100644 index 000000000..ba65be805 --- /dev/null +++ b/apps/opencs/model/world/defaultgmsts.hpp @@ -0,0 +1,34 @@ +#ifndef CSM_WORLD_DEFAULTGMSTS_H +#define CSM_WORLD_DEFAULTGMSTS_H + +#include + +namespace CSMWorld { + namespace DefaultGMSTs { + + const size_t FloatCount = 258; + const size_t IntCount = 89; + const size_t StringCount = 1174; + + const size_t OptionalFloatCount = 42; + const size_t OptionalIntCount = 4; + const size_t OptionalStringCount = 26; + + extern const char* Floats[]; + extern const char * Ints[]; + extern const char * Strings[]; + + extern const char * OptionalFloats[]; + extern const char * OptionalInts[]; + extern const char * OptionalStrings[]; + + extern const float FloatsDefaultValues[]; + extern const int IntsDefaultValues[]; + + extern const float FloatLimits[]; + extern const int IntLimits[]; + + } +} + +#endif From bbda5fe634aafc3104a47ee02d0f0bc236274cba Mon Sep 17 00:00:00 2001 From: Aesylwinn Date: Mon, 18 Jan 2016 12:34:33 -0500 Subject: [PATCH 26/26] Removed hints from error messages and fixed naming to match conventions --- apps/opencs/model/doc/document.cpp | 28 ++++----- apps/opencs/model/tools/gmstcheck.cpp | 78 +++++++++++++++++------- apps/opencs/model/tools/gmstcheck.hpp | 6 +- apps/opencs/model/tools/tools.cpp | 2 +- apps/opencs/model/world/defaultgmsts.cpp | 20 +++--- apps/opencs/model/world/defaultgmsts.hpp | 2 +- 6 files changed, 85 insertions(+), 51 deletions(-) diff --git a/apps/opencs/model/doc/document.cpp b/apps/opencs/model/doc/document.cpp index ea1fbb330..19891363f 100644 --- a/apps/opencs/model/doc/document.cpp +++ b/apps/opencs/model/doc/document.cpp @@ -14,28 +14,28 @@ void CSMDoc::Document::addGmsts() { - for (size_t i=0; i < CSMWorld::DefaultGMSTs::FloatCount; ++i) + for (size_t i=0; i < CSMWorld::DefaultGmsts::FloatCount; ++i) { ESM::GameSetting gmst; - gmst.mId = CSMWorld::DefaultGMSTs::Floats[i]; + gmst.mId = CSMWorld::DefaultGmsts::Floats[i]; gmst.mValue.setType (ESM::VT_Float); - gmst.mValue.setFloat (CSMWorld::DefaultGMSTs::FloatsDefaultValues[i]); + gmst.mValue.setFloat (CSMWorld::DefaultGmsts::FloatsDefaultValues[i]); getData().getGmsts().add (gmst); } - for (size_t i=0; i < CSMWorld::DefaultGMSTs::IntCount; ++i) + for (size_t i=0; i < CSMWorld::DefaultGmsts::IntCount; ++i) { ESM::GameSetting gmst; - gmst.mId = CSMWorld::DefaultGMSTs::Ints[i]; + gmst.mId = CSMWorld::DefaultGmsts::Ints[i]; gmst.mValue.setType (ESM::VT_Int); - gmst.mValue.setInteger (CSMWorld::DefaultGMSTs::IntsDefaultValues[i]); + gmst.mValue.setInteger (CSMWorld::DefaultGmsts::IntsDefaultValues[i]); getData().getGmsts().add (gmst); } - for (size_t i=0; i < CSMWorld::DefaultGMSTs::StringCount; ++i) + for (size_t i=0; i < CSMWorld::DefaultGmsts::StringCount; ++i) { ESM::GameSetting gmst; - gmst.mId = CSMWorld::DefaultGMSTs::Strings[i]; + gmst.mId = CSMWorld::DefaultGmsts::Strings[i]; gmst.mValue.setType (ESM::VT_String); gmst.mValue.setString (""); getData().getGmsts().add (gmst); @@ -44,28 +44,28 @@ void CSMDoc::Document::addGmsts() void CSMDoc::Document::addOptionalGmsts() { - for (size_t i=0; i < CSMWorld::DefaultGMSTs::OptionalFloatCount; ++i) + for (size_t i=0; i < CSMWorld::DefaultGmsts::OptionalFloatCount; ++i) { ESM::GameSetting gmst; - gmst.mId = CSMWorld::DefaultGMSTs::OptionalFloats[i]; + gmst.mId = CSMWorld::DefaultGmsts::OptionalFloats[i]; gmst.blank(); gmst.mValue.setType (ESM::VT_Float); addOptionalGmst (gmst); } - for (size_t i=0; i < CSMWorld::DefaultGMSTs::OptionalIntCount; ++i) + for (size_t i=0; i < CSMWorld::DefaultGmsts::OptionalIntCount; ++i) { ESM::GameSetting gmst; - gmst.mId = CSMWorld::DefaultGMSTs::OptionalInts[i]; + gmst.mId = CSMWorld::DefaultGmsts::OptionalInts[i]; gmst.blank(); gmst.mValue.setType (ESM::VT_Int); addOptionalGmst (gmst); } - for (size_t i=0; i < CSMWorld::DefaultGMSTs::OptionalStringCount; ++i) + for (size_t i=0; i < CSMWorld::DefaultGmsts::OptionalStringCount; ++i) { ESM::GameSetting gmst; - gmst.mId = CSMWorld::DefaultGMSTs::OptionalStrings[i]; + gmst.mId = CSMWorld::DefaultGmsts::OptionalStrings[i]; gmst.blank(); gmst.mValue.setType (ESM::VT_String); gmst.mValue.setString (""); diff --git a/apps/opencs/model/tools/gmstcheck.cpp b/apps/opencs/model/tools/gmstcheck.cpp index 6c17ff3a5..0c32c0056 100644 --- a/apps/opencs/model/tools/gmstcheck.cpp +++ b/apps/opencs/model/tools/gmstcheck.cpp @@ -1,17 +1,19 @@ #include "gmstcheck.hpp" +#include + #include "../world/defaultgmsts.hpp" -CSMTools::GMSTCheckStage::GMSTCheckStage(const CSMWorld::IdCollection& gameSettings) +CSMTools::GmstCheckStage::GmstCheckStage(const CSMWorld::IdCollection& gameSettings) : mGameSettings(gameSettings) {} -int CSMTools::GMSTCheckStage::setup() +int CSMTools::GmstCheckStage::setup() { return mGameSettings.getSize(); } -void CSMTools::GMSTCheckStage::perform(int stage, CSMDoc::Messages& messages) +void CSMTools::GmstCheckStage::perform(int stage, CSMDoc::Messages& messages) { const CSMWorld::Record& record = mGameSettings.getRecord (stage); @@ -30,20 +32,25 @@ void CSMTools::GMSTCheckStage::perform(int stage, CSMDoc::Messages& messages) // optimization - compare it to lists based on naming convention (f-float,i-int,s-string) if (gmst.mId[0] == 'f') { - for (size_t i = 0; i < CSMWorld::DefaultGMSTs::FloatCount; ++i) + for (size_t i = 0; i < CSMWorld::DefaultGmsts::FloatCount; ++i) { - if (gmst.mId == CSMWorld::DefaultGMSTs::Floats[i]) + if (gmst.mId == CSMWorld::DefaultGmsts::Floats[i]) { if (gmst.mValue.getType() != ESM::VT_Float) - messages.add(id, "The type of " + gmst.mId + " is incorrect", - "Change the GMST type to a float", CSMDoc::Message::Severity_Error); + { + std::ostringstream stream; + stream << "Expected float type for " << gmst.mId << " but found " + << varTypeToString(gmst.mValue.getType()) << " type"; + + messages.add(id, stream.str(), "", CSMDoc::Message::Severity_Error); + } - if (gmst.mValue.getFloat() < CSMWorld::DefaultGMSTs::FloatLimits[i*2]) - messages.add(id, gmst.mId + " is less than the suggested range", "Change the value", + if (gmst.mValue.getFloat() < CSMWorld::DefaultGmsts::FloatLimits[i*2]) + messages.add(id, gmst.mId + " is less than the suggested range", "", CSMDoc::Message::Severity_Warning); - if (gmst.mValue.getFloat() > CSMWorld::DefaultGMSTs::FloatLimits[i*2+1]) - messages.add(id, gmst.mId + " is more than the suggested range", "Change the value", + if (gmst.mValue.getFloat() > CSMWorld::DefaultGmsts::FloatLimits[i*2+1]) + messages.add(id, gmst.mId + " is more than the suggested range", "", CSMDoc::Message::Severity_Warning); break; // for loop @@ -52,20 +59,25 @@ void CSMTools::GMSTCheckStage::perform(int stage, CSMDoc::Messages& messages) } else if (gmst.mId[0] == 'i') { - for (size_t i = 0; i < CSMWorld::DefaultGMSTs::IntCount; ++i) + for (size_t i = 0; i < CSMWorld::DefaultGmsts::IntCount; ++i) { - if (gmst.mId == CSMWorld::DefaultGMSTs::Ints[i]) + if (gmst.mId == CSMWorld::DefaultGmsts::Ints[i]) { if (gmst.mValue.getType() != ESM::VT_Int) - messages.add(id, "The type of " + gmst.mId + " is incorrect", - "Change the GMST type to an int", CSMDoc::Message::Severity_Error); + { + std::ostringstream stream; + stream << "Expected int type for " << gmst.mId << " but found " + << varTypeToString(gmst.mValue.getType()) << " type"; + + messages.add(id, stream.str(), "", CSMDoc::Message::Severity_Error); + } - if (gmst.mValue.getInteger() < CSMWorld::DefaultGMSTs::IntLimits[i*2]) - messages.add(id, gmst.mId + " is less than the suggested range", "Change the value", + if (gmst.mValue.getInteger() < CSMWorld::DefaultGmsts::IntLimits[i*2]) + messages.add(id, gmst.mId + " is less than the suggested range", "", CSMDoc::Message::Severity_Warning); - if (gmst.mValue.getInteger() > CSMWorld::DefaultGMSTs::IntLimits[i*2+1]) - messages.add(id, gmst.mId + " is more than the suggested range", "Change the value", + if (gmst.mValue.getInteger() > CSMWorld::DefaultGmsts::IntLimits[i*2+1]) + messages.add(id, gmst.mId + " is more than the suggested range", "", CSMDoc::Message::Severity_Warning); break; // for loop @@ -74,18 +86,38 @@ void CSMTools::GMSTCheckStage::perform(int stage, CSMDoc::Messages& messages) } else if (gmst.mId[0] == 's') { - for (size_t i = 0; i < CSMWorld::DefaultGMSTs::StringCount; ++i) + for (size_t i = 0; i < CSMWorld::DefaultGmsts::StringCount; ++i) { - if (gmst.mId == CSMWorld::DefaultGMSTs::Strings[i]) + if (gmst.mId == CSMWorld::DefaultGmsts::Strings[i]) { ESM::VarType type = gmst.mValue.getType(); if (type != ESM::VT_String && type != ESM::VT_None) - messages.add(id, "The type of " + gmst.mId + " is incorrect", - "Change the GMST type to a string", CSMDoc::Message::Severity_Error); + { + std::ostringstream stream; + stream << "Expected string or none type for " << gmst.mId << " but found " + << varTypeToString(gmst.mValue.getType()) << " type"; + + messages.add(id, stream.str(), "", CSMDoc::Message::Severity_Error); + } break; // for loop } } } } + +std::string CSMTools::GmstCheckStage::varTypeToString(ESM::VarType type) +{ + switch (type) + { + case ESM::VT_Unknown: return "unknown"; + case ESM::VT_None: return "none"; + case ESM::VT_Short: return "short"; + case ESM::VT_Int: return "int"; + case ESM::VT_Long: return "long"; + case ESM::VT_Float: return "float"; + case ESM::VT_String: return "string"; + default: return "unhandled"; + } +} diff --git a/apps/opencs/model/tools/gmstcheck.hpp b/apps/opencs/model/tools/gmstcheck.hpp index ca1564d9e..0d4f7f204 100644 --- a/apps/opencs/model/tools/gmstcheck.hpp +++ b/apps/opencs/model/tools/gmstcheck.hpp @@ -10,11 +10,11 @@ namespace CSMTools { /// \brief VerifyStage: make sure that GMSTs are alright - class GMSTCheckStage : public CSMDoc::Stage + class GmstCheckStage : public CSMDoc::Stage { public: - GMSTCheckStage(const CSMWorld::IdCollection& gameSettings); + GmstCheckStage(const CSMWorld::IdCollection& gameSettings); virtual int setup(); ///< \return number of steps @@ -26,6 +26,8 @@ namespace CSMTools const CSMWorld::IdCollection& mGameSettings; + std::string varTypeToString(ESM::VarType); + }; } diff --git a/apps/opencs/model/tools/tools.cpp b/apps/opencs/model/tools/tools.cpp index 9f36193ef..e750092b9 100644 --- a/apps/opencs/model/tools/tools.cpp +++ b/apps/opencs/model/tools/tools.cpp @@ -112,7 +112,7 @@ CSMDoc::OperationHolder *CSMTools::Tools::getVerifier() mData.getResources (CSMWorld::UniversalId::Type_Icons), mData.getResources (CSMWorld::UniversalId::Type_Textures))); - mVerifierOperation->appendStage (new GMSTCheckStage (mData.getGmsts())); + mVerifierOperation->appendStage (new GmstCheckStage (mData.getGmsts())); mVerifier.setOperation (mVerifierOperation); } diff --git a/apps/opencs/model/world/defaultgmsts.cpp b/apps/opencs/model/world/defaultgmsts.cpp index ef3d536b1..f44e98411 100644 --- a/apps/opencs/model/world/defaultgmsts.cpp +++ b/apps/opencs/model/world/defaultgmsts.cpp @@ -8,7 +8,7 @@ const float FEps = std::numeric_limits::epsilon(); const int IMax = std::numeric_limits::max(); const int IMin = std::numeric_limits::min(); -const char* CSMWorld::DefaultGMSTs::Floats[CSMWorld::DefaultGMSTs::FloatCount] = +const char* CSMWorld::DefaultGmsts::Floats[CSMWorld::DefaultGmsts::FloatCount] = { "fAIFleeFleeMult", "fAIFleeHealthMult", @@ -270,7 +270,7 @@ const char* CSMWorld::DefaultGMSTs::Floats[CSMWorld::DefaultGMSTs::FloatCount] = "fWortChanceValue" }; -const char * CSMWorld::DefaultGMSTs::Ints[CSMWorld::DefaultGMSTs::IntCount] = +const char * CSMWorld::DefaultGmsts::Ints[CSMWorld::DefaultGmsts::IntCount] = { "i1stPersonSneakDelta", "iAlarmAttack", @@ -363,7 +363,7 @@ const char * CSMWorld::DefaultGMSTs::Ints[CSMWorld::DefaultGMSTs::IntCount] = "iWereWolfLevelToAttack" }; -const char * CSMWorld::DefaultGMSTs::Strings[CSMWorld::DefaultGMSTs::StringCount] = +const char * CSMWorld::DefaultGmsts::Strings[CSMWorld::DefaultGmsts::StringCount] = { "s3dAudio", "s3dHardware", @@ -1541,7 +1541,7 @@ const char * CSMWorld::DefaultGMSTs::Strings[CSMWorld::DefaultGMSTs::StringCount "sYourGold" }; -const char * CSMWorld::DefaultGMSTs::OptionalFloats[CSMWorld::DefaultGMSTs::OptionalFloatCount] = +const char * CSMWorld::DefaultGmsts::OptionalFloats[CSMWorld::DefaultGmsts::OptionalFloatCount] = { "fCombatDistanceWerewolfMod", "fFleeDistance", @@ -1587,7 +1587,7 @@ const char * CSMWorld::DefaultGMSTs::OptionalFloats[CSMWorld::DefaultGMSTs::Opti "fWereWolfWillPower" }; -const char * CSMWorld::DefaultGMSTs::OptionalInts[CSMWorld::DefaultGMSTs::OptionalIntCount] = +const char * CSMWorld::DefaultGmsts::OptionalInts[CSMWorld::DefaultGmsts::OptionalIntCount] = { "iWereWolfBounty", "iWereWolfFightMod", @@ -1595,7 +1595,7 @@ const char * CSMWorld::DefaultGMSTs::OptionalInts[CSMWorld::DefaultGMSTs::Option "iWereWolfLevelToAttack" }; -const char * CSMWorld::DefaultGMSTs::OptionalStrings[CSMWorld::DefaultGMSTs::OptionalStringCount] = +const char * CSMWorld::DefaultGmsts::OptionalStrings[CSMWorld::DefaultGmsts::OptionalStringCount] = { "sCompanionShare", "sCompanionWarningButtonOne", @@ -1625,7 +1625,7 @@ const char * CSMWorld::DefaultGMSTs::OptionalStrings[CSMWorld::DefaultGMSTs::Opt "sWerewolfRestMessage" }; -const float CSMWorld::DefaultGMSTs::FloatsDefaultValues[CSMWorld::DefaultGMSTs::FloatCount] = +const float CSMWorld::DefaultGmsts::FloatsDefaultValues[CSMWorld::DefaultGmsts::FloatCount] = { 0.3, // fAIFleeFleeMult 7.0, // fAIFleeHealthMult @@ -1887,7 +1887,7 @@ const float CSMWorld::DefaultGMSTs::FloatsDefaultValues[CSMWorld::DefaultGMSTs:: 15.0 // fWortChanceValue }; -const int CSMWorld::DefaultGMSTs::IntsDefaultValues[CSMWorld::DefaultGMSTs::IntCount] = +const int CSMWorld::DefaultGmsts::IntsDefaultValues[CSMWorld::DefaultGmsts::IntCount] = { 10, // i1stPersonSneakDelta 50, // iAlarmAttack @@ -1980,7 +1980,7 @@ const int CSMWorld::DefaultGMSTs::IntsDefaultValues[CSMWorld::DefaultGMSTs::IntC 20 // iWereWolfLevelToAttack }; -const float CSMWorld::DefaultGMSTs::FloatLimits[CSMWorld::DefaultGMSTs::FloatCount * 2] = +const float CSMWorld::DefaultGmsts::FloatLimits[CSMWorld::DefaultGmsts::FloatCount * 2] = { -FInf, FInf, // fAIFleeFleeMult -FInf, FInf, // fAIFleeHealthMult @@ -2242,7 +2242,7 @@ const float CSMWorld::DefaultGMSTs::FloatLimits[CSMWorld::DefaultGMSTs::FloatCou 0, FInf // fWortChanceValue }; -const int CSMWorld::DefaultGMSTs::IntLimits[CSMWorld::DefaultGMSTs::IntCount * 2] = +const int CSMWorld::DefaultGmsts::IntLimits[CSMWorld::DefaultGmsts::IntCount * 2] = { IMin, IMax, // i1stPersonSneakDelta IMin, IMax, // iAlarmAttack diff --git a/apps/opencs/model/world/defaultgmsts.hpp b/apps/opencs/model/world/defaultgmsts.hpp index ba65be805..a2888ed6a 100644 --- a/apps/opencs/model/world/defaultgmsts.hpp +++ b/apps/opencs/model/world/defaultgmsts.hpp @@ -4,7 +4,7 @@ #include namespace CSMWorld { - namespace DefaultGMSTs { + namespace DefaultGmsts { const size_t FloatCount = 258; const size_t IntCount = 89;