Access to Fallback via getFallback

actorid
Glorf 12 years ago
parent 485b6c855a
commit ea7f386e7d

@ -46,6 +46,7 @@ namespace MWRender
namespace MWWorld
{
class Fallback;
class CellStore;
class Player;
class LocalScripts;
@ -103,7 +104,7 @@ namespace MWBase
virtual void getTriangleBatchCount(unsigned int &triangles, unsigned int &batches) = 0;
virtual std::string getFallback (const std::string& key) const = 0;
virtual MWWorld::Fallback *getFallback () = 0;
virtual MWWorld::Player& getPlayer() = 0;

@ -12,6 +12,7 @@
#include "../mwbase/environment.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwbase/mechanicsmanager.hpp"
#include "../mwworld/fallback.hpp"
namespace
{
@ -23,14 +24,13 @@ 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) {
MWBase::World *world = MWBase::Environment::get().getWorld();
number++;
Step step = {world->getFallback("Question_"+boost::lexical_cast<std::string>(number)+"_Question"),
{world->getFallback("Question_"+boost::lexical_cast<std::string>(number)+"_AnswerOne"),
world->getFallback("Question_"+boost::lexical_cast<std::string>(number)+"_AnswerTwo"),
world->getFallback("Question_"+boost::lexical_cast<std::string>(number)+"_AnswerThree")},
MWWorld::Fallback* fallback=MWBase::Environment::get().getWorld()->getFallback();
Step step = {fallback->getFallbackString("Question_"+boost::lexical_cast<std::string>(number)+"_Question"),
{fallback->getFallbackString("Question_"+boost::lexical_cast<std::string>(number)+"_AnswerOne"),
fallback->getFallbackString("Question_"+boost::lexical_cast<std::string>(number)+"_AnswerTwo"),
fallback->getFallbackString("Question_"+boost::lexical_cast<std::string>(number)+"_AnswerThree")},
"vo\\misc\\chargen qa"+boost::lexical_cast<std::string>(number)+".wav"
};
return step;

@ -9,6 +9,7 @@
#include "../mwworld/player.hpp"
#include "../mwworld/class.hpp"
#include "../mwworld/esmstore.hpp"
#include "../mwworld/fallback.hpp"
#include "../mwmechanics/creaturestats.hpp"
#include "../mwmechanics/npcstats.hpp"
@ -138,9 +139,9 @@ namespace MWGui
std::string levelupdescription;
if(level>20)
levelupdescription=world->getFallback("Level_Up_Default");
levelupdescription=world->getFallback()->getFallbackString("Level_Up_Default");
else
levelupdescription=world->getFallback("Level_Up_Level"+boost::lexical_cast<std::string>(level));
levelupdescription=world->getFallback()->getFallbackString("Level_Up_Level"+boost::lexical_cast<std::string>(level));
mLevelDescription->setCaption (levelupdescription);

@ -154,11 +154,6 @@ namespace MWWorld
mRendering->skyDisable();
}
std::string World::getFallback (const std::string& key) const
{
return mFallback.getFallbackString(key);
}
World::World (OEngine::Render::OgreRenderer& renderer,
const Files::Collections& fileCollections,
const std::vector<std::string>& master, const std::vector<std::string>& plugins,
@ -267,6 +262,11 @@ namespace MWWorld
return 0;
}
MWWorld::Fallback *World::getFallback ()
{
return &mFallback;
}
Ptr::CellStore *World::getExterior (int x, int y)
{
return mCells.getExterior (x, y);

@ -133,7 +133,7 @@ namespace MWWorld
virtual void getTriangleBatchCount(unsigned int &triangles, unsigned int &batches);
virtual std::string getFallback (const std::string& key) const;
virtual Fallback *getFallback ();
virtual Player& getPlayer();

Loading…
Cancel
Save