mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-01 09:15:36 +00:00
Merge remote-tracking branch 'greye/store' into next
Conflicts: apps/openmw/mwclass/light.cpp apps/openmw/mwworld/worldimp.cpp
This commit is contained in:
commit
918316168f
140 changed files with 3117 additions and 2353 deletions
|
@ -1213,7 +1213,7 @@ void Record<ESM::Region>::print()
|
|||
template<>
|
||||
void Record<ESM::Script>::print()
|
||||
{
|
||||
std::cout << " Name: " << mData.mData.mName.toString() << std::endl;
|
||||
std::cout << " Name: " << mData.mId << std::endl;
|
||||
|
||||
std::cout << " Num Shorts: " << mData.mData.mNumShorts << std::endl;
|
||||
std::cout << " Num Longs: " << mData.mData.mNumLongs << std::endl;
|
||||
|
|
|
@ -53,6 +53,7 @@ add_openmw_dir (mwworld
|
|||
containerstore actiontalk actiontake manualref player cellfunctors
|
||||
cells localscripts customdata weather inventorystore ptr actionopen actionread
|
||||
actionequip timestamp actionalchemy cellstore actionapply actioneat
|
||||
esmstore store recordcmp
|
||||
)
|
||||
|
||||
add_openmw_dir (mwclass
|
||||
|
|
|
@ -31,11 +31,6 @@ namespace ESM
|
|||
struct Spell;
|
||||
}
|
||||
|
||||
namespace ESMS
|
||||
{
|
||||
struct ESMStore;
|
||||
}
|
||||
|
||||
namespace MWRender
|
||||
{
|
||||
class ExternalRendering;
|
||||
|
@ -48,6 +43,7 @@ namespace MWWorld
|
|||
class LocalScripts;
|
||||
class Ptr;
|
||||
class TimeStamp;
|
||||
class ESMStore;
|
||||
}
|
||||
|
||||
namespace MWBase
|
||||
|
@ -104,7 +100,7 @@ namespace MWBase
|
|||
|
||||
virtual MWWorld::Player& getPlayer() = 0;
|
||||
|
||||
virtual const ESMS::ESMStore& getStore() const = 0;
|
||||
virtual const MWWorld::ESMStore& getStore() const = 0;
|
||||
|
||||
virtual ESM::ESMReader& getEsmReader() = 0;
|
||||
|
||||
|
|
|
@ -38,9 +38,9 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Activator> *ref =
|
||||
ptr.get<ESM::Activator>();
|
||||
assert(ref->base != NULL);
|
||||
assert(ref->mBase != NULL);
|
||||
|
||||
const std::string &model = ref->base->mModel;
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
return "meshes\\" + model;
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Activator> *ref =
|
||||
ptr.get<ESM::Activator>();
|
||||
|
||||
return ref->base->mName;
|
||||
return ref->mBase->mName;
|
||||
}
|
||||
|
||||
std::string Activator::getScript (const MWWorld::Ptr& ptr) const
|
||||
|
@ -60,7 +60,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Activator> *ref =
|
||||
ptr.get<ESM::Activator>();
|
||||
|
||||
return ref->base->mScript;
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
||||
void Activator::registerSelf()
|
||||
|
@ -75,7 +75,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Activator> *ref =
|
||||
ptr.get<ESM::Activator>();
|
||||
|
||||
return (ref->base->mName != "");
|
||||
return (ref->mBase->mName != "");
|
||||
}
|
||||
|
||||
MWGui::ToolTipInfo Activator::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
|
@ -84,11 +84,11 @@ namespace MWClass
|
|||
ptr.get<ESM::Activator>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
info.caption = ref->base->mName + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
|
||||
info.caption = ref->mBase->mName + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
|
||||
|
||||
std::string text;
|
||||
if (MWBase::Environment::get().getWindowManager()->getFullHelp())
|
||||
text += MWGui::ToolTips::getMiscString(ref->base->mScript, "Script");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mBase->mScript, "Script");
|
||||
info.text = text;
|
||||
|
||||
return info;
|
||||
|
@ -100,6 +100,6 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Activator> *ref =
|
||||
ptr.get<ESM::Activator>();
|
||||
|
||||
return MWWorld::Ptr(&cell.activators.insert(*ref), &cell);
|
||||
return MWWorld::Ptr(&cell.mActivators.insert(*ref), &cell);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,9 +41,9 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Apparatus> *ref =
|
||||
ptr.get<ESM::Apparatus>();
|
||||
assert(ref->base != NULL);
|
||||
assert(ref->mBase != NULL);
|
||||
|
||||
const std::string &model = ref->base->mModel;
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
return "meshes\\" + model;
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Apparatus> *ref =
|
||||
ptr.get<ESM::Apparatus>();
|
||||
|
||||
return ref->base->mName;
|
||||
return ref->mBase->mName;
|
||||
}
|
||||
|
||||
boost::shared_ptr<MWWorld::Action> Apparatus::activate (const MWWorld::Ptr& ptr,
|
||||
|
@ -74,7 +74,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Apparatus> *ref =
|
||||
ptr.get<ESM::Apparatus>();
|
||||
|
||||
return ref->base->mScript;
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
||||
int Apparatus::getValue (const MWWorld::Ptr& ptr) const
|
||||
|
@ -82,7 +82,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Apparatus> *ref =
|
||||
ptr.get<ESM::Apparatus>();
|
||||
|
||||
return ref->base->mData.mValue;
|
||||
return ref->mBase->mData.mValue;
|
||||
}
|
||||
|
||||
void Apparatus::registerSelf()
|
||||
|
@ -107,7 +107,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Apparatus> *ref =
|
||||
ptr.get<ESM::Apparatus>();
|
||||
|
||||
return ref->base->mIcon;
|
||||
return ref->mBase->mIcon;
|
||||
}
|
||||
|
||||
bool Apparatus::hasToolTip (const MWWorld::Ptr& ptr) const
|
||||
|
@ -115,7 +115,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Apparatus> *ref =
|
||||
ptr.get<ESM::Apparatus>();
|
||||
|
||||
return (ref->base->mName != "");
|
||||
return (ref->mBase->mName != "");
|
||||
}
|
||||
|
||||
MWGui::ToolTipInfo Apparatus::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
|
@ -124,17 +124,17 @@ namespace MWClass
|
|||
ptr.get<ESM::Apparatus>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
info.caption = ref->base->mName + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
|
||||
info.icon = ref->base->mIcon;
|
||||
info.caption = ref->mBase->mName + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
|
||||
info.icon = ref->mBase->mIcon;
|
||||
|
||||
std::string text;
|
||||
text += "\n#{sQuality}: " + MWGui::ToolTips::toString(ref->base->mData.mQuality);
|
||||
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->base->mData.mWeight);
|
||||
text += MWGui::ToolTips::getValueString(ref->base->mData.mValue, "#{sValue}");
|
||||
text += "\n#{sQuality}: " + MWGui::ToolTips::toString(ref->mBase->mData.mQuality);
|
||||
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->mBase->mData.mWeight);
|
||||
text += MWGui::ToolTips::getValueString(ref->mBase->mData.mValue, "#{sValue}");
|
||||
|
||||
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
|
||||
text += MWGui::ToolTips::getMiscString(ref->ref.mOwner, "Owner");
|
||||
text += MWGui::ToolTips::getMiscString(ref->base->mScript, "Script");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mRef.mOwner, "Owner");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mBase->mScript, "Script");
|
||||
}
|
||||
info.text = text;
|
||||
|
||||
|
@ -153,6 +153,6 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Apparatus> *ref =
|
||||
ptr.get<ESM::Apparatus>();
|
||||
|
||||
return MWWorld::Ptr(&cell.appas.insert(*ref), &cell);
|
||||
return MWWorld::Ptr(&cell.mAppas.insert(*ref), &cell);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,9 +44,9 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Armor> *ref =
|
||||
ptr.get<ESM::Armor>();
|
||||
assert(ref->base != NULL);
|
||||
assert(ref->mBase != NULL);
|
||||
|
||||
const std::string &model = ref->base->mModel;
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
return "meshes\\" + model;
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Armor> *ref =
|
||||
ptr.get<ESM::Armor>();
|
||||
|
||||
return ref->base->mName;
|
||||
return ref->mBase->mName;
|
||||
}
|
||||
|
||||
boost::shared_ptr<MWWorld::Action> Armor::activate (const MWWorld::Ptr& ptr,
|
||||
|
@ -81,7 +81,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Armor> *ref =
|
||||
ptr.get<ESM::Armor>();
|
||||
|
||||
return ref->base->mData.mHealth;
|
||||
return ref->mBase->mData.mHealth;
|
||||
}
|
||||
|
||||
std::string Armor::getScript (const MWWorld::Ptr& ptr) const
|
||||
|
@ -89,7 +89,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Armor> *ref =
|
||||
ptr.get<ESM::Armor>();
|
||||
|
||||
return ref->base->mScript;
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
||||
std::pair<std::vector<int>, bool> Armor::getEquipmentSlots (const MWWorld::Ptr& ptr) const
|
||||
|
@ -117,7 +117,7 @@ namespace MWClass
|
|||
};
|
||||
|
||||
for (int i=0; i<size; ++i)
|
||||
if (sMapping[i][0]==ref->base->mData.mType)
|
||||
if (sMapping[i][0]==ref->mBase->mData.mType)
|
||||
{
|
||||
slots.push_back (int (sMapping[i][1]));
|
||||
break;
|
||||
|
@ -133,7 +133,7 @@ namespace MWClass
|
|||
|
||||
std::string typeGmst;
|
||||
|
||||
switch (ref->base->mData.mType)
|
||||
switch (ref->mBase->mData.mType)
|
||||
{
|
||||
case ESM::Armor::Helmet: typeGmst = "iHelmWeight"; break;
|
||||
case ESM::Armor::Cuirass: typeGmst = "iCuirassWeight"; break;
|
||||
|
@ -151,14 +151,17 @@ namespace MWClass
|
|||
if (typeGmst.empty())
|
||||
return -1;
|
||||
|
||||
float iWeight = MWBase::Environment::get().getWorld()->getStore().gameSettings.find (typeGmst)->getInt();
|
||||
const MWWorld::Store<ESM::GameSetting> &gmst =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
||||
|
||||
if (iWeight * MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("fLightMaxMod")->getFloat()>=
|
||||
ref->base->mData.mWeight)
|
||||
float iWeight = gmst.find (typeGmst)->getInt();
|
||||
|
||||
if (iWeight * gmst.find ("fLightMaxMod")->getFloat()>=
|
||||
ref->mBase->mData.mWeight)
|
||||
return ESM::Skill::LightArmor;
|
||||
|
||||
if (iWeight * MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("fMedMaxMod")->getFloat()>=
|
||||
ref->base->mData.mWeight)
|
||||
if (iWeight * gmst.find ("fMedMaxMod")->getFloat()>=
|
||||
ref->mBase->mData.mWeight)
|
||||
return ESM::Skill::MediumArmor;
|
||||
|
||||
return ESM::Skill::HeavyArmor;
|
||||
|
@ -169,7 +172,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Armor> *ref =
|
||||
ptr.get<ESM::Armor>();
|
||||
|
||||
return ref->base->mData.mValue;
|
||||
return ref->mBase->mData.mValue;
|
||||
}
|
||||
|
||||
void Armor::registerSelf()
|
||||
|
@ -206,7 +209,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Armor> *ref =
|
||||
ptr.get<ESM::Armor>();
|
||||
|
||||
return ref->base->mIcon;
|
||||
return ref->mBase->mIcon;
|
||||
}
|
||||
|
||||
bool Armor::hasToolTip (const MWWorld::Ptr& ptr) const
|
||||
|
@ -214,7 +217,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Armor> *ref =
|
||||
ptr.get<ESM::Armor>();
|
||||
|
||||
return (ref->base->mName != "");
|
||||
return (ref->mBase->mName != "");
|
||||
}
|
||||
|
||||
MWGui::ToolTipInfo Armor::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
|
@ -223,8 +226,8 @@ namespace MWClass
|
|||
ptr.get<ESM::Armor>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
info.caption = ref->base->mName + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
|
||||
info.icon = ref->base->mIcon;
|
||||
info.caption = ref->mBase->mName + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
|
||||
info.icon = ref->mBase->mIcon;
|
||||
|
||||
std::string text;
|
||||
|
||||
|
@ -238,20 +241,20 @@ namespace MWClass
|
|||
else
|
||||
typeText = "#{sHeavy}";
|
||||
|
||||
text += "\n#{sArmorRating}: " + MWGui::ToolTips::toString(ref->base->mData.mArmor);
|
||||
text += "\n#{sArmorRating}: " + MWGui::ToolTips::toString(ref->mBase->mData.mArmor);
|
||||
|
||||
/// \todo store the current armor health somewhere
|
||||
text += "\n#{sCondition}: " + MWGui::ToolTips::toString(ref->base->mData.mHealth);
|
||||
text += "\n#{sCondition}: " + MWGui::ToolTips::toString(ref->mBase->mData.mHealth);
|
||||
|
||||
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->base->mData.mWeight) + " (" + typeText + ")";
|
||||
text += MWGui::ToolTips::getValueString(ref->base->mData.mValue, "#{sValue}");
|
||||
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->mBase->mData.mWeight) + " (" + typeText + ")";
|
||||
text += MWGui::ToolTips::getValueString(ref->mBase->mData.mValue, "#{sValue}");
|
||||
|
||||
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
|
||||
text += MWGui::ToolTips::getMiscString(ref->ref.mOwner, "Owner");
|
||||
text += MWGui::ToolTips::getMiscString(ref->base->mScript, "Script");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mRef.mOwner, "Owner");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mBase->mScript, "Script");
|
||||
}
|
||||
|
||||
info.enchant = ref->base->mEnchant;
|
||||
info.enchant = ref->mBase->mEnchant;
|
||||
|
||||
info.text = text;
|
||||
|
||||
|
@ -263,7 +266,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Armor> *ref =
|
||||
ptr.get<ESM::Armor>();
|
||||
|
||||
return ref->base->mEnchant;
|
||||
return ref->mBase->mEnchant;
|
||||
}
|
||||
|
||||
boost::shared_ptr<MWWorld::Action> Armor::use (const MWWorld::Ptr& ptr) const
|
||||
|
@ -281,6 +284,6 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Armor> *ref =
|
||||
ptr.get<ESM::Armor>();
|
||||
|
||||
return MWWorld::Ptr(&cell.armors.insert(*ref), &cell);
|
||||
return MWWorld::Ptr(&cell.mArmors.insert(*ref), &cell);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,9 +40,9 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Book> *ref =
|
||||
ptr.get<ESM::Book>();
|
||||
assert(ref->base != NULL);
|
||||
assert(ref->mBase != NULL);
|
||||
|
||||
const std::string &model = ref->base->mModel;
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
return "meshes\\" + model;
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Book> *ref =
|
||||
ptr.get<ESM::Book>();
|
||||
|
||||
return ref->base->mName;
|
||||
return ref->mBase->mName;
|
||||
}
|
||||
|
||||
boost::shared_ptr<MWWorld::Action> Book::activate (const MWWorld::Ptr& ptr,
|
||||
|
@ -69,7 +69,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Book> *ref =
|
||||
ptr.get<ESM::Book>();
|
||||
|
||||
return ref->base->mScript;
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
||||
int Book::getValue (const MWWorld::Ptr& ptr) const
|
||||
|
@ -77,7 +77,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Book> *ref =
|
||||
ptr.get<ESM::Book>();
|
||||
|
||||
return ref->base->mData.mValue;
|
||||
return ref->mBase->mData.mValue;
|
||||
}
|
||||
|
||||
void Book::registerSelf()
|
||||
|
@ -102,7 +102,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Book> *ref =
|
||||
ptr.get<ESM::Book>();
|
||||
|
||||
return ref->base->mIcon;
|
||||
return ref->mBase->mIcon;
|
||||
}
|
||||
|
||||
bool Book::hasToolTip (const MWWorld::Ptr& ptr) const
|
||||
|
@ -110,7 +110,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Book> *ref =
|
||||
ptr.get<ESM::Book>();
|
||||
|
||||
return (ref->base->mName != "");
|
||||
return (ref->mBase->mName != "");
|
||||
}
|
||||
|
||||
MWGui::ToolTipInfo Book::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
|
@ -119,20 +119,20 @@ namespace MWClass
|
|||
ptr.get<ESM::Book>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
info.caption = ref->base->mName + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
|
||||
info.icon = ref->base->mIcon;
|
||||
info.caption = ref->mBase->mName + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
|
||||
info.icon = ref->mBase->mIcon;
|
||||
|
||||
std::string text;
|
||||
|
||||
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->base->mData.mWeight);
|
||||
text += MWGui::ToolTips::getValueString(ref->base->mData.mValue, "#{sValue}");
|
||||
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->mBase->mData.mWeight);
|
||||
text += MWGui::ToolTips::getValueString(ref->mBase->mData.mValue, "#{sValue}");
|
||||
|
||||
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
|
||||
text += MWGui::ToolTips::getMiscString(ref->ref.mOwner, "Owner");
|
||||
text += MWGui::ToolTips::getMiscString(ref->base->mScript, "Script");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mRef.mOwner, "Owner");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mBase->mScript, "Script");
|
||||
}
|
||||
|
||||
info.enchant = ref->base->mEnchant;
|
||||
info.enchant = ref->mBase->mEnchant;
|
||||
|
||||
info.text = text;
|
||||
|
||||
|
@ -144,7 +144,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Book> *ref =
|
||||
ptr.get<ESM::Book>();
|
||||
|
||||
return ref->base->mEnchant;
|
||||
return ref->mBase->mEnchant;
|
||||
}
|
||||
|
||||
boost::shared_ptr<MWWorld::Action> Book::use (const MWWorld::Ptr& ptr) const
|
||||
|
@ -158,6 +158,6 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Book> *ref =
|
||||
ptr.get<ESM::Book>();
|
||||
|
||||
return MWWorld::Ptr(&cell.books.insert(*ref), &cell);
|
||||
return MWWorld::Ptr(&cell.mBooks.insert(*ref), &cell);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,9 +42,9 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
assert(ref->base != NULL);
|
||||
assert(ref->mBase != NULL);
|
||||
|
||||
const std::string &model = ref->base->mModel;
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
return "meshes\\" + model;
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
|
||||
return ref->base->mName;
|
||||
return ref->mBase->mName;
|
||||
}
|
||||
|
||||
boost::shared_ptr<MWWorld::Action> Clothing::activate (const MWWorld::Ptr& ptr,
|
||||
|
@ -74,7 +74,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
|
||||
return ref->base->mScript;
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
||||
std::pair<std::vector<int>, bool> Clothing::getEquipmentSlots (const MWWorld::Ptr& ptr) const
|
||||
|
@ -84,7 +84,7 @@ namespace MWClass
|
|||
|
||||
std::vector<int> slots;
|
||||
|
||||
if (ref->base->mData.mType==ESM::Clothing::Ring)
|
||||
if (ref->mBase->mData.mType==ESM::Clothing::Ring)
|
||||
{
|
||||
slots.push_back (int (MWWorld::InventoryStore::Slot_LeftRing));
|
||||
slots.push_back (int (MWWorld::InventoryStore::Slot_RightRing));
|
||||
|
@ -107,7 +107,7 @@ namespace MWClass
|
|||
};
|
||||
|
||||
for (int i=0; i<size; ++i)
|
||||
if (sMapping[i][0]==ref->base->mData.mType)
|
||||
if (sMapping[i][0]==ref->mBase->mData.mType)
|
||||
{
|
||||
slots.push_back (int (sMapping[i][1]));
|
||||
break;
|
||||
|
@ -122,7 +122,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
|
||||
if (ref->base->mData.mType==ESM::Clothing::Shoes)
|
||||
if (ref->mBase->mData.mType==ESM::Clothing::Shoes)
|
||||
return ESM::Skill::Unarmored;
|
||||
|
||||
return -1;
|
||||
|
@ -133,7 +133,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
|
||||
return ref->base->mData.mValue;
|
||||
return ref->mBase->mData.mValue;
|
||||
}
|
||||
|
||||
void Clothing::registerSelf()
|
||||
|
@ -148,7 +148,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
|
||||
if (ref->base->mData.mType == 8)
|
||||
if (ref->mBase->mData.mType == 8)
|
||||
{
|
||||
return std::string("Item Ring Up");
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
|
||||
if (ref->base->mData.mType == 8)
|
||||
if (ref->mBase->mData.mType == 8)
|
||||
{
|
||||
return std::string("Item Ring Down");
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
|
||||
return ref->base->mIcon;
|
||||
return ref->mBase->mIcon;
|
||||
}
|
||||
|
||||
bool Clothing::hasToolTip (const MWWorld::Ptr& ptr) const
|
||||
|
@ -180,7 +180,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
|
||||
return (ref->base->mName != "");
|
||||
return (ref->mBase->mName != "");
|
||||
}
|
||||
|
||||
MWGui::ToolTipInfo Clothing::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
|
@ -189,20 +189,20 @@ namespace MWClass
|
|||
ptr.get<ESM::Clothing>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
info.caption = ref->base->mName + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
|
||||
info.icon = ref->base->mIcon;
|
||||
info.caption = ref->mBase->mName + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
|
||||
info.icon = ref->mBase->mIcon;
|
||||
|
||||
std::string text;
|
||||
|
||||
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->base->mData.mWeight);
|
||||
text += MWGui::ToolTips::getValueString(ref->base->mData.mValue, "#{sValue}");
|
||||
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->mBase->mData.mWeight);
|
||||
text += MWGui::ToolTips::getValueString(ref->mBase->mData.mValue, "#{sValue}");
|
||||
|
||||
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
|
||||
text += MWGui::ToolTips::getMiscString(ref->ref.mOwner, "Owner");
|
||||
text += MWGui::ToolTips::getMiscString(ref->base->mScript, "Script");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mRef.mOwner, "Owner");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mBase->mScript, "Script");
|
||||
}
|
||||
|
||||
info.enchant = ref->base->mEnchant;
|
||||
info.enchant = ref->mBase->mEnchant;
|
||||
|
||||
info.text = text;
|
||||
|
||||
|
@ -214,7 +214,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
|
||||
return ref->base->mEnchant;
|
||||
return ref->mBase->mEnchant;
|
||||
}
|
||||
|
||||
boost::shared_ptr<MWWorld::Action> Clothing::use (const MWWorld::Ptr& ptr) const
|
||||
|
@ -232,6 +232,6 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
|
||||
return MWWorld::Ptr(&cell.clothes.insert(*ref), &cell);
|
||||
return MWWorld::Ptr(&cell.mClothes.insert(*ref), &cell);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,9 +73,9 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Container> *ref =
|
||||
ptr.get<ESM::Container>();
|
||||
assert(ref->base != NULL);
|
||||
assert(ref->mBase != NULL);
|
||||
|
||||
const std::string &model = ref->base->mModel;
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
return "meshes\\" + model;
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Container> *ref =
|
||||
ptr.get<ESM::Container>();
|
||||
|
||||
return ref->base->mName;
|
||||
return ref->mBase->mName;
|
||||
}
|
||||
|
||||
MWWorld::ContainerStore& Container::getContainerStore (const MWWorld::Ptr& ptr)
|
||||
|
@ -164,7 +164,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Container> *ref =
|
||||
ptr.get<ESM::Container>();
|
||||
|
||||
return ref->base->mScript;
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
||||
void Container::registerSelf()
|
||||
|
@ -179,7 +179,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Container> *ref =
|
||||
ptr.get<ESM::Container>();
|
||||
|
||||
return (ref->base->mName != "");
|
||||
return (ref->mBase->mName != "");
|
||||
}
|
||||
|
||||
MWGui::ToolTipInfo Container::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
|
@ -188,17 +188,17 @@ namespace MWClass
|
|||
ptr.get<ESM::Container>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
info.caption = ref->base->mName;
|
||||
info.caption = ref->mBase->mName;
|
||||
|
||||
std::string text;
|
||||
if (ref->ref.mLockLevel > 0)
|
||||
text += "\n#{sLockLevel}: " + MWGui::ToolTips::toString(ref->ref.mLockLevel);
|
||||
if (ref->ref.mTrap != "")
|
||||
if (ref->mRef.mLockLevel > 0)
|
||||
text += "\n#{sLockLevel}: " + MWGui::ToolTips::toString(ref->mRef.mLockLevel);
|
||||
if (ref->mRef.mTrap != "")
|
||||
text += "\n#{sTrapped}";
|
||||
|
||||
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
|
||||
text += MWGui::ToolTips::getMiscString(ref->ref.mOwner, "Owner");
|
||||
text += MWGui::ToolTips::getMiscString(ref->base->mScript, "Script");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mRef.mOwner, "Owner");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mBase->mScript, "Script");
|
||||
}
|
||||
|
||||
info.text = text;
|
||||
|
@ -211,7 +211,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Container> *ref =
|
||||
ptr.get<ESM::Container>();
|
||||
|
||||
return ref->base->mWeight;
|
||||
return ref->mBase->mWeight;
|
||||
}
|
||||
|
||||
float Container::getEncumbrance (const MWWorld::Ptr& ptr) const
|
||||
|
@ -238,6 +238,6 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Container> *ref =
|
||||
ptr.get<ESM::Container>();
|
||||
|
||||
return MWWorld::Ptr(&cell.containers.insert(*ref), &cell);
|
||||
return MWWorld::Ptr(&cell.mContainers.insert(*ref), &cell);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,28 +48,28 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Creature> *ref = ptr.get<ESM::Creature>();
|
||||
|
||||
// creature stats
|
||||
data->mCreatureStats.getAttribute(0).set (ref->base->mData.mStrength);
|
||||
data->mCreatureStats.getAttribute(1).set (ref->base->mData.mIntelligence);
|
||||
data->mCreatureStats.getAttribute(2).set (ref->base->mData.mWillpower);
|
||||
data->mCreatureStats.getAttribute(3).set (ref->base->mData.mAgility);
|
||||
data->mCreatureStats.getAttribute(4).set (ref->base->mData.mSpeed);
|
||||
data->mCreatureStats.getAttribute(5).set (ref->base->mData.mEndurance);
|
||||
data->mCreatureStats.getAttribute(6).set (ref->base->mData.mPersonality);
|
||||
data->mCreatureStats.getAttribute(7).set (ref->base->mData.mLuck);
|
||||
data->mCreatureStats.setHealth (ref->base->mData.mHealth);
|
||||
data->mCreatureStats.setMagicka (ref->base->mData.mMana);
|
||||
data->mCreatureStats.setFatigue (ref->base->mData.mFatigue);
|
||||
data->mCreatureStats.getAttribute(0).set (ref->mBase->mData.mStrength);
|
||||
data->mCreatureStats.getAttribute(1).set (ref->mBase->mData.mIntelligence);
|
||||
data->mCreatureStats.getAttribute(2).set (ref->mBase->mData.mWillpower);
|
||||
data->mCreatureStats.getAttribute(3).set (ref->mBase->mData.mAgility);
|
||||
data->mCreatureStats.getAttribute(4).set (ref->mBase->mData.mSpeed);
|
||||
data->mCreatureStats.getAttribute(5).set (ref->mBase->mData.mEndurance);
|
||||
data->mCreatureStats.getAttribute(6).set (ref->mBase->mData.mPersonality);
|
||||
data->mCreatureStats.getAttribute(7).set (ref->mBase->mData.mLuck);
|
||||
data->mCreatureStats.setHealth (ref->mBase->mData.mHealth);
|
||||
data->mCreatureStats.setMagicka (ref->mBase->mData.mMana);
|
||||
data->mCreatureStats.setFatigue (ref->mBase->mData.mFatigue);
|
||||
|
||||
data->mCreatureStats.setLevel(ref->base->mData.mLevel);
|
||||
data->mCreatureStats.setLevel(ref->mBase->mData.mLevel);
|
||||
|
||||
data->mCreatureStats.setHello(ref->base->mAiData.mHello);
|
||||
data->mCreatureStats.setFight(ref->base->mAiData.mFight);
|
||||
data->mCreatureStats.setFlee(ref->base->mAiData.mFlee);
|
||||
data->mCreatureStats.setAlarm(ref->base->mAiData.mAlarm);
|
||||
data->mCreatureStats.setHello(ref->mBase->mAiData.mHello);
|
||||
data->mCreatureStats.setFight(ref->mBase->mAiData.mFight);
|
||||
data->mCreatureStats.setFlee(ref->mBase->mAiData.mFlee);
|
||||
data->mCreatureStats.setAlarm(ref->mBase->mAiData.mAlarm);
|
||||
|
||||
// spells
|
||||
for (std::vector<std::string>::const_iterator iter (ref->base->mSpells.mList.begin());
|
||||
iter!=ref->base->mSpells.mList.end(); ++iter)
|
||||
for (std::vector<std::string>::const_iterator iter (ref->mBase->mSpells.mList.begin());
|
||||
iter!=ref->mBase->mSpells.mList.end(); ++iter)
|
||||
data->mCreatureStats.getSpells().add (*iter);
|
||||
|
||||
// store
|
||||
|
@ -82,7 +82,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Creature> *ref =
|
||||
ptr.get<ESM::Creature>();
|
||||
|
||||
return ref->base->mId;
|
||||
return ref->mBase->mId;
|
||||
}
|
||||
|
||||
void Creature::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||
|
@ -103,9 +103,9 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Creature> *ref =
|
||||
ptr.get<ESM::Creature>();
|
||||
assert (ref->base != NULL);
|
||||
assert (ref->mBase != NULL);
|
||||
|
||||
const std::string &model = ref->base->mModel;
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
return "meshes\\" + model;
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Creature> *ref =
|
||||
ptr.get<ESM::Creature>();
|
||||
|
||||
return ref->base->mName;
|
||||
return ref->mBase->mName;
|
||||
}
|
||||
|
||||
MWMechanics::CreatureStats& Creature::getCreatureStats (const MWWorld::Ptr& ptr) const
|
||||
|
@ -149,7 +149,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Creature> *ref =
|
||||
ptr.get<ESM::Creature>();
|
||||
|
||||
return ref->base->mScript;
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
||||
bool Creature::isEssential (const MWWorld::Ptr& ptr) const
|
||||
|
@ -157,7 +157,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Creature> *ref =
|
||||
ptr.get<ESM::Creature>();
|
||||
|
||||
return ref->base->mFlags & ESM::Creature::Essential;
|
||||
return ref->mBase->mFlags & ESM::Creature::Essential;
|
||||
}
|
||||
|
||||
void Creature::registerSelf()
|
||||
|
@ -180,11 +180,11 @@ namespace MWClass
|
|||
ptr.get<ESM::Creature>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
info.caption = ref->base->mName;
|
||||
info.caption = ref->mBase->mName;
|
||||
|
||||
std::string text;
|
||||
if (MWBase::Environment::get().getWindowManager()->getFullHelp())
|
||||
text += MWGui::ToolTips::getMiscString(ref->base->mScript, "Script");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mBase->mScript, "Script");
|
||||
info.text = text;
|
||||
|
||||
return info;
|
||||
|
@ -218,6 +218,6 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Creature> *ref =
|
||||
ptr.get<ESM::Creature>();
|
||||
|
||||
return MWWorld::Ptr(&cell.creatures.insert(*ref), &cell);
|
||||
return MWWorld::Ptr(&cell.mCreatures.insert(*ref), &cell);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,9 +43,9 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Door> *ref =
|
||||
ptr.get<ESM::Door>();
|
||||
assert(ref->base != NULL);
|
||||
assert(ref->mBase != NULL);
|
||||
|
||||
const std::string &model = ref->base->mModel;
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
return "meshes\\" + model;
|
||||
}
|
||||
|
@ -57,10 +57,10 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Door> *ref =
|
||||
ptr.get<ESM::Door>();
|
||||
|
||||
if (ref->ref.mTeleport && !ref->ref.mDestCell.empty()) // TODO doors that lead to exteriors
|
||||
return ref->ref.mDestCell;
|
||||
if (ref->mRef.mTeleport && !ref->mRef.mDestCell.empty()) // TODO doors that lead to exteriors
|
||||
return ref->mRef.mDestCell;
|
||||
|
||||
return ref->base->mName;
|
||||
return ref->mBase->mName;
|
||||
}
|
||||
|
||||
boost::shared_ptr<MWWorld::Action> Door::activate (const MWWorld::Ptr& ptr,
|
||||
|
@ -69,8 +69,8 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Door> *ref =
|
||||
ptr.get<ESM::Door>();
|
||||
|
||||
const std::string &openSound = ref->base->mOpenSound;
|
||||
//const std::string &closeSound = ref->base->closeSound;
|
||||
const std::string &openSound = ref->mBase->mOpenSound;
|
||||
//const std::string &closeSound = ref->mBase->closeSound;
|
||||
const std::string lockedSound = "LockedDoor";
|
||||
const std::string trapActivationSound = "Disarm Trap Fail";
|
||||
|
||||
|
@ -118,13 +118,13 @@ namespace MWClass
|
|||
return action;
|
||||
}
|
||||
|
||||
if (ref->ref.mTeleport)
|
||||
if (ref->mRef.mTeleport)
|
||||
{
|
||||
// teleport door
|
||||
/// \todo remove this if clause once ActionTeleport can also support other actors
|
||||
if (MWBase::Environment::get().getWorld()->getPlayer().getPlayer()==actor)
|
||||
{
|
||||
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTeleport (ref->ref.mDestCell, ref->ref.mDoorDest));
|
||||
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTeleport (ref->mRef.mDestCell, ref->mRef.mDoorDest));
|
||||
|
||||
action->setSound(openSound);
|
||||
|
||||
|
@ -176,7 +176,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Door> *ref =
|
||||
ptr.get<ESM::Door>();
|
||||
|
||||
return ref->base->mScript;
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
||||
void Door::registerSelf()
|
||||
|
@ -191,7 +191,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Door> *ref =
|
||||
ptr.get<ESM::Door>();
|
||||
|
||||
return (ref->base->mName != "");
|
||||
return (ref->mBase->mName != "");
|
||||
}
|
||||
|
||||
MWGui::ToolTipInfo Door::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
|
@ -200,31 +200,32 @@ namespace MWClass
|
|||
ptr.get<ESM::Door>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
info.caption = ref->base->mName;
|
||||
info.caption = ref->mBase->mName;
|
||||
|
||||
std::string text;
|
||||
|
||||
const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
if (ref->ref.mTeleport)
|
||||
if (ref->mRef.mTeleport)
|
||||
{
|
||||
std::string dest;
|
||||
if (ref->ref.mDestCell != "")
|
||||
if (ref->mRef.mDestCell != "")
|
||||
{
|
||||
// door leads to an interior, use interior name as tooltip
|
||||
dest = ref->ref.mDestCell;
|
||||
dest = ref->mRef.mDestCell;
|
||||
}
|
||||
else
|
||||
{
|
||||
// door leads to exterior, use cell name (if any), otherwise translated region name
|
||||
int x,y;
|
||||
MWBase::Environment::get().getWorld()->positionToIndex (ref->ref.mDoorDest.pos[0], ref->ref.mDoorDest.pos[1], x, y);
|
||||
const ESM::Cell* cell = store.cells.findExt(x,y);
|
||||
MWBase::Environment::get().getWorld()->positionToIndex (ref->mRef.mDoorDest.pos[0], ref->mRef.mDoorDest.pos[1], x, y);
|
||||
const ESM::Cell* cell = store.get<ESM::Cell>().find(x,y);
|
||||
if (cell->mName != "")
|
||||
dest = cell->mName;
|
||||
else
|
||||
{
|
||||
const ESM::Region* region = store.regions.search(cell->mRegion);
|
||||
const ESM::Region* region =
|
||||
store.get<ESM::Region>().find(cell->mRegion);
|
||||
dest = region->mName;
|
||||
}
|
||||
}
|
||||
|
@ -232,13 +233,13 @@ namespace MWClass
|
|||
text += "\n"+dest;
|
||||
}
|
||||
|
||||
if (ref->ref.mLockLevel > 0)
|
||||
text += "\n#{sLockLevel}: " + MWGui::ToolTips::toString(ref->ref.mLockLevel);
|
||||
if (ref->ref.mTrap != "")
|
||||
if (ref->mRef.mLockLevel > 0)
|
||||
text += "\n#{sLockLevel}: " + MWGui::ToolTips::toString(ref->mRef.mLockLevel);
|
||||
if (ref->mRef.mTrap != "")
|
||||
text += "\n#{sTrapped}";
|
||||
|
||||
if (MWBase::Environment::get().getWindowManager()->getFullHelp())
|
||||
text += MWGui::ToolTips::getMiscString(ref->base->mScript, "Script");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mBase->mScript, "Script");
|
||||
|
||||
info.text = text;
|
||||
|
||||
|
@ -251,6 +252,6 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Door> *ref =
|
||||
ptr.get<ESM::Door>();
|
||||
|
||||
return MWWorld::Ptr(&cell.doors.insert(*ref), &cell);
|
||||
return MWWorld::Ptr(&cell.mDoors.insert(*ref), &cell);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Ingredient> *ref =
|
||||
ptr.get<ESM::Ingredient>();
|
||||
|
||||
return ref->base->mId;
|
||||
return ref->mBase->mId;
|
||||
}
|
||||
|
||||
void Ingredient::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||
|
@ -49,9 +49,9 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Ingredient> *ref =
|
||||
ptr.get<ESM::Ingredient>();
|
||||
assert(ref->base != NULL);
|
||||
assert(ref->mBase != NULL);
|
||||
|
||||
const std::string &model = ref->base->mModel;
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
return "meshes\\" + model;
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Ingredient> *ref =
|
||||
ptr.get<ESM::Ingredient>();
|
||||
|
||||
return ref->base->mName;
|
||||
return ref->mBase->mName;
|
||||
}
|
||||
|
||||
boost::shared_ptr<MWWorld::Action> Ingredient::activate (const MWWorld::Ptr& ptr,
|
||||
|
@ -81,7 +81,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Ingredient> *ref =
|
||||
ptr.get<ESM::Ingredient>();
|
||||
|
||||
return ref->base->mScript;
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
||||
int Ingredient::getValue (const MWWorld::Ptr& ptr) const
|
||||
|
@ -89,7 +89,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Ingredient> *ref =
|
||||
ptr.get<ESM::Ingredient>();
|
||||
|
||||
return ref->base->mData.mValue;
|
||||
return ref->mBase->mData.mValue;
|
||||
}
|
||||
|
||||
|
||||
|
@ -124,7 +124,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Ingredient> *ref =
|
||||
ptr.get<ESM::Ingredient>();
|
||||
|
||||
return ref->base->mIcon;
|
||||
return ref->mBase->mIcon;
|
||||
}
|
||||
|
||||
bool Ingredient::hasToolTip (const MWWorld::Ptr& ptr) const
|
||||
|
@ -132,7 +132,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Ingredient> *ref =
|
||||
ptr.get<ESM::Ingredient>();
|
||||
|
||||
return (ref->base->mName != "");
|
||||
return (ref->mBase->mName != "");
|
||||
}
|
||||
|
||||
MWGui::ToolTipInfo Ingredient::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
|
@ -141,28 +141,28 @@ namespace MWClass
|
|||
ptr.get<ESM::Ingredient>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
info.caption = ref->base->mName + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
|
||||
info.icon = ref->base->mIcon;
|
||||
info.caption = ref->mBase->mName + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
|
||||
info.icon = ref->mBase->mIcon;
|
||||
|
||||
std::string text;
|
||||
|
||||
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->base->mData.mWeight);
|
||||
text += MWGui::ToolTips::getValueString(ref->base->mData.mValue, "#{sValue}");
|
||||
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->mBase->mData.mWeight);
|
||||
text += MWGui::ToolTips::getValueString(ref->mBase->mData.mValue, "#{sValue}");
|
||||
|
||||
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
|
||||
text += MWGui::ToolTips::getMiscString(ref->ref.mOwner, "Owner");
|
||||
text += MWGui::ToolTips::getMiscString(ref->base->mScript, "Script");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mRef.mOwner, "Owner");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mBase->mScript, "Script");
|
||||
}
|
||||
|
||||
MWGui::Widgets::SpellEffectList list;
|
||||
for (int i=0; i<4; ++i)
|
||||
{
|
||||
if (ref->base->mData.mEffectID[i] < 0)
|
||||
if (ref->mBase->mData.mEffectID[i] < 0)
|
||||
continue;
|
||||
MWGui::Widgets::SpellEffectParams params;
|
||||
params.mEffectID = ref->base->mData.mEffectID[i];
|
||||
params.mAttribute = ref->base->mData.mAttributes[i];
|
||||
params.mSkill = ref->base->mData.mSkills[i];
|
||||
params.mEffectID = ref->mBase->mData.mEffectID[i];
|
||||
params.mAttribute = ref->mBase->mData.mAttributes[i];
|
||||
params.mSkill = ref->mBase->mData.mSkills[i];
|
||||
list.push_back(params);
|
||||
}
|
||||
info.effects = list;
|
||||
|
@ -178,6 +178,6 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Ingredient> *ref =
|
||||
ptr.get<ESM::Ingredient>();
|
||||
|
||||
return MWWorld::Ptr(&cell.ingreds.insert(*ref), &cell);
|
||||
return MWWorld::Ptr(&cell.mIngreds.insert(*ref), &cell);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,9 +27,9 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Light> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
assert (ref->base != NULL);
|
||||
assert (ref->mBase != NULL);
|
||||
|
||||
const std::string &model = ref->base->mModel;
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
|
||||
MWRender::Objects& objects = renderingInterface.getObjects();
|
||||
objects.insertBegin(ptr, ptr.getRefData().isEnabled(), false);
|
||||
|
@ -37,11 +37,11 @@ namespace MWClass
|
|||
if (!model.empty())
|
||||
objects.insertMesh(ptr, "meshes\\" + model);
|
||||
|
||||
const int color = ref->base->mData.mColor;
|
||||
const int color = ref->mBase->mData.mColor;
|
||||
const float r = ((color >> 0) & 0xFF) / 255.0f;
|
||||
const float g = ((color >> 8) & 0xFF) / 255.0f;
|
||||
const float b = ((color >> 16) & 0xFF) / 255.0f;
|
||||
const float radius = float (ref->base->mData.mRadius);
|
||||
const float radius = float (ref->mBase->mData.mRadius);
|
||||
objects.insertLight (ptr, r, g, b, radius);
|
||||
}
|
||||
|
||||
|
@ -49,24 +49,24 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Light> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
assert (ref->base != NULL);
|
||||
assert (ref->mBase != NULL);
|
||||
|
||||
const std::string &model = ref->base->mModel;
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
|
||||
if(!model.empty())
|
||||
physics.addObject(ptr);
|
||||
|
||||
if (!ref->base->mSound.empty())
|
||||
MWBase::Environment::get().getSoundManager()->playSound3D(ptr, ref->base->mSound, 1.0, 1.0, MWBase::SoundManager::Play_Loop);
|
||||
if (!ref->mBase->mSound.empty())
|
||||
MWBase::Environment::get().getSoundManager()->playSound3D(ptr, ref->mBase->mSound, 1.0, 1.0, MWBase::SoundManager::Play_Loop);
|
||||
}
|
||||
|
||||
std::string Light::getModel(const MWWorld::Ptr &ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Light> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
assert (ref->base != NULL);
|
||||
assert (ref->mBase != NULL);
|
||||
|
||||
const std::string &model = ref->base->mModel;
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
return "meshes\\" + model;
|
||||
}
|
||||
|
@ -78,10 +78,10 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Light> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
|
||||
if (ref->base->mModel.empty())
|
||||
if (ref->mBase->mModel.empty())
|
||||
return "";
|
||||
|
||||
return ref->base->mName;
|
||||
return ref->mBase->mName;
|
||||
}
|
||||
|
||||
boost::shared_ptr<MWWorld::Action> Light::activate (const MWWorld::Ptr& ptr,
|
||||
|
@ -90,7 +90,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Light> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
|
||||
if (!(ref->base->mData.mFlags & ESM::Light::Carry))
|
||||
if (!(ref->mBase->mData.mFlags & ESM::Light::Carry))
|
||||
return boost::shared_ptr<MWWorld::Action> (new MWWorld::NullAction);
|
||||
|
||||
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTake (ptr));
|
||||
|
@ -105,7 +105,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Light> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
|
||||
return ref->base->mScript;
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
||||
std::pair<std::vector<int>, bool> Light::getEquipmentSlots (const MWWorld::Ptr& ptr) const
|
||||
|
@ -115,7 +115,7 @@ namespace MWClass
|
|||
|
||||
std::vector<int> slots;
|
||||
|
||||
if (ref->base->mData.mFlags & ESM::Light::Carry)
|
||||
if (ref->mBase->mData.mFlags & ESM::Light::Carry)
|
||||
slots.push_back (int (MWWorld::InventoryStore::Slot_CarriedLeft));
|
||||
|
||||
return std::make_pair (slots, false);
|
||||
|
@ -126,7 +126,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Light> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
|
||||
return ref->base->mData.mValue;
|
||||
return ref->mBase->mData.mValue;
|
||||
}
|
||||
|
||||
void Light::registerSelf()
|
||||
|
@ -152,7 +152,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Light> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
|
||||
return ref->base->mIcon;
|
||||
return ref->mBase->mIcon;
|
||||
}
|
||||
|
||||
bool Light::hasToolTip (const MWWorld::Ptr& ptr) const
|
||||
|
@ -160,7 +160,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Light> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
|
||||
return (ref->base->mName != "");
|
||||
return (ref->mBase->mName != "");
|
||||
}
|
||||
|
||||
MWGui::ToolTipInfo Light::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
|
@ -169,17 +169,17 @@ namespace MWClass
|
|||
ptr.get<ESM::Light>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
info.caption = ref->base->mName + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
|
||||
info.icon = ref->base->mIcon;
|
||||
info.caption = ref->mBase->mName + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
|
||||
info.icon = ref->mBase->mIcon;
|
||||
|
||||
std::string text;
|
||||
|
||||
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->base->mData.mWeight);
|
||||
text += MWGui::ToolTips::getValueString(ref->base->mData.mValue, "#{sValue}");
|
||||
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->mBase->mData.mWeight);
|
||||
text += MWGui::ToolTips::getValueString(ref->mBase->mData.mValue, "#{sValue}");
|
||||
|
||||
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
|
||||
text += MWGui::ToolTips::getMiscString(ref->ref.mOwner, "Owner");
|
||||
text += MWGui::ToolTips::getMiscString(ref->base->mScript, "Script");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mRef.mOwner, "Owner");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mBase->mScript, "Script");
|
||||
}
|
||||
|
||||
info.text = text;
|
||||
|
@ -202,6 +202,6 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Light> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
|
||||
return MWWorld::Ptr(&cell.lights.insert(*ref), &cell);
|
||||
return MWWorld::Ptr(&cell.mLights.insert(*ref), &cell);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,9 +42,9 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Tool> *ref =
|
||||
ptr.get<ESM::Tool>();
|
||||
assert(ref->base != NULL);
|
||||
assert(ref->mBase != NULL);
|
||||
|
||||
const std::string &model = ref->base->mModel;
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
return "meshes\\" + model;
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Tool> *ref =
|
||||
ptr.get<ESM::Tool>();
|
||||
|
||||
return ref->base->mName;
|
||||
return ref->mBase->mName;
|
||||
}
|
||||
|
||||
boost::shared_ptr<MWWorld::Action> Lockpick::activate (const MWWorld::Ptr& ptr,
|
||||
|
@ -74,7 +74,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Tool> *ref =
|
||||
ptr.get<ESM::Tool>();
|
||||
|
||||
return ref->base->mScript;
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
||||
std::pair<std::vector<int>, bool> Lockpick::getEquipmentSlots (const MWWorld::Ptr& ptr) const
|
||||
|
@ -91,7 +91,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Tool> *ref =
|
||||
ptr.get<ESM::Tool>();
|
||||
|
||||
return ref->base->mData.mValue;
|
||||
return ref->mBase->mData.mValue;
|
||||
}
|
||||
|
||||
void Lockpick::registerSelf()
|
||||
|
@ -116,7 +116,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Tool> *ref =
|
||||
ptr.get<ESM::Tool>();
|
||||
|
||||
return ref->base->mIcon;
|
||||
return ref->mBase->mIcon;
|
||||
}
|
||||
|
||||
bool Lockpick::hasToolTip (const MWWorld::Ptr& ptr) const
|
||||
|
@ -124,7 +124,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Tool> *ref =
|
||||
ptr.get<ESM::Tool>();
|
||||
|
||||
return (ref->base->mName != "");
|
||||
return (ref->mBase->mName != "");
|
||||
}
|
||||
|
||||
MWGui::ToolTipInfo Lockpick::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
|
@ -133,21 +133,21 @@ namespace MWClass
|
|||
ptr.get<ESM::Tool>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
info.caption = ref->base->mName + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
|
||||
info.icon = ref->base->mIcon;
|
||||
info.caption = ref->mBase->mName + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
|
||||
info.icon = ref->mBase->mIcon;
|
||||
|
||||
std::string text;
|
||||
|
||||
/// \todo store remaining uses somewhere
|
||||
|
||||
text += "\n#{sUses}: " + MWGui::ToolTips::toString(ref->base->mData.mUses);
|
||||
text += "\n#{sQuality}: " + MWGui::ToolTips::toString(ref->base->mData.mQuality);
|
||||
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->base->mData.mWeight);
|
||||
text += MWGui::ToolTips::getValueString(ref->base->mData.mValue, "#{sValue}");
|
||||
text += "\n#{sUses}: " + MWGui::ToolTips::toString(ref->mBase->mData.mUses);
|
||||
text += "\n#{sQuality}: " + MWGui::ToolTips::toString(ref->mBase->mData.mQuality);
|
||||
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->mBase->mData.mWeight);
|
||||
text += MWGui::ToolTips::getValueString(ref->mBase->mData.mValue, "#{sValue}");
|
||||
|
||||
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
|
||||
text += MWGui::ToolTips::getMiscString(ref->ref.mOwner, "Owner");
|
||||
text += MWGui::ToolTips::getMiscString(ref->base->mScript, "Script");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mRef.mOwner, "Owner");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mBase->mScript, "Script");
|
||||
}
|
||||
|
||||
info.text = text;
|
||||
|
@ -170,6 +170,6 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Tool> *ref =
|
||||
ptr.get<ESM::Tool>();
|
||||
|
||||
return MWWorld::Ptr(&cell.lockpicks.insert(*ref), &cell);
|
||||
return MWWorld::Ptr(&cell.mLockpicks.insert(*ref), &cell);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,9 +45,9 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
ptr.get<ESM::Miscellaneous>();
|
||||
assert(ref->base != NULL);
|
||||
assert(ref->mBase != NULL);
|
||||
|
||||
const std::string &model = ref->base->mModel;
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
return "meshes\\" + model;
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
ptr.get<ESM::Miscellaneous>();
|
||||
|
||||
return ref->base->mName;
|
||||
return ref->mBase->mName;
|
||||
}
|
||||
|
||||
boost::shared_ptr<MWWorld::Action> Miscellaneous::activate (const MWWorld::Ptr& ptr,
|
||||
|
@ -77,7 +77,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
ptr.get<ESM::Miscellaneous>();
|
||||
|
||||
return ref->base->mScript;
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
||||
int Miscellaneous::getValue (const MWWorld::Ptr& ptr) const
|
||||
|
@ -85,7 +85,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
ptr.get<ESM::Miscellaneous>();
|
||||
|
||||
return ref->base->mData.mValue;
|
||||
return ref->mBase->mData.mValue;
|
||||
}
|
||||
|
||||
void Miscellaneous::registerSelf()
|
||||
|
@ -100,7 +100,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
ptr.get<ESM::Miscellaneous>();
|
||||
|
||||
if (ref->base->mName == MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sGold")->getString())
|
||||
if (ref->mBase->mName == MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sGold")->getString())
|
||||
{
|
||||
return std::string("Item Gold Up");
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
ptr.get<ESM::Miscellaneous>();
|
||||
|
||||
if (ref->base->mName == MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sGold")->getString())
|
||||
if (ref->mBase->mName == MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sGold")->getString())
|
||||
{
|
||||
return std::string("Item Gold Down");
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
ptr.get<ESM::Miscellaneous>();
|
||||
|
||||
return ref->base->mIcon;
|
||||
return ref->mBase->mIcon;
|
||||
}
|
||||
|
||||
bool Miscellaneous::hasToolTip (const MWWorld::Ptr& ptr) const
|
||||
|
@ -132,7 +132,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
ptr.get<ESM::Miscellaneous>();
|
||||
|
||||
return (ref->base->mName != "");
|
||||
return (ref->mBase->mName != "");
|
||||
}
|
||||
|
||||
MWGui::ToolTipInfo Miscellaneous::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
|
@ -142,13 +142,13 @@ namespace MWClass
|
|||
|
||||
MWGui::ToolTipInfo info;
|
||||
|
||||
const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
int count = ptr.getRefData().getCount();
|
||||
|
||||
bool isGold = (ref->base->mName == store.gameSettings.find("sGold")->getString());
|
||||
bool isGold = (ref->mBase->mName == store.get<ESM::GameSetting>().find("sGold")->getString());
|
||||
if (isGold && count == 1)
|
||||
count = ref->base->mData.mValue;
|
||||
count = ref->mBase->mData.mValue;
|
||||
|
||||
std::string countString;
|
||||
if (!isGold)
|
||||
|
@ -156,12 +156,12 @@ namespace MWClass
|
|||
else // gold displays its count also if it's 1.
|
||||
countString = " (" + boost::lexical_cast<std::string>(count) + ")";
|
||||
|
||||
info.caption = ref->base->mName + countString;
|
||||
info.icon = ref->base->mIcon;
|
||||
info.caption = ref->mBase->mName + countString;
|
||||
info.icon = ref->mBase->mIcon;
|
||||
|
||||
if (ref->ref.mSoul != "")
|
||||
if (ref->mRef.mSoul != "")
|
||||
{
|
||||
const ESM::Creature *creature = store.creatures.search(ref->ref.mSoul);
|
||||
const ESM::Creature *creature = store.get<ESM::Creature>().find(ref->mRef.mSoul);
|
||||
info.caption += " (" + creature->mName + ")";
|
||||
}
|
||||
|
||||
|
@ -169,13 +169,13 @@ namespace MWClass
|
|||
|
||||
if (!isGold)
|
||||
{
|
||||
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->base->mData.mWeight);
|
||||
text += MWGui::ToolTips::getValueString(ref->base->mData.mValue, "#{sValue}");
|
||||
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->mBase->mData.mWeight);
|
||||
text += MWGui::ToolTips::getValueString(ref->mBase->mData.mValue, "#{sValue}");
|
||||
}
|
||||
|
||||
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
|
||||
text += MWGui::ToolTips::getMiscString(ref->ref.mOwner, "Owner");
|
||||
text += MWGui::ToolTips::getMiscString(ref->base->mScript, "Script");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mRef.mOwner, "Owner");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mBase->mScript, "Script");
|
||||
}
|
||||
|
||||
info.text = text;
|
||||
|
@ -188,10 +188,10 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::Ptr newPtr;
|
||||
|
||||
const ESMS::ESMStore &store =
|
||||
const MWWorld::ESMStore &store =
|
||||
MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
if (MWWorld::Class::get(ptr).getName(ptr) == store.gameSettings.find("sGold")->getString()) {
|
||||
if (MWWorld::Class::get(ptr).getName(ptr) == store.get<ESM::GameSetting>().find("sGold")->getString()) {
|
||||
int goldAmount = ptr.getRefData().getCount();
|
||||
|
||||
std::string base = "Gold_001";
|
||||
|
@ -209,11 +209,11 @@ namespace MWClass
|
|||
MWWorld::ManualRef newRef(store, base);
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
newRef.getPtr().get<ESM::Miscellaneous>();
|
||||
newPtr = MWWorld::Ptr(&cell.miscItems.insert(*ref), &cell);
|
||||
newPtr = MWWorld::Ptr(&cell.mMiscItems.insert(*ref), &cell);
|
||||
} else {
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
ptr.get<ESM::Miscellaneous>();
|
||||
newPtr = MWWorld::Ptr(&cell.miscItems.insert(*ref), &cell);
|
||||
newPtr = MWWorld::Ptr(&cell.mMiscItems.insert(*ref), &cell);
|
||||
}
|
||||
return newPtr;
|
||||
}
|
||||
|
|
|
@ -62,39 +62,39 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::NPC> *ref = ptr.get<ESM::NPC>();
|
||||
|
||||
// NPC stats
|
||||
if (!ref->base->mFaction.empty())
|
||||
if (!ref->mBase->mFaction.empty())
|
||||
{
|
||||
std::string faction = ref->base->mFaction;
|
||||
std::string faction = ref->mBase->mFaction;
|
||||
boost::algorithm::to_lower(faction);
|
||||
if(ref->base->mNpdt52.mGold != -10)
|
||||
if(ref->mBase->mNpdt52.mGold != -10)
|
||||
{
|
||||
data->mNpcStats.getFactionRanks()[faction] = (int)ref->base->mNpdt52.mRank;
|
||||
data->mNpcStats.getFactionRanks()[faction] = (int)ref->mBase->mNpdt52.mRank;
|
||||
}
|
||||
else
|
||||
{
|
||||
data->mNpcStats.getFactionRanks()[faction] = (int)ref->base->mNpdt12.mRank;
|
||||
data->mNpcStats.getFactionRanks()[faction] = (int)ref->mBase->mNpdt12.mRank;
|
||||
}
|
||||
}
|
||||
|
||||
// creature stats
|
||||
if(ref->base->mNpdt52.mGold != -10)
|
||||
if(ref->mBase->mNpdt52.mGold != -10)
|
||||
{
|
||||
for (int i=0; i<27; ++i)
|
||||
data->mNpcStats.getSkill (i).setBase (ref->base->mNpdt52.mSkills[i]);
|
||||
data->mNpcStats.getSkill (i).setBase (ref->mBase->mNpdt52.mSkills[i]);
|
||||
|
||||
data->mCreatureStats.getAttribute(0).set (ref->base->mNpdt52.mStrength);
|
||||
data->mCreatureStats.getAttribute(1).set (ref->base->mNpdt52.mIntelligence);
|
||||
data->mCreatureStats.getAttribute(2).set (ref->base->mNpdt52.mWillpower);
|
||||
data->mCreatureStats.getAttribute(3).set (ref->base->mNpdt52.mAgility);
|
||||
data->mCreatureStats.getAttribute(4).set (ref->base->mNpdt52.mSpeed);
|
||||
data->mCreatureStats.getAttribute(5).set (ref->base->mNpdt52.mEndurance);
|
||||
data->mCreatureStats.getAttribute(6).set (ref->base->mNpdt52.mPersonality);
|
||||
data->mCreatureStats.getAttribute(7).set (ref->base->mNpdt52.mLuck);
|
||||
data->mCreatureStats.setHealth (ref->base->mNpdt52.mHealth);
|
||||
data->mCreatureStats.setMagicka (ref->base->mNpdt52.mMana);
|
||||
data->mCreatureStats.setFatigue (ref->base->mNpdt52.mFatigue);
|
||||
data->mCreatureStats.getAttribute(0).set (ref->mBase->mNpdt52.mStrength);
|
||||
data->mCreatureStats.getAttribute(1).set (ref->mBase->mNpdt52.mIntelligence);
|
||||
data->mCreatureStats.getAttribute(2).set (ref->mBase->mNpdt52.mWillpower);
|
||||
data->mCreatureStats.getAttribute(3).set (ref->mBase->mNpdt52.mAgility);
|
||||
data->mCreatureStats.getAttribute(4).set (ref->mBase->mNpdt52.mSpeed);
|
||||
data->mCreatureStats.getAttribute(5).set (ref->mBase->mNpdt52.mEndurance);
|
||||
data->mCreatureStats.getAttribute(6).set (ref->mBase->mNpdt52.mPersonality);
|
||||
data->mCreatureStats.getAttribute(7).set (ref->mBase->mNpdt52.mLuck);
|
||||
data->mCreatureStats.setHealth (ref->mBase->mNpdt52.mHealth);
|
||||
data->mCreatureStats.setMagicka (ref->mBase->mNpdt52.mMana);
|
||||
data->mCreatureStats.setFatigue (ref->mBase->mNpdt52.mFatigue);
|
||||
|
||||
data->mCreatureStats.setLevel(ref->base->mNpdt52.mLevel);
|
||||
data->mCreatureStats.setLevel(ref->mBase->mNpdt52.mLevel);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -108,14 +108,14 @@ namespace MWClass
|
|||
data->mCreatureStats.setLevel (1);
|
||||
}
|
||||
|
||||
data->mCreatureStats.setHello(ref->base->mAiData.mHello);
|
||||
data->mCreatureStats.setFight(ref->base->mAiData.mFight);
|
||||
data->mCreatureStats.setFlee(ref->base->mAiData.mFlee);
|
||||
data->mCreatureStats.setAlarm(ref->base->mAiData.mAlarm);
|
||||
data->mCreatureStats.setHello(ref->mBase->mAiData.mHello);
|
||||
data->mCreatureStats.setFight(ref->mBase->mAiData.mFight);
|
||||
data->mCreatureStats.setFlee(ref->mBase->mAiData.mFlee);
|
||||
data->mCreatureStats.setAlarm(ref->mBase->mAiData.mAlarm);
|
||||
|
||||
// spells
|
||||
for (std::vector<std::string>::const_iterator iter (ref->base->mSpells.mList.begin());
|
||||
iter!=ref->base->mSpells.mList.end(); ++iter)
|
||||
for (std::vector<std::string>::const_iterator iter (ref->mBase->mSpells.mList.begin());
|
||||
iter!=ref->mBase->mSpells.mList.end(); ++iter)
|
||||
data->mCreatureStats.getSpells().add (*iter);
|
||||
|
||||
// store
|
||||
|
@ -128,7 +128,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::NPC> *ref =
|
||||
ptr.get<ESM::NPC>();
|
||||
|
||||
return ref->base->mId;
|
||||
return ref->mBase->mId;
|
||||
}
|
||||
|
||||
void Npc::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||
|
@ -146,9 +146,9 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::NPC> *ref =
|
||||
ptr.get<ESM::NPC>();
|
||||
assert(ref->base != NULL);
|
||||
assert(ref->mBase != NULL);
|
||||
|
||||
std::string headID = ref->base->mHead;
|
||||
std::string headID = ref->mBase->mHead;
|
||||
|
||||
int end = headID.find_last_of("head_") - 4;
|
||||
std::string bodyRaceID = headID.substr(0, end);
|
||||
|
@ -170,7 +170,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::NPC> *ref =
|
||||
ptr.get<ESM::NPC>();
|
||||
|
||||
return ref->base->mName;
|
||||
return ref->mBase->mName;
|
||||
}
|
||||
|
||||
MWMechanics::CreatureStats& Npc::getCreatureStats (const MWWorld::Ptr& ptr) const
|
||||
|
@ -217,7 +217,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::NPC> *ref =
|
||||
ptr.get<ESM::NPC>();
|
||||
|
||||
return ref->base->mScript;
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
||||
void Npc::setForceStance (const MWWorld::Ptr& ptr, Stance stance, bool force) const
|
||||
|
@ -325,7 +325,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::NPC> *ref =
|
||||
ptr.get<ESM::NPC>();
|
||||
|
||||
return ref->base->mFlags & ESM::NPC::Essential;
|
||||
return ref->mBase->mFlags & ESM::NPC::Essential;
|
||||
}
|
||||
|
||||
void Npc::registerSelf()
|
||||
|
@ -347,11 +347,11 @@ namespace MWClass
|
|||
ptr.get<ESM::NPC>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
info.caption = ref->base->mName;
|
||||
info.caption = ref->mBase->mName;
|
||||
|
||||
std::string text;
|
||||
if (MWBase::Environment::get().getWindowManager()->getFullHelp())
|
||||
text += MWGui::ToolTips::getMiscString(ref->base->mScript, "Script");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mBase->mScript, "Script");
|
||||
info.text = text;
|
||||
|
||||
return info;
|
||||
|
@ -395,8 +395,10 @@ namespace MWClass
|
|||
|
||||
MWWorld::LiveCellRef<ESM::NPC> *ref = ptr.get<ESM::NPC>();
|
||||
|
||||
const ESM::Class *class_ = MWBase::Environment::get().getWorld()->getStore().classes.find (
|
||||
ref->base->mClass);
|
||||
const ESM::Class *class_ =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Class>().find (
|
||||
ref->mBase->mClass
|
||||
);
|
||||
|
||||
stats.useSkill (skill, *class_, usageType);
|
||||
}
|
||||
|
@ -413,6 +415,6 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::NPC> *ref =
|
||||
ptr.get<ESM::NPC>();
|
||||
|
||||
return MWWorld::Ptr(&cell.npcs.insert(*ref), &cell);
|
||||
return MWWorld::Ptr(&cell.mNpcs.insert(*ref), &cell);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,9 +42,9 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Potion> *ref =
|
||||
ptr.get<ESM::Potion>();
|
||||
assert(ref->base != NULL);
|
||||
assert(ref->mBase != NULL);
|
||||
|
||||
const std::string &model = ref->base->mModel;
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
return "meshes\\" + model;
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Potion> *ref =
|
||||
ptr.get<ESM::Potion>();
|
||||
|
||||
return ref->base->mName;
|
||||
return ref->mBase->mName;
|
||||
}
|
||||
|
||||
boost::shared_ptr<MWWorld::Action> Potion::activate (const MWWorld::Ptr& ptr,
|
||||
|
@ -75,7 +75,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Potion> *ref =
|
||||
ptr.get<ESM::Potion>();
|
||||
|
||||
return ref->base->mScript;
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
||||
int Potion::getValue (const MWWorld::Ptr& ptr) const
|
||||
|
@ -83,7 +83,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Potion> *ref =
|
||||
ptr.get<ESM::Potion>();
|
||||
|
||||
return ref->base->mData.mValue;
|
||||
return ref->mBase->mData.mValue;
|
||||
}
|
||||
|
||||
void Potion::registerSelf()
|
||||
|
@ -108,7 +108,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Potion> *ref =
|
||||
ptr.get<ESM::Potion>();
|
||||
|
||||
return ref->base->mIcon;
|
||||
return ref->mBase->mIcon;
|
||||
}
|
||||
|
||||
bool Potion::hasToolTip (const MWWorld::Ptr& ptr) const
|
||||
|
@ -116,7 +116,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Potion> *ref =
|
||||
ptr.get<ESM::Potion>();
|
||||
|
||||
return (ref->base->mName != "");
|
||||
return (ref->mBase->mName != "");
|
||||
}
|
||||
|
||||
MWGui::ToolTipInfo Potion::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
|
@ -125,20 +125,20 @@ namespace MWClass
|
|||
ptr.get<ESM::Potion>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
info.caption = ref->base->mName + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
|
||||
info.icon = ref->base->mIcon;
|
||||
info.caption = ref->mBase->mName + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
|
||||
info.icon = ref->mBase->mIcon;
|
||||
|
||||
std::string text;
|
||||
|
||||
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->base->mData.mWeight);
|
||||
text += MWGui::ToolTips::getValueString(ref->base->mData.mValue, "#{sValue}");
|
||||
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->mBase->mData.mWeight);
|
||||
text += MWGui::ToolTips::getValueString(ref->mBase->mData.mValue, "#{sValue}");
|
||||
|
||||
info.effects = MWGui::Widgets::MWEffectList::effectListFromESM(&ref->base->mEffects);
|
||||
info.effects = MWGui::Widgets::MWEffectList::effectListFromESM(&ref->mBase->mEffects);
|
||||
info.isPotion = true;
|
||||
|
||||
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
|
||||
text += MWGui::ToolTips::getMiscString(ref->ref.mOwner, "Owner");
|
||||
text += MWGui::ToolTips::getMiscString(ref->base->mScript, "Script");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mRef.mOwner, "Owner");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mBase->mScript, "Script");
|
||||
}
|
||||
|
||||
info.text = text;
|
||||
|
@ -156,7 +156,7 @@ namespace MWClass
|
|||
MWWorld::Ptr actor = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
||||
|
||||
boost::shared_ptr<MWWorld::Action> action (
|
||||
new MWWorld::ActionApply (actor, ref->base->mId));
|
||||
new MWWorld::ActionApply (actor, ref->mBase->mId));
|
||||
|
||||
action->setSound ("Drink");
|
||||
|
||||
|
@ -169,6 +169,6 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Potion> *ref =
|
||||
ptr.get<ESM::Potion>();
|
||||
|
||||
return MWWorld::Ptr(&cell.potions.insert(*ref), &cell);
|
||||
return MWWorld::Ptr(&cell.mPotions.insert(*ref), &cell);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,9 +42,9 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Probe> *ref =
|
||||
ptr.get<ESM::Probe>();
|
||||
assert(ref->base != NULL);
|
||||
assert(ref->mBase != NULL);
|
||||
|
||||
const std::string &model = ref->base->mModel;
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
return "meshes\\" + model;
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Probe> *ref =
|
||||
ptr.get<ESM::Probe>();
|
||||
|
||||
return ref->base->mName;
|
||||
return ref->mBase->mName;
|
||||
}
|
||||
boost::shared_ptr<MWWorld::Action> Probe::activate (const MWWorld::Ptr& ptr,
|
||||
const MWWorld::Ptr& actor) const
|
||||
|
@ -73,7 +73,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Probe> *ref =
|
||||
ptr.get<ESM::Probe>();
|
||||
|
||||
return ref->base->mScript;
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
||||
std::pair<std::vector<int>, bool> Probe::getEquipmentSlots (const MWWorld::Ptr& ptr) const
|
||||
|
@ -90,7 +90,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Probe> *ref =
|
||||
ptr.get<ESM::Probe>();
|
||||
|
||||
return ref->base->mData.mValue;
|
||||
return ref->mBase->mData.mValue;
|
||||
}
|
||||
|
||||
void Probe::registerSelf()
|
||||
|
@ -115,7 +115,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Probe> *ref =
|
||||
ptr.get<ESM::Probe>();
|
||||
|
||||
return ref->base->mIcon;
|
||||
return ref->mBase->mIcon;
|
||||
}
|
||||
|
||||
bool Probe::hasToolTip (const MWWorld::Ptr& ptr) const
|
||||
|
@ -123,7 +123,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Probe> *ref =
|
||||
ptr.get<ESM::Probe>();
|
||||
|
||||
return (ref->base->mName != "");
|
||||
return (ref->mBase->mName != "");
|
||||
}
|
||||
|
||||
MWGui::ToolTipInfo Probe::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
|
@ -132,21 +132,21 @@ namespace MWClass
|
|||
ptr.get<ESM::Probe>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
info.caption = ref->base->mName + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
|
||||
info.icon = ref->base->mIcon;
|
||||
info.caption = ref->mBase->mName + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
|
||||
info.icon = ref->mBase->mIcon;
|
||||
|
||||
std::string text;
|
||||
|
||||
/// \todo store remaining uses somewhere
|
||||
|
||||
text += "\n#{sUses}: " + MWGui::ToolTips::toString(ref->base->mData.mUses);
|
||||
text += "\n#{sQuality}: " + MWGui::ToolTips::toString(ref->base->mData.mQuality);
|
||||
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->base->mData.mWeight);
|
||||
text += MWGui::ToolTips::getValueString(ref->base->mData.mValue, "#{sValue}");
|
||||
text += "\n#{sUses}: " + MWGui::ToolTips::toString(ref->mBase->mData.mUses);
|
||||
text += "\n#{sQuality}: " + MWGui::ToolTips::toString(ref->mBase->mData.mQuality);
|
||||
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->mBase->mData.mWeight);
|
||||
text += MWGui::ToolTips::getValueString(ref->mBase->mData.mValue, "#{sValue}");
|
||||
|
||||
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
|
||||
text += MWGui::ToolTips::getMiscString(ref->ref.mOwner, "Owner");
|
||||
text += MWGui::ToolTips::getMiscString(ref->base->mScript, "Script");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mRef.mOwner, "Owner");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mBase->mScript, "Script");
|
||||
}
|
||||
|
||||
info.text = text;
|
||||
|
@ -169,6 +169,6 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Probe> *ref =
|
||||
ptr.get<ESM::Probe>();
|
||||
|
||||
return MWWorld::Ptr(&cell.probes.insert(*ref), &cell);
|
||||
return MWWorld::Ptr(&cell.mProbes.insert(*ref), &cell);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,9 +40,9 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Repair> *ref =
|
||||
ptr.get<ESM::Repair>();
|
||||
assert(ref->base != NULL);
|
||||
assert(ref->mBase != NULL);
|
||||
|
||||
const std::string &model = ref->base->mModel;
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
return "meshes\\" + model;
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Repair> *ref =
|
||||
ptr.get<ESM::Repair>();
|
||||
|
||||
return ref->base->mName;
|
||||
return ref->mBase->mName;
|
||||
}
|
||||
|
||||
boost::shared_ptr<MWWorld::Action> Repair::activate (const MWWorld::Ptr& ptr,
|
||||
|
@ -72,7 +72,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Repair> *ref =
|
||||
ptr.get<ESM::Repair>();
|
||||
|
||||
return ref->base->mScript;
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
||||
int Repair::getValue (const MWWorld::Ptr& ptr) const
|
||||
|
@ -80,7 +80,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Repair> *ref =
|
||||
ptr.get<ESM::Repair>();
|
||||
|
||||
return ref->base->mData.mValue;
|
||||
return ref->mBase->mData.mValue;
|
||||
}
|
||||
|
||||
void Repair::registerSelf()
|
||||
|
@ -105,7 +105,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Repair> *ref =
|
||||
ptr.get<ESM::Repair>();
|
||||
|
||||
return ref->base->mIcon;
|
||||
return ref->mBase->mIcon;
|
||||
}
|
||||
|
||||
bool Repair::hasToolTip (const MWWorld::Ptr& ptr) const
|
||||
|
@ -113,7 +113,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Repair> *ref =
|
||||
ptr.get<ESM::Repair>();
|
||||
|
||||
return (ref->base->mName != "");
|
||||
return (ref->mBase->mName != "");
|
||||
}
|
||||
|
||||
MWGui::ToolTipInfo Repair::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
|
@ -122,21 +122,21 @@ namespace MWClass
|
|||
ptr.get<ESM::Repair>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
info.caption = ref->base->mName + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
|
||||
info.icon = ref->base->mIcon;
|
||||
info.caption = ref->mBase->mName + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
|
||||
info.icon = ref->mBase->mIcon;
|
||||
|
||||
std::string text;
|
||||
|
||||
/// \todo store remaining uses somewhere
|
||||
|
||||
text += "\n#{sUses}: " + MWGui::ToolTips::toString(ref->base->mData.mUses);
|
||||
text += "\n#{sQuality}: " + MWGui::ToolTips::toString(ref->base->mData.mQuality);
|
||||
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->base->mData.mWeight);
|
||||
text += MWGui::ToolTips::getValueString(ref->base->mData.mValue, "#{sValue}");
|
||||
text += "\n#{sUses}: " + MWGui::ToolTips::toString(ref->mBase->mData.mUses);
|
||||
text += "\n#{sQuality}: " + MWGui::ToolTips::toString(ref->mBase->mData.mQuality);
|
||||
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->mBase->mData.mWeight);
|
||||
text += MWGui::ToolTips::getValueString(ref->mBase->mData.mValue, "#{sValue}");
|
||||
|
||||
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
|
||||
text += MWGui::ToolTips::getMiscString(ref->ref.mOwner, "Owner");
|
||||
text += MWGui::ToolTips::getMiscString(ref->base->mScript, "Script");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mRef.mOwner, "Owner");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mBase->mScript, "Script");
|
||||
}
|
||||
|
||||
info.text = text;
|
||||
|
@ -150,6 +150,6 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Repair> *ref =
|
||||
ptr.get<ESM::Repair>();
|
||||
|
||||
return MWWorld::Ptr(&cell.repairs.insert(*ref), &cell);
|
||||
return MWWorld::Ptr(&cell.mRepairs.insert(*ref), &cell);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,9 +32,9 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Static> *ref =
|
||||
ptr.get<ESM::Static>();
|
||||
assert(ref->base != NULL);
|
||||
assert(ref->mBase != NULL);
|
||||
|
||||
const std::string &model = ref->base->mModel;
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
return "meshes\\" + model;
|
||||
}
|
||||
|
@ -59,6 +59,6 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Static> *ref =
|
||||
ptr.get<ESM::Static>();
|
||||
|
||||
return MWWorld::Ptr(&cell.statics.insert(*ref), &cell);
|
||||
return MWWorld::Ptr(&cell.mStatics.insert(*ref), &cell);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,9 +42,9 @@ namespace MWClass
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
assert(ref->base != NULL);
|
||||
assert(ref->mBase != NULL);
|
||||
|
||||
const std::string &model = ref->base->mModel;
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
if (!model.empty()) {
|
||||
return "meshes\\" + model;
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
|
||||
return ref->base->mName;
|
||||
return ref->mBase->mName;
|
||||
}
|
||||
|
||||
boost::shared_ptr<MWWorld::Action> Weapon::activate (const MWWorld::Ptr& ptr,
|
||||
|
@ -79,7 +79,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
|
||||
return ref->base->mData.mHealth;
|
||||
return ref->mBase->mData.mHealth;
|
||||
}
|
||||
|
||||
std::string Weapon::getScript (const MWWorld::Ptr& ptr) const
|
||||
|
@ -87,7 +87,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
|
||||
return ref->base->mScript;
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
||||
std::pair<std::vector<int>, bool> Weapon::getEquipmentSlots (const MWWorld::Ptr& ptr) const
|
||||
|
@ -98,12 +98,12 @@ namespace MWClass
|
|||
std::vector<int> slots;
|
||||
bool stack = false;
|
||||
|
||||
if (ref->base->mData.mType==ESM::Weapon::Arrow || ref->base->mData.mType==ESM::Weapon::Bolt)
|
||||
if (ref->mBase->mData.mType==ESM::Weapon::Arrow || ref->mBase->mData.mType==ESM::Weapon::Bolt)
|
||||
{
|
||||
slots.push_back (int (MWWorld::InventoryStore::Slot_Ammunition));
|
||||
stack = true;
|
||||
}
|
||||
else if (ref->base->mData.mType==ESM::Weapon::MarksmanThrown)
|
||||
else if (ref->mBase->mData.mType==ESM::Weapon::MarksmanThrown)
|
||||
{
|
||||
slots.push_back (int (MWWorld::InventoryStore::Slot_CarriedRight));
|
||||
stack = true;
|
||||
|
@ -138,7 +138,7 @@ namespace MWClass
|
|||
};
|
||||
|
||||
for (int i=0; i<size; ++i)
|
||||
if (sMapping[i][0]==ref->base->mData.mType)
|
||||
if (sMapping[i][0]==ref->mBase->mData.mType)
|
||||
return sMapping[i][1];
|
||||
|
||||
return -1;
|
||||
|
@ -149,7 +149,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
|
||||
return ref->base->mData.mValue;
|
||||
return ref->mBase->mData.mValue;
|
||||
}
|
||||
|
||||
void Weapon::registerSelf()
|
||||
|
@ -164,7 +164,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
|
||||
int type = ref->base->mData.mType;
|
||||
int type = ref->mBase->mData.mType;
|
||||
// Ammo
|
||||
if (type == 12 || type == 13)
|
||||
{
|
||||
|
@ -210,7 +210,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
|
||||
int type = ref->base->mData.mType;
|
||||
int type = ref->mBase->mData.mType;
|
||||
// Ammo
|
||||
if (type == 12 || type == 13)
|
||||
{
|
||||
|
@ -256,7 +256,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
|
||||
return ref->base->mIcon;
|
||||
return ref->mBase->mIcon;
|
||||
}
|
||||
|
||||
bool Weapon::hasToolTip (const MWWorld::Ptr& ptr) const
|
||||
|
@ -264,7 +264,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
|
||||
return (ref->base->mName != "");
|
||||
return (ref->mBase->mName != "");
|
||||
}
|
||||
|
||||
MWGui::ToolTipInfo Weapon::getToolTipInfo (const MWWorld::Ptr& ptr) const
|
||||
|
@ -273,15 +273,15 @@ namespace MWClass
|
|||
ptr.get<ESM::Weapon>();
|
||||
|
||||
MWGui::ToolTipInfo info;
|
||||
info.caption = ref->base->mName + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
|
||||
info.icon = ref->base->mIcon;
|
||||
info.caption = ref->mBase->mName + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
|
||||
info.icon = ref->mBase->mIcon;
|
||||
|
||||
const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
std::string text;
|
||||
|
||||
// weapon type & damage. arrows / bolts don't have his info.
|
||||
if (ref->base->mData.mType < 12)
|
||||
if (ref->mBase->mData.mType < 12)
|
||||
{
|
||||
text += "\n#{sType} ";
|
||||
|
||||
|
@ -299,49 +299,49 @@ namespace MWClass
|
|||
mapping[ESM::Weapon::MarksmanCrossbow] = std::make_pair("sSkillMarksman", "");
|
||||
mapping[ESM::Weapon::MarksmanThrown] = std::make_pair("sSkillMarksman", "");
|
||||
|
||||
std::string type = mapping[ref->base->mData.mType].first;
|
||||
std::string oneOrTwoHanded = mapping[ref->base->mData.mType].second;
|
||||
std::string type = mapping[ref->mBase->mData.mType].first;
|
||||
std::string oneOrTwoHanded = mapping[ref->mBase->mData.mType].second;
|
||||
|
||||
text += store.gameSettings.find(type)->getString() +
|
||||
((oneOrTwoHanded != "") ? ", " + store.gameSettings.find(oneOrTwoHanded)->getString() : "");
|
||||
text += store.get<ESM::GameSetting>().find(type)->getString() +
|
||||
((oneOrTwoHanded != "") ? ", " + store.get<ESM::GameSetting>().find(oneOrTwoHanded)->getString() : "");
|
||||
|
||||
// weapon damage
|
||||
if (ref->base->mData.mType >= 9)
|
||||
if (ref->mBase->mData.mType >= 9)
|
||||
{
|
||||
// marksman
|
||||
text += "\n#{sAttack}: "
|
||||
+ MWGui::ToolTips::toString(static_cast<int>(ref->base->mData.mChop[0]))
|
||||
+ " - " + MWGui::ToolTips::toString(static_cast<int>(ref->base->mData.mChop[1]));
|
||||
+ MWGui::ToolTips::toString(static_cast<int>(ref->mBase->mData.mChop[0]))
|
||||
+ " - " + MWGui::ToolTips::toString(static_cast<int>(ref->mBase->mData.mChop[1]));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Chop
|
||||
text += "\n#{sChop}: "
|
||||
+ MWGui::ToolTips::toString(static_cast<int>(ref->base->mData.mChop[0]))
|
||||
+ " - " + MWGui::ToolTips::toString(static_cast<int>(ref->base->mData.mChop[1]));
|
||||
+ MWGui::ToolTips::toString(static_cast<int>(ref->mBase->mData.mChop[0]))
|
||||
+ " - " + MWGui::ToolTips::toString(static_cast<int>(ref->mBase->mData.mChop[1]));
|
||||
// Slash
|
||||
text += "\n#{sSlash}: "
|
||||
+ MWGui::ToolTips::toString(static_cast<int>(ref->base->mData.mSlash[0]))
|
||||
+ " - " + MWGui::ToolTips::toString(static_cast<int>(ref->base->mData.mSlash[1]));
|
||||
+ MWGui::ToolTips::toString(static_cast<int>(ref->mBase->mData.mSlash[0]))
|
||||
+ " - " + MWGui::ToolTips::toString(static_cast<int>(ref->mBase->mData.mSlash[1]));
|
||||
// Thrust
|
||||
text += "\n#{sThrust}: "
|
||||
+ MWGui::ToolTips::toString(static_cast<int>(ref->base->mData.mThrust[0]))
|
||||
+ " - " + MWGui::ToolTips::toString(static_cast<int>(ref->base->mData.mThrust[1]));
|
||||
+ MWGui::ToolTips::toString(static_cast<int>(ref->mBase->mData.mThrust[0]))
|
||||
+ " - " + MWGui::ToolTips::toString(static_cast<int>(ref->mBase->mData.mThrust[1]));
|
||||
}
|
||||
}
|
||||
|
||||
/// \todo store the current weapon health somewhere
|
||||
if (ref->base->mData.mType < 11) // thrown weapons and arrows/bolts don't have health, only quantity
|
||||
text += "\n#{sCondition}: " + MWGui::ToolTips::toString(ref->base->mData.mHealth);
|
||||
if (ref->mBase->mData.mType < 11) // thrown weapons and arrows/bolts don't have health, only quantity
|
||||
text += "\n#{sCondition}: " + MWGui::ToolTips::toString(ref->mBase->mData.mHealth);
|
||||
|
||||
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->base->mData.mWeight);
|
||||
text += MWGui::ToolTips::getValueString(ref->base->mData.mValue, "#{sValue}");
|
||||
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->mBase->mData.mWeight);
|
||||
text += MWGui::ToolTips::getValueString(ref->mBase->mData.mValue, "#{sValue}");
|
||||
|
||||
info.enchant = ref->base->mEnchant;
|
||||
info.enchant = ref->mBase->mEnchant;
|
||||
|
||||
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
|
||||
text += MWGui::ToolTips::getMiscString(ref->ref.mOwner, "Owner");
|
||||
text += MWGui::ToolTips::getMiscString(ref->base->mScript, "Script");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mRef.mOwner, "Owner");
|
||||
text += MWGui::ToolTips::getMiscString(ref->mBase->mScript, "Script");
|
||||
}
|
||||
|
||||
info.text = text;
|
||||
|
@ -354,7 +354,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
|
||||
return ref->base->mEnchant;
|
||||
return ref->mBase->mEnchant;
|
||||
}
|
||||
|
||||
boost::shared_ptr<MWWorld::Action> Weapon::use (const MWWorld::Ptr& ptr) const
|
||||
|
@ -372,6 +372,6 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
|
||||
return MWWorld::Ptr(&cell.weapons.insert(*ref), &cell);
|
||||
return MWWorld::Ptr(&cell.mWeapons.insert(*ref), &cell);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
|
||||
#include <components/esm/loaddial.hpp>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
#include "../mwbase/scriptmanager.hpp"
|
||||
|
@ -19,6 +17,7 @@
|
|||
#include "../mwworld/refdata.hpp"
|
||||
#include "../mwworld/player.hpp"
|
||||
#include "../mwworld/containerstore.hpp"
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "../mwgui/dialogue.hpp"
|
||||
|
||||
|
@ -84,14 +83,15 @@ namespace
|
|||
|
||||
template<typename T>
|
||||
bool checkLocal (char comp, const std::string& name, T value, const MWWorld::Ptr& actor,
|
||||
const ESMS::ESMStore& store)
|
||||
const MWWorld::ESMStore& store)
|
||||
{
|
||||
std::string scriptName = MWWorld::Class::get (actor).getScript (actor);
|
||||
|
||||
if (scriptName.empty())
|
||||
return false; // no script
|
||||
|
||||
const ESM::Script *script = store.scripts.find (scriptName);
|
||||
const ESM::Script *script =
|
||||
store.get<ESM::Script>().find (scriptName);
|
||||
|
||||
int i = 0;
|
||||
|
||||
|
@ -391,7 +391,7 @@ namespace MWDialogue
|
|||
if(select.mType==ESM::VT_Int)
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::NPC>* npc = actor.get<ESM::NPC>();
|
||||
int isFaction = int(toLower(npc->base->mFaction) == toLower(name));
|
||||
int isFaction = int(toLower(npc->mBase->mFaction) == toLower(name));
|
||||
if(selectCompare<int,int>(comp,!isFaction,select.mI))
|
||||
return false;
|
||||
}
|
||||
|
@ -408,7 +408,7 @@ namespace MWDialogue
|
|||
if(select.mType==ESM::VT_Int)
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::NPC>* npc = actor.get<ESM::NPC>();
|
||||
int isClass = int(toLower(npc->base->mClass) == toLower(name));
|
||||
int isClass = int(toLower(npc->mBase->mClass) == toLower(name));
|
||||
if(selectCompare<int,int>(comp,!isClass,select.mI))
|
||||
return false;
|
||||
}
|
||||
|
@ -425,7 +425,7 @@ namespace MWDialogue
|
|||
if(select.mType==ESM::VT_Int)
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::NPC>* npc = actor.get<ESM::NPC>();
|
||||
int isRace = int(toLower(npc->base->mRace) == toLower(name));
|
||||
int isRace = int(toLower(npc->mBase->mRace) == toLower(name));
|
||||
if(selectCompare<int,int>(comp,!isRace,select.mI))
|
||||
return false;
|
||||
}
|
||||
|
@ -438,7 +438,7 @@ namespace MWDialogue
|
|||
case 'B'://not Cell
|
||||
if(select.mType==ESM::VT_Int)
|
||||
{
|
||||
int isCell = int(toLower(actor.getCell()->cell->mName) == toLower(name));
|
||||
int isCell = int(toLower(actor.getCell()->mCell->mName) == toLower(name));
|
||||
if(selectCompare<int,int>(comp,!isCell,select.mI))
|
||||
return false;
|
||||
}
|
||||
|
@ -496,7 +496,7 @@ namespace MWDialogue
|
|||
if (!cellRef)
|
||||
return false;
|
||||
|
||||
if (toLower (info.mRace)!=toLower (cellRef->base->mRace))
|
||||
if (toLower (info.mRace)!=toLower (cellRef->mBase->mRace))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -511,7 +511,7 @@ namespace MWDialogue
|
|||
if (!cellRef)
|
||||
return false;
|
||||
|
||||
if (toLower (info.mClass)!=toLower (cellRef->base->mClass))
|
||||
if (toLower (info.mClass)!=toLower (cellRef->mBase->mClass))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -557,7 +557,7 @@ namespace MWDialogue
|
|||
if (!isCreature)
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::NPC>* npc = actor.get<ESM::NPC>();
|
||||
if(npc->base->mFlags & npc->base->Female)
|
||||
if(npc->mBase->mFlags & npc->mBase->Female)
|
||||
{
|
||||
if(static_cast<int> (info.mData.mGender)==0) return false;
|
||||
}
|
||||
|
@ -569,7 +569,7 @@ namespace MWDialogue
|
|||
|
||||
// check cell
|
||||
if (!info.mCell.empty())
|
||||
if (MWBase::Environment::get().getWorld()->getPlayer().getPlayer().getCell()->cell->mName != info.mCell)
|
||||
if (MWBase::Environment::get().getWorld()->getPlayer().getPlayer().getCell()->mCell->mName != info.mCell)
|
||||
return false;
|
||||
|
||||
// TODO check DATAstruct
|
||||
|
@ -590,10 +590,14 @@ namespace MWDialogue
|
|||
mCompilerContext.setExtensions (&extensions);
|
||||
mDialogueMap.clear();
|
||||
mActorKnownTopics.clear();
|
||||
ESMS::RecListCaseT<ESM::Dialogue>::MapType dialogueList = MWBase::Environment::get().getWorld()->getStore().dialogs.list;
|
||||
for(ESMS::RecListCaseT<ESM::Dialogue>::MapType::iterator it = dialogueList.begin(); it!=dialogueList.end();it++)
|
||||
|
||||
const MWWorld::Store<ESM::Dialogue> &dialogs =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Dialogue>();
|
||||
|
||||
MWWorld::Store<ESM::Dialogue>::iterator it = dialogs.begin();
|
||||
for (; it != dialogs.end(); ++it)
|
||||
{
|
||||
mDialogueMap[toLower(it->first)] = it->second;
|
||||
mDialogueMap[toLower(it->mId)] = *it;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -642,16 +646,17 @@ namespace MWDialogue
|
|||
|
||||
//greeting
|
||||
bool greetingFound = false;
|
||||
//ESMS::RecListT<ESM::Dialogue>::MapType dialogueList = MWBase::Environment::get().getWorld()->getStore().dialogs.list;
|
||||
ESMS::RecListCaseT<ESM::Dialogue>::MapType dialogueList = MWBase::Environment::get().getWorld()->getStore().dialogs.list;
|
||||
for(ESMS::RecListCaseT<ESM::Dialogue>::MapType::iterator it = dialogueList.begin(); it!=dialogueList.end();it++)
|
||||
const MWWorld::Store<ESM::Dialogue> &dialogs =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Dialogue>();
|
||||
|
||||
MWWorld::Store<ESM::Dialogue>::iterator it = dialogs.begin();
|
||||
for (; it != dialogs.end(); ++it)
|
||||
{
|
||||
ESM::Dialogue ndialogue = it->second;
|
||||
if(ndialogue.mType == ESM::Dialogue::Greeting)
|
||||
if(it->mType == ESM::Dialogue::Greeting)
|
||||
{
|
||||
if (greetingFound) break;
|
||||
for (std::vector<ESM::DialInfo>::const_iterator iter (it->second.mInfo.begin());
|
||||
iter!=it->second.mInfo.end(); ++iter)
|
||||
for (std::vector<ESM::DialInfo>::const_iterator iter (it->mInfo.begin());
|
||||
iter!=it->mInfo.end(); ++iter)
|
||||
{
|
||||
if (isMatching (actor, *iter) && functionFilter(mActor,*iter,true))
|
||||
{
|
||||
|
@ -665,7 +670,7 @@ namespace MWDialogue
|
|||
win->addText(iter->mResponse);
|
||||
executeScript(iter->mResultScript);
|
||||
greetingFound = true;
|
||||
mLastTopic = it->first;
|
||||
mLastTopic = it->mId;
|
||||
mLastDialogue = *iter;
|
||||
break;
|
||||
}
|
||||
|
@ -742,22 +747,26 @@ namespace MWDialogue
|
|||
mChoice = -1;
|
||||
mActorKnownTopics.clear();
|
||||
MWGui::DialogueWindow* win = MWBase::Environment::get().getWindowManager()->getDialogueWindow();
|
||||
ESMS::RecListCaseT<ESM::Dialogue>::MapType dialogueList = MWBase::Environment::get().getWorld()->getStore().dialogs.list;
|
||||
for(ESMS::RecListCaseT<ESM::Dialogue>::MapType::iterator it = dialogueList.begin(); it!=dialogueList.end();it++)
|
||||
|
||||
const MWWorld::Store<ESM::Dialogue> &dialogs =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Dialogue>();
|
||||
|
||||
|
||||
MWWorld::Store<ESM::Dialogue>::iterator it = dialogs.begin();
|
||||
for (; it != dialogs.end(); ++it)
|
||||
{
|
||||
ESM::Dialogue ndialogue = it->second;
|
||||
if(ndialogue.mType == ESM::Dialogue::Topic)
|
||||
if(it->mType == ESM::Dialogue::Topic)
|
||||
{
|
||||
for (std::vector<ESM::DialInfo>::const_iterator iter (it->second.mInfo.begin());
|
||||
iter!=it->second.mInfo.end(); ++iter)
|
||||
for (std::vector<ESM::DialInfo>::const_iterator iter (it->mInfo.begin());
|
||||
iter!=it->mInfo.end(); ++iter)
|
||||
{
|
||||
if (isMatching (mActor, *iter) && functionFilter(mActor,*iter,true))
|
||||
{
|
||||
mActorKnownTopics.push_back(toLower(it->first));
|
||||
mActorKnownTopics.push_back(toLower(it->mId));
|
||||
//does the player know the topic?
|
||||
if(mKnownTopics.find(toLower(it->first)) != mKnownTopics.end())
|
||||
if(mKnownTopics.find(toLower(it->mId)) != mKnownTopics.end())
|
||||
{
|
||||
keywordList.push_back(it->first);
|
||||
keywordList.push_back(it->mId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -770,14 +779,14 @@ namespace MWDialogue
|
|||
if (mActor.getTypeName() == typeid(ESM::NPC).name())
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::NPC>* ref = mActor.get<ESM::NPC>();
|
||||
if (ref->base->mHasAI)
|
||||
services = ref->base->mAiData.mServices;
|
||||
if (ref->mBase->mHasAI)
|
||||
services = ref->mBase->mAiData.mServices;
|
||||
}
|
||||
else if (mActor.getTypeName() == typeid(ESM::Creature).name())
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Creature>* ref = mActor.get<ESM::Creature>();
|
||||
if (ref->base->mHasAI)
|
||||
services = ref->base->mAiData.mServices;
|
||||
if (ref->mBase->mHasAI)
|
||||
services = ref->mBase->mAiData.mServices;
|
||||
}
|
||||
|
||||
int windowServices = 0;
|
||||
|
@ -795,7 +804,7 @@ namespace MWDialogue
|
|||
|| services & ESM::NPC::Misc)
|
||||
windowServices |= MWGui::DialogueWindow::Service_Trade;
|
||||
|
||||
if( !mActor.get<ESM::NPC>()->base->mTransport.empty())
|
||||
if( !mActor.get<ESM::NPC>()->mBase->mTransport.empty())
|
||||
windowServices |= MWGui::DialogueWindow::Service_Travel;
|
||||
|
||||
if (services & ESM::NPC::Spells)
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
|
||||
#include <stdexcept>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
namespace MWDialogue
|
||||
{
|
||||
JournalEntry::JournalEntry() {}
|
||||
|
@ -16,9 +16,10 @@ namespace MWDialogue
|
|||
: mTopic (topic), mInfoId (infoId)
|
||||
{}
|
||||
|
||||
std::string JournalEntry::getText (const ESMS::ESMStore& store) const
|
||||
std::string JournalEntry::getText (const MWWorld::ESMStore& store) const
|
||||
{
|
||||
const ESM::Dialogue *dialogue = store.dialogs.find (mTopic);
|
||||
const ESM::Dialogue *dialogue =
|
||||
store.get<ESM::Dialogue>().find (mTopic);
|
||||
|
||||
for (std::vector<ESM::DialInfo>::const_iterator iter (dialogue->mInfo.begin());
|
||||
iter!=dialogue->mInfo.end(); ++iter)
|
||||
|
@ -35,7 +36,8 @@ namespace MWDialogue
|
|||
|
||||
std::string JournalEntry::idFromIndex (const std::string& topic, int index)
|
||||
{
|
||||
const ESM::Dialogue *dialogue = MWBase::Environment::get().getWorld()->getStore().dialogs.find (topic);
|
||||
const ESM::Dialogue *dialogue =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Dialogue>().find (topic);
|
||||
|
||||
for (std::vector<ESM::DialInfo>::const_iterator iter (dialogue->mInfo.begin());
|
||||
iter!=dialogue->mInfo.end(); ++iter)
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
namespace ESMS
|
||||
namespace MWWorld
|
||||
{
|
||||
struct ESMStore;
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace MWDialogue
|
|||
|
||||
JournalEntry (const std::string& topic, const std::string& infoId);
|
||||
|
||||
std::string getText (const ESMS::ESMStore& store) const;
|
||||
std::string getText (const MWWorld::ESMStore& store) const;
|
||||
|
||||
static JournalEntry makeFromQuest (const std::string& topic, int index);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
#include "journalimp.hpp"
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
#include "quest.hpp"
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
@ -18,7 +18,8 @@ namespace MWDialogue
|
|||
|
||||
const std::string Quest::getName() const
|
||||
{
|
||||
const ESM::Dialogue *dialogue = MWBase::Environment::get().getWorld()->getStore().dialogs.find (mTopic);
|
||||
const ESM::Dialogue *dialogue =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Dialogue>().find (mTopic);
|
||||
|
||||
for (std::vector<ESM::DialInfo>::const_iterator iter (dialogue->mInfo.begin());
|
||||
iter!=dialogue->mInfo.end(); ++iter)
|
||||
|
@ -35,7 +36,8 @@ namespace MWDialogue
|
|||
|
||||
void Quest::setIndex (int index)
|
||||
{
|
||||
const ESM::Dialogue *dialogue = MWBase::Environment::get().getWorld()->getStore().dialogs.find (mTopic);
|
||||
const ESM::Dialogue *dialogue =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Dialogue>().find (mTopic);
|
||||
|
||||
for (std::vector<ESM::DialInfo>::const_iterator iter (dialogue->mInfo.begin());
|
||||
iter!=dialogue->mInfo.end(); ++iter)
|
||||
|
@ -63,7 +65,8 @@ namespace MWDialogue
|
|||
{
|
||||
int index = -1;
|
||||
|
||||
const ESM::Dialogue *dialogue = MWBase::Environment::get().getWorld()->getStore().dialogs.find (entry.mTopic);
|
||||
const ESM::Dialogue *dialogue =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Dialogue>().find (entry.mTopic);
|
||||
|
||||
for (std::vector<ESM::DialInfo>::const_iterator iter (dialogue->mInfo.begin());
|
||||
iter!=dialogue->mInfo.end(); ++iter)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
#include "topic.hpp"
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
namespace MWDialogue
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include "components/esm_store/store.hpp"
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
@ -130,19 +130,18 @@ void BirthDialog::updateBirths()
|
|||
{
|
||||
mBirthList->removeAllItems();
|
||||
|
||||
const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const MWWorld::Store<ESM::BirthSign> &signs =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::BirthSign>();
|
||||
|
||||
ESMS::RecListT<ESM::BirthSign>::MapType::const_iterator it = store.birthSigns.list.begin();
|
||||
ESMS::RecListT<ESM::BirthSign>::MapType::const_iterator end = store.birthSigns.list.end();
|
||||
int index = 0;
|
||||
|
||||
// sort by name
|
||||
std::vector < std::pair<std::string, const ESM::BirthSign*> > birthSigns;
|
||||
for (; it!=end; ++it)
|
||||
|
||||
MWWorld::Store<ESM::BirthSign>::iterator it = signs.begin();
|
||||
for (; it != signs.end(); ++it)
|
||||
{
|
||||
std::string id = it->first;
|
||||
const ESM::BirthSign* sign = &it->second;
|
||||
birthSigns.push_back(std::make_pair(id, sign));
|
||||
birthSigns.push_back(std::make_pair(it->mId, &(*it)));
|
||||
}
|
||||
std::sort(birthSigns.begin(), birthSigns.end(), sortBirthSigns);
|
||||
|
||||
|
@ -170,8 +169,11 @@ void BirthDialog::updateSpells()
|
|||
const int lineHeight = 18;
|
||||
MyGUI::IntCoord coord(0, 0, mSpellArea->getWidth(), 18);
|
||||
|
||||
const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const ESM::BirthSign *birth = store.birthSigns.find(mCurrentBirthId);
|
||||
const MWWorld::ESMStore &store =
|
||||
MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
const ESM::BirthSign *birth =
|
||||
store.get<ESM::BirthSign>().find(mCurrentBirthId);
|
||||
|
||||
std::string texturePath = std::string("textures\\") + birth->mTexture;
|
||||
fixTexturePath(texturePath);
|
||||
|
@ -184,7 +186,7 @@ void BirthDialog::updateSpells()
|
|||
for (; it != end; ++it)
|
||||
{
|
||||
const std::string &spellId = *it;
|
||||
const ESM::Spell *spell = store.spells.search(spellId);
|
||||
const ESM::Spell *spell = store.get<ESM::Spell>().search(spellId);
|
||||
if (!spell)
|
||||
continue; // Skip spells which cannot be found
|
||||
ESM::Spell::SpellType type = static_cast<ESM::Spell::SpellType>(spell->mData.mType);
|
||||
|
@ -200,11 +202,17 @@ void BirthDialog::updateSpells()
|
|||
}
|
||||
|
||||
int i = 0;
|
||||
struct{ const std::vector<std::string> &spells; const char *label; } categories[3] = {
|
||||
|
||||
struct {
|
||||
const std::vector<std::string> &spells;
|
||||
const char *label;
|
||||
}
|
||||
categories[3] = {
|
||||
{abilities, "sBirthsignmenu1"},
|
||||
{powers, "sPowers"},
|
||||
{spells, "sBirthsignmenu2"}
|
||||
};
|
||||
|
||||
for (int category = 0; category < 3; ++category)
|
||||
{
|
||||
if (!categories[category].spells.empty())
|
||||
|
|
|
@ -60,7 +60,7 @@ void BookWindow::open (MWWorld::Ptr book)
|
|||
MWWorld::LiveCellRef<ESM::Book> *ref = mBook.get<ESM::Book>();
|
||||
|
||||
BookTextParser parser;
|
||||
std::vector<std::string> results = parser.split(ref->base->mText, mLeftPage->getSize().width, mLeftPage->getSize().height);
|
||||
std::vector<std::string> results = parser.split(ref->mBase->mText, mLeftPage->getSize().width, mLeftPage->getSize().height);
|
||||
|
||||
int i=0;
|
||||
for (std::vector<std::string>::iterator it=results.begin();
|
||||
|
|
|
@ -357,7 +357,9 @@ void CharacterCreation::onPickClassDialogDone(WindowBase* parWindow)
|
|||
const std::string &classId = mPickClassDialog->getClassId();
|
||||
if (!classId.empty())
|
||||
MWBase::Environment::get().getMechanicsManager()->setPlayerClass(classId);
|
||||
const ESM::Class *klass = MWBase::Environment::get().getWorld()->getStore().classes.find(classId);
|
||||
|
||||
const ESM::Class *klass =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Class>().find(classId);
|
||||
if (klass)
|
||||
{
|
||||
mPlayerClass = *klass;
|
||||
|
@ -729,7 +731,10 @@ void CharacterCreation::onGenerateClassDone(WindowBase* parWindow)
|
|||
mGenerateClassResultDialog = 0;
|
||||
|
||||
MWBase::Environment::get().getMechanicsManager()->setPlayerClass(mGenerateClass);
|
||||
const ESM::Class *klass = MWBase::Environment::get().getWorld()->getStore().classes.find(mGenerateClass);
|
||||
|
||||
const ESM::Class *klass =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Class>().find(mGenerateClass);
|
||||
|
||||
mPlayerClass = *klass;
|
||||
mWM->setPlayerClass(mPlayerClass);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef CHARACTER_CREATION_HPP
|
||||
#define CHARACTER_CREATION_HPP
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "../mwbase/world.hpp"
|
||||
#include "../mwbase/windowmanager.hpp"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
@ -50,7 +50,7 @@ void GenerateClassResultDialog::setClassId(const std::string &classId)
|
|||
{
|
||||
mCurrentClassId = classId;
|
||||
mClassImage->setImageTexture(std::string("textures\\levelup\\") + mCurrentClassId + ".dds");
|
||||
mClassName->setCaption(MWBase::Environment::get().getWorld()->getStore().classes.find(mCurrentClassId)->mName);
|
||||
mClassName->setCaption(MWBase::Environment::get().getWorld()->getStore().get<ESM::Class>().find(mCurrentClassId)->mName);
|
||||
}
|
||||
|
||||
// widget controls
|
||||
|
@ -185,20 +185,18 @@ void PickClassDialog::updateClasses()
|
|||
{
|
||||
mClassList->removeAllItems();
|
||||
|
||||
const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
ESMS::RecListT<ESM::Class>::MapType::const_iterator it = store.classes.list.begin();
|
||||
ESMS::RecListT<ESM::Class>::MapType::const_iterator end = store.classes.list.end();
|
||||
int index = 0;
|
||||
for (; it != end; ++it)
|
||||
MWWorld::Store<ESM::Class>::iterator it = store.get<ESM::Class>().begin();
|
||||
for (; it != store.get<ESM::Class>().end(); ++it)
|
||||
{
|
||||
const ESM::Class &klass = it->second;
|
||||
bool playable = (klass.mData.mIsPlayable != 0);
|
||||
bool playable = (it->mData.mIsPlayable != 0);
|
||||
if (!playable) // Only display playable classes
|
||||
continue;
|
||||
|
||||
const std::string &id = it->first;
|
||||
mClassList->addItem(klass.mName, id);
|
||||
const std::string &id = it->mId;
|
||||
mClassList->addItem(it->mName, id);
|
||||
if (boost::iequals(id, mCurrentClassId))
|
||||
mClassList->setIndexSelected(index);
|
||||
++index;
|
||||
|
@ -209,8 +207,8 @@ void PickClassDialog::updateStats()
|
|||
{
|
||||
if (mCurrentClassId.empty())
|
||||
return;
|
||||
const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const ESM::Class *klass = store.classes.search(mCurrentClassId);
|
||||
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const ESM::Class *klass = store.get<ESM::Class>().search(mCurrentClassId);
|
||||
if (!klass)
|
||||
return;
|
||||
|
||||
|
|
|
@ -4,11 +4,10 @@
|
|||
#include <algorithm>
|
||||
#include <fstream>
|
||||
|
||||
#include <components/esm_store/reclists.hpp>
|
||||
#include <components/esm_store/store.hpp>
|
||||
|
||||
#include <components/compiler/exception.hpp>
|
||||
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "../mwscript/extensions.hpp"
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
|
@ -93,12 +92,12 @@ namespace MWGui
|
|||
scanner.listKeywords (mNames);
|
||||
|
||||
// identifier
|
||||
const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const MWWorld::ESMStore& store =
|
||||
MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
for (ESMS::RecListList::const_iterator iter (store.recLists.begin());
|
||||
iter!=store.recLists.end(); ++iter)
|
||||
for (MWWorld::ESMStore::iterator it = store.begin(); it != store.end(); ++it)
|
||||
{
|
||||
iter->second->listIdentifier (mNames);
|
||||
it->second->listIdentifier (mNames);
|
||||
}
|
||||
|
||||
// sort
|
||||
|
|
|
@ -127,10 +127,13 @@ void ContainerBase::onSelectedItem(MyGUI::Widget* _sender)
|
|||
|
||||
if (isInventory())
|
||||
{
|
||||
const MWWorld::Store<ESM::GameSetting> &gmst =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
||||
|
||||
// the player is trying to sell an item, check if the merchant accepts it
|
||||
// also, don't allow selling gold (let's be better than Morrowind at this, can we?)
|
||||
if (!MWBase::Environment::get().getWindowManager()->getTradeWindow()->npcAcceptsItem(object) ||
|
||||
MWWorld::Class::get(object).getName(object) == MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sGold")->getString())
|
||||
MWWorld::Class::get(object).getName(object) == gmst.find("sGold")->getString())
|
||||
{
|
||||
// user notification "i don't buy this item"
|
||||
MWBase::Environment::get().getWindowManager()->
|
||||
|
@ -274,7 +277,7 @@ void ContainerBase::onContainerClicked(MyGUI::Widget* _sender)
|
|||
if (mPtr.getTypeName() == typeid(ESM::Container).name())
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Container>* ref = mPtr.get<ESM::Container>();
|
||||
if (ref->base->mFlags & ESM::Container::Organic)
|
||||
if (ref->mBase->mFlags & ESM::Container::Organic)
|
||||
{
|
||||
// user notification
|
||||
MWBase::Environment::get().getWindowManager()->
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef MGUI_CONTAINER_H
|
||||
#define MGUI_CONTAINER_H
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "window_base.hpp"
|
||||
#include "referenceinterface.hpp"
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/dialoguemanager.hpp"
|
||||
|
@ -127,33 +127,36 @@ void DialogueWindow::onSelectTopic(std::string topic)
|
|||
{
|
||||
if (!mEnabled) return;
|
||||
|
||||
if (topic == MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sBarter")->getString())
|
||||
const MWWorld::Store<ESM::GameSetting> &gmst =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
||||
|
||||
if (topic == gmst.find("sBarter")->getString())
|
||||
{
|
||||
/// \todo check if the player is allowed to trade with this actor (e.g. faction rank high enough)?
|
||||
mWindowManager.pushGuiMode(GM_Barter);
|
||||
mWindowManager.getTradeWindow()->startTrade(mPtr);
|
||||
}
|
||||
else if (topic == MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sSpells")->getString())
|
||||
else if (topic == gmst.find("sSpells")->getString())
|
||||
{
|
||||
mWindowManager.pushGuiMode(GM_SpellBuying);
|
||||
mWindowManager.getSpellBuyingWindow()->startSpellBuying(mPtr);
|
||||
}
|
||||
else if (topic == MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sTravel")->getString())
|
||||
else if (topic == gmst.find("sTravel")->getString())
|
||||
{
|
||||
mWindowManager.pushGuiMode(GM_Travel);
|
||||
mWindowManager.getTravelWindow()->startTravel(mPtr);
|
||||
}
|
||||
else if (topic == MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sSpellMakingMenuTitle")->getString())
|
||||
else if (topic == gmst.find("sSpellMakingMenuTitle")->getString())
|
||||
{
|
||||
mWindowManager.pushGuiMode(GM_SpellCreation);
|
||||
mWindowManager.startSpellMaking (mPtr);
|
||||
}
|
||||
else if (topic == MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sEnchanting")->getString())
|
||||
else if (topic == gmst.find("sEnchanting")->getString())
|
||||
{
|
||||
mWindowManager.pushGuiMode(GM_Enchanting);
|
||||
mWindowManager.startEnchanting (mPtr);
|
||||
}
|
||||
else if (topic == MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sServiceTrainingTitle")->getString())
|
||||
else if (topic == gmst.find("sServiceTrainingTitle")->getString())
|
||||
{
|
||||
mWindowManager.pushGuiMode(GM_Training);
|
||||
mWindowManager.startTraining (mPtr);
|
||||
|
@ -180,23 +183,26 @@ void DialogueWindow::setKeywords(std::list<std::string> keyWords)
|
|||
|
||||
bool anyService = mServices > 0;
|
||||
|
||||
const MWWorld::Store<ESM::GameSetting> &gmst =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
||||
|
||||
if (mServices & Service_Trade)
|
||||
mTopicsList->addItem(MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sBarter")->getString());
|
||||
mTopicsList->addItem(gmst.find("sBarter")->getString());
|
||||
|
||||
if (mServices & Service_BuySpells)
|
||||
mTopicsList->addItem(MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sSpells")->getString());
|
||||
mTopicsList->addItem(gmst.find("sSpells")->getString());
|
||||
|
||||
if (mServices & Service_Travel)
|
||||
mTopicsList->addItem(MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sTravel")->getString());
|
||||
mTopicsList->addItem(gmst.find("sTravel")->getString());
|
||||
|
||||
if (mServices & Service_CreateSpells)
|
||||
mTopicsList->addItem(MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sSpellmakingMenuTitle")->getString());
|
||||
mTopicsList->addItem(gmst.find("sSpellmakingMenuTitle")->getString());
|
||||
|
||||
// if (mServices & Service_Enchant)
|
||||
// mTopicsList->addItem(MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sEnchanting")->getString());
|
||||
// mTopicsList->addItem(gmst.find("sEnchanting")->getString());
|
||||
|
||||
if (mServices & Service_Training)
|
||||
mTopicsList->addItem(MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sServiceTrainingTitle")->getString());
|
||||
mTopicsList->addItem(gmst.find("sServiceTrainingTitle")->getString());
|
||||
|
||||
if (anyService)
|
||||
mTopicsList->addSeparator();
|
||||
|
@ -301,7 +307,7 @@ void DialogueWindow::updateOptions()
|
|||
|
||||
void DialogueWindow::goodbye()
|
||||
{
|
||||
mHistory->addDialogText("\n#572D21" + MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sGoodbye")->getString());
|
||||
mHistory->addDialogText("\n#572D21" + MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sGoodbye")->getString());
|
||||
mTopicsList->setEnabled(false);
|
||||
mEnabled = false;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
#include "../mwbase/windowmanager.hpp"
|
||||
|
||||
#include "widgets.hpp"
|
||||
#include "components/esm_store/store.hpp"
|
||||
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <iterator>
|
||||
|
|
|
@ -341,7 +341,9 @@ void HUD::onResChange(int width, int height)
|
|||
|
||||
void HUD::setSelectedSpell(const std::string& spellId, int successChancePercent)
|
||||
{
|
||||
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find(spellId);
|
||||
const ESM::Spell* spell =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find(spellId);
|
||||
|
||||
std::string spellName = spell->mName;
|
||||
if (spellName != mSpellName && mSpellVisible)
|
||||
{
|
||||
|
@ -361,7 +363,9 @@ void HUD::setSelectedSpell(const std::string& spellId, int successChancePercent)
|
|||
mSpellBox->setUserString("Spell", spellId);
|
||||
|
||||
// use the icon of the first effect
|
||||
const ESM::MagicEffect* effect = MWBase::Environment::get().getWorld()->getStore().magicEffects.find(spell->mEffects.mList.front().mEffectID);
|
||||
const ESM::MagicEffect* effect =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::MagicEffect>().find(spell->mEffects.mList.front().mEffectID);
|
||||
|
||||
std::string icon = effect->mIcon;
|
||||
int slashPos = icon.find("\\");
|
||||
icon.insert(slashPos+1, "b_");
|
||||
|
|
|
@ -8,14 +8,12 @@
|
|||
|
||||
#include "../mwworld/player.hpp"
|
||||
#include "../mwworld/class.hpp"
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "../mwmechanics/creaturestats.hpp"
|
||||
#include "../mwmechanics/npcstats.hpp"
|
||||
#include "../mwmechanics/stat.hpp"
|
||||
|
||||
#include <components/esm_store/reclists.hpp>
|
||||
#include <components/esm_store/store.hpp>
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
|
||||
|
@ -125,11 +123,14 @@ namespace MWGui
|
|||
const ESM::Class& playerClass = MWBase::Environment::get().getWorld ()->getPlayer ().getClass ();
|
||||
// retrieve the ID to this class
|
||||
std::string classId;
|
||||
std::map<std::string, ESM::Class> list = MWBase::Environment::get().getWorld()->getStore ().classes.list;
|
||||
for (std::map<std::string, ESM::Class>::iterator it = list.begin(); it != list.end(); ++it)
|
||||
const MWWorld::Store<ESM::Class> &classes =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Class>();
|
||||
|
||||
MWWorld::Store<ESM::Class>::iterator it = classes.begin();
|
||||
for (; it != classes.end(); ++it)
|
||||
{
|
||||
if (playerClass.mName == it->second.mName)
|
||||
classId = it->first;
|
||||
if (playerClass.mName == it->mName)
|
||||
classId = it->mId;
|
||||
}
|
||||
mClassImage->setImageTexture ("textures\\levelup\\" + classId + ".dds");
|
||||
|
||||
|
|
|
@ -29,8 +29,11 @@ namespace
|
|||
|
||||
bool sortSpells(const std::string& left, const std::string& right)
|
||||
{
|
||||
const ESM::Spell* a = MWBase::Environment::get().getWorld()->getStore().spells.find(left);
|
||||
const ESM::Spell* b = MWBase::Environment::get().getWorld()->getStore().spells.find(right);
|
||||
const MWWorld::Store<ESM::Spell> &spells =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>();
|
||||
|
||||
const ESM::Spell* a = spells.find(left);
|
||||
const ESM::Spell* b = spells.find(right);
|
||||
|
||||
int cmp = a->mName.compare(b->mName);
|
||||
return cmp < 0;
|
||||
|
@ -234,9 +237,15 @@ namespace MWGui
|
|||
|
||||
MyGUI::ImageBox* image = frame->createWidget<MyGUI::ImageBox>("ImageBox", MyGUI::IntCoord(5, 5, 32, 32), MyGUI::Align::Default);
|
||||
|
||||
const MWWorld::ESMStore &esmStore =
|
||||
MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
// use the icon of the first effect
|
||||
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find(spellId);
|
||||
const ESM::MagicEffect* effect = MWBase::Environment::get().getWorld()->getStore().magicEffects.find(spell->mEffects.mList.front().mEffectID);
|
||||
const ESM::Spell* spell = esmStore.get<ESM::Spell>().find(spellId);
|
||||
|
||||
const ESM::MagicEffect* effect =
|
||||
esmStore.get<ESM::MagicEffect>().find(spell->mEffects.mList.front().mEffectID);
|
||||
|
||||
std::string path = effect->mIcon;
|
||||
int slashPos = path.find("\\");
|
||||
path.insert(slashPos+1, "b_");
|
||||
|
@ -434,11 +443,14 @@ namespace MWGui
|
|||
spellList.push_back(*it);
|
||||
}
|
||||
|
||||
const MWWorld::ESMStore &esmStore =
|
||||
MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
std::vector<std::string> powers;
|
||||
std::vector<std::string>::iterator it = spellList.begin();
|
||||
while (it != spellList.end())
|
||||
{
|
||||
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find(*it);
|
||||
const ESM::Spell* spell = esmStore.get<ESM::Spell>().find(*it);
|
||||
if (spell->mData.mType == ESM::Spell::ST_Power)
|
||||
{
|
||||
powers.push_back(*it);
|
||||
|
@ -465,7 +477,9 @@ namespace MWGui
|
|||
if (enchantId != "")
|
||||
{
|
||||
// only add items with "Cast once" or "Cast on use"
|
||||
const ESM::Enchantment* enchant = MWBase::Environment::get().getWorld()->getStore().enchants.find(enchantId);
|
||||
const ESM::Enchantment* enchant =
|
||||
esmStore.get<ESM::Enchantment>().find(enchantId);
|
||||
|
||||
int type = enchant->mData.mType;
|
||||
if (type != ESM::Enchantment::CastOnce
|
||||
&& type != ESM::Enchantment::WhenUsed)
|
||||
|
@ -487,7 +501,7 @@ namespace MWGui
|
|||
|
||||
for (std::vector<std::string>::const_iterator it = powers.begin(); it != powers.end(); ++it)
|
||||
{
|
||||
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find(*it);
|
||||
const ESM::Spell* spell = esmStore.get<ESM::Spell>().find(*it);
|
||||
MyGUI::Button* t = mMagicList->createWidget<MyGUI::Button>("SpellText",
|
||||
MyGUI::IntCoord(4, mHeight, mWidth-8, spellHeight), MyGUI::Align::Left | MyGUI::Align::Top);
|
||||
t->setCaption(spell->mName);
|
||||
|
@ -504,7 +518,7 @@ namespace MWGui
|
|||
addGroup("#{sSpells}", "");
|
||||
for (std::vector<std::string>::const_iterator it = spellList.begin(); it != spellList.end(); ++it)
|
||||
{
|
||||
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find(*it);
|
||||
const ESM::Spell* spell = esmStore.get<ESM::Spell>().find(*it);
|
||||
MyGUI::Button* t = mMagicList->createWidget<MyGUI::Button>("SpellText",
|
||||
MyGUI::IntCoord(4, mHeight, mWidth-8, spellHeight), MyGUI::Align::Left | MyGUI::Align::Top);
|
||||
t->setCaption(spell->mName);
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
@ -224,20 +224,20 @@ void RaceDialog::updateRaces()
|
|||
{
|
||||
mRaceList->removeAllItems();
|
||||
|
||||
const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const MWWorld::Store<ESM::Race> &races =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Race>();
|
||||
|
||||
|
||||
ESMS::RecListT<ESM::Race>::MapType::const_iterator it = store.races.list.begin();
|
||||
ESMS::RecListT<ESM::Race>::MapType::const_iterator end = store.races.list.end();
|
||||
int index = 0;
|
||||
for (; it != end; ++it)
|
||||
MWWorld::Store<ESM::Race>::iterator it = races.begin();
|
||||
for (; it != races.end(); ++it)
|
||||
{
|
||||
const ESM::Race &race = it->second;
|
||||
bool playable = race.mData.mFlags & ESM::Race::Playable;
|
||||
bool playable = it->mData.mFlags & ESM::Race::Playable;
|
||||
if (!playable) // Only display playable races
|
||||
continue;
|
||||
|
||||
mRaceList->addItem(race.mName, it->first);
|
||||
if (boost::iequals(it->first, mCurrentRaceId))
|
||||
mRaceList->addItem(it->mName, it->mId);
|
||||
if (boost::iequals(it->mId, mCurrentRaceId))
|
||||
mRaceList->setIndexSelected(index);
|
||||
++index;
|
||||
}
|
||||
|
@ -258,8 +258,8 @@ void RaceDialog::updateSkills()
|
|||
const int lineHeight = 18;
|
||||
MyGUI::IntCoord coord1(0, 0, mSkillList->getWidth(), 18);
|
||||
|
||||
const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const ESM::Race *race = store.races.find(mCurrentRaceId);
|
||||
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const ESM::Race *race = store.get<ESM::Race>().find(mCurrentRaceId);
|
||||
int count = sizeof(race->mData.mBonus)/sizeof(race->mData.mBonus[0]); // TODO: Find a portable macro for this ARRAYSIZE?
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
|
@ -296,8 +296,8 @@ void RaceDialog::updateSpellPowers()
|
|||
const int lineHeight = 18;
|
||||
MyGUI::IntCoord coord(0, 0, mSpellPowerList->getWidth(), 18);
|
||||
|
||||
const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const ESM::Race *race = store.races.find(mCurrentRaceId);
|
||||
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const ESM::Race *race = store.get<ESM::Race>().find(mCurrentRaceId);
|
||||
|
||||
std::vector<std::string>::const_iterator it = race->mPowers.mList.begin();
|
||||
std::vector<std::string>::const_iterator end = race->mPowers.mList.end();
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
#include <boost/array.hpp>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "../mwrender/characterpreview.hpp"
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
@ -108,7 +108,9 @@ void ReviewDialog::setPlayerName(const std::string &name)
|
|||
void ReviewDialog::setRace(const std::string &raceId)
|
||||
{
|
||||
mRaceId = raceId;
|
||||
const ESM::Race *race = MWBase::Environment::get().getWorld()->getStore().races.search(mRaceId);
|
||||
|
||||
const ESM::Race *race =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Race>().search(mRaceId);
|
||||
if (race)
|
||||
{
|
||||
ToolTips::createRaceToolTip(mRaceWidget, race);
|
||||
|
@ -126,7 +128,9 @@ void ReviewDialog::setClass(const ESM::Class& class_)
|
|||
void ReviewDialog::setBirthSign(const std::string& signId)
|
||||
{
|
||||
mBirthSignId = signId;
|
||||
const ESM::BirthSign *sign = MWBase::Environment::get().getWorld()->getStore().birthSigns.search(mBirthSignId);
|
||||
|
||||
const ESM::BirthSign *sign =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::BirthSign>().search(mBirthSignId);
|
||||
if (sign)
|
||||
{
|
||||
mBirthSignWidget->setCaption(sign->mName);
|
||||
|
@ -281,7 +285,7 @@ void ReviewDialog::addSkills(const SkillList &skills, const std::string &titleId
|
|||
if (skillId < 0 || skillId > ESM::Skill::Length) // Skip unknown skill indexes
|
||||
continue;
|
||||
assert(skillId >= 0 && skillId < ESM::Skill::Length);
|
||||
const std::string &skillNameId = ESMS::Skill::sSkillNameIds[skillId];
|
||||
const std::string &skillNameId = ESM::Skill::sSkillNameIds[skillId];
|
||||
const MWMechanics::Stat<float> &stat = mSkillValues.find(skillId)->second;
|
||||
float base = stat.getBase();
|
||||
float modified = stat.getModified();
|
||||
|
|
|
@ -36,7 +36,7 @@ void ScrollWindow::open (MWWorld::Ptr scroll)
|
|||
MWWorld::LiveCellRef<ESM::Book> *ref = mScroll.get<ESM::Book>();
|
||||
|
||||
BookTextParser parser;
|
||||
MyGUI::IntSize size = parser.parse(ref->base->mText, mTextView, 390);
|
||||
MyGUI::IntSize size = parser.parse(ref->mBase->mText, mTextView, 390);
|
||||
|
||||
if (size.height > mTextView->getSize().height)
|
||||
mTextView->setCanvasSize(MyGUI::IntSize(410, size.height));
|
||||
|
|
|
@ -49,8 +49,12 @@ namespace MWGui
|
|||
|
||||
void SpellBuyingWindow::addSpell(const std::string& spellId)
|
||||
{
|
||||
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find(spellId);
|
||||
int price = spell->mData.mCost*MWBase::Environment::get().getWorld()->getStore().gameSettings.find("fSpellValueMult")->getFloat();
|
||||
const MWWorld::ESMStore &store =
|
||||
MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
const ESM::Spell* spell = store.get<ESM::Spell>().find(spellId);
|
||||
|
||||
int price = spell->mData.mCost*store.get<ESM::GameSetting>().find("fSpellValueMult")->getFloat();
|
||||
|
||||
MyGUI::Button* toAdd =
|
||||
mSpellsView->createWidget<MyGUI::Button>(
|
||||
|
@ -97,7 +101,8 @@ namespace MWGui
|
|||
|
||||
for (MWMechanics::Spells::TIterator iter = merchantSpells.begin(); iter!=merchantSpells.end(); ++iter)
|
||||
{
|
||||
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find (*iter);
|
||||
const ESM::Spell* spell =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find (*iter);
|
||||
|
||||
if (spell->mData.mType!=ESM::Spell::ST_Spell)
|
||||
continue; // don't try to sell diseases, curses or powers
|
||||
|
|
|
@ -2,14 +2,13 @@
|
|||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
|
||||
#include "../mwbase/windowmanager.hpp"
|
||||
|
||||
#include "../mwbase/world.hpp"
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/soundmanager.hpp"
|
||||
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
#include "../mwworld/player.hpp"
|
||||
#include "../mwworld/class.hpp"
|
||||
|
||||
|
@ -29,8 +28,11 @@ namespace
|
|||
|
||||
bool sortMagicEffects (short id1, short id2)
|
||||
{
|
||||
return MWBase::Environment::get().getWorld ()->getStore ().gameSettings.find(ESM::MagicEffect::effectIdToString (id1))->getString()
|
||||
< MWBase::Environment::get().getWorld ()->getStore ().gameSettings.find(ESM::MagicEffect::effectIdToString (id2))->getString();
|
||||
const MWWorld::Store<ESM::GameSetting> &gmst =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
||||
|
||||
return gmst.find(ESM::MagicEffect::effectIdToString (id1))->getString()
|
||||
< gmst.find(ESM::MagicEffect::effectIdToString (id2))->getString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -106,7 +108,8 @@ namespace MWGui
|
|||
|
||||
void EditEffectDialog::editEffect (ESM::ENAMstruct effect)
|
||||
{
|
||||
const ESM::MagicEffect* magicEffect = MWBase::Environment::get().getWorld()->getStore().magicEffects.find(effect.mEffectID);
|
||||
const ESM::MagicEffect* magicEffect =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::MagicEffect>().find(effect.mEffectID);
|
||||
|
||||
setMagicEffect(magicEffect);
|
||||
|
||||
|
@ -360,16 +363,23 @@ namespace MWGui
|
|||
{
|
||||
float y = 0;
|
||||
|
||||
const MWWorld::ESMStore &store =
|
||||
MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
for (std::vector<ESM::ENAMstruct>::const_iterator it = mEffects.begin(); it != mEffects.end(); ++it)
|
||||
{
|
||||
float x = 0.5 * it->mMagnMin + it->mMagnMax;
|
||||
|
||||
const ESM::MagicEffect* effect = MWBase::Environment::get().getWorld()->getStore().magicEffects.find(it->mEffectID);
|
||||
const ESM::MagicEffect* effect =
|
||||
store.get<ESM::MagicEffect>().find(it->mEffectID);
|
||||
|
||||
x *= 0.1 * effect->mData.mBaseCost;
|
||||
x *= 1 + it->mDuration;
|
||||
x += 0.05 * std::max(1, it->mArea) * effect->mData.mBaseCost;
|
||||
|
||||
float fEffectCostMult = MWBase::Environment::get().getWorld()->getStore().gameSettings.find("fEffectCostMult")->getFloat();
|
||||
float fEffectCostMult =
|
||||
store.get<ESM::GameSetting>().find("fEffectCostMult")->getFloat();
|
||||
|
||||
y += x * fEffectCostMult;
|
||||
y = std::max(1.f,y);
|
||||
|
||||
|
@ -386,7 +396,8 @@ namespace MWGui
|
|||
|
||||
mMagickaCost->setCaption(boost::lexical_cast<std::string>(int(y)));
|
||||
|
||||
float fSpellMakingValueMult = MWBase::Environment::get().getWorld()->getStore().gameSettings.find("fSpellMakingValueMult")->getFloat();
|
||||
float fSpellMakingValueMult =
|
||||
store.get<ESM::GameSetting>().find("fSpellMakingValueMult")->getFloat();
|
||||
|
||||
/// \todo mercantile
|
||||
int price = int(y) * fSpellMakingValueMult;
|
||||
|
@ -424,7 +435,8 @@ namespace MWGui
|
|||
|
||||
for (MWMechanics::Spells::TIterator it = spells.begin(); it != spells.end(); ++it)
|
||||
{
|
||||
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find(*it);
|
||||
const ESM::Spell* spell =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find(*it);
|
||||
|
||||
// only normal spells count
|
||||
if (spell->mData.mType != ESM::Spell::ST_Spell)
|
||||
|
@ -444,14 +456,14 @@ namespace MWGui
|
|||
|
||||
for (std::vector<short>::const_iterator it = knownEffects.begin(); it != knownEffects.end(); ++it)
|
||||
{
|
||||
mAvailableEffectsList->addItem(MWBase::Environment::get().getWorld ()->getStore ().gameSettings.find(
|
||||
mAvailableEffectsList->addItem(MWBase::Environment::get().getWorld ()->getStore ().get<ESM::GameSetting>().find(
|
||||
ESM::MagicEffect::effectIdToString (*it))->getString());
|
||||
}
|
||||
mAvailableEffectsList->adjustSize ();
|
||||
|
||||
for (std::vector<short>::const_iterator it = knownEffects.begin(); it != knownEffects.end(); ++it)
|
||||
{
|
||||
std::string name = MWBase::Environment::get().getWorld ()->getStore ().gameSettings.find(
|
||||
std::string name = MWBase::Environment::get().getWorld ()->getStore ().get<ESM::GameSetting>().find(
|
||||
ESM::MagicEffect::effectIdToString (*it))->getString();
|
||||
MyGUI::Widget* w = mAvailableEffectsList->getItemWidget(name);
|
||||
w->setUserData(*it);
|
||||
|
@ -517,7 +529,8 @@ namespace MWGui
|
|||
}
|
||||
}
|
||||
|
||||
const ESM::MagicEffect* effect = MWBase::Environment::get().getWorld()->getStore().magicEffects.find(effectId);
|
||||
const ESM::MagicEffect* effect =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::MagicEffect>().find(effectId);
|
||||
|
||||
mAddEffectDialog.newEffect (effect);
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/format.hpp>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "../mwbase/world.hpp"
|
||||
#include "../mwbase/environment.hpp"
|
||||
|
@ -26,8 +26,11 @@ namespace
|
|||
{
|
||||
bool sortSpells(const std::string& left, const std::string& right)
|
||||
{
|
||||
const ESM::Spell* a = MWBase::Environment::get().getWorld()->getStore().spells.find(left);
|
||||
const ESM::Spell* b = MWBase::Environment::get().getWorld()->getStore().spells.find(right);
|
||||
const MWWorld::Store<ESM::Spell> &spells =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>();
|
||||
|
||||
const ESM::Spell* a = spells.find(left);
|
||||
const ESM::Spell* b = spells.find(right);
|
||||
|
||||
int cmp = a->mName.compare(b->mName);
|
||||
return cmp < 0;
|
||||
|
@ -139,11 +142,15 @@ namespace MWGui
|
|||
spellList.push_back(*it);
|
||||
}
|
||||
|
||||
const MWWorld::ESMStore &esmStore =
|
||||
MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
std::vector<std::string> powers;
|
||||
std::vector<std::string>::iterator it = spellList.begin();
|
||||
while (it != spellList.end())
|
||||
{
|
||||
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find(*it);
|
||||
const ESM::Spell* spell = esmStore.get<ESM::Spell>().find(*it);
|
||||
|
||||
if (spell->mData.mType == ESM::Spell::ST_Power)
|
||||
{
|
||||
powers.push_back(*it);
|
||||
|
@ -170,7 +177,9 @@ namespace MWGui
|
|||
if (enchantId != "")
|
||||
{
|
||||
// only add items with "Cast once" or "Cast on use"
|
||||
const ESM::Enchantment* enchant = MWBase::Environment::get().getWorld()->getStore().enchants.find(enchantId);
|
||||
const ESM::Enchantment* enchant =
|
||||
esmStore.get<ESM::Enchantment>().find(enchantId);
|
||||
|
||||
int type = enchant->mData.mType;
|
||||
if (type != ESM::Enchantment::CastOnce
|
||||
&& type != ESM::Enchantment::WhenUsed)
|
||||
|
@ -191,7 +200,7 @@ namespace MWGui
|
|||
|
||||
for (std::vector<std::string>::const_iterator it = powers.begin(); it != powers.end(); ++it)
|
||||
{
|
||||
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find(*it);
|
||||
const ESM::Spell* spell = esmStore.get<ESM::Spell>().find(*it);
|
||||
MyGUI::Button* t = mSpellView->createWidget<MyGUI::Button>("SpellText",
|
||||
MyGUI::IntCoord(4, mHeight, mWidth-8, spellHeight), MyGUI::Align::Left | MyGUI::Align::Top);
|
||||
t->setCaption(spell->mName);
|
||||
|
@ -211,7 +220,7 @@ namespace MWGui
|
|||
addGroup("#{sSpells}", "#{sCostChance}");
|
||||
for (std::vector<std::string>::const_iterator it = spellList.begin(); it != spellList.end(); ++it)
|
||||
{
|
||||
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find(*it);
|
||||
const ESM::Spell* spell = esmStore.get<ESM::Spell>().find(*it);
|
||||
MyGUI::Button* t = mSpellView->createWidget<MyGUI::Button>("SpellText",
|
||||
MyGUI::IntCoord(4, mHeight, mWidth-8, spellHeight), MyGUI::Align::Left | MyGUI::Align::Top);
|
||||
t->setCaption(spell->mName);
|
||||
|
@ -244,7 +253,8 @@ namespace MWGui
|
|||
{
|
||||
MWWorld::Ptr item = *it;
|
||||
|
||||
const ESM::Enchantment* enchant = MWBase::Environment::get().getWorld()->getStore().enchants.find(MWWorld::Class::get(item).getEnchantment(item));
|
||||
const ESM::Enchantment* enchant =
|
||||
esmStore.get<ESM::Enchantment>().find(MWWorld::Class::get(item).getEnchantment(item));
|
||||
|
||||
// check if the item is currently equipped (will display in a different color)
|
||||
bool equipped = false;
|
||||
|
@ -378,7 +388,9 @@ namespace MWGui
|
|||
if (MyGUI::InputManager::getInstance().isShiftPressed())
|
||||
{
|
||||
// delete spell, if allowed
|
||||
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find(spellId);
|
||||
const ESM::Spell* spell =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find(spellId);
|
||||
|
||||
if (spell->mData.mFlags & ESM::Spell::F_Always
|
||||
|| spell->mData.mType == ESM::Spell::ST_Power)
|
||||
{
|
||||
|
|
|
@ -54,10 +54,10 @@ StatsWindow::StatsWindow (MWBase::WindowManager& parWindowManager)
|
|||
{ 0, 0 }
|
||||
};
|
||||
|
||||
const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||
for (int i=0; names[i][0]; ++i)
|
||||
{
|
||||
setText (names[i][0], store.gameSettings.find (names[i][1])->getString());
|
||||
setText (names[i][0], store.get<ESM::GameSetting>().find (names[i][1])->getString());
|
||||
}
|
||||
|
||||
getWidget(mSkillView, "SkillView");
|
||||
|
@ -357,18 +357,22 @@ void StatsWindow::addSkills(const SkillList &skills, const std::string &titleId,
|
|||
if (skillId < 0 || skillId > ESM::Skill::Length) // Skip unknown skill indexes
|
||||
continue;
|
||||
assert(skillId >= 0 && skillId < ESM::Skill::Length);
|
||||
const std::string &skillNameId = ESMS::Skill::sSkillNameIds[skillId];
|
||||
const std::string &skillNameId = ESM::Skill::sSkillNameIds[skillId];
|
||||
const MWMechanics::Stat<float> &stat = mSkillValues.find(skillId)->second;
|
||||
float base = stat.getBase();
|
||||
float modified = stat.getModified();
|
||||
int progressPercent = (modified - float(static_cast<int>(modified))) * 100;
|
||||
|
||||
const ESM::Skill* skill = MWBase::Environment::get().getWorld()->getStore().skills.search(skillId);
|
||||
const MWWorld::ESMStore &esmStore =
|
||||
MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
const ESM::Skill* skill = esmStore.get<ESM::Skill>().find(skillId);
|
||||
assert(skill);
|
||||
|
||||
std::string icon = "icons\\k\\" + ESM::Skill::sIconNames[skillId];
|
||||
|
||||
const ESM::Attribute* attr = MWBase::Environment::get().getWorld()->getStore().attributes.search(skill->mData.mAttribute);
|
||||
const ESM::Attribute* attr =
|
||||
esmStore.get<ESM::Attribute>().find(skill->mData.mAttribute);
|
||||
assert(attr);
|
||||
|
||||
std::string state = "normal";
|
||||
|
@ -422,10 +426,12 @@ void StatsWindow::updateSkillArea()
|
|||
if (!mMiscSkills.empty())
|
||||
addSkills(mMiscSkills, "sSkillClassMisc", "Misc Skills", coord1, coord2);
|
||||
|
||||
const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
// race tooltip
|
||||
const ESM::Race* playerRace = store.races.find (MWBase::Environment::get().getWorld()->getPlayer().getRace());
|
||||
const ESM::Race* playerRace =
|
||||
store.get<ESM::Race>().find (MWBase::Environment::get().getWorld()->getPlayer().getRace());
|
||||
|
||||
MyGUI::Widget* raceWidget;
|
||||
getWidget(raceWidget, "RaceText");
|
||||
ToolTips::createRaceToolTip(raceWidget, playerRace);
|
||||
|
@ -450,7 +456,8 @@ void StatsWindow::updateSkillArea()
|
|||
FactionList::const_iterator end = mFactions.end();
|
||||
for (FactionList::const_iterator it = mFactions.begin(); it != end; ++it)
|
||||
{
|
||||
const ESM::Faction *faction = store.factions.find(it->first);
|
||||
const ESM::Faction *faction =
|
||||
store.get<ESM::Faction>().find(it->first);
|
||||
MyGUI::Widget* w = addItem(faction->mName, coord1, coord2);
|
||||
|
||||
std::string text;
|
||||
|
@ -464,8 +471,8 @@ void StatsWindow::updateSkillArea()
|
|||
text += std::string("\n\n#DDC79E#{sNextRank} ") + faction->mRanks[it->second+1];
|
||||
|
||||
ESM::RankData rankData = faction->mData.mRankData[it->second+1];
|
||||
const ESM::Attribute* attr1 = MWBase::Environment::get().getWorld()->getStore().attributes.search(faction->mData.mAttribute1);
|
||||
const ESM::Attribute* attr2 = MWBase::Environment::get().getWorld()->getStore().attributes.search(faction->mData.mAttribute2);
|
||||
const ESM::Attribute* attr1 = store.get<ESM::Attribute>().find(faction->mData.mAttribute1);
|
||||
const ESM::Attribute* attr2 = store.get<ESM::Attribute>().find(faction->mData.mAttribute2);
|
||||
assert(attr1 && attr2);
|
||||
|
||||
text += "\n#BF9959#{" + attr1->mName + "}: " + boost::lexical_cast<std::string>(rankData.mAttribute1)
|
||||
|
@ -501,7 +508,8 @@ void StatsWindow::updateSkillArea()
|
|||
addSeparator(coord1, coord2);
|
||||
|
||||
addGroup(mWindowManager.getGameSettingString("sBirthSign", "Sign"), coord1, coord2);
|
||||
const ESM::BirthSign *sign = store.birthSigns.find(mBirthSignId);
|
||||
const ESM::BirthSign *sign =
|
||||
store.get<ESM::BirthSign>().find(mBirthSignId);
|
||||
MyGUI::Widget* w = addItem(sign->mName, coord1, coord2);
|
||||
|
||||
ToolTips::createBirthsignToolTip(w, mBirthSignId);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef MWGUI_STATS_WINDOW_H
|
||||
#define MWGUI_STATS_WINDOW_H
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include <sstream>
|
||||
#include <set>
|
||||
|
|
|
@ -179,7 +179,9 @@ void ToolTips::onFrame(float frameDuration)
|
|||
else if (type == "Spell")
|
||||
{
|
||||
ToolTipInfo info;
|
||||
const ESM::Spell *spell = MWBase::Environment::get().getWorld()->getStore().spells.find(focus->getUserString("Spell"));
|
||||
|
||||
const ESM::Spell *spell =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find(focus->getUserString("Spell"));
|
||||
info.caption = spell->mName;
|
||||
Widgets::SpellEffectList effects;
|
||||
std::vector<ESM::ENAMstruct>::const_iterator end = spell->mEffects.mList.end();
|
||||
|
@ -368,10 +370,10 @@ IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
|
|||
caption[0] = toupper(caption[0]);
|
||||
|
||||
const ESM::Enchantment* enchant = 0;
|
||||
const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
||||
if (info.enchant != "")
|
||||
{
|
||||
enchant = store.enchants.search(info.enchant);
|
||||
enchant = store.get<ESM::Enchantment>().find(info.enchant);
|
||||
if (enchant->mData.mType == ESM::Enchantment::CastOnce)
|
||||
text += "\n#{sItemCastOnce}";
|
||||
else if (enchant->mData.mType == ESM::Enchantment::WhenStrikes)
|
||||
|
@ -574,10 +576,15 @@ void ToolTips::createSkillToolTip(MyGUI::Widget* widget, int skillId)
|
|||
if (skillId == -1)
|
||||
return;
|
||||
|
||||
const std::string &skillNameId = ESMS::Skill::sSkillNameIds[skillId];
|
||||
const ESM::Skill* skill = MWBase::Environment::get().getWorld()->getStore().skills.search(skillId);
|
||||
const MWWorld::ESMStore &store =
|
||||
MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
const std::string &skillNameId = ESM::Skill::sSkillNameIds[skillId];
|
||||
const ESM::Skill* skill = store.get<ESM::Skill>().find(skillId);
|
||||
assert(skill);
|
||||
const ESM::Attribute* attr = MWBase::Environment::get().getWorld()->getStore().attributes.search(skill->mData.mAttribute);
|
||||
|
||||
const ESM::Attribute* attr =
|
||||
store.get<ESM::Attribute>().find(skill->mData.mAttribute);
|
||||
assert(attr);
|
||||
std::string icon = "icons\\k\\" + ESM::Skill::sIconNames[skillId];
|
||||
|
||||
|
@ -610,12 +617,14 @@ void ToolTips::createSpecializationToolTip(MyGUI::Widget* widget, const std::str
|
|||
widget->setUserString("Caption_CenteredCaption", name);
|
||||
std::string specText;
|
||||
// get all skills of this specialisation
|
||||
std::map<int, ESM::Skill> skills = MWBase::Environment::get().getWorld()->getStore().skills.list;
|
||||
for (std::map<int, ESM::Skill>::const_iterator it = skills.begin();
|
||||
it != skills.end(); ++it)
|
||||
const MWWorld::Store<ESM::Skill> &skills =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Skill>();
|
||||
|
||||
MWWorld::Store<ESM::Skill>::iterator it = skills.begin();
|
||||
for (; it != skills.end(); ++it)
|
||||
{
|
||||
if (it->second.mData.mSpecialization == specId)
|
||||
specText += std::string("\n#{") + ESM::Skill::sSkillNameIds[it->second.mIndex] + "}";
|
||||
if (it->mData.mSpecialization == specId)
|
||||
specText += std::string("\n#{") + ESM::Skill::sSkillNameIds[it->mIndex] + "}";
|
||||
}
|
||||
widget->setUserString("Caption_CenteredCaptionText", specText);
|
||||
widget->setUserString("ToolTipLayout", "TextWithCenteredCaptionToolTip");
|
||||
|
@ -624,7 +633,10 @@ void ToolTips::createSpecializationToolTip(MyGUI::Widget* widget, const std::str
|
|||
|
||||
void ToolTips::createBirthsignToolTip(MyGUI::Widget* widget, const std::string& birthsignId)
|
||||
{
|
||||
const ESM::BirthSign *sign = MWBase::Environment::get().getWorld()->getStore().birthSigns.find(birthsignId);
|
||||
const MWWorld::ESMStore &store =
|
||||
MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
const ESM::BirthSign *sign = store.get<ESM::BirthSign>().find(birthsignId);
|
||||
|
||||
widget->setUserString("ToolTipType", "Layout");
|
||||
widget->setUserString("ToolTipLayout", "BirthSignToolTip");
|
||||
|
@ -643,7 +655,7 @@ void ToolTips::createBirthsignToolTip(MyGUI::Widget* widget, const std::string&
|
|||
for (; it != end; ++it)
|
||||
{
|
||||
const std::string &spellId = *it;
|
||||
const ESM::Spell *spell = MWBase::Environment::get().getWorld()->getStore().spells.search(spellId);
|
||||
const ESM::Spell *spell = store.get<ESM::Spell>().search(spellId);
|
||||
if (!spell)
|
||||
continue; // Skip spells which cannot be found
|
||||
ESM::Spell::SpellType type = static_cast<ESM::Spell::SpellType>(spell->mData.mType);
|
||||
|
@ -658,7 +670,11 @@ void ToolTips::createBirthsignToolTip(MyGUI::Widget* widget, const std::string&
|
|||
spells.push_back(spellId);
|
||||
}
|
||||
|
||||
struct{ const std::vector<std::string> &spells; std::string label; } categories[3] = {
|
||||
struct {
|
||||
const std::vector<std::string> &spells;
|
||||
std::string label;
|
||||
}
|
||||
categories[3] = {
|
||||
{abilities, "sBirthsignmenu1"},
|
||||
{powers, "sPowers"},
|
||||
{spells, "sBirthsignmenu2"}
|
||||
|
@ -675,7 +691,7 @@ void ToolTips::createBirthsignToolTip(MyGUI::Widget* widget, const std::string&
|
|||
|
||||
const std::string &spellId = *it;
|
||||
|
||||
const ESM::Spell *spell = MWBase::Environment::get().getWorld()->getStore().spells.search(spellId);
|
||||
const ESM::Spell *spell = store.get<ESM::Spell>().find(spellId);
|
||||
text += "\n#BF9959" + spell->mName;
|
||||
}
|
||||
}
|
||||
|
@ -714,7 +730,8 @@ void ToolTips::createClassToolTip(MyGUI::Widget* widget, const ESM::Class& playe
|
|||
|
||||
void ToolTips::createMagicEffectToolTip(MyGUI::Widget* widget, short id)
|
||||
{
|
||||
const ESM::MagicEffect* effect = MWBase::Environment::get().getWorld ()->getStore ().magicEffects.find(id);
|
||||
const ESM::MagicEffect* effect =
|
||||
MWBase::Environment::get().getWorld ()->getStore ().get<ESM::MagicEffect>().find(id);
|
||||
const std::string &name = ESM::MagicEffect::effectIdToString (id);
|
||||
|
||||
std::string icon = effect->mIcon;
|
||||
|
|
|
@ -107,10 +107,14 @@ namespace MWGui
|
|||
bool goldFound = false;
|
||||
MWWorld::Ptr gold;
|
||||
MWWorld::ContainerStore& playerStore = mWindowManager.getInventoryWindow()->getContainerStore();
|
||||
|
||||
const MWWorld::Store<ESM::GameSetting> &gmst =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
||||
|
||||
for (MWWorld::ContainerStoreIterator it = playerStore.begin();
|
||||
it != playerStore.end(); ++it)
|
||||
{
|
||||
if (MWWorld::Class::get(*it).getName(*it) == MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sGold")->getString())
|
||||
if (MWWorld::Class::get(*it).getName(*it) == gmst.find("sGold")->getString())
|
||||
{
|
||||
goldFound = true;
|
||||
gold = *it;
|
||||
|
@ -156,15 +160,15 @@ namespace MWGui
|
|||
if (mPtr.getTypeName() == typeid(ESM::NPC).name())
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::NPC>* ref = mPtr.get<ESM::NPC>();
|
||||
if (ref->base->mNpdt52.mGold == -10)
|
||||
merchantgold = ref->base->mNpdt12.mGold;
|
||||
if (ref->mBase->mNpdt52.mGold == -10)
|
||||
merchantgold = ref->mBase->mNpdt12.mGold;
|
||||
else
|
||||
merchantgold = ref->base->mNpdt52.mGold;
|
||||
merchantgold = ref->mBase->mNpdt52.mGold;
|
||||
}
|
||||
else // ESM::Creature
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Creature>* ref = mPtr.get<ESM::Creature>();
|
||||
merchantgold = ref->base->mData.mGold;
|
||||
merchantgold = ref->mBase->mData.mGold;
|
||||
}
|
||||
if (mCurrentBalance > 0 && merchantgold < mCurrentBalance)
|
||||
{
|
||||
|
@ -217,15 +221,15 @@ namespace MWGui
|
|||
if (mPtr.getTypeName() == typeid(ESM::NPC).name())
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::NPC>* ref = mPtr.get<ESM::NPC>();
|
||||
if (ref->base->mNpdt52.mGold == -10)
|
||||
merchantgold = ref->base->mNpdt12.mGold;
|
||||
if (ref->mBase->mNpdt52.mGold == -10)
|
||||
merchantgold = ref->mBase->mNpdt12.mGold;
|
||||
else
|
||||
merchantgold = ref->base->mNpdt52.mGold;
|
||||
merchantgold = ref->mBase->mNpdt52.mGold;
|
||||
}
|
||||
else // ESM::Creature
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Creature>* ref = mPtr.get<ESM::Creature>();
|
||||
merchantgold = ref->base->mData.mGold;
|
||||
merchantgold = ref->mBase->mData.mGold;
|
||||
}
|
||||
|
||||
mMerchantGold->setCaptionWithReplacing("#{sSellerGold} " + boost::lexical_cast<std::string>(merchantgold));
|
||||
|
@ -261,14 +265,14 @@ namespace MWGui
|
|||
if (mPtr.getTypeName() == typeid(ESM::NPC).name())
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::NPC>* ref = mPtr.get<ESM::NPC>();
|
||||
if (ref->base->mHasAI)
|
||||
services = ref->base->mAiData.mServices;
|
||||
if (ref->mBase->mHasAI)
|
||||
services = ref->mBase->mAiData.mServices;
|
||||
}
|
||||
else if (mPtr.getTypeName() == typeid(ESM::Creature).name())
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Creature>* ref = mPtr.get<ESM::Creature>();
|
||||
if (ref->base->mHasAI)
|
||||
services = ref->base->mAiData.mServices;
|
||||
if (ref->mBase->mHasAI)
|
||||
services = ref->mBase->mAiData.mServices;
|
||||
}
|
||||
|
||||
/// \todo what about potions, there doesn't seem to be a flag for them??
|
||||
|
|
|
@ -73,10 +73,13 @@ namespace MWGui
|
|||
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayer ().getPlayer ();
|
||||
MWMechanics::NpcStats& pcStats = MWWorld::Class::get(player).getNpcStats (player);
|
||||
|
||||
const MWWorld::Store<ESM::GameSetting> &gmst =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
||||
|
||||
for (int i=0; i<3; ++i)
|
||||
{
|
||||
/// \todo mercantile skill
|
||||
int price = pcStats.getSkill (bestSkills[i].first).getBase() * MWBase::Environment::get().getWorld ()->getStore ().gameSettings.find("iTrainingMod")->getInt ();
|
||||
int price = pcStats.getSkill (bestSkills[i].first).getBase() * gmst.find("iTrainingMod")->getInt ();
|
||||
|
||||
std::string skin = (price > mWindowManager.getInventoryWindow ()->getPlayerGold ()) ? "SandTextGreyedOut" : "SandTextButton";
|
||||
|
||||
|
@ -113,8 +116,11 @@ namespace MWGui
|
|||
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayer ().getPlayer ();
|
||||
MWMechanics::NpcStats& pcStats = MWWorld::Class::get(player).getNpcStats (player);
|
||||
|
||||
const MWWorld::ESMStore &store =
|
||||
MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
/// \todo mercantile skill
|
||||
int price = pcStats.getSkill (skillId).getBase() * MWBase::Environment::get().getWorld ()->getStore ().gameSettings.find("iTrainingMod")->getInt ();
|
||||
int price = pcStats.getSkill (skillId).getBase() * store.get<ESM::GameSetting>().find("iTrainingMod")->getInt ();
|
||||
|
||||
if (mWindowManager.getInventoryWindow()->getPlayerGold()<price)
|
||||
return;
|
||||
|
@ -128,8 +134,9 @@ namespace MWGui
|
|||
|
||||
// increase skill
|
||||
MWWorld::LiveCellRef<ESM::NPC> *playerRef = player.get<ESM::NPC>();
|
||||
const ESM::Class *class_ = MWBase::Environment::get().getWorld()->getStore().classes.find (
|
||||
playerRef->base->mClass);
|
||||
|
||||
const ESM::Class *class_ =
|
||||
store.get<ESM::Class>().find(playerRef->mBase->mClass);
|
||||
pcStats.increaseSkill (skillId, *class_, true);
|
||||
|
||||
// remove gold
|
||||
|
|
|
@ -54,16 +54,19 @@ namespace MWGui
|
|||
{
|
||||
int price = 0;
|
||||
|
||||
const MWWorld::Store<ESM::GameSetting> &gmst =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
||||
|
||||
if(interior)
|
||||
{
|
||||
price = MWBase::Environment::get().getWorld()->getStore().gameSettings.find("fMagesGuildTravel")->getFloat();
|
||||
price = gmst.find("fMagesGuildTravel")->getFloat();
|
||||
}
|
||||
else
|
||||
{
|
||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
||||
ESM::Position PlayerPos = player.getRefData().getPosition();
|
||||
float d = sqrt( pow(pos.pos[0] - PlayerPos.pos[0],2) + pow(pos.pos[1] - PlayerPos.pos[1],2) + pow(pos.pos[2] - PlayerPos.pos[2],2) );
|
||||
price = d/MWBase::Environment::get().getWorld()->getStore().gameSettings.find("fTravelMult")->getFloat();
|
||||
price = d/gmst.find("fTravelMult")->getFloat();
|
||||
}
|
||||
|
||||
MyGUI::Button* toAdd = mDestinationsView->createWidget<MyGUI::Button>((price>mWindowManager.getInventoryWindow()->getPlayerGold()) ? "SandTextGreyedOut" : "SandTextButton", 0, mCurrentY, 200, sLineHeight, MyGUI::Align::Default);
|
||||
|
@ -104,15 +107,15 @@ namespace MWGui
|
|||
|
||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
||||
|
||||
for(unsigned int i = 0;i<mPtr.get<ESM::NPC>()->base->mTransport.size();i++)
|
||||
for(unsigned int i = 0;i<mPtr.get<ESM::NPC>()->mBase->mTransport.size();i++)
|
||||
{
|
||||
std::string cellname = mPtr.get<ESM::NPC>()->base->mTransport[i].mCellName;
|
||||
std::string cellname = mPtr.get<ESM::NPC>()->mBase->mTransport[i].mCellName;
|
||||
bool interior = true;
|
||||
int x,y;
|
||||
MWBase::Environment::get().getWorld()->positionToIndex(mPtr.get<ESM::NPC>()->base->mTransport[i].mPos.pos[0],
|
||||
mPtr.get<ESM::NPC>()->base->mTransport[i].mPos.pos[1],x,y);
|
||||
if(cellname == "") {cellname = MWBase::Environment::get().getWorld()->getExterior(x,y)->cell->mName; interior= false;}
|
||||
addDestination(cellname,mPtr.get<ESM::NPC>()->base->mTransport[i].mPos,interior);
|
||||
MWBase::Environment::get().getWorld()->positionToIndex(mPtr.get<ESM::NPC>()->mBase->mTransport[i].mPos.pos[0],
|
||||
mPtr.get<ESM::NPC>()->mBase->mTransport[i].mPos.pos[1],x,y);
|
||||
if(cellname == "") {cellname = MWBase::Environment::get().getWorld()->getExterior(x,y)->mCell->mName; interior= false;}
|
||||
addDestination(cellname,mPtr.get<ESM::NPC>()->mBase->mTransport[i].mPos,interior);
|
||||
}
|
||||
|
||||
updateLabels();
|
||||
|
@ -142,7 +145,7 @@ namespace MWGui
|
|||
cell = MWBase::Environment::get().getWorld()->getExterior(x,y);
|
||||
ESM::Position PlayerPos = player.getRefData().getPosition();
|
||||
float d = sqrt( pow(pos.pos[0] - PlayerPos.pos[0],2) + pow(pos.pos[1] - PlayerPos.pos[1],2) + pow(pos.pos[2] - PlayerPos.pos[2],2) );
|
||||
int time = int(d /MWBase::Environment::get().getWorld()->getStore().gameSettings.find("fTravelTimeMult")->getFloat());
|
||||
int time = int(d /MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fTravelTimeMult")->getFloat());
|
||||
for(int i = 0;i < time;i++)
|
||||
{
|
||||
MWBase::Environment::get().getMechanicsManager ()->restoreDynamicStats ();
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include "components/esm_store/store.hpp"
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
#include "../mwbase/windowmanager.hpp"
|
||||
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
|
@ -228,8 +228,10 @@ void MWSpell::setSpellId(const std::string &spellId)
|
|||
|
||||
void MWSpell::createEffectWidgets(std::vector<MyGUI::WidgetPtr> &effects, MyGUI::WidgetPtr creator, MyGUI::IntCoord &coord, int flags)
|
||||
{
|
||||
const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const ESM::Spell *spell = store.spells.search(mId);
|
||||
const MWWorld::ESMStore &store =
|
||||
MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
const ESM::Spell *spell = store.get<ESM::Spell>().search(mId);
|
||||
MYGUI_ASSERT(spell, "spell with id '" << mId << "' not found");
|
||||
|
||||
MWSpellEffectPtr effect = nullptr;
|
||||
|
@ -259,8 +261,10 @@ void MWSpell::updateWidgets()
|
|||
{
|
||||
if (mSpellNameWidget && mWindowManager)
|
||||
{
|
||||
const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const ESM::Spell *spell = store.spells.search(mId);
|
||||
const MWWorld::ESMStore &store =
|
||||
MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
const ESM::Spell *spell = store.get<ESM::Spell>().search(mId);
|
||||
if (spell)
|
||||
static_cast<MyGUI::TextBox*>(mSpellNameWidget)->setCaption(spell->mName);
|
||||
else
|
||||
|
@ -386,8 +390,14 @@ void MWSpellEffect::setSpellEffect(const SpellEffectParams& params)
|
|||
|
||||
void MWSpellEffect::updateWidgets()
|
||||
{
|
||||
const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const ESM::MagicEffect *magicEffect = store.magicEffects.search(mEffectParams.mEffectID);
|
||||
if (!mWindowManager)
|
||||
return;
|
||||
|
||||
const MWWorld::ESMStore &store =
|
||||
MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
const ESM::MagicEffect *magicEffect =
|
||||
store.get<ESM::MagicEffect>().search(mEffectParams.mEffectID);
|
||||
|
||||
assert(magicEffect);
|
||||
assert(mWindowManager);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef MWGUI_WIDGETS_H
|
||||
#define MWGUI_WIDGETS_H
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include <MyGUI.h>
|
||||
|
||||
|
|
|
@ -554,7 +554,9 @@ int WindowManager::readPressedButton ()
|
|||
|
||||
std::string WindowManager::getGameSettingString(const std::string &id, const std::string &default_)
|
||||
{
|
||||
const ESM::GameSetting *setting = MWBase::Environment::get().getWorld()->getStore().gameSettings.search(id);
|
||||
const ESM::GameSetting *setting =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().search(id);
|
||||
|
||||
if (setting && setting->mType == ESM::VT_String)
|
||||
return setting->getString();
|
||||
return default_;
|
||||
|
@ -604,17 +606,18 @@ void WindowManager::onFrame (float frameDuration)
|
|||
|
||||
void WindowManager::changeCell(MWWorld::Ptr::CellStore* cell)
|
||||
{
|
||||
if (!(cell->cell->mData.mFlags & ESM::Cell::Interior))
|
||||
if (cell->mCell->isExterior())
|
||||
{
|
||||
std::string name;
|
||||
if (cell->cell->mName != "")
|
||||
if (cell->mCell->mName != "")
|
||||
{
|
||||
name = cell->cell->mName;
|
||||
mMap->addVisitedLocation (name, cell->cell->getGridX (), cell->cell->getGridY ());
|
||||
name = cell->mCell->mName;
|
||||
mMap->addVisitedLocation (name, cell->mCell->getGridX (), cell->mCell->getGridY ());
|
||||
}
|
||||
else
|
||||
{
|
||||
const ESM::Region* region = MWBase::Environment::get().getWorld()->getStore().regions.search(cell->cell->mRegion);
|
||||
const ESM::Region* region =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Region>().search(cell->mCell->mRegion);
|
||||
if (region)
|
||||
name = region->mName;
|
||||
else
|
||||
|
@ -626,15 +629,15 @@ void WindowManager::changeCell(MWWorld::Ptr::CellStore* cell)
|
|||
|
||||
mMap->setCellPrefix("Cell");
|
||||
mHud->setCellPrefix("Cell");
|
||||
mMap->setActiveCell( cell->cell->mData.mX, cell->cell->mData.mY );
|
||||
mHud->setActiveCell( cell->cell->mData.mX, cell->cell->mData.mY );
|
||||
mMap->setActiveCell( cell->mCell->getGridX(), cell->mCell->getGridY() );
|
||||
mHud->setActiveCell( cell->mCell->getGridX(), cell->mCell->getGridY() );
|
||||
}
|
||||
else
|
||||
{
|
||||
mMap->setCellName( cell->cell->mName );
|
||||
mHud->setCellName( cell->cell->mName );
|
||||
mMap->setCellPrefix( cell->cell->mName );
|
||||
mHud->setCellPrefix( cell->cell->mName );
|
||||
mMap->setCellName( cell->mCell->mName );
|
||||
mHud->setCellName( cell->mCell->mName );
|
||||
mMap->setCellPrefix( cell->mCell->mName );
|
||||
mHud->setCellPrefix( cell->mCell->mName );
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -717,7 +720,9 @@ void WindowManager::setDragDrop(bool dragDrop)
|
|||
|
||||
void WindowManager::onRetrieveTag(const MyGUI::UString& _tag, MyGUI::UString& _result)
|
||||
{
|
||||
const ESM::GameSetting *setting = MWBase::Environment::get().getWorld()->getStore().gameSettings.find(_tag);
|
||||
const ESM::GameSetting *setting =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find(_tag);
|
||||
|
||||
if (setting && setting->mType == ESM::VT_String)
|
||||
_result = setting->getString();
|
||||
else
|
||||
|
@ -808,7 +813,10 @@ void WindowManager::removeGuiMode(GuiMode mode)
|
|||
void WindowManager::setSelectedSpell(const std::string& spellId, int successChancePercent)
|
||||
{
|
||||
mHud->setSelectedSpell(spellId, successChancePercent);
|
||||
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find(spellId);
|
||||
|
||||
const ESM::Spell* spell =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find(spellId);
|
||||
|
||||
mSpellWindow->setTitle(spell->mName);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <components/esm/loadmgef.hpp>
|
||||
#include <components/esm/loadskil.hpp>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
@ -86,7 +86,7 @@ namespace MWMechanics
|
|||
if (effects.second)
|
||||
{
|
||||
const ESM::MagicEffect *magicEffect =
|
||||
MWBase::Environment::get().getWorld()->getStore().magicEffects.find (
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::MagicEffect>().find (
|
||||
iter->mEffectID);
|
||||
|
||||
if (iter->mDuration==0)
|
||||
|
@ -114,18 +114,18 @@ namespace MWMechanics
|
|||
std::pair<ESM::EffectList, bool> ActiveSpells::getEffectList (const std::string& id) const
|
||||
{
|
||||
if (const ESM::Spell *spell =
|
||||
MWBase::Environment::get().getWorld()->getStore().spells.search (id))
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().search (id))
|
||||
return std::make_pair (spell->mEffects, false);
|
||||
|
||||
if (const ESM::Potion *potion =
|
||||
MWBase::Environment::get().getWorld()->getStore().potions.search (id))
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Potion>().search (id))
|
||||
return std::make_pair (potion->mEffects, false);
|
||||
|
||||
if (const ESM::Ingredient *ingredient =
|
||||
MWBase::Environment::get().getWorld()->getStore().ingreds.search (id))
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Ingredient>().search (id))
|
||||
{
|
||||
const ESM::MagicEffect *magicEffect =
|
||||
MWBase::Environment::get().getWorld()->getStore().magicEffects.find (
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::MagicEffect>().find (
|
||||
ingredient->mData.mEffectID[0]);
|
||||
|
||||
ESM::ENAMstruct effect;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include <components/esm/loadnpc.hpp>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "../mwworld/class.hpp"
|
||||
#include "../mwworld/inventorystore.hpp"
|
||||
|
@ -101,11 +101,11 @@ namespace MWMechanics
|
|||
health.setCurrent (health.getCurrent() + 0.1 * endurance);
|
||||
stats.setHealth (health);
|
||||
|
||||
const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
float fFatigueReturnBase = store.gameSettings.find("fFatigueReturnBase")->getFloat ();
|
||||
float fFatigueReturnMult = store.gameSettings.find("fFatigueReturnMult")->getFloat ();
|
||||
float fEndFatigueMult = store.gameSettings.find("fEndFatigueMult")->getFloat ();
|
||||
float fFatigueReturnBase = store.get<ESM::GameSetting>().find("fFatigueReturnBase")->getFloat ();
|
||||
float fFatigueReturnMult = store.get<ESM::GameSetting>().find("fFatigueReturnMult")->getFloat ();
|
||||
float fEndFatigueMult = store.get<ESM::GameSetting>().find("fEndFatigueMult")->getFloat ();
|
||||
|
||||
float capacity = MWWorld::Class::get(ptr).getCapacity(ptr);
|
||||
float encumbrance = MWWorld::Class::get(ptr).getEncumbrance(ptr);
|
||||
|
@ -122,7 +122,7 @@ namespace MWMechanics
|
|||
|
||||
if (!stunted)
|
||||
{
|
||||
float fRestMagicMult = store.gameSettings.find("fRestMagicMult")->getFloat ();
|
||||
float fRestMagicMult = store.get<ESM::GameSetting>().find("fRestMagicMult")->getFloat ();
|
||||
|
||||
DynamicStat<float> magicka = stats.getMagicka();
|
||||
magicka.setCurrent (magicka.getCurrent()
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
#include <components/esm/loadgmst.hpp>
|
||||
#include <components/esm/loadmgef.hpp>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
#include "../mwworld/containerstore.hpp"
|
||||
#include "../mwworld/class.hpp"
|
||||
#include "../mwworld/cellstore.hpp"
|
||||
|
@ -38,11 +38,11 @@ std::set<MWMechanics::EffectKey> MWMechanics::Alchemy::listEffects() const
|
|||
const MWWorld::LiveCellRef<ESM::Ingredient> *ingredient = iter->get<ESM::Ingredient>();
|
||||
|
||||
for (int i=0; i<4; ++i)
|
||||
if (ingredient->base->mData.mEffectID[i]!=-1)
|
||||
if (ingredient->mBase->mData.mEffectID[i]!=-1)
|
||||
{
|
||||
EffectKey key (
|
||||
ingredient->base->mData.mEffectID[i], ingredient->base->mData.mSkills[i]!=-1 ?
|
||||
ingredient->base->mData.mSkills[i] : ingredient->base->mData.mAttributes[i]);
|
||||
ingredient->mBase->mData.mEffectID[i], ingredient->mBase->mData.mSkills[i]!=-1 ?
|
||||
ingredient->mBase->mData.mSkills[i] : ingredient->mBase->mData.mAttributes[i]);
|
||||
|
||||
++effects[key];
|
||||
}
|
||||
|
@ -77,9 +77,9 @@ void MWMechanics::Alchemy::applyTools (int flags, float& value) const
|
|||
else
|
||||
return;
|
||||
|
||||
float toolQuality = setup==1 || setup==2 ? mTools[tool].get<ESM::Apparatus>()->base->mData.mQuality : 0;
|
||||
float toolQuality = setup==1 || setup==2 ? mTools[tool].get<ESM::Apparatus>()->mBase->mData.mQuality : 0;
|
||||
float calcinatorQuality = setup==1 || setup==3 ?
|
||||
mTools[ESM::Apparatus::Calcinator].get<ESM::Apparatus>()->base->mData.mQuality : 0;
|
||||
mTools[ESM::Apparatus::Calcinator].get<ESM::Apparatus>()->mBase->mData.mQuality : 0;
|
||||
|
||||
float quality = 1;
|
||||
|
||||
|
@ -130,30 +130,30 @@ void MWMechanics::Alchemy::updateEffects()
|
|||
// general alchemy factor
|
||||
float x = getChance();
|
||||
|
||||
x *= mTools[ESM::Apparatus::MortarPestle].get<ESM::Apparatus>()->base->mData.mQuality;
|
||||
x *= MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("fPotionStrengthMult")->getFloat();
|
||||
x *= mTools[ESM::Apparatus::MortarPestle].get<ESM::Apparatus>()->mBase->mData.mQuality;
|
||||
x *= MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find ("fPotionStrengthMult")->getFloat();
|
||||
|
||||
// value
|
||||
mValue = static_cast<int> (
|
||||
x * MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("iAlchemyMod")->getFloat());
|
||||
x * MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find ("iAlchemyMod")->getFloat());
|
||||
|
||||
// build quantified effect list
|
||||
for (std::set<EffectKey>::const_iterator iter (effects.begin()); iter!=effects.end(); ++iter)
|
||||
{
|
||||
const ESM::MagicEffect *magicEffect =
|
||||
MWBase::Environment::get().getWorld()->getStore().magicEffects.find (iter->mId);
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::MagicEffect>().find (iter->mId);
|
||||
|
||||
if (magicEffect->mData.mBaseCost<=0)
|
||||
throw std::runtime_error ("invalid base cost for magic effect " + iter->mId);
|
||||
|
||||
float fPotionT1MagMul =
|
||||
MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("fPotionT1MagMult")->getFloat();
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find ("fPotionT1MagMult")->getFloat();
|
||||
|
||||
if (fPotionT1MagMul<=0)
|
||||
throw std::runtime_error ("invalid gmst: fPotionT1MagMul");
|
||||
|
||||
float fPotionT1DurMult =
|
||||
MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("fPotionT1DurMult")->getFloat();
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find ("fPotionT1DurMult")->getFloat();
|
||||
|
||||
if (fPotionT1DurMult<=0)
|
||||
throw std::runtime_error ("invalid gmst: fPotionT1DurMult");
|
||||
|
@ -192,18 +192,20 @@ void MWMechanics::Alchemy::updateEffects()
|
|||
|
||||
const ESM::Potion *MWMechanics::Alchemy::getRecord() const
|
||||
{
|
||||
for (ESMS::RecListWithIDT<ESM::Potion>::MapType::const_iterator iter (
|
||||
MWBase::Environment::get().getWorld()->getStore().potions.list.begin());
|
||||
iter!=MWBase::Environment::get().getWorld()->getStore().potions.list.end(); ++iter)
|
||||
const MWWorld::Store<ESM::Potion> &potions =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Potion>();
|
||||
|
||||
MWWorld::Store<ESM::Potion>::iterator iter = potions.begin();
|
||||
for (; iter != potions.end(); ++iter)
|
||||
{
|
||||
if (iter->second.mEffects.mList.size()!=mEffects.size())
|
||||
if (iter->mEffects.mList.size() != mEffects.size())
|
||||
continue;
|
||||
|
||||
bool mismatch = false;
|
||||
|
||||
for (int i=0; i<static_cast<int> (iter->second.mEffects.mList.size()); ++iter)
|
||||
for (int i=0; i<static_cast<int> (iter->mEffects.mList.size()); ++iter)
|
||||
{
|
||||
const ESM::ENAMstruct& first = iter->second.mEffects.mList[i];
|
||||
const ESM::ENAMstruct& first = iter->mEffects.mList[i];
|
||||
const ESM::ENAMstruct& second = mEffects[i];
|
||||
|
||||
if (first.mEffectID!=second.mEffectID ||
|
||||
|
@ -221,7 +223,7 @@ const ESM::Potion *MWMechanics::Alchemy::getRecord() const
|
|||
}
|
||||
|
||||
if (!mismatch)
|
||||
return &iter->second;
|
||||
return &(*iter);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -258,7 +260,7 @@ void MWMechanics::Alchemy::addPotion (const std::string& name)
|
|||
|
||||
for (TIngredientsIterator iter (beginIngredients()); iter!=endIngredients(); ++iter)
|
||||
if (!iter->isEmpty())
|
||||
newRecord.mData.mWeight += iter->get<ESM::Ingredient>()->base->mData.mWeight;
|
||||
newRecord.mData.mWeight += iter->get<ESM::Ingredient>()->mBase->mData.mWeight;
|
||||
|
||||
newRecord.mData.mWeight /= countIngredients();
|
||||
|
||||
|
@ -332,13 +334,13 @@ void MWMechanics::Alchemy::setAlchemist (const MWWorld::Ptr& npc)
|
|||
{
|
||||
MWWorld::LiveCellRef<ESM::Apparatus>* ref = iter->get<ESM::Apparatus>();
|
||||
|
||||
int type = ref->base->mData.mType;
|
||||
int type = ref->mBase->mData.mType;
|
||||
|
||||
if (type<0 || type>=static_cast<int> (mTools.size()))
|
||||
throw std::runtime_error ("invalid apparatus type");
|
||||
|
||||
if (!mTools[type].isEmpty())
|
||||
if (ref->base->mData.mQuality<=mTools[type].get<ESM::Apparatus>()->base->mData.mQuality)
|
||||
if (ref->mBase->mData.mQuality<=mTools[type].get<ESM::Apparatus>()->mBase->mData.mQuality)
|
||||
continue;
|
||||
|
||||
mTools[type] = *iter;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include <algorithm>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
@ -41,10 +41,11 @@ namespace MWMechanics
|
|||
|
||||
float normalised = max==0 ? 1 : std::max (0.0f, static_cast<float> (current)/max);
|
||||
|
||||
const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const MWWorld::Store<ESM::GameSetting> &gmst =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
||||
|
||||
return store.gameSettings.find ("fFatigueBase")->getFloat()
|
||||
- store.gameSettings.find ("fFatigueMult")->getFloat() * (1-normalised);
|
||||
return gmst.find ("fFatigueBase")->getFloat()
|
||||
- gmst.find ("fFatigueMult")->getFloat() * (1-normalised);
|
||||
}
|
||||
|
||||
const Stat<int> &CreatureStats::getAttribute(int index) const
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
#include "mechanicsmanagerimp.hpp"
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
@ -19,7 +19,7 @@ namespace MWMechanics
|
|||
MWMechanics::CreatureStats& creatureStats = MWWorld::Class::get (ptr).getCreatureStats (ptr);
|
||||
MWMechanics::NpcStats& npcStats = MWWorld::Class::get (ptr).getNpcStats (ptr);
|
||||
|
||||
const ESM::NPC *player = ptr.get<ESM::NPC>()->base;
|
||||
const ESM::NPC *player = ptr.get<ESM::NPC>()->mBase;
|
||||
|
||||
// reset
|
||||
creatureStats.setLevel(player->mNpdt52.mLevel);
|
||||
|
@ -42,8 +42,9 @@ namespace MWMechanics
|
|||
if (mRaceSelected)
|
||||
{
|
||||
const ESM::Race *race =
|
||||
MWBase::Environment::get().getWorld()->getStore().races.find (
|
||||
MWBase::Environment::get().getWorld()->getPlayer().getRace());
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Race>().find (
|
||||
MWBase::Environment::get().getWorld()->getPlayer().getRace()
|
||||
);
|
||||
|
||||
bool male = MWBase::Environment::get().getWorld()->getPlayer().isMale();
|
||||
|
||||
|
@ -91,7 +92,7 @@ namespace MWMechanics
|
|||
if (!MWBase::Environment::get().getWorld()->getPlayer().getBirthsign().empty())
|
||||
{
|
||||
const ESM::BirthSign *sign =
|
||||
MWBase::Environment::get().getWorld()->getStore().birthSigns.find (
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::BirthSign>().find (
|
||||
MWBase::Environment::get().getWorld()->getPlayer().getBirthsign());
|
||||
|
||||
for (std::vector<std::string>::const_iterator iter (sign->mPowers.mList.begin());
|
||||
|
@ -132,14 +133,15 @@ namespace MWMechanics
|
|||
}
|
||||
}
|
||||
|
||||
typedef ESMS::IndexListT<ESM::Skill>::MapType ContainerType;
|
||||
const ContainerType& skills = MWBase::Environment::get().getWorld()->getStore().skills.list;
|
||||
const MWWorld::Store<ESM::Skill> &skills =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Skill>();
|
||||
|
||||
for (ContainerType::const_iterator iter (skills.begin()); iter!=skills.end(); ++iter)
|
||||
MWWorld::Store<ESM::Skill>::iterator iter = skills.begin();
|
||||
for (; iter != skills.end(); ++iter)
|
||||
{
|
||||
if (iter->second.mData.mSpecialization==class_.mData.mSpecialization)
|
||||
if (iter->mData.mSpecialization==class_.mData.mSpecialization)
|
||||
{
|
||||
int index = iter->first;
|
||||
int index = iter->mIndex;
|
||||
|
||||
if (index>=0 && index<27)
|
||||
{
|
||||
|
@ -261,12 +263,16 @@ namespace MWMechanics
|
|||
if (mUpdatePlayer)
|
||||
{
|
||||
// basic player profile; should not change anymore after the creation phase is finished.
|
||||
MWBase::Environment::get().getWindowManager()->setValue ("name", MWBase::Environment::get().getWorld()->getPlayer().getName());
|
||||
MWBase::Environment::get().getWindowManager()->setValue ("race",
|
||||
MWBase::Environment::get().getWorld()->getStore().races.find (MWBase::Environment::get().getWorld()->getPlayer().
|
||||
getRace())->mName);
|
||||
MWBase::Environment::get().getWindowManager()->setValue ("class",
|
||||
MWBase::Environment::get().getWorld()->getPlayer().getClass().mName);
|
||||
MWBase::WindowManager *winMgr =
|
||||
MWBase::Environment::get().getWindowManager();
|
||||
|
||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||
MWWorld::Player &player = world->getPlayer();
|
||||
|
||||
winMgr->setValue ("name", player.getName());
|
||||
winMgr->setValue ("race", world->getStore().get<ESM::Race>().find (player.getRace())->mName);
|
||||
winMgr->setValue ("class", player.getClass().mName);
|
||||
|
||||
mUpdatePlayer = false;
|
||||
|
||||
MWBase::WindowManager::SkillList majorSkills (5);
|
||||
|
@ -274,11 +280,11 @@ namespace MWMechanics
|
|||
|
||||
for (int i=0; i<5; ++i)
|
||||
{
|
||||
minorSkills[i] = MWBase::Environment::get().getWorld()->getPlayer().getClass().mData.mSkills[i][0];
|
||||
majorSkills[i] = MWBase::Environment::get().getWorld()->getPlayer().getClass().mData.mSkills[i][1];
|
||||
minorSkills[i] = player.getClass().mData.mSkills[i][0];
|
||||
majorSkills[i] = player.getClass().mData.mSkills[i][1];
|
||||
}
|
||||
|
||||
MWBase::Environment::get().getWindowManager()->configureSkills (majorSkills, minorSkills);
|
||||
winMgr->configureSkills (majorSkills, minorSkills);
|
||||
}
|
||||
|
||||
mActors.update (movement, duration, paused);
|
||||
|
@ -313,7 +319,9 @@ namespace MWMechanics
|
|||
|
||||
void MechanicsManager::setPlayerClass (const std::string& id)
|
||||
{
|
||||
MWBase::Environment::get().getWorld()->getPlayer().setClass (*MWBase::Environment::get().getWorld()->getStore().classes.find (id));
|
||||
MWBase::Environment::get().getWorld()->getPlayer().setClass (
|
||||
*MWBase::Environment::get().getWorld()->getStore().get<ESM::Class>().find (id)
|
||||
);
|
||||
mClassSelected = true;
|
||||
buildPlayer();
|
||||
mUpdatePlayer = true;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include <components/esm/loadclas.hpp>
|
||||
#include <components/esm/loadgmst.hpp>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
@ -81,7 +81,8 @@ float MWMechanics::NpcStats::getSkillGain (int skillIndex, const ESM::Class& cla
|
|||
if (level<0)
|
||||
level = static_cast<int> (getSkill (skillIndex).getBase());
|
||||
|
||||
const ESM::Skill *skill = MWBase::Environment::get().getWorld()->getStore().skills.find (skillIndex);
|
||||
const ESM::Skill *skill =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Skill>().find (skillIndex);
|
||||
|
||||
float skillFactor = 1;
|
||||
|
||||
|
@ -96,14 +97,15 @@ float MWMechanics::NpcStats::getSkillGain (int skillIndex, const ESM::Class& cla
|
|||
throw std::runtime_error ("invalid skill gain factor");
|
||||
}
|
||||
|
||||
float typeFactor =
|
||||
MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("fMiscSkillBonus")->getFloat();
|
||||
const MWWorld::Store<ESM::GameSetting> &gmst =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
||||
|
||||
float typeFactor = gmst.find ("fMiscSkillBonus")->getFloat();
|
||||
|
||||
for (int i=0; i<5; ++i)
|
||||
if (class_.mData.mSkills[i][0]==skillIndex)
|
||||
{
|
||||
typeFactor =
|
||||
MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("fMinorSkillBonus")->getFloat();
|
||||
typeFactor = gmst.find ("fMinorSkillBonus")->getFloat();
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -111,8 +113,7 @@ float MWMechanics::NpcStats::getSkillGain (int skillIndex, const ESM::Class& cla
|
|||
for (int i=0; i<5; ++i)
|
||||
if (class_.mData.mSkills[i][1]==skillIndex)
|
||||
{
|
||||
typeFactor =
|
||||
MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("fMajorSkillBonus")->getFloat();
|
||||
typeFactor = gmst.find ("fMajorSkillBonus")->getFloat();
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -124,8 +125,7 @@ float MWMechanics::NpcStats::getSkillGain (int skillIndex, const ESM::Class& cla
|
|||
|
||||
if (skill->mData.mSpecialization==class_.mData.mSpecialization)
|
||||
{
|
||||
specialisationFactor =
|
||||
MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("fSpecialSkillBonus")->getFloat();
|
||||
specialisationFactor = gmst.find ("fSpecialSkillBonus")->getFloat();
|
||||
|
||||
if (specialisationFactor<=0)
|
||||
throw std::runtime_error ("invalid skill specialisation factor");
|
||||
|
@ -178,7 +178,8 @@ void MWMechanics::NpcStats::increaseSkill(int skillIndex, const ESM::Class &clas
|
|||
mLevelProgress += levelProgress;
|
||||
|
||||
// check the attribute this skill belongs to
|
||||
const ESM::Skill* skill = MWBase::Environment::get().getWorld ()->getStore ().skills.find(skillIndex);
|
||||
const ESM::Skill* skill =
|
||||
MWBase::Environment::get().getWorld ()->getStore ().get<ESM::Skill>().find(skillIndex);
|
||||
++mSkillIncreases[skill->mData.mAttribute];
|
||||
|
||||
// Play sound & skill progress notification
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
#include "spells.hpp"
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include <components/esm/loadspel.hpp>
|
||||
|
||||
|
@ -50,7 +50,8 @@ namespace MWMechanics
|
|||
|
||||
for (TIterator iter = mSpells.begin(); iter!=mSpells.end(); ++iter)
|
||||
{
|
||||
const ESM::Spell *spell = MWBase::Environment::get().getWorld()->getStore().spells.find (*iter);
|
||||
const ESM::Spell *spell =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find (*iter);
|
||||
|
||||
if (spell->mData.mType==ESM::Spell::ST_Ability || spell->mData.mType==ESM::Spell::ST_Blight ||
|
||||
spell->mData.mType==ESM::Spell::ST_Disease || spell->mData.mType==ESM::Spell::ST_Curse)
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "../mwworld/class.hpp"
|
||||
#include "../mwmechanics/creaturestats.hpp"
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "npcstats.hpp"
|
||||
|
||||
|
@ -40,7 +40,8 @@ namespace MWMechanics
|
|||
for (std::vector<ESM::ENAMstruct>::const_iterator it = effects.begin();
|
||||
it != effects.end(); ++it)
|
||||
{
|
||||
const ESM::MagicEffect* effect = MWBase::Environment::get().getWorld()->getStore().magicEffects.find(it->mEffectID);
|
||||
const ESM::MagicEffect* effect =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::MagicEffect>().find(it->mEffectID);
|
||||
int _school = effect->mData.mSchool;
|
||||
int _skillLevel = stats.getSkill (spellSchoolToSkill(_school)).getModified();
|
||||
|
||||
|
@ -61,7 +62,8 @@ namespace MWMechanics
|
|||
|
||||
inline int getSpellSchool(const std::string& spellId, const MWWorld::Ptr& actor)
|
||||
{
|
||||
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find(spellId);
|
||||
const ESM::Spell* spell =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find(spellId);
|
||||
return getSpellSchool(spell, actor);
|
||||
}
|
||||
|
||||
|
@ -107,7 +109,8 @@ namespace MWMechanics
|
|||
|
||||
inline float getSpellSuccessChance (const std::string& spellId, const MWWorld::Ptr& actor)
|
||||
{
|
||||
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find(spellId);
|
||||
const ESM::Spell* spell =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find(spellId);
|
||||
return getSpellSuccessChance(spell, actor);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,10 +21,10 @@ CreatureAnimation::CreatureAnimation(const MWWorld::Ptr& ptr): Animation()
|
|||
mInsert = ptr.getRefData().getBaseNode();
|
||||
MWWorld::LiveCellRef<ESM::Creature> *ref = ptr.get<ESM::Creature>();
|
||||
|
||||
assert (ref->base != NULL);
|
||||
if(!ref->base->mModel.empty())
|
||||
assert (ref->mBase != NULL);
|
||||
if(!ref->mBase->mModel.empty())
|
||||
{
|
||||
std::string mesh = "meshes\\" + ref->base->mModel;
|
||||
std::string mesh = "meshes\\" + ref->mBase->mModel;
|
||||
|
||||
mEntityList = NifOgre::NIFLoader::createEntities(mInsert, &mTextKeys, mesh);
|
||||
for(size_t i = 0;i < mEntityList.mEntities.size();i++)
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include <components/esm/loadstat.hpp>
|
||||
#include <components/esm/loadpgrd.hpp>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "../mwbase/world.hpp" // these includes can be removed once the static-hack is gone
|
||||
#include "../mwbase/environment.hpp"
|
||||
|
@ -228,22 +228,23 @@ void Debugging::togglePathgrid()
|
|||
|
||||
void Debugging::enableCellPathgrid(MWWorld::Ptr::CellStore *store)
|
||||
{
|
||||
ESM::Pathgrid *pathgrid = MWBase::Environment::get().getWorld()->getStore().pathgrids.search(*store->cell);
|
||||
const ESM::Pathgrid *pathgrid =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Pathgrid>().search(*store->mCell);
|
||||
if (!pathgrid) return;
|
||||
|
||||
Vector3 cellPathGridPos(0, 0, 0);
|
||||
if (store->cell->isExterior())
|
||||
if (store->mCell->isExterior())
|
||||
{
|
||||
cellPathGridPos.x = store->cell->mData.mX * ESM::Land::REAL_SIZE;
|
||||
cellPathGridPos.y = store->cell->mData.mY * ESM::Land::REAL_SIZE;
|
||||
cellPathGridPos.x = store->mCell->mData.mX * ESM::Land::REAL_SIZE;
|
||||
cellPathGridPos.y = store->mCell->mData.mY * ESM::Land::REAL_SIZE;
|
||||
}
|
||||
SceneNode *cellPathGrid = mPathGridRoot->createChildSceneNode(cellPathGridPos);
|
||||
cellPathGrid->attachObject(createPathgridLines(pathgrid));
|
||||
cellPathGrid->attachObject(createPathgridPoints(pathgrid));
|
||||
|
||||
if (store->cell->isExterior())
|
||||
if (store->mCell->isExterior())
|
||||
{
|
||||
mExteriorPathgridNodes[std::make_pair(store->cell->mData.mX, store->cell->mData.mY)] = cellPathGrid;
|
||||
mExteriorPathgridNodes[std::make_pair(store->mCell->getGridX(), store->mCell->getGridY())] = cellPathGrid;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -254,10 +255,10 @@ void Debugging::enableCellPathgrid(MWWorld::Ptr::CellStore *store)
|
|||
|
||||
void Debugging::disableCellPathgrid(MWWorld::Ptr::CellStore *store)
|
||||
{
|
||||
if (store->cell->isExterior())
|
||||
if (store->mCell->isExterior())
|
||||
{
|
||||
ExteriorPathgridNodes::iterator it =
|
||||
mExteriorPathgridNodes.find(std::make_pair(store->cell->mData.mX, store->cell->mData.mY));
|
||||
mExteriorPathgridNodes.find(std::make_pair(store->mCell->getGridX(), store->mCell->getGridY()));
|
||||
if (it != mExteriorPathgridNodes.end())
|
||||
{
|
||||
destroyCellPathgridNode(it->second);
|
||||
|
|
|
@ -11,8 +11,7 @@
|
|||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include <components/esm_store/reclists.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
namespace MWRender
|
||||
{
|
||||
|
@ -29,18 +28,21 @@ namespace MWRender
|
|||
{
|
||||
Ogre::TexturePtr tex;
|
||||
|
||||
const MWWorld::ESMStore &esmStore =
|
||||
MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
// get the size of the world
|
||||
const ESMS::CellList::ExtCells& extCells = MWBase::Environment::get().getWorld ()->getStore ().cells.extCells;
|
||||
for (ESMS::CellList::ExtCells::const_iterator it = extCells.begin(); it != extCells.end(); ++it)
|
||||
MWWorld::Store<ESM::Cell>::iterator it = esmStore.get<ESM::Cell>().extBegin();
|
||||
for (; it != esmStore.get<ESM::Cell>().extEnd(); ++it)
|
||||
{
|
||||
if (it->first.first < mMinX)
|
||||
mMinX = it->first.first;
|
||||
if (it->first.first > mMaxX)
|
||||
mMaxX = it->first.first;
|
||||
if (it->first.second < mMinY)
|
||||
mMinY = it->first.second;
|
||||
if (it->first.second > mMaxY)
|
||||
mMaxY = it->first.second;
|
||||
if (it->getGridX() < mMinX)
|
||||
mMinX = it->getGridX();
|
||||
if (it->getGridX() > mMaxX)
|
||||
mMaxX = it->getGridX();
|
||||
if (it->getGridY() < mMinY)
|
||||
mMinY = it->getGridY();
|
||||
if (it->getGridY() > mMaxY)
|
||||
mMaxY = it->getGridY();
|
||||
}
|
||||
|
||||
int cellSize = 24;
|
||||
|
@ -59,7 +61,7 @@ namespace MWRender
|
|||
{
|
||||
for (int y = mMinY; y <= mMaxY; ++y)
|
||||
{
|
||||
ESM::Land* land = MWBase::Environment::get().getWorld ()->getStore ().lands.search (x,y);
|
||||
ESM::Land* land = esmStore.get<ESM::Land>().search (x,y);
|
||||
|
||||
if (land)
|
||||
{
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <OgreMaterialManager.h>
|
||||
#include <OgreHardwarePixelBuffer.h>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
@ -108,10 +108,10 @@ void LocalMap::requestMap(MWWorld::Ptr::CellStore* cell)
|
|||
|
||||
mCameraRotNode->setOrientation(Quaternion::IDENTITY);
|
||||
|
||||
std::string name = "Cell_"+coordStr(cell->cell->mData.mX, cell->cell->mData.mY);
|
||||
int x = cell->mCell->getGridX();
|
||||
int y = cell->mCell->getGridY();
|
||||
|
||||
int x = cell->cell->mData.mX;
|
||||
int y = cell->cell->mData.mY;
|
||||
std::string name = "Cell_"+coordStr(x, y);
|
||||
|
||||
mCameraPosNode->setPosition(Vector3(0,0,0));
|
||||
|
||||
|
@ -163,7 +163,7 @@ void LocalMap::requestMap(MWWorld::Ptr::CellStore* cell,
|
|||
const int segsX = std::ceil( length.x / sSize );
|
||||
const int segsY = std::ceil( length.y / sSize );
|
||||
|
||||
mInteriorName = cell->cell->mName;
|
||||
mInteriorName = cell->mCell->mName;
|
||||
|
||||
for (int x=0; x<segsX; ++x)
|
||||
{
|
||||
|
@ -173,7 +173,7 @@ void LocalMap::requestMap(MWWorld::Ptr::CellStore* cell,
|
|||
Vector2 newcenter = start + 4096;
|
||||
|
||||
render(newcenter.x - center.x, newcenter.y - center.y, z.y, z.x, sSize, sSize,
|
||||
cell->cell->mName + "_" + coordStr(x,y));
|
||||
cell->mCell->mName + "_" + coordStr(x,y));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <OgreEntity.h>
|
||||
#include <OgreSubEntity.h>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
@ -62,19 +62,20 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, Ogre::SceneNode* node, MWWor
|
|||
mPartPriorities[init] = 0;
|
||||
}
|
||||
|
||||
const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const ESM::Race *race = store.races.find(ref->base->mRace);
|
||||
const MWWorld::ESMStore &store =
|
||||
MWBase::Environment::get().getWorld()->getStore();
|
||||
const ESM::Race *race = store.get<ESM::Race>().find(ref->mBase->mRace);
|
||||
|
||||
std::string hairID = ref->base->mHair;
|
||||
std::string headID = ref->base->mHead;
|
||||
headModel = "meshes\\" + store.bodyParts.find(headID)->mModel;
|
||||
hairModel = "meshes\\" + store.bodyParts.find(hairID)->mModel;
|
||||
npcName = ref->base->mName;
|
||||
std::string hairID = ref->mBase->mHair;
|
||||
std::string headID = ref->mBase->mHead;
|
||||
headModel = "meshes\\" + store.get<ESM::BodyPart>().find(headID)->mModel;
|
||||
hairModel = "meshes\\" + store.get<ESM::BodyPart>().find(hairID)->mModel;
|
||||
npcName = ref->mBase->mName;
|
||||
|
||||
isFemale = !!(ref->base->mFlags&ESM::NPC::Female);
|
||||
isFemale = !!(ref->mBase->mFlags&ESM::NPC::Female);
|
||||
isBeast = !!(race->mData.mFlags&ESM::Race::Beast);
|
||||
|
||||
bodyRaceID = "b_n_"+ref->base->mRace;
|
||||
bodyRaceID = "b_n_"+ref->mBase->mRace;
|
||||
std::transform(bodyRaceID.begin(), bodyRaceID.end(), bodyRaceID.begin(), ::tolower);
|
||||
|
||||
|
||||
|
@ -170,7 +171,7 @@ void NpcAnimation::updateParts()
|
|||
{
|
||||
MWWorld::Ptr ptr = *robe;
|
||||
|
||||
const ESM::Clothing *clothes = (ptr.get<ESM::Clothing>())->base;
|
||||
const ESM::Clothing *clothes = (ptr.get<ESM::Clothing>())->mBase;
|
||||
std::vector<ESM::PartReference> parts = clothes->mParts.mParts;
|
||||
addPartGroup(MWWorld::InventoryStore::Slot_Robe, 5, parts);
|
||||
reserveIndividualPart(ESM::PRT_Groin, MWWorld::InventoryStore::Slot_Robe, 5);
|
||||
|
@ -190,7 +191,7 @@ void NpcAnimation::updateParts()
|
|||
{
|
||||
MWWorld::Ptr ptr = *skirtiter;
|
||||
|
||||
const ESM::Clothing *clothes = (ptr.get<ESM::Clothing>())->base;
|
||||
const ESM::Clothing *clothes = (ptr.get<ESM::Clothing>())->mBase;
|
||||
std::vector<ESM::PartReference> parts = clothes->mParts.mParts;
|
||||
addPartGroup(MWWorld::InventoryStore::Slot_Skirt, 4, parts);
|
||||
reserveIndividualPart(ESM::PRT_Groin, MWWorld::InventoryStore::Slot_Skirt, 4);
|
||||
|
@ -201,32 +202,32 @@ void NpcAnimation::updateParts()
|
|||
if(helmet != mInv.end())
|
||||
{
|
||||
removeIndividualPart(ESM::PRT_Hair);
|
||||
const ESM::Armor *armor = (helmet->get<ESM::Armor>())->base;
|
||||
const ESM::Armor *armor = (helmet->get<ESM::Armor>())->mBase;
|
||||
std::vector<ESM::PartReference> parts = armor->mParts.mParts;
|
||||
addPartGroup(MWWorld::InventoryStore::Slot_Helmet, 3, parts);
|
||||
}
|
||||
if(cuirass != mInv.end())
|
||||
{
|
||||
const ESM::Armor *armor = (cuirass->get<ESM::Armor>())->base;
|
||||
const ESM::Armor *armor = (cuirass->get<ESM::Armor>())->mBase;
|
||||
std::vector<ESM::PartReference> parts = armor->mParts.mParts;
|
||||
addPartGroup(MWWorld::InventoryStore::Slot_Cuirass, 3, parts);
|
||||
}
|
||||
if(greaves != mInv.end())
|
||||
{
|
||||
const ESM::Armor *armor = (greaves->get<ESM::Armor>())->base;
|
||||
const ESM::Armor *armor = (greaves->get<ESM::Armor>())->mBase;
|
||||
std::vector<ESM::PartReference> parts = armor->mParts.mParts;
|
||||
addPartGroup(MWWorld::InventoryStore::Slot_Greaves, 3, parts);
|
||||
}
|
||||
|
||||
if(leftpauldron != mInv.end())
|
||||
{
|
||||
const ESM::Armor *armor = (leftpauldron->get<ESM::Armor>())->base;
|
||||
const ESM::Armor *armor = (leftpauldron->get<ESM::Armor>())->mBase;
|
||||
std::vector<ESM::PartReference> parts = armor->mParts.mParts;
|
||||
addPartGroup(MWWorld::InventoryStore::Slot_LeftPauldron, 3, parts);
|
||||
}
|
||||
if(rightpauldron != mInv.end())
|
||||
{
|
||||
const ESM::Armor *armor = (rightpauldron->get<ESM::Armor>())->base;
|
||||
const ESM::Armor *armor = (rightpauldron->get<ESM::Armor>())->mBase;
|
||||
std::vector<ESM::PartReference> parts = armor->mParts.mParts;
|
||||
addPartGroup(MWWorld::InventoryStore::Slot_RightPauldron, 3, parts);
|
||||
}
|
||||
|
@ -234,13 +235,13 @@ void NpcAnimation::updateParts()
|
|||
{
|
||||
if(boots->getTypeName() == typeid(ESM::Clothing).name())
|
||||
{
|
||||
const ESM::Clothing *clothes = (boots->get<ESM::Clothing>())->base;
|
||||
const ESM::Clothing *clothes = (boots->get<ESM::Clothing>())->mBase;
|
||||
std::vector<ESM::PartReference> parts = clothes->mParts.mParts;
|
||||
addPartGroup(MWWorld::InventoryStore::Slot_Boots, 2, parts);
|
||||
}
|
||||
else if(boots->getTypeName() == typeid(ESM::Armor).name())
|
||||
{
|
||||
const ESM::Armor *armor = (boots->get<ESM::Armor>())->base;
|
||||
const ESM::Armor *armor = (boots->get<ESM::Armor>())->mBase;
|
||||
std::vector<ESM::PartReference> parts = armor->mParts.mParts;
|
||||
addPartGroup(MWWorld::InventoryStore::Slot_Boots, 3, parts);
|
||||
}
|
||||
|
@ -249,13 +250,13 @@ void NpcAnimation::updateParts()
|
|||
{
|
||||
if(leftglove->getTypeName() == typeid(ESM::Clothing).name())
|
||||
{
|
||||
const ESM::Clothing *clothes = (leftglove->get<ESM::Clothing>())->base;
|
||||
const ESM::Clothing *clothes = (leftglove->get<ESM::Clothing>())->mBase;
|
||||
std::vector<ESM::PartReference> parts = clothes->mParts.mParts;
|
||||
addPartGroup(MWWorld::InventoryStore::Slot_LeftGauntlet, 2, parts);
|
||||
}
|
||||
else
|
||||
{
|
||||
const ESM::Armor *armor = (leftglove->get<ESM::Armor>())->base;
|
||||
const ESM::Armor *armor = (leftglove->get<ESM::Armor>())->mBase;
|
||||
std::vector<ESM::PartReference> parts = armor->mParts.mParts;
|
||||
addPartGroup(MWWorld::InventoryStore::Slot_LeftGauntlet, 3, parts);
|
||||
}
|
||||
|
@ -264,13 +265,13 @@ void NpcAnimation::updateParts()
|
|||
{
|
||||
if(rightglove->getTypeName() == typeid(ESM::Clothing).name())
|
||||
{
|
||||
const ESM::Clothing *clothes = (rightglove->get<ESM::Clothing>())->base;
|
||||
const ESM::Clothing *clothes = (rightglove->get<ESM::Clothing>())->mBase;
|
||||
std::vector<ESM::PartReference> parts = clothes->mParts.mParts;
|
||||
addPartGroup(MWWorld::InventoryStore::Slot_RightGauntlet, 2, parts);
|
||||
}
|
||||
else
|
||||
{
|
||||
const ESM::Armor *armor = (rightglove->get<ESM::Armor>())->base;
|
||||
const ESM::Armor *armor = (rightglove->get<ESM::Armor>())->mBase;
|
||||
std::vector<ESM::PartReference> parts = armor->mParts.mParts;
|
||||
addPartGroup(MWWorld::InventoryStore::Slot_RightGauntlet, 3, parts);
|
||||
}
|
||||
|
@ -279,13 +280,13 @@ void NpcAnimation::updateParts()
|
|||
|
||||
if(shirt != mInv.end())
|
||||
{
|
||||
const ESM::Clothing *clothes = (shirt->get<ESM::Clothing>())->base;
|
||||
const ESM::Clothing *clothes = (shirt->get<ESM::Clothing>())->mBase;
|
||||
std::vector<ESM::PartReference> parts = clothes->mParts.mParts;
|
||||
addPartGroup(MWWorld::InventoryStore::Slot_Shirt, 2, parts);
|
||||
}
|
||||
if(pants != mInv.end())
|
||||
{
|
||||
const ESM::Clothing *clothes = (pants->get<ESM::Clothing>())->base;
|
||||
const ESM::Clothing *clothes = (pants->get<ESM::Clothing>())->mBase;
|
||||
std::vector<ESM::PartReference> parts = clothes->mParts.mParts;
|
||||
addPartGroup(MWWorld::InventoryStore::Slot_Pants, 2, parts);
|
||||
}
|
||||
|
@ -322,7 +323,7 @@ void NpcAnimation::updateParts()
|
|||
{ ESM::PRT_Tail, { "tail", "" } }
|
||||
};
|
||||
|
||||
const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||
for(size_t i = 0;i < sizeof(PartTypeList)/sizeof(PartTypeList[0]);i++)
|
||||
{
|
||||
if(mPartPriorities[PartTypeList[i].type] < 1)
|
||||
|
@ -331,7 +332,7 @@ void NpcAnimation::updateParts()
|
|||
bool tryfemale = isFemale;
|
||||
int ni = 0;
|
||||
do {
|
||||
part = store.bodyParts.search(bodyRaceID+(tryfemale?"_f_":"_m_")+PartTypeList[i].name[ni]);
|
||||
part = store.get<ESM::BodyPart>().search(bodyRaceID+(tryfemale?"_f_":"_m_")+PartTypeList[i].name[ni]);
|
||||
if(part) break;
|
||||
|
||||
ni ^= 1;
|
||||
|
@ -569,11 +570,14 @@ void NpcAnimation::addPartGroup(int group, int priority, std::vector<ESM::PartRe
|
|||
{
|
||||
ESM::PartReference &part = parts[i];
|
||||
|
||||
const MWWorld::Store<ESM::BodyPart> &parts =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::BodyPart>();
|
||||
|
||||
const ESM::BodyPart *bodypart = 0;
|
||||
if(isFemale)
|
||||
bodypart = MWBase::Environment::get().getWorld()->getStore().bodyParts.search(part.mFemale);
|
||||
bodypart = parts.search(part.mFemale);
|
||||
if(!bodypart)
|
||||
bodypart = MWBase::Environment::get().getWorld()->getStore().bodyParts.search(part.mMale);
|
||||
bodypart = parts.search(part.mMale);
|
||||
|
||||
if(bodypart)
|
||||
addOrReplaceIndividualPart(part.mPart, group, priority,"meshes\\" + bodypart->mModel);
|
||||
|
|
|
@ -219,18 +219,18 @@ void Objects::insertLight (const MWWorld::Ptr& ptr, float r, float g, float b, f
|
|||
info.radius = radius;
|
||||
info.colour = Ogre::ColourValue(r, g, b);
|
||||
|
||||
if (ref->base->mData.mFlags & ESM::Light::Negative)
|
||||
if (ref->mBase->mData.mFlags & ESM::Light::Negative)
|
||||
info.colour *= -1;
|
||||
|
||||
info.interior = (ptr.getCell()->cell->mData.mFlags & ESM::Cell::Interior);
|
||||
info.interior = !ptr.getCell()->mCell->isExterior();
|
||||
|
||||
if (ref->base->mData.mFlags & ESM::Light::Flicker)
|
||||
if (ref->mBase->mData.mFlags & ESM::Light::Flicker)
|
||||
info.type = LT_Flicker;
|
||||
else if (ref->base->mData.mFlags & ESM::Light::FlickerSlow)
|
||||
else if (ref->mBase->mData.mFlags & ESM::Light::FlickerSlow)
|
||||
info.type = LT_FlickerSlow;
|
||||
else if (ref->base->mData.mFlags & ESM::Light::Pulse)
|
||||
else if (ref->mBase->mData.mFlags & ESM::Light::Pulse)
|
||||
info.type = LT_Pulse;
|
||||
else if (ref->base->mData.mFlags & ESM::Light::PulseSlow)
|
||||
else if (ref->mBase->mData.mFlags & ESM::Light::PulseSlow)
|
||||
info.type = LT_PulseSlow;
|
||||
else
|
||||
info.type = LT_Normal;
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include <extern/shiny/Platforms/Ogre/OgrePlatform.hpp>
|
||||
|
||||
#include <components/esm/loadstat.hpp>
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
#include <components/settings/settings.hpp>
|
||||
|
||||
#include "../mwbase/world.hpp" // these includes can be removed once the static-hack is gone
|
||||
|
@ -207,7 +207,7 @@ void RenderingManager::removeCell (MWWorld::Ptr::CellStore *store)
|
|||
mObjects.removeCell(store);
|
||||
mActors.removeCell(store);
|
||||
mDebugging->cellRemoved(store);
|
||||
if (store->cell->isExterior())
|
||||
if (store->mCell->isExterior())
|
||||
mTerrainManager->cellRemoved(store);
|
||||
}
|
||||
|
||||
|
@ -228,7 +228,7 @@ void RenderingManager::cellAdded (MWWorld::Ptr::CellStore *store)
|
|||
{
|
||||
mObjects.buildStaticGeometry (*store);
|
||||
mDebugging->cellAdded(store);
|
||||
if (store->cell->isExterior())
|
||||
if (store->mCell->isExterior())
|
||||
mTerrainManager->cellAdded(store);
|
||||
waterAdded(store);
|
||||
}
|
||||
|
@ -377,22 +377,26 @@ void RenderingManager::update (float duration, bool paused)
|
|||
|
||||
mWater->updateUnderwater(
|
||||
world->isUnderwater(
|
||||
*world->getPlayer().getPlayer().getCell()->cell,
|
||||
*world->getPlayer().getPlayer().getCell()->mCell,
|
||||
Ogre::Vector3(cam.x, -cam.z, cam.y))
|
||||
);
|
||||
mWater->update(duration);
|
||||
}
|
||||
}
|
||||
|
||||
void RenderingManager::waterAdded (MWWorld::Ptr::CellStore *store){
|
||||
if(store->cell->mData.mFlags & store->cell->HasWater
|
||||
|| ((!(store->cell->mData.mFlags & ESM::Cell::Interior))
|
||||
&& !MWBase::Environment::get().getWorld()->getStore().lands.search(store->cell->mData.mX,store->cell->mData.mY) )) // always use water, if the cell does not have land.
|
||||
void RenderingManager::waterAdded (MWWorld::Ptr::CellStore *store)
|
||||
{
|
||||
const MWWorld::Store<ESM::Land> &lands =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Land>();
|
||||
|
||||
if(store->mCell->mData.mFlags & ESM::Cell::HasWater
|
||||
|| ((store->mCell->isExterior())
|
||||
&& !lands.search(store->mCell->getGridX(),store->mCell->getGridY()) )) // always use water, if the cell does not have land.
|
||||
{
|
||||
if(mWater == 0)
|
||||
mWater = new MWRender::Water(mRendering.getCamera(), this, store->cell);
|
||||
mWater = new MWRender::Water(mRendering.getCamera(), this, store->mCell);
|
||||
else
|
||||
mWater->changeCell(store->cell);
|
||||
mWater->changeCell(store->mCell);
|
||||
mWater->setActive(true);
|
||||
}
|
||||
else
|
||||
|
@ -478,9 +482,9 @@ bool RenderingManager::toggleRenderMode(int mode)
|
|||
void RenderingManager::configureFog(MWWorld::Ptr::CellStore &mCell)
|
||||
{
|
||||
Ogre::ColourValue color;
|
||||
color.setAsABGR (mCell.cell->mAmbi.mFog);
|
||||
color.setAsABGR (mCell.mCell->mAmbi.mFog);
|
||||
|
||||
configureFog(mCell.cell->mAmbi.mFogDensity, color);
|
||||
configureFog(mCell.mCell->mAmbi.mFogDensity, color);
|
||||
|
||||
if (mWater)
|
||||
mWater->setViewportBackground (Ogre::ColourValue(0.8f, 0.9f, 1.0f));
|
||||
|
@ -530,7 +534,7 @@ void RenderingManager::setAmbientMode()
|
|||
|
||||
void RenderingManager::configureAmbient(MWWorld::Ptr::CellStore &mCell)
|
||||
{
|
||||
mAmbientColor.setAsABGR (mCell.cell->mAmbi.mAmbient);
|
||||
mAmbientColor.setAsABGR (mCell.mCell->mAmbi.mAmbient);
|
||||
setAmbientMode();
|
||||
|
||||
// Create a "sun" that shines light downwards. It doesn't look
|
||||
|
@ -540,7 +544,7 @@ void RenderingManager::configureAmbient(MWWorld::Ptr::CellStore &mCell)
|
|||
mSun = mRendering.getScene()->createLight();
|
||||
}
|
||||
Ogre::ColourValue colour;
|
||||
colour.setAsABGR (mCell.cell->mAmbi.mSunlight);
|
||||
colour.setAsABGR (mCell.mCell->mAmbi.mSunlight);
|
||||
mSun->setDiffuseColour (colour);
|
||||
mSun->setType(Ogre::Light::LT_DIRECTIONAL);
|
||||
mSun->setDirection(0,-1,0);
|
||||
|
@ -624,7 +628,7 @@ void RenderingManager::setGlare(bool glare)
|
|||
|
||||
void RenderingManager::requestMap(MWWorld::Ptr::CellStore* cell)
|
||||
{
|
||||
if (!(cell->cell->mData.mFlags & ESM::Cell::Interior))
|
||||
if (cell->mCell->isExterior())
|
||||
mLocalMap->requestMap(cell);
|
||||
else
|
||||
mLocalMap->requestMap(cell, mObjects.getDimensions(cell));
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <OgreTerrainGroup.h>
|
||||
#include <OgreHardwarePixelBuffer.h>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include <components/settings/settings.hpp>
|
||||
|
||||
|
@ -92,10 +92,11 @@ namespace MWRender
|
|||
|
||||
void TerrainManager::cellAdded(MWWorld::Ptr::CellStore *store)
|
||||
{
|
||||
const int cellX = store->cell->getGridX();
|
||||
const int cellY = store->cell->getGridY();
|
||||
const int cellX = store->mCell->getGridX();
|
||||
const int cellY = store->mCell->getGridY();
|
||||
|
||||
ESM::Land* land = MWBase::Environment::get().getWorld()->getStore().lands.search(cellX, cellY);
|
||||
ESM::Land* land =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Land>().search(cellX, cellY);
|
||||
if (land == NULL) // no land data means we're not going to create any terrain.
|
||||
return;
|
||||
|
||||
|
@ -188,8 +189,8 @@ namespace MWRender
|
|||
{
|
||||
for ( int y = 0; y < 2; y++ )
|
||||
{
|
||||
int terrainX = store->cell->getGridX() * 2 + x;
|
||||
int terrainY = store->cell->getGridY() * 2 + y;
|
||||
int terrainX = store->mCell->getGridX() * 2 + x;
|
||||
int terrainY = store->mCell->getGridY() * 2 + y;
|
||||
if (mTerrainGroup.getTerrain(terrainX, terrainY) != NULL)
|
||||
mTerrainGroup.unloadTerrain(terrainX, terrainY);
|
||||
}
|
||||
|
@ -245,7 +246,10 @@ namespace MWRender
|
|||
{
|
||||
//NB: All vtex ids are +1 compared to the ltex ids
|
||||
|
||||
assert( (int)MWBase::Environment::get().getWorld()->getStore().landTexts.getSize() >= (int)ltexIndex - 1 &&
|
||||
const MWWorld::Store<ESM::LandTexture> <exStore =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::LandTexture>();
|
||||
|
||||
assert( (int)ltexStore.getSize() >= (int)ltexIndex - 1 &&
|
||||
"LAND.VTEX must be within the bounds of the LTEX array");
|
||||
|
||||
std::string texture;
|
||||
|
@ -255,7 +259,7 @@ namespace MWRender
|
|||
}
|
||||
else
|
||||
{
|
||||
texture = MWBase::Environment::get().getWorld()->getStore().landTexts.search(ltexIndex-1)->mTexture;
|
||||
texture = ltexStore.search(ltexIndex-1)->mTexture;
|
||||
//TODO this is needed due to MWs messed up texture handling
|
||||
texture = texture.substr(0, texture.rfind(".")) + ".dds";
|
||||
}
|
||||
|
@ -411,7 +415,8 @@ namespace MWRender
|
|||
}
|
||||
|
||||
|
||||
ESM::Land* land = MWBase::Environment::get().getWorld()->getStore().lands.search(cellX, cellY);
|
||||
ESM::Land* land =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Land>().search(cellX, cellY);
|
||||
if ( land != NULL )
|
||||
{
|
||||
if (!land->isDataLoaded(ESM::Land::DATA_VTEX))
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
#include "cellextensions.hpp"
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include <components/compiler/extensions.hpp>
|
||||
|
||||
|
@ -87,8 +87,7 @@ namespace MWScript
|
|||
virtual void execute (Interpreter::Runtime& runtime)
|
||||
{
|
||||
bool interior =
|
||||
MWBase::Environment::get().getWorld()->getPlayer().getPlayer().getCell()->cell->mData.mFlags &
|
||||
ESM::Cell::Interior;
|
||||
!MWBase::Environment::get().getWorld()->getPlayer().getPlayer().getCell()->mCell->isExterior();
|
||||
|
||||
runtime.push (interior ? 1 : 0);
|
||||
}
|
||||
|
@ -103,14 +102,14 @@ namespace MWScript
|
|||
std::string name = runtime.getStringLiteral (runtime[0].mInteger);
|
||||
runtime.pop();
|
||||
|
||||
const ESM::Cell *cell = MWBase::Environment::get().getWorld()->getPlayer().getPlayer().getCell()->cell;
|
||||
const ESM::Cell *cell = MWBase::Environment::get().getWorld()->getPlayer().getPlayer().getCell()->mCell;
|
||||
|
||||
std::string current = cell->mName;
|
||||
|
||||
if (!(cell->mData.mFlags & ESM::Cell::Interior) && current.empty())
|
||||
{
|
||||
const ESM::Region *region =
|
||||
MWBase::Environment::get().getWorld()->getStore().regions.find (cell->mRegion);
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Region>().find (cell->mRegion);
|
||||
|
||||
current = region->mName;
|
||||
}
|
||||
|
@ -143,7 +142,7 @@ namespace MWScript
|
|||
|
||||
MWWorld::Ptr::CellStore *cell = MWBase::Environment::get().getWorld()->getPlayer().getPlayer().getCell();
|
||||
|
||||
if (!(cell->cell->mData.mFlags & ESM::Cell::Interior))
|
||||
if (cell->mCell->isExterior())
|
||||
throw std::runtime_error("Can't set water level in exterior cell");
|
||||
|
||||
cell->mWaterLevel = level;
|
||||
|
@ -161,7 +160,7 @@ namespace MWScript
|
|||
|
||||
MWWorld::Ptr::CellStore *cell = MWBase::Environment::get().getWorld()->getPlayer().getPlayer().getCell();
|
||||
|
||||
if (!(cell->cell->mData.mFlags & ESM::Cell::Interior))
|
||||
if (cell->mCell->isExterior())
|
||||
throw std::runtime_error("Can't set water level in exterior cell");
|
||||
|
||||
cell->mWaterLevel +=level;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
#include "compilercontext.hpp"
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include <components/compiler/locals.hpp>
|
||||
|
||||
|
@ -42,26 +42,29 @@ namespace MWScript
|
|||
|
||||
bool CompilerContext::isId (const std::string& name) const
|
||||
{
|
||||
const MWWorld::ESMStore &store =
|
||||
MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
return
|
||||
MWBase::Environment::get().getWorld()->getStore().activators.search (name) ||
|
||||
MWBase::Environment::get().getWorld()->getStore().potions.search (name) ||
|
||||
MWBase::Environment::get().getWorld()->getStore().appas.search (name) ||
|
||||
MWBase::Environment::get().getWorld()->getStore().armors.search (name) ||
|
||||
MWBase::Environment::get().getWorld()->getStore().books.search (name) ||
|
||||
MWBase::Environment::get().getWorld()->getStore().clothes.search (name) ||
|
||||
MWBase::Environment::get().getWorld()->getStore().containers.search (name) ||
|
||||
MWBase::Environment::get().getWorld()->getStore().creatures.search (name) ||
|
||||
MWBase::Environment::get().getWorld()->getStore().doors.search (name) ||
|
||||
MWBase::Environment::get().getWorld()->getStore().ingreds.search (name) ||
|
||||
MWBase::Environment::get().getWorld()->getStore().creatureLists.search (name) ||
|
||||
MWBase::Environment::get().getWorld()->getStore().itemLists.search (name) ||
|
||||
MWBase::Environment::get().getWorld()->getStore().lights.search (name) ||
|
||||
MWBase::Environment::get().getWorld()->getStore().lockpicks.search (name) ||
|
||||
MWBase::Environment::get().getWorld()->getStore().miscItems.search (name) ||
|
||||
MWBase::Environment::get().getWorld()->getStore().npcs.search (name) ||
|
||||
MWBase::Environment::get().getWorld()->getStore().probes.search (name) ||
|
||||
MWBase::Environment::get().getWorld()->getStore().repairs.search (name) ||
|
||||
MWBase::Environment::get().getWorld()->getStore().statics.search (name) ||
|
||||
MWBase::Environment::get().getWorld()->getStore().weapons.search (name);
|
||||
store.get<ESM::Activator>().search (name) ||
|
||||
store.get<ESM::Potion>().search (name) ||
|
||||
store.get<ESM::Apparatus>().search (name) ||
|
||||
store.get<ESM::Armor>().search (name) ||
|
||||
store.get<ESM::Book>().search (name) ||
|
||||
store.get<ESM::Clothing>().search (name) ||
|
||||
store.get<ESM::Container>().search (name) ||
|
||||
store.get<ESM::Creature>().search (name) ||
|
||||
store.get<ESM::Door>().search (name) ||
|
||||
store.get<ESM::Ingredient>().search (name) ||
|
||||
store.get<ESM::CreatureLevList>().search (name) ||
|
||||
store.get<ESM::ItemLevList>().search (name) ||
|
||||
store.get<ESM::Light>().search (name) ||
|
||||
store.get<ESM::Tool>().search (name) ||
|
||||
store.get<ESM::Miscellaneous>().search (name) ||
|
||||
store.get<ESM::NPC>().search (name) ||
|
||||
store.get<ESM::Probe>().search (name) ||
|
||||
store.get<ESM::Repair>().search (name) ||
|
||||
store.get<ESM::Static>().search (name) ||
|
||||
store.get<ESM::Weapon>().search (name);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
|
||||
#include <cassert>
|
||||
|
||||
#include <components/esm_store/reclists.hpp>
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/scriptmanager.hpp"
|
||||
|
@ -13,21 +12,23 @@
|
|||
|
||||
namespace MWScript
|
||||
{
|
||||
GlobalScripts::GlobalScripts (const ESMS::ESMStore& store)
|
||||
GlobalScripts::GlobalScripts (const MWWorld::ESMStore& store)
|
||||
: mStore (store)
|
||||
{
|
||||
addScript ("Main");
|
||||
|
||||
for (ESMS::RecListT<ESM::StartScript>::MapType::const_iterator iter
|
||||
(store.startScripts.list.begin());
|
||||
iter != store.startScripts.list.end(); ++iter)
|
||||
addScript (iter->second.mScript);
|
||||
MWWorld::Store<ESM::StartScript>::iterator iter =
|
||||
store.get<ESM::StartScript>().begin();
|
||||
|
||||
for (; iter != store.get<ESM::StartScript>().end(); ++iter) {
|
||||
addScript (iter->mScript);
|
||||
}
|
||||
}
|
||||
|
||||
void GlobalScripts::addScript (const std::string& name)
|
||||
{
|
||||
if (mScripts.find (name)==mScripts.end())
|
||||
if (const ESM::Script *script = mStore.scripts.find (name))
|
||||
if (const ESM::Script *script = mStore.get<ESM::Script>().find (name))
|
||||
{
|
||||
Locals locals;
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "locals.hpp"
|
||||
|
||||
namespace ESMS
|
||||
namespace MWWorld
|
||||
{
|
||||
struct ESMStore;
|
||||
}
|
||||
|
@ -15,12 +15,12 @@ namespace MWScript
|
|||
{
|
||||
class GlobalScripts
|
||||
{
|
||||
const ESMS::ESMStore& mStore;
|
||||
const MWWorld::ESMStore& mStore;
|
||||
std::map<std::string, std::pair<bool, Locals> > mScripts; // running, local variables
|
||||
|
||||
public:
|
||||
|
||||
GlobalScripts (const ESMS::ESMStore& store);
|
||||
GlobalScripts (const MWWorld::ESMStore& store);
|
||||
|
||||
void addScript (const std::string& name);
|
||||
|
||||
|
|
|
@ -9,8 +9,7 @@
|
|||
#include <components/interpreter/runtime.hpp>
|
||||
#include <components/interpreter/opcodes.hpp>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include <components/esm_store/reclists.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/windowmanager.hpp"
|
||||
|
@ -109,13 +108,20 @@ namespace MWScript
|
|||
// "Will match complete or partial cells, so ShowMap, "Vivec" will show cells Vivec and Vivec, Fred's House as well."
|
||||
// http://www.uesp.net/wiki/Tes3Mod:ShowMap
|
||||
|
||||
const ESMS::CellList::ExtCells& extCells = MWBase::Environment::get().getWorld ()->getStore ().cells.extCells;
|
||||
for (ESMS::CellList::ExtCells::const_iterator it = extCells.begin(); it != extCells.end(); ++it)
|
||||
const MWWorld::Store<ESM::Cell> &cells =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Cell>();
|
||||
|
||||
MWWorld::Store<ESM::Cell>::iterator it = cells.extBegin();
|
||||
for (; it != cells.extEnd(); ++it)
|
||||
{
|
||||
std::string name = it->second->mName;
|
||||
std::string name = it->mName;
|
||||
boost::algorithm::to_lower(name);
|
||||
if (name.find(cell) != std::string::npos)
|
||||
MWBase::Environment::get().getWindowManager()->addVisitedLocation (it->second->mName, it->first.first, it->first.second);
|
||||
MWBase::Environment::get().getWindowManager()->addVisitedLocation (
|
||||
it->mName,
|
||||
it->getGridX(),
|
||||
it->getGridY()
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -126,12 +132,19 @@ namespace MWScript
|
|||
|
||||
virtual void execute (Interpreter::Runtime& runtime)
|
||||
{
|
||||
const ESMS::CellList::ExtCells& extCells = MWBase::Environment::get().getWorld ()->getStore ().cells.extCells;
|
||||
for (ESMS::CellList::ExtCells::const_iterator it = extCells.begin(); it != extCells.end(); ++it)
|
||||
const MWWorld::Store<ESM::Cell> &cells =
|
||||
MWBase::Environment::get().getWorld ()->getStore().get<ESM::Cell>();
|
||||
|
||||
MWWorld::Store<ESM::Cell>::iterator it = cells.extBegin();
|
||||
for (; it != cells.extEnd(); ++it)
|
||||
{
|
||||
std::string name = it->second->mName;
|
||||
std::string name = it->mName;
|
||||
if (name != "")
|
||||
MWBase::Environment::get().getWindowManager()->addVisitedLocation (name, it->first.first, it->first.second);
|
||||
MWBase::Environment::get().getWindowManager()->addVisitedLocation (
|
||||
name,
|
||||
it->getGridX(),
|
||||
it->getGridY()
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <stdexcept>
|
||||
|
||||
#include <components/interpreter/types.hpp>
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
@ -278,7 +278,7 @@ namespace MWScript
|
|||
int index = MWBase::Environment::get().getScriptManager()->getLocalIndex (scriptId, name, 's');
|
||||
|
||||
ptr.getRefData().setLocals (
|
||||
*MWBase::Environment::get().getWorld()->getStore().scripts.find (scriptId));
|
||||
*MWBase::Environment::get().getWorld()->getStore().get<ESM::Script>().find (scriptId));
|
||||
return ptr.getRefData().getLocals().mShorts[index];
|
||||
}
|
||||
|
||||
|
@ -291,7 +291,7 @@ namespace MWScript
|
|||
int index = MWBase::Environment::get().getScriptManager()->getLocalIndex (scriptId, name, 'l');
|
||||
|
||||
ptr.getRefData().setLocals (
|
||||
*MWBase::Environment::get().getWorld()->getStore().scripts.find (scriptId));
|
||||
*MWBase::Environment::get().getWorld()->getStore().get<ESM::Script>().find (scriptId));
|
||||
return ptr.getRefData().getLocals().mLongs[index];
|
||||
}
|
||||
|
||||
|
@ -304,7 +304,7 @@ namespace MWScript
|
|||
int index = MWBase::Environment::get().getScriptManager()->getLocalIndex (scriptId, name, 'f');
|
||||
|
||||
ptr.getRefData().setLocals (
|
||||
*MWBase::Environment::get().getWorld()->getStore().scripts.find (scriptId));
|
||||
*MWBase::Environment::get().getWorld()->getStore().get<ESM::Script>().find (scriptId));
|
||||
return ptr.getRefData().getLocals().mFloats[index];
|
||||
}
|
||||
|
||||
|
@ -317,7 +317,7 @@ namespace MWScript
|
|||
int index = MWBase::Environment::get().getScriptManager()->getLocalIndex (scriptId, name, 's');
|
||||
|
||||
ptr.getRefData().setLocals (
|
||||
*MWBase::Environment::get().getWorld()->getStore().scripts.find (scriptId));
|
||||
*MWBase::Environment::get().getWorld()->getStore().get<ESM::Script>().find (scriptId));
|
||||
ptr.getRefData().getLocals().mShorts[index] = value;
|
||||
}
|
||||
|
||||
|
@ -330,7 +330,7 @@ namespace MWScript
|
|||
int index = MWBase::Environment::get().getScriptManager()->getLocalIndex (scriptId, name, 'l');
|
||||
|
||||
ptr.getRefData().setLocals (
|
||||
*MWBase::Environment::get().getWorld()->getStore().scripts.find (scriptId));
|
||||
*MWBase::Environment::get().getWorld()->getStore().get<ESM::Script>().find (scriptId));
|
||||
ptr.getRefData().getLocals().mLongs[index] = value;
|
||||
}
|
||||
|
||||
|
@ -343,7 +343,7 @@ namespace MWScript
|
|||
int index = MWBase::Environment::get().getScriptManager()->getLocalIndex (scriptId, name, 'f');
|
||||
|
||||
ptr.getRefData().setLocals (
|
||||
*MWBase::Environment::get().getWorld()->getStore().scripts.find (scriptId));
|
||||
*MWBase::Environment::get().getWorld()->getStore().get<ESM::Script>().find (scriptId));
|
||||
ptr.getRefData().getLocals().mFloats[index] = value;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include <exception>
|
||||
|
||||
#include <components/esm/loadscpt.hpp>
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include <components/compiler/scanner.hpp>
|
||||
#include <components/compiler/context.hpp>
|
||||
|
@ -17,7 +17,7 @@
|
|||
|
||||
namespace MWScript
|
||||
{
|
||||
ScriptManager::ScriptManager (const ESMS::ESMStore& store, bool verbose,
|
||||
ScriptManager::ScriptManager (const MWWorld::ESMStore& store, bool verbose,
|
||||
Compiler::Context& compilerContext)
|
||||
: mErrorHandler (std::cerr), mStore (store), mVerbose (verbose),
|
||||
mCompilerContext (compilerContext), mParser (mErrorHandler, mCompilerContext),
|
||||
|
@ -31,7 +31,7 @@ namespace MWScript
|
|||
|
||||
bool Success = true;
|
||||
|
||||
if (const ESM::Script *script = mStore.scripts.find (name))
|
||||
if (const ESM::Script *script = mStore.get<ESM::Script>().find (name))
|
||||
{
|
||||
if (mVerbose)
|
||||
std::cout << "compiling script: " << name << std::endl;
|
||||
|
@ -125,15 +125,14 @@ namespace MWScript
|
|||
|
||||
std::pair<int, int> ScriptManager::compileAll()
|
||||
{
|
||||
typedef ESMS::ScriptListT<ESM::Script>::MapType Container;
|
||||
|
||||
const Container& scripts = mStore.scripts.list;
|
||||
|
||||
int count = 0;
|
||||
int success = 0;
|
||||
|
||||
for (Container::const_iterator iter (scripts.begin()); iter!=scripts.end(); ++iter, ++count)
|
||||
if (compile (iter->first))
|
||||
const MWWorld::Store<ESM::Script>& scripts = mStore.get<ESM::Script>();
|
||||
MWWorld::Store<ESM::Script>::iterator it = scripts.begin();
|
||||
|
||||
for (; it != scripts.end(); ++it, ++count)
|
||||
if (compile (it->mId))
|
||||
++success;
|
||||
|
||||
return std::make_pair (count, success);
|
||||
|
@ -170,7 +169,7 @@ namespace MWScript
|
|||
int ScriptManager::getLocalIndex (const std::string& scriptId, const std::string& variable,
|
||||
char type)
|
||||
{
|
||||
const ESM::Script *script = mStore.scripts.find (scriptId);
|
||||
const ESM::Script *script = mStore.get<ESM::Script>().find (scriptId);
|
||||
|
||||
int offset = 0;
|
||||
int size = 0;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#include "globalscripts.hpp"
|
||||
|
||||
namespace ESMS
|
||||
namespace MWWorld
|
||||
{
|
||||
struct ESMStore;
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ namespace MWScript
|
|||
class ScriptManager : public MWBase::ScriptManager
|
||||
{
|
||||
Compiler::StreamErrorHandler mErrorHandler;
|
||||
const ESMS::ESMStore& mStore;
|
||||
const MWWorld::ESMStore& mStore;
|
||||
bool mVerbose;
|
||||
Compiler::Context& mCompilerContext;
|
||||
Compiler::FileParser mParser;
|
||||
|
@ -50,7 +50,7 @@ namespace MWScript
|
|||
|
||||
public:
|
||||
|
||||
ScriptManager (const ESMS::ESMStore& store, bool verbose,
|
||||
ScriptManager (const MWWorld::ESMStore& store, bool verbose,
|
||||
Compiler::Context& compilerContext);
|
||||
|
||||
virtual void run (const std::string& name, Interpreter::Context& interpreterContext);
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include <components/esm/loadnpc.hpp>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include <components/compiler/extensions.hpp>
|
||||
|
||||
|
@ -328,7 +328,7 @@ namespace MWScript
|
|||
assert (ref);
|
||||
|
||||
const ESM::Class& class_ =
|
||||
*MWBase::Environment::get().getWorld()->getStore().classes.find (ref->base->mClass);
|
||||
*MWBase::Environment::get().getWorld()->getStore().get<ESM::Class>().find (ref->mBase->mClass);
|
||||
|
||||
float level = 0;
|
||||
float progress = std::modf (stats.getSkill (mIndex).getBase(), &level);
|
||||
|
@ -390,7 +390,7 @@ namespace MWScript
|
|||
runtime.pop();
|
||||
|
||||
// make sure a spell with this ID actually exists.
|
||||
MWBase::Environment::get().getWorld()->getStore().spells.find (id);
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find (id);
|
||||
|
||||
MWWorld::Class::get (ptr).getCreatureStats (ptr).getSpells().add (id);
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <OgreMath.h>
|
||||
#include <OgreSceneNode.h>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
#include <components/esm/loadcell.hpp>
|
||||
|
||||
#include <components/compiler/extensions.hpp>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <algorithm>
|
||||
#include <map>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
@ -116,9 +116,8 @@ namespace MWSound
|
|||
std::string SoundManager::lookup(const std::string &soundId,
|
||||
float &volume, float &min, float &max)
|
||||
{
|
||||
const ESM::Sound *snd = MWBase::Environment::get().getWorld()->getStore().sounds.search(soundId);
|
||||
if(snd == NULL)
|
||||
throw std::runtime_error(std::string("Failed to lookup sound ")+soundId);
|
||||
const ESM::Sound *snd =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Sound>().find(soundId);
|
||||
|
||||
volume *= pow(10.0, (snd->mData.mVolume/255.0*3348.0 - 3348.0) / 2000.0);
|
||||
|
||||
|
@ -414,17 +413,19 @@ namespace MWSound
|
|||
|
||||
//If the region has changed
|
||||
timePassed += duration;
|
||||
if((current->cell->mData.mFlags & current->cell->Interior) || timePassed < 10)
|
||||
if(!current->mCell->isExterior() || timePassed < 10)
|
||||
return;
|
||||
timePassed = 0;
|
||||
|
||||
if(regionName != current->cell->mRegion)
|
||||
if(regionName != current->mCell->mRegion)
|
||||
{
|
||||
regionName = current->cell->mRegion;
|
||||
regionName = current->mCell->mRegion;
|
||||
total = 0;
|
||||
}
|
||||
|
||||
const ESM::Region *regn = MWBase::Environment::get().getWorld()->getStore().regions.search(regionName);
|
||||
const ESM::Region *regn =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Region>().search(regionName);
|
||||
|
||||
if (regn == NULL)
|
||||
return;
|
||||
|
||||
|
@ -477,7 +478,7 @@ namespace MWSound
|
|||
|
||||
MWWorld::Ptr player =
|
||||
MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
||||
const ESM::Cell *cell = player.getCell()->cell;
|
||||
const ESM::Cell *cell = player.getCell()->mCell;
|
||||
|
||||
Environment env = Env_Normal;
|
||||
if((cell->mData.mFlags&cell->HasWater) && mListenerPos.z < cell->mWater)
|
||||
|
|
|
@ -5,14 +5,13 @@
|
|||
|
||||
#include <components/esm/loadskil.hpp>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
||||
#include "../mwmechanics/creaturestats.hpp"
|
||||
#include "../mwmechanics/npcstats.hpp"
|
||||
|
||||
#include "esmstore.hpp"
|
||||
#include "class.hpp"
|
||||
|
||||
namespace MWWorld
|
||||
|
|
|
@ -4,15 +4,14 @@
|
|||
#include "../mwbase/windowmanager.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
||||
#include "../mwworld/player.hpp"
|
||||
#include "../mwworld/class.hpp"
|
||||
|
||||
#include "../mwmechanics/npcstats.hpp"
|
||||
|
||||
#include "../mwgui/bookwindow.hpp"
|
||||
#include "../mwgui/scrollwindow.hpp"
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "player.hpp"
|
||||
#include "class.hpp"
|
||||
#include "esmstore.hpp"
|
||||
|
||||
namespace MWWorld
|
||||
{
|
||||
|
@ -24,7 +23,7 @@ namespace MWWorld
|
|||
{
|
||||
LiveCellRef<ESM::Book> *ref = getTarget().get<ESM::Book>();
|
||||
|
||||
if (ref->base->mData.mIsScroll)
|
||||
if (ref->mBase->mData.mIsScroll)
|
||||
{
|
||||
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Scroll);
|
||||
MWBase::Environment::get().getWindowManager()->getScrollWindow()->open(getTarget());
|
||||
|
@ -39,16 +38,19 @@ namespace MWWorld
|
|||
MWMechanics::NpcStats& npcStats = MWWorld::Class::get(player).getNpcStats (player);
|
||||
|
||||
// Skill gain from books
|
||||
if (ref->base->mData.mSkillID >= 0 && ref->base->mData.mSkillID < ESM::Skill::Length
|
||||
&& !npcStats.hasBeenUsed (ref->base->mId))
|
||||
if (ref->mBase->mData.mSkillID >= 0 && ref->mBase->mData.mSkillID < ESM::Skill::Length
|
||||
&& !npcStats.hasBeenUsed (ref->mBase->mId))
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::NPC> *playerRef = player.get<ESM::NPC>();
|
||||
const ESM::Class *class_ = MWBase::Environment::get().getWorld()->getStore().classes.find (
|
||||
playerRef->base->mClass);
|
||||
|
||||
npcStats.increaseSkill (ref->base->mData.mSkillID, *class_, true);
|
||||
const ESM::Class *class_ =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Class>().find (
|
||||
playerRef->mBase->mClass
|
||||
);
|
||||
|
||||
npcStats.flagAsUsed (ref->base->mId);
|
||||
npcStats.increaseSkill (ref->mBase->mData.mSkillID, *class_, true);
|
||||
|
||||
npcStats.flagAsUsed (ref->mBase->mId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
#include "cells.hpp"
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
||||
#include "class.hpp"
|
||||
#include "esmstore.hpp"
|
||||
#include "containerstore.hpp"
|
||||
|
||||
MWWorld::Ptr::CellStore *MWWorld::Cells::getCellStore (const ESM::Cell *cell)
|
||||
|
@ -24,12 +23,12 @@ MWWorld::Ptr::CellStore *MWWorld::Cells::getCellStore (const ESM::Cell *cell)
|
|||
else
|
||||
{
|
||||
std::map<std::pair<int, int>, Ptr::CellStore>::iterator result =
|
||||
mExteriors.find (std::make_pair (cell->mData.mX, cell->mData.mY));
|
||||
mExteriors.find (std::make_pair (cell->getGridX(), cell->getGridY()));
|
||||
|
||||
if (result==mExteriors.end())
|
||||
{
|
||||
result = mExteriors.insert (std::make_pair (
|
||||
std::make_pair (cell->mData.mX, cell->mData.mY), Ptr::CellStore (cell))).first;
|
||||
std::make_pair (cell->getGridX(), cell->getGridY()), Ptr::CellStore (cell))).first;
|
||||
|
||||
}
|
||||
|
||||
|
@ -40,33 +39,33 @@ MWWorld::Ptr::CellStore *MWWorld::Cells::getCellStore (const ESM::Cell *cell)
|
|||
void MWWorld::Cells::fillContainers (Ptr::CellStore& cellStore)
|
||||
{
|
||||
for (CellRefList<ESM::Container>::List::iterator iter (
|
||||
cellStore.containers.list.begin());
|
||||
iter!=cellStore.containers.list.end(); ++iter)
|
||||
cellStore.mContainers.mList.begin());
|
||||
iter!=cellStore.mContainers.mList.end(); ++iter)
|
||||
{
|
||||
Ptr container (&*iter, &cellStore);
|
||||
|
||||
Class::get (container).getContainerStore (container).fill (
|
||||
iter->base->mInventory, mStore);
|
||||
iter->mBase->mInventory, mStore);
|
||||
}
|
||||
|
||||
for (CellRefList<ESM::Creature>::List::iterator iter (
|
||||
cellStore.creatures.list.begin());
|
||||
iter!=cellStore.creatures.list.end(); ++iter)
|
||||
cellStore.mCreatures.mList.begin());
|
||||
iter!=cellStore.mCreatures.mList.end(); ++iter)
|
||||
{
|
||||
Ptr container (&*iter, &cellStore);
|
||||
|
||||
Class::get (container).getContainerStore (container).fill (
|
||||
iter->base->mInventory, mStore);
|
||||
iter->mBase->mInventory, mStore);
|
||||
}
|
||||
|
||||
for (CellRefList<ESM::NPC>::List::iterator iter (
|
||||
cellStore.npcs.list.begin());
|
||||
iter!=cellStore.npcs.list.end(); ++iter)
|
||||
cellStore.mNpcs.mList.begin());
|
||||
iter!=cellStore.mNpcs.mList.end(); ++iter)
|
||||
{
|
||||
Ptr container (&*iter, &cellStore);
|
||||
|
||||
Class::get (container).getContainerStore (container).fill (
|
||||
iter->base->mInventory, mStore);
|
||||
iter->mBase->mInventory, mStore);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -85,7 +84,7 @@ MWWorld::Ptr MWWorld::Cells::getPtrAndCache (const std::string& name, Ptr::CellS
|
|||
return ptr;
|
||||
}
|
||||
|
||||
MWWorld::Cells::Cells (const ESMS::ESMStore& store, ESM::ESMReader& reader)
|
||||
MWWorld::Cells::Cells (const MWWorld::ESMStore& store, ESM::ESMReader& reader)
|
||||
: mStore (store), mReader (reader),
|
||||
mIdCache (20, std::pair<std::string, Ptr::CellStore *> ("", (Ptr::CellStore*)0)), /// \todo make cache size configurable
|
||||
mIdCacheIndex (0)
|
||||
|
@ -98,7 +97,7 @@ MWWorld::Ptr::CellStore *MWWorld::Cells::getExterior (int x, int y)
|
|||
|
||||
if (result==mExteriors.end())
|
||||
{
|
||||
const ESM::Cell *cell = mStore.cells.searchExt (x, y);
|
||||
const ESM::Cell *cell = mStore.get<ESM::Cell>().search(x, y);
|
||||
|
||||
if (!cell)
|
||||
{
|
||||
|
@ -133,7 +132,7 @@ MWWorld::Ptr::CellStore *MWWorld::Cells::getInterior (const std::string& name)
|
|||
|
||||
if (result==mInteriors.end())
|
||||
{
|
||||
const ESM::Cell *cell = mStore.cells.findInt (name);
|
||||
const ESM::Cell *cell = mStore.get<ESM::Cell>().find(name);
|
||||
|
||||
result = mInteriors.insert (std::make_pair (name, Ptr::CellStore (cell))).first;
|
||||
}
|
||||
|
@ -169,64 +168,64 @@ MWWorld::Ptr MWWorld::Cells::getPtr (const std::string& name, Ptr::CellStore& ce
|
|||
}
|
||||
MWWorld::Ptr ptr;
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Activator> *ref = cell.activators.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Activator> *ref = cell.mActivators.find (name))
|
||||
ptr = Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Potion> *ref = cell.potions.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Potion> *ref = cell.mPotions.find (name))
|
||||
ptr = Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Apparatus> *ref = cell.appas.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Apparatus> *ref = cell.mAppas.find (name))
|
||||
ptr = Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Armor> *ref = cell.armors.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Armor> *ref = cell.mArmors.find (name))
|
||||
ptr = Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Book> *ref = cell.books.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Book> *ref = cell.mBooks.find (name))
|
||||
ptr = Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Clothing> *ref = cell.clothes.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Clothing> *ref = cell.mClothes.find (name))
|
||||
ptr = Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Container> *ref = cell.containers.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Container> *ref = cell.mContainers.find (name))
|
||||
ptr = Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Creature> *ref = cell.creatures.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Creature> *ref = cell.mCreatures.find (name))
|
||||
ptr = Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Door> *ref = cell.doors.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Door> *ref = cell.mDoors.find (name))
|
||||
ptr = Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Ingredient> *ref = cell.ingreds.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Ingredient> *ref = cell.mIngreds.find (name))
|
||||
ptr = Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::CreatureLevList> *ref = cell.creatureLists.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::CreatureLevList> *ref = cell.mCreatureLists.find (name))
|
||||
ptr = Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::ItemLevList> *ref = cell.itemLists.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::ItemLevList> *ref = cell.mItemLists.find (name))
|
||||
ptr = Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Light> *ref = cell.lights.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Light> *ref = cell.mLights.find (name))
|
||||
ptr = Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Tool> *ref = cell.lockpicks.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Tool> *ref = cell.mLockpicks.find (name))
|
||||
ptr = Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Miscellaneous> *ref = cell.miscItems.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Miscellaneous> *ref = cell.mMiscItems.find (name))
|
||||
ptr = Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::NPC> *ref = cell.npcs.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::NPC> *ref = cell.mNpcs.find (name))
|
||||
ptr = Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Probe> *ref = cell.probes.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Probe> *ref = cell.mProbes.find (name))
|
||||
ptr = Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Repair> *ref = cell.repairs.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Repair> *ref = cell.mRepairs.find (name))
|
||||
ptr = Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Static> *ref = cell.statics.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Static> *ref = cell.mStatics.find (name))
|
||||
ptr = Ptr (ref, &cell);
|
||||
|
||||
if (MWWorld::LiveCellRef<ESM::Weapon> *ref = cell.weapons.find (name))
|
||||
if (MWWorld::LiveCellRef<ESM::Weapon> *ref = cell.mWeapons.find (name))
|
||||
ptr = Ptr (ref, &cell);
|
||||
|
||||
if (!ptr.isEmpty() && ptr.getRefData().getCount() > 0) {
|
||||
|
@ -265,10 +264,12 @@ MWWorld::Ptr MWWorld::Cells::getPtr (const std::string& name)
|
|||
}
|
||||
|
||||
// Now try the other cells
|
||||
for (ESMS::CellList::IntCells::const_iterator iter = mStore.cells.intCells.begin();
|
||||
iter!=mStore.cells.intCells.end(); ++iter)
|
||||
const MWWorld::Store<ESM::Cell> &cells = mStore.get<ESM::Cell>();
|
||||
MWWorld::Store<ESM::Cell>::iterator iter;
|
||||
|
||||
for (iter = cells.intBegin(); iter != cells.intEnd(); ++iter)
|
||||
{
|
||||
Ptr::CellStore *cellStore = getCellStore (iter->second);
|
||||
Ptr::CellStore *cellStore = getCellStore (&(*iter));
|
||||
|
||||
Ptr ptr = getPtrAndCache (name, *cellStore);
|
||||
|
||||
|
@ -276,10 +277,9 @@ MWWorld::Ptr MWWorld::Cells::getPtr (const std::string& name)
|
|||
return ptr;
|
||||
}
|
||||
|
||||
for (ESMS::CellList::ExtCells::const_iterator iter = mStore.cells.extCells.begin();
|
||||
iter!=mStore.cells.extCells.end(); ++iter)
|
||||
for (iter = cells.extBegin(); iter != cells.extEnd(); ++iter)
|
||||
{
|
||||
Ptr::CellStore *cellStore = getCellStore (iter->second);
|
||||
Ptr::CellStore *cellStore = getCellStore (&(*iter));
|
||||
|
||||
Ptr ptr = getPtrAndCache (name, *cellStore);
|
||||
|
||||
|
|
|
@ -11,17 +11,14 @@ namespace ESM
|
|||
class ESMReader;
|
||||
}
|
||||
|
||||
namespace ESM
|
||||
{
|
||||
class ESMStore;
|
||||
}
|
||||
|
||||
namespace MWWorld
|
||||
{
|
||||
class ESMStore;
|
||||
|
||||
/// \brief Cell container
|
||||
class Cells
|
||||
{
|
||||
const ESMS::ESMStore& mStore;
|
||||
const MWWorld::ESMStore& mStore;
|
||||
ESM::ESMReader& mReader;
|
||||
std::map<std::string, CellStore> mInteriors;
|
||||
std::map<std::pair<int, int>, CellStore> mExteriors;
|
||||
|
@ -39,7 +36,7 @@ namespace MWWorld
|
|||
|
||||
public:
|
||||
|
||||
Cells (const ESMS::ESMStore& store, ESM::ESMReader& reader);
|
||||
Cells (const MWWorld::ESMStore& store, ESM::ESMReader& reader);
|
||||
///< \todo pass the dynamic part of the ESMStore isntead (once it is written) of the whole
|
||||
/// world
|
||||
|
||||
|
|
|
@ -2,28 +2,28 @@
|
|||
|
||||
#include <iostream>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
||||
#include "ptr.hpp"
|
||||
#include "esmstore.hpp"
|
||||
|
||||
namespace MWWorld
|
||||
{
|
||||
CellStore::CellStore (const ESM::Cell *cell_) : cell (cell_), mState (State_Unloaded)
|
||||
CellStore::CellStore (const ESM::Cell *cell)
|
||||
: mCell (cell), mState (State_Unloaded)
|
||||
{
|
||||
mWaterLevel = cell->mWater;
|
||||
}
|
||||
|
||||
void CellStore::load (const ESMS::ESMStore &store, ESM::ESMReader &esm)
|
||||
void CellStore::load (const MWWorld::ESMStore &store, ESM::ESMReader &esm)
|
||||
{
|
||||
if (mState!=State_Loaded)
|
||||
{
|
||||
if (mState==State_Preloaded)
|
||||
mIds.clear();
|
||||
|
||||
std::cout << "loading cell " << cell->getDescription() << std::endl;
|
||||
std::cout << "loading cell " << mCell->getDescription() << std::endl;
|
||||
|
||||
loadRefs (store, esm);
|
||||
|
||||
|
@ -31,7 +31,7 @@ namespace MWWorld
|
|||
}
|
||||
}
|
||||
|
||||
void CellStore::preload (const ESMS::ESMStore &store, ESM::ESMReader &esm)
|
||||
void CellStore::preload (const MWWorld::ESMStore &store, ESM::ESMReader &esm)
|
||||
{
|
||||
if (mState==State_Unloaded)
|
||||
{
|
||||
|
@ -41,20 +41,20 @@ namespace MWWorld
|
|||
}
|
||||
}
|
||||
|
||||
void CellStore::listRefs(const ESMS::ESMStore &store, ESM::ESMReader &esm)
|
||||
void CellStore::listRefs(const MWWorld::ESMStore &store, ESM::ESMReader &esm)
|
||||
{
|
||||
assert (cell);
|
||||
assert (mCell);
|
||||
|
||||
if (cell->mContext.filename.empty())
|
||||
if (mCell->mContext.filename.empty())
|
||||
return; // this is a dynamically generated cell -> skipping.
|
||||
|
||||
// Reopen the ESM reader and seek to the right position.
|
||||
cell->restore (esm);
|
||||
mCell->restore (esm);
|
||||
|
||||
ESM::CellRef ref;
|
||||
|
||||
// Get each reference in turn
|
||||
while (cell->getNextRef (esm, ref))
|
||||
while (mCell->getNextRef (esm, ref))
|
||||
{
|
||||
std::string lowerCase;
|
||||
|
||||
|
@ -67,20 +67,20 @@ namespace MWWorld
|
|||
std::sort (mIds.begin(), mIds.end());
|
||||
}
|
||||
|
||||
void CellStore::loadRefs(const ESMS::ESMStore &store, ESM::ESMReader &esm)
|
||||
void CellStore::loadRefs(const MWWorld::ESMStore &store, ESM::ESMReader &esm)
|
||||
{
|
||||
assert (cell);
|
||||
assert (mCell);
|
||||
|
||||
if (cell->mContext.filename.empty())
|
||||
if (mCell->mContext.filename.empty())
|
||||
return; // this is a dynamically generated cell -> skipping.
|
||||
|
||||
// Reopen the ESM reader and seek to the right position.
|
||||
cell->restore(esm);
|
||||
mCell->restore(esm);
|
||||
|
||||
ESM::CellRef ref;
|
||||
|
||||
// Get each reference in turn
|
||||
while(cell->getNextRef(esm, ref))
|
||||
while(mCell->getNextRef(esm, ref))
|
||||
{
|
||||
std::string lowerCase;
|
||||
|
||||
|
@ -98,26 +98,26 @@ namespace MWWorld
|
|||
*/
|
||||
switch(rec)
|
||||
{
|
||||
case ESM::REC_ACTI: activators.find(ref, store.activators); break;
|
||||
case ESM::REC_ALCH: potions.find(ref, store.potions); break;
|
||||
case ESM::REC_APPA: appas.find(ref, store.appas); break;
|
||||
case ESM::REC_ARMO: armors.find(ref, store.armors); break;
|
||||
case ESM::REC_BOOK: books.find(ref, store.books); break;
|
||||
case ESM::REC_CLOT: clothes.find(ref, store.clothes); break;
|
||||
case ESM::REC_CONT: containers.find(ref, store.containers); break;
|
||||
case ESM::REC_CREA: creatures.find(ref, store.creatures); break;
|
||||
case ESM::REC_DOOR: doors.find(ref, store.doors); break;
|
||||
case ESM::REC_INGR: ingreds.find(ref, store.ingreds); break;
|
||||
case ESM::REC_LEVC: creatureLists.find(ref, store.creatureLists); break;
|
||||
case ESM::REC_LEVI: itemLists.find(ref, store.itemLists); break;
|
||||
case ESM::REC_LIGH: lights.find(ref, store.lights); break;
|
||||
case ESM::REC_LOCK: lockpicks.find(ref, store.lockpicks); break;
|
||||
case ESM::REC_MISC: miscItems.find(ref, store.miscItems); break;
|
||||
case ESM::REC_NPC_: npcs.find(ref, store.npcs); break;
|
||||
case ESM::REC_PROB: probes.find(ref, store.probes); break;
|
||||
case ESM::REC_REPA: repairs.find(ref, store.repairs); break;
|
||||
case ESM::REC_STAT: statics.find(ref, store.statics); break;
|
||||
case ESM::REC_WEAP: weapons.find(ref, store.weapons); break;
|
||||
case ESM::REC_ACTI: mActivators.load(ref, store); break;
|
||||
case ESM::REC_ALCH: mPotions.load(ref, store); break;
|
||||
case ESM::REC_APPA: mAppas.load(ref, store); break;
|
||||
case ESM::REC_ARMO: mArmors.load(ref, store); break;
|
||||
case ESM::REC_BOOK: mBooks.load(ref, store); break;
|
||||
case ESM::REC_CLOT: mClothes.load(ref, store); break;
|
||||
case ESM::REC_CONT: mContainers.load(ref, store); break;
|
||||
case ESM::REC_CREA: mCreatures.load(ref, store); break;
|
||||
case ESM::REC_DOOR: mDoors.load(ref, store); break;
|
||||
case ESM::REC_INGR: mIngreds.load(ref, store); break;
|
||||
case ESM::REC_LEVC: mCreatureLists.load(ref, store); break;
|
||||
case ESM::REC_LEVI: mItemLists.load(ref, store); break;
|
||||
case ESM::REC_LIGH: mLights.load(ref, store); break;
|
||||
case ESM::REC_LOCK: mLockpicks.load(ref, store); break;
|
||||
case ESM::REC_MISC: mMiscItems.load(ref, store); break;
|
||||
case ESM::REC_NPC_: mNpcs.load(ref, store); break;
|
||||
case ESM::REC_PROB: mProbes.load(ref, store); break;
|
||||
case ESM::REC_REPA: mRepairs.load(ref, store); break;
|
||||
case ESM::REC_STAT: mStatics.load(ref, store); break;
|
||||
case ESM::REC_WEAP: mWeapons.load(ref, store); break;
|
||||
|
||||
case 0: std::cout << "Cell reference " + ref.mRefID + " not found!\n"; break;
|
||||
default:
|
||||
|
|
|
@ -7,15 +7,12 @@
|
|||
#include <algorithm>
|
||||
|
||||
#include "refdata.hpp"
|
||||
|
||||
namespace ESMS
|
||||
{
|
||||
struct ESMStore;
|
||||
}
|
||||
#include "esmstore.hpp"
|
||||
|
||||
namespace MWWorld
|
||||
{
|
||||
class Ptr;
|
||||
class ESMStore;
|
||||
|
||||
/// A reference to one object (of any type) in a cell.
|
||||
///
|
||||
|
@ -26,19 +23,21 @@ namespace MWWorld
|
|||
template <typename X>
|
||||
struct LiveCellRef
|
||||
{
|
||||
LiveCellRef(const ESM::CellRef& cref, const X* b = NULL) : base(b), ref(cref),
|
||||
mData(ref) {}
|
||||
LiveCellRef(const ESM::CellRef& cref, const X* b = NULL)
|
||||
: mBase(b), mRef(cref), mData(mRef)
|
||||
{}
|
||||
|
||||
|
||||
LiveCellRef(const X* b = NULL) : base(b), mData(ref) {}
|
||||
LiveCellRef(const X* b = NULL)
|
||||
: mBase(b), mData(mRef)
|
||||
{}
|
||||
|
||||
// The object that this instance is based on.
|
||||
const X* base;
|
||||
const X* mBase;
|
||||
|
||||
/* Information about this instance, such as 3D location and
|
||||
rotation and individual type-dependent data.
|
||||
*/
|
||||
ESM::CellRef ref;
|
||||
ESM::CellRef mRef;
|
||||
|
||||
/// runtime-data
|
||||
RefData mData;
|
||||
|
@ -50,26 +49,29 @@ namespace MWWorld
|
|||
{
|
||||
typedef LiveCellRef<X> LiveRef;
|
||||
typedef std::list<LiveRef> List;
|
||||
List list;
|
||||
List mList;
|
||||
|
||||
// Search for the given reference in the given reclist from
|
||||
// ESMStore. Insert the reference into the list if a match is
|
||||
// found. If not, throw an exception.
|
||||
template <typename Y>
|
||||
void find(ESM::CellRef &ref, const Y& recList)
|
||||
/// Searches for reference of appropriate type in given ESMStore.
|
||||
/// If reference exists, loads it into container, throws an exception
|
||||
/// on miss
|
||||
void load(ESM::CellRef &ref, const MWWorld::ESMStore &esmStore)
|
||||
{
|
||||
const X* obj = recList.find(ref.mRefID);
|
||||
if(obj == NULL)
|
||||
throw std::runtime_error("Error resolving cell reference " + ref.mRefID);
|
||||
// for throwing exception on unhandled record type
|
||||
const MWWorld::Store<X> &store = esmStore.get<X>();
|
||||
const X *ptr = store.find(ref.mRefID);
|
||||
|
||||
list.push_back(LiveRef(ref, obj));
|
||||
/// \note redundant because Store<X>::find() throws exception on miss
|
||||
if (ptr == NULL) {
|
||||
throw std::runtime_error("Error resolving cell reference " + ref.mRefID);
|
||||
}
|
||||
mList.push_back(LiveRef(ref, ptr));
|
||||
}
|
||||
|
||||
LiveRef *find (const std::string& name)
|
||||
{
|
||||
for (typename std::list<LiveRef>::iterator iter (list.begin()); iter!=list.end(); ++iter)
|
||||
for (typename std::list<LiveRef>::iterator iter (mList.begin()); iter!=mList.end(); ++iter)
|
||||
{
|
||||
if (iter->mData.getCount() > 0 && iter->ref.mRefID == name)
|
||||
if (iter->mData.getCount() > 0 && iter->mRef.mRefID == name)
|
||||
return &*iter;
|
||||
}
|
||||
|
||||
|
@ -77,8 +79,8 @@ namespace MWWorld
|
|||
}
|
||||
|
||||
LiveRef &insert(const LiveRef &item) {
|
||||
list.push_back(item);
|
||||
return list.back();
|
||||
mList.push_back(item);
|
||||
return mList.back();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -94,37 +96,37 @@ namespace MWWorld
|
|||
|
||||
CellStore (const ESM::Cell *cell_);
|
||||
|
||||
const ESM::Cell *cell;
|
||||
const ESM::Cell *mCell;
|
||||
State mState;
|
||||
std::vector<std::string> mIds;
|
||||
|
||||
float mWaterLevel;
|
||||
|
||||
// Lists for each individual object type
|
||||
CellRefList<ESM::Activator> activators;
|
||||
CellRefList<ESM::Potion> potions;
|
||||
CellRefList<ESM::Apparatus> appas;
|
||||
CellRefList<ESM::Armor> armors;
|
||||
CellRefList<ESM::Book> books;
|
||||
CellRefList<ESM::Clothing> clothes;
|
||||
CellRefList<ESM::Container> containers;
|
||||
CellRefList<ESM::Creature> creatures;
|
||||
CellRefList<ESM::Door> doors;
|
||||
CellRefList<ESM::Ingredient> ingreds;
|
||||
CellRefList<ESM::CreatureLevList> creatureLists;
|
||||
CellRefList<ESM::ItemLevList> itemLists;
|
||||
CellRefList<ESM::Light> lights;
|
||||
CellRefList<ESM::Tool> lockpicks;
|
||||
CellRefList<ESM::Miscellaneous> miscItems;
|
||||
CellRefList<ESM::NPC> npcs;
|
||||
CellRefList<ESM::Probe> probes;
|
||||
CellRefList<ESM::Repair> repairs;
|
||||
CellRefList<ESM::Static> statics;
|
||||
CellRefList<ESM::Weapon> weapons;
|
||||
CellRefList<ESM::Activator> mActivators;
|
||||
CellRefList<ESM::Potion> mPotions;
|
||||
CellRefList<ESM::Apparatus> mAppas;
|
||||
CellRefList<ESM::Armor> mArmors;
|
||||
CellRefList<ESM::Book> mBooks;
|
||||
CellRefList<ESM::Clothing> mClothes;
|
||||
CellRefList<ESM::Container> mContainers;
|
||||
CellRefList<ESM::Creature> mCreatures;
|
||||
CellRefList<ESM::Door> mDoors;
|
||||
CellRefList<ESM::Ingredient> mIngreds;
|
||||
CellRefList<ESM::CreatureLevList> mCreatureLists;
|
||||
CellRefList<ESM::ItemLevList> mItemLists;
|
||||
CellRefList<ESM::Light> mLights;
|
||||
CellRefList<ESM::Tool> mLockpicks;
|
||||
CellRefList<ESM::Miscellaneous> mMiscItems;
|
||||
CellRefList<ESM::NPC> mNpcs;
|
||||
CellRefList<ESM::Probe> mProbes;
|
||||
CellRefList<ESM::Repair> mRepairs;
|
||||
CellRefList<ESM::Static> mStatics;
|
||||
CellRefList<ESM::Weapon> mWeapons;
|
||||
|
||||
void load (const ESMS::ESMStore &store, ESM::ESMReader &esm);
|
||||
void load (const MWWorld::ESMStore &store, ESM::ESMReader &esm);
|
||||
|
||||
void preload (const ESMS::ESMStore &store, ESM::ESMReader &esm);
|
||||
void preload (const MWWorld::ESMStore &store, ESM::ESMReader &esm);
|
||||
|
||||
/// Call functor (ref) for each reference. functor must return a bool. Returning
|
||||
/// false will abort the iteration.
|
||||
|
@ -133,32 +135,32 @@ namespace MWWorld
|
|||
bool forEach (Functor& functor)
|
||||
{
|
||||
return
|
||||
forEachImp (functor, activators) &&
|
||||
forEachImp (functor, potions) &&
|
||||
forEachImp (functor, appas) &&
|
||||
forEachImp (functor, armors) &&
|
||||
forEachImp (functor, books) &&
|
||||
forEachImp (functor, clothes) &&
|
||||
forEachImp (functor, containers) &&
|
||||
forEachImp (functor, creatures) &&
|
||||
forEachImp (functor, doors) &&
|
||||
forEachImp (functor, ingreds) &&
|
||||
forEachImp (functor, creatureLists) &&
|
||||
forEachImp (functor, itemLists) &&
|
||||
forEachImp (functor, lights) &&
|
||||
forEachImp (functor, lockpicks) &&
|
||||
forEachImp (functor, miscItems) &&
|
||||
forEachImp (functor, npcs) &&
|
||||
forEachImp (functor, probes) &&
|
||||
forEachImp (functor, repairs) &&
|
||||
forEachImp (functor, statics) &&
|
||||
forEachImp (functor, weapons);
|
||||
forEachImp (functor, mActivators) &&
|
||||
forEachImp (functor, mPotions) &&
|
||||
forEachImp (functor, mAppas) &&
|
||||
forEachImp (functor, mArmors) &&
|
||||
forEachImp (functor, mBooks) &&
|
||||
forEachImp (functor, mClothes) &&
|
||||
forEachImp (functor, mContainers) &&
|
||||
forEachImp (functor, mCreatures) &&
|
||||
forEachImp (functor, mDoors) &&
|
||||
forEachImp (functor, mIngreds) &&
|
||||
forEachImp (functor, mCreatureLists) &&
|
||||
forEachImp (functor, mItemLists) &&
|
||||
forEachImp (functor, mLights) &&
|
||||
forEachImp (functor, mLockpicks) &&
|
||||
forEachImp (functor, mMiscItems) &&
|
||||
forEachImp (functor, mNpcs) &&
|
||||
forEachImp (functor, mProbes) &&
|
||||
forEachImp (functor, mRepairs) &&
|
||||
forEachImp (functor, mStatics) &&
|
||||
forEachImp (functor, mWeapons);
|
||||
}
|
||||
|
||||
bool operator==(const CellStore &cell) {
|
||||
return this->cell->mName == cell.cell->mName &&
|
||||
this->cell->mData.mX == cell.cell->mData.mX &&
|
||||
this->cell->mData.mY == cell.cell->mData.mY;
|
||||
return mCell->mName == cell.mCell->mName &&
|
||||
mCell->mData.mX == cell.mCell->mData.mX &&
|
||||
mCell->mData.mY == cell.mCell->mData.mY;
|
||||
}
|
||||
|
||||
bool operator!=(const CellStore &cell) {
|
||||
|
@ -166,7 +168,7 @@ namespace MWWorld
|
|||
}
|
||||
|
||||
bool isExterior() const {
|
||||
return cell->isExterior();
|
||||
return mCell->isExterior();
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -174,18 +176,18 @@ namespace MWWorld
|
|||
template<class Functor, class List>
|
||||
bool forEachImp (Functor& functor, List& list)
|
||||
{
|
||||
for (typename List::List::iterator iter (list.list.begin()); iter!=list.list.end();
|
||||
for (typename List::List::iterator iter (list.mList.begin()); iter!=list.mList.end();
|
||||
++iter)
|
||||
if (!functor (iter->ref, iter->mData))
|
||||
if (!functor (iter->mRef, iter->mData))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// Run through references and store IDs
|
||||
void listRefs(const ESMS::ESMStore &store, ESM::ESMReader &esm);
|
||||
void listRefs(const MWWorld::ESMStore &store, ESM::ESMReader &esm);
|
||||
|
||||
void loadRefs(const ESMS::ESMStore &store, ESM::ESMReader &esm);
|
||||
void loadRefs(const MWWorld::ESMStore &store, ESM::ESMReader &esm);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -24,12 +24,12 @@ namespace
|
|||
float sum = 0;
|
||||
|
||||
for (typename MWWorld::CellRefList<T>::List::const_iterator iter (
|
||||
cellRefList.list.begin());
|
||||
iter!=cellRefList.list.end();
|
||||
cellRefList.mList.begin());
|
||||
iter!=cellRefList.mList.end();
|
||||
++iter)
|
||||
{
|
||||
if (iter->mData.getCount()>0)
|
||||
sum += iter->mData.getCount()*iter->base->mData.mWeight;
|
||||
sum += iter->mData.getCount()*iter->mBase->mData.mWeight;
|
||||
}
|
||||
|
||||
return sum;
|
||||
|
@ -74,26 +74,29 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::add (const Ptr& ptr)
|
|||
{
|
||||
int type = getType(ptr);
|
||||
|
||||
const MWWorld::ESMStore &esmStore =
|
||||
MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
// gold needs special handling: when it is inserted into a container, the base object automatically becomes Gold_001
|
||||
// this ensures that gold piles of different sizes stack with each other (also, several scripts rely on Gold_001 for detecting player gold)
|
||||
if (MWWorld::Class::get(ptr).getName(ptr) == MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sGold")->getString())
|
||||
if (MWWorld::Class::get(ptr).getName(ptr) == esmStore.get<ESM::GameSetting>().find("sGold")->getString())
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous> *gold =
|
||||
ptr.get<ESM::Miscellaneous>();
|
||||
|
||||
if (compare_string_ci(gold->ref.mRefID, "gold_001")
|
||||
|| compare_string_ci(gold->ref.mRefID, "gold_005")
|
||||
|| compare_string_ci(gold->ref.mRefID, "gold_010")
|
||||
|| compare_string_ci(gold->ref.mRefID, "gold_025")
|
||||
|| compare_string_ci(gold->ref.mRefID, "gold_100"))
|
||||
if (compare_string_ci(gold->mRef.mRefID, "gold_001")
|
||||
|| compare_string_ci(gold->mRef.mRefID, "gold_005")
|
||||
|| compare_string_ci(gold->mRef.mRefID, "gold_010")
|
||||
|| compare_string_ci(gold->mRef.mRefID, "gold_025")
|
||||
|| compare_string_ci(gold->mRef.mRefID, "gold_100"))
|
||||
{
|
||||
MWWorld::ManualRef ref(MWBase::Environment::get().getWorld()->getStore(), "Gold_001");
|
||||
MWWorld::ManualRef ref(esmStore, "Gold_001");
|
||||
|
||||
int count = (ptr.getRefData().getCount() == 1) ? gold->base->mData.mValue : ptr.getRefData().getCount();
|
||||
int count = (ptr.getRefData().getCount() == 1) ? gold->mBase->mData.mValue : ptr.getRefData().getCount();
|
||||
ref.getPtr().getRefData().setCount(count);
|
||||
for (MWWorld::ContainerStoreIterator iter (begin(type)); iter!=end(); ++iter)
|
||||
{
|
||||
if (compare_string_ci((*iter).get<ESM::Miscellaneous>()->ref.mRefID, "gold_001"))
|
||||
if (compare_string_ci((*iter).get<ESM::Miscellaneous>()->mRef.mRefID, "gold_001"))
|
||||
{
|
||||
(*iter).getRefData().setCount( (*iter).getRefData().getCount() + count);
|
||||
flagAsModified();
|
||||
|
@ -127,25 +130,25 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::addImpl (const Ptr& ptr
|
|||
|
||||
switch (getType(ptr))
|
||||
{
|
||||
case Type_Potion: potions.list.push_back (*ptr.get<ESM::Potion>()); it = ContainerStoreIterator(this, --potions.list.end()); break;
|
||||
case Type_Apparatus: appas.list.push_back (*ptr.get<ESM::Apparatus>()); it = ContainerStoreIterator(this, --appas.list.end()); break;
|
||||
case Type_Armor: armors.list.push_back (*ptr.get<ESM::Armor>()); it = ContainerStoreIterator(this, --armors.list.end()); break;
|
||||
case Type_Book: books.list.push_back (*ptr.get<ESM::Book>()); it = ContainerStoreIterator(this, --books.list.end()); break;
|
||||
case Type_Clothing: clothes.list.push_back (*ptr.get<ESM::Clothing>()); it = ContainerStoreIterator(this, --clothes.list.end()); break;
|
||||
case Type_Ingredient: ingreds.list.push_back (*ptr.get<ESM::Ingredient>()); it = ContainerStoreIterator(this, --ingreds.list.end()); break;
|
||||
case Type_Light: lights.list.push_back (*ptr.get<ESM::Light>()); it = ContainerStoreIterator(this, --lights.list.end()); break;
|
||||
case Type_Lockpick: lockpicks.list.push_back (*ptr.get<ESM::Tool>()); it = ContainerStoreIterator(this, --lockpicks.list.end()); break;
|
||||
case Type_Miscellaneous: miscItems.list.push_back (*ptr.get<ESM::Miscellaneous>()); it = ContainerStoreIterator(this, --miscItems.list.end()); break;
|
||||
case Type_Probe: probes.list.push_back (*ptr.get<ESM::Probe>()); it = ContainerStoreIterator(this, --probes.list.end()); break;
|
||||
case Type_Repair: repairs.list.push_back (*ptr.get<ESM::Repair>()); it = ContainerStoreIterator(this, --repairs.list.end()); break;
|
||||
case Type_Weapon: weapons.list.push_back (*ptr.get<ESM::Weapon>()); it = ContainerStoreIterator(this, --weapons.list.end()); break;
|
||||
case Type_Potion: potions.mList.push_back (*ptr.get<ESM::Potion>()); it = ContainerStoreIterator(this, --potions.mList.end()); break;
|
||||
case Type_Apparatus: appas.mList.push_back (*ptr.get<ESM::Apparatus>()); it = ContainerStoreIterator(this, --appas.mList.end()); break;
|
||||
case Type_Armor: armors.mList.push_back (*ptr.get<ESM::Armor>()); it = ContainerStoreIterator(this, --armors.mList.end()); break;
|
||||
case Type_Book: books.mList.push_back (*ptr.get<ESM::Book>()); it = ContainerStoreIterator(this, --books.mList.end()); break;
|
||||
case Type_Clothing: clothes.mList.push_back (*ptr.get<ESM::Clothing>()); it = ContainerStoreIterator(this, --clothes.mList.end()); break;
|
||||
case Type_Ingredient: ingreds.mList.push_back (*ptr.get<ESM::Ingredient>()); it = ContainerStoreIterator(this, --ingreds.mList.end()); break;
|
||||
case Type_Light: lights.mList.push_back (*ptr.get<ESM::Light>()); it = ContainerStoreIterator(this, --lights.mList.end()); break;
|
||||
case Type_Lockpick: lockpicks.mList.push_back (*ptr.get<ESM::Tool>()); it = ContainerStoreIterator(this, --lockpicks.mList.end()); break;
|
||||
case Type_Miscellaneous: miscItems.mList.push_back (*ptr.get<ESM::Miscellaneous>()); it = ContainerStoreIterator(this, --miscItems.mList.end()); break;
|
||||
case Type_Probe: probes.mList.push_back (*ptr.get<ESM::Probe>()); it = ContainerStoreIterator(this, --probes.mList.end()); break;
|
||||
case Type_Repair: repairs.mList.push_back (*ptr.get<ESM::Repair>()); it = ContainerStoreIterator(this, --repairs.mList.end()); break;
|
||||
case Type_Weapon: weapons.mList.push_back (*ptr.get<ESM::Weapon>()); it = ContainerStoreIterator(this, --weapons.mList.end()); break;
|
||||
}
|
||||
|
||||
flagAsModified();
|
||||
return it;
|
||||
}
|
||||
|
||||
void MWWorld::ContainerStore::fill (const ESM::InventoryList& items, const ESMS::ESMStore& store)
|
||||
void MWWorld::ContainerStore::fill (const ESM::InventoryList& items, const MWWorld::ESMStore& store)
|
||||
{
|
||||
for (std::vector<ESM::ContItem>::const_iterator iter (items.mList.begin()); iter!=items.mList.end();
|
||||
++iter)
|
||||
|
@ -326,63 +329,63 @@ bool MWWorld::ContainerStoreIterator::resetIterator()
|
|||
{
|
||||
case ContainerStore::Type_Potion:
|
||||
|
||||
mPotion = mContainer->potions.list.begin();
|
||||
return mPotion!=mContainer->potions.list.end();
|
||||
mPotion = mContainer->potions.mList.begin();
|
||||
return mPotion!=mContainer->potions.mList.end();
|
||||
|
||||
case ContainerStore::Type_Apparatus:
|
||||
|
||||
mApparatus = mContainer->appas.list.begin();
|
||||
return mApparatus!=mContainer->appas.list.end();
|
||||
mApparatus = mContainer->appas.mList.begin();
|
||||
return mApparatus!=mContainer->appas.mList.end();
|
||||
|
||||
case ContainerStore::Type_Armor:
|
||||
|
||||
mArmor = mContainer->armors.list.begin();
|
||||
return mArmor!=mContainer->armors.list.end();
|
||||
mArmor = mContainer->armors.mList.begin();
|
||||
return mArmor!=mContainer->armors.mList.end();
|
||||
|
||||
case ContainerStore::Type_Book:
|
||||
|
||||
mBook = mContainer->books.list.begin();
|
||||
return mBook!=mContainer->books.list.end();
|
||||
mBook = mContainer->books.mList.begin();
|
||||
return mBook!=mContainer->books.mList.end();
|
||||
|
||||
case ContainerStore::Type_Clothing:
|
||||
|
||||
mClothing = mContainer->clothes.list.begin();
|
||||
return mClothing!=mContainer->clothes.list.end();
|
||||
mClothing = mContainer->clothes.mList.begin();
|
||||
return mClothing!=mContainer->clothes.mList.end();
|
||||
|
||||
case ContainerStore::Type_Ingredient:
|
||||
|
||||
mIngredient = mContainer->ingreds.list.begin();
|
||||
return mIngredient!=mContainer->ingreds.list.end();
|
||||
mIngredient = mContainer->ingreds.mList.begin();
|
||||
return mIngredient!=mContainer->ingreds.mList.end();
|
||||
|
||||
case ContainerStore::Type_Light:
|
||||
|
||||
mLight = mContainer->lights.list.begin();
|
||||
return mLight!=mContainer->lights.list.end();
|
||||
mLight = mContainer->lights.mList.begin();
|
||||
return mLight!=mContainer->lights.mList.end();
|
||||
|
||||
case ContainerStore::Type_Lockpick:
|
||||
|
||||
mLockpick = mContainer->lockpicks.list.begin();
|
||||
return mLockpick!=mContainer->lockpicks.list.end();
|
||||
mLockpick = mContainer->lockpicks.mList.begin();
|
||||
return mLockpick!=mContainer->lockpicks.mList.end();
|
||||
|
||||
case ContainerStore::Type_Miscellaneous:
|
||||
|
||||
mMiscellaneous = mContainer->miscItems.list.begin();
|
||||
return mMiscellaneous!=mContainer->miscItems.list.end();
|
||||
mMiscellaneous = mContainer->miscItems.mList.begin();
|
||||
return mMiscellaneous!=mContainer->miscItems.mList.end();
|
||||
|
||||
case ContainerStore::Type_Probe:
|
||||
|
||||
mProbe = mContainer->probes.list.begin();
|
||||
return mProbe!=mContainer->probes.list.end();
|
||||
mProbe = mContainer->probes.mList.begin();
|
||||
return mProbe!=mContainer->probes.mList.end();
|
||||
|
||||
case ContainerStore::Type_Repair:
|
||||
|
||||
mRepair = mContainer->repairs.list.begin();
|
||||
return mRepair!=mContainer->repairs.list.end();
|
||||
mRepair = mContainer->repairs.mList.begin();
|
||||
return mRepair!=mContainer->repairs.mList.end();
|
||||
|
||||
case ContainerStore::Type_Weapon:
|
||||
|
||||
mWeapon = mContainer->weapons.list.begin();
|
||||
return mWeapon!=mContainer->weapons.list.end();
|
||||
mWeapon = mContainer->weapons.mList.begin();
|
||||
return mWeapon!=mContainer->weapons.mList.end();
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -395,62 +398,62 @@ bool MWWorld::ContainerStoreIterator::incIterator()
|
|||
case ContainerStore::Type_Potion:
|
||||
|
||||
++mPotion;
|
||||
return mPotion==mContainer->potions.list.end();
|
||||
return mPotion==mContainer->potions.mList.end();
|
||||
|
||||
case ContainerStore::Type_Apparatus:
|
||||
|
||||
++mApparatus;
|
||||
return mApparatus==mContainer->appas.list.end();
|
||||
return mApparatus==mContainer->appas.mList.end();
|
||||
|
||||
case ContainerStore::Type_Armor:
|
||||
|
||||
++mArmor;
|
||||
return mArmor==mContainer->armors.list.end();
|
||||
return mArmor==mContainer->armors.mList.end();
|
||||
|
||||
case ContainerStore::Type_Book:
|
||||
|
||||
++mBook;
|
||||
return mBook==mContainer->books.list.end();
|
||||
return mBook==mContainer->books.mList.end();
|
||||
|
||||
case ContainerStore::Type_Clothing:
|
||||
|
||||
++mClothing;
|
||||
return mClothing==mContainer->clothes.list.end();
|
||||
return mClothing==mContainer->clothes.mList.end();
|
||||
|
||||
case ContainerStore::Type_Ingredient:
|
||||
|
||||
++mIngredient;
|
||||
return mIngredient==mContainer->ingreds.list.end();
|
||||
return mIngredient==mContainer->ingreds.mList.end();
|
||||
|
||||
case ContainerStore::Type_Light:
|
||||
|
||||
++mLight;
|
||||
return mLight==mContainer->lights.list.end();
|
||||
return mLight==mContainer->lights.mList.end();
|
||||
|
||||
case ContainerStore::Type_Lockpick:
|
||||
|
||||
++mLockpick;
|
||||
return mLockpick==mContainer->lockpicks.list.end();
|
||||
return mLockpick==mContainer->lockpicks.mList.end();
|
||||
|
||||
case ContainerStore::Type_Miscellaneous:
|
||||
|
||||
++mMiscellaneous;
|
||||
return mMiscellaneous==mContainer->miscItems.list.end();
|
||||
return mMiscellaneous==mContainer->miscItems.mList.end();
|
||||
|
||||
case ContainerStore::Type_Probe:
|
||||
|
||||
++mProbe;
|
||||
return mProbe==mContainer->probes.list.end();
|
||||
return mProbe==mContainer->probes.mList.end();
|
||||
|
||||
case ContainerStore::Type_Repair:
|
||||
|
||||
++mRepair;
|
||||
return mRepair==mContainer->repairs.list.end();
|
||||
return mRepair==mContainer->repairs.mList.end();
|
||||
|
||||
case ContainerStore::Type_Weapon:
|
||||
|
||||
++mWeapon;
|
||||
return mWeapon==mContainer->weapons.list.end();
|
||||
return mWeapon==mContainer->weapons.mList.end();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -83,7 +83,7 @@ namespace MWWorld
|
|||
|
||||
public:
|
||||
|
||||
void fill (const ESM::InventoryList& items, const ESMS::ESMStore& store);
|
||||
void fill (const ESM::InventoryList& items, const MWWorld::ESMStore& store);
|
||||
///< Insert items into *this.
|
||||
|
||||
void clear();
|
||||
|
|
111
apps/openmw/mwworld/esmstore.cpp
Normal file
111
apps/openmw/mwworld/esmstore.cpp
Normal file
|
@ -0,0 +1,111 @@
|
|||
#include "esmstore.hpp"
|
||||
|
||||
#include <set>
|
||||
#include <iostream>
|
||||
|
||||
namespace MWWorld
|
||||
{
|
||||
|
||||
static bool isCacheableRecord(int id)
|
||||
{
|
||||
if (id == ESM::REC_ACTI || id == ESM::REC_ALCH || id == ESM::REC_APPA || id == ESM::REC_ARMO ||
|
||||
id == ESM::REC_BOOK || id == ESM::REC_CLOT || id == ESM::REC_CONT || id == ESM::REC_CREA ||
|
||||
id == ESM::REC_DOOR || id == ESM::REC_INGR || id == ESM::REC_LEVC || id == ESM::REC_LEVI ||
|
||||
id == ESM::REC_LIGH || id == ESM::REC_LOCK || id == ESM::REC_MISC || id == ESM::REC_NPC_ ||
|
||||
id == ESM::REC_PROB || id == ESM::REC_REPA || id == ESM::REC_STAT || id == ESM::REC_WEAP)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void ESMStore::load(ESM::ESMReader &esm)
|
||||
{
|
||||
std::set<std::string> missing;
|
||||
|
||||
ESM::Dialogue *dialogue = 0;
|
||||
|
||||
// Loop through all records
|
||||
while(esm.hasMoreRecs())
|
||||
{
|
||||
ESM::NAME n = esm.getRecName();
|
||||
esm.getRecHeader();
|
||||
|
||||
// Look up the record type.
|
||||
std::map<int, StoreBase *>::iterator it = mStores.find(n.val);
|
||||
|
||||
if (it == mStores.end()) {
|
||||
if (n.val == ESM::REC_INFO) {
|
||||
if (dialogue) {
|
||||
dialogue->mInfo.push_back(ESM::DialInfo());
|
||||
dialogue->mInfo.back().load(esm);
|
||||
} else {
|
||||
std::cerr << "error: info record without dialog" << std::endl;
|
||||
esm.skipRecord();
|
||||
}
|
||||
} else if (n.val == ESM::REC_MGEF) {
|
||||
mMagicEffects.load (esm);
|
||||
} else if (n.val == ESM::REC_SKIL) {
|
||||
mSkills.load (esm);
|
||||
} else {
|
||||
// Not found (this would be an error later)
|
||||
esm.skipRecord();
|
||||
missing.insert(n.toString());
|
||||
}
|
||||
} else {
|
||||
// Load it
|
||||
std::string id = esm.getHNOString("NAME");
|
||||
it->second->load(esm, id);
|
||||
|
||||
if (n.val==ESM::REC_DIAL) {
|
||||
// dirty hack, but it is better than non-const search()
|
||||
// or friends
|
||||
dialogue = &mDialogs.mStatic.back();
|
||||
assert (dialogue->mId == id);
|
||||
} else {
|
||||
dialogue = 0;
|
||||
}
|
||||
// Insert the reference into the global lookup
|
||||
if (!id.empty() && isCacheableRecord(n.val)) {
|
||||
mIds[id] = n.val;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* This information isn't needed on screen. But keep the code around
|
||||
for debugging purposes later.
|
||||
|
||||
cout << "\n" << mStores.size() << " record types:\n";
|
||||
for(RecListList::iterator it = mStores.begin(); it != mStores.end(); it++)
|
||||
cout << " " << toStr(it->first) << ": " << it->second->getSize() << endl;
|
||||
cout << "\nNot implemented yet: ";
|
||||
for(set<string>::iterator it = missing.begin();
|
||||
it != missing.end(); it++ )
|
||||
cout << *it << " ";
|
||||
cout << endl;
|
||||
*/
|
||||
setUp();
|
||||
}
|
||||
|
||||
void ESMStore::setUp()
|
||||
{
|
||||
std::map<int, StoreBase *>::iterator it = mStores.begin();
|
||||
for (; it != mStores.end(); ++it) {
|
||||
it->second->setUp();
|
||||
}
|
||||
mSkills.setUp();
|
||||
mMagicEffects.setUp();
|
||||
mAttributes.setUp();
|
||||
|
||||
ESM::NPC item;
|
||||
item.mId = "player";
|
||||
|
||||
std::vector<ESM::NPC>::iterator pIt =
|
||||
std::lower_bound(mNpcs.mStatic.begin(), mNpcs.mStatic.end(), item, RecordCmp());
|
||||
assert(pIt != mNpcs.mStatic.end() && pIt->mId == "player");
|
||||
|
||||
mNpcs.insert(*pIt);
|
||||
mNpcs.mStatic.erase(pIt);
|
||||
}
|
||||
|
||||
} // end namespace
|
401
apps/openmw/mwworld/esmstore.hpp
Normal file
401
apps/openmw/mwworld/esmstore.hpp
Normal file
|
@ -0,0 +1,401 @@
|
|||
#ifndef OPENMW_MWWORLD_ESMSTORE_H
|
||||
#define OPENMW_MWWORLD_ESMSTORE_H
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
#include <components/esm/records.hpp>
|
||||
#include "store.hpp"
|
||||
|
||||
namespace MWWorld
|
||||
{
|
||||
class ESMStore
|
||||
{
|
||||
Store<ESM::Activator> mActivators;
|
||||
Store<ESM::Potion> mPotions;
|
||||
Store<ESM::Apparatus> mAppas;
|
||||
Store<ESM::Armor> mArmors;
|
||||
Store<ESM::BodyPart> mBodyParts;
|
||||
Store<ESM::Book> mBooks;
|
||||
Store<ESM::BirthSign> mBirthSigns;
|
||||
Store<ESM::Class> mClasses;
|
||||
Store<ESM::Clothing> mClothes;
|
||||
Store<ESM::LoadCNTC> mContChange;
|
||||
Store<ESM::Container> mContainers;
|
||||
Store<ESM::Creature> mCreatures;
|
||||
Store<ESM::LoadCREC> mCreaChange;
|
||||
Store<ESM::Dialogue> mDialogs;
|
||||
Store<ESM::Door> mDoors;
|
||||
Store<ESM::Enchantment> mEnchants;
|
||||
Store<ESM::Faction> mFactions;
|
||||
Store<ESM::Global> mGlobals;
|
||||
Store<ESM::Ingredient> mIngreds;
|
||||
Store<ESM::CreatureLevList> mCreatureLists;
|
||||
Store<ESM::ItemLevList> mItemLists;
|
||||
Store<ESM::Light> mLights;
|
||||
Store<ESM::Tool> mLockpicks;
|
||||
Store<ESM::Miscellaneous> mMiscItems;
|
||||
Store<ESM::NPC> mNpcs;
|
||||
Store<ESM::LoadNPCC> mNpcChange;
|
||||
Store<ESM::Probe> mProbes;
|
||||
Store<ESM::Race> mRaces;
|
||||
Store<ESM::Region> mRegions;
|
||||
Store<ESM::Repair> mRepairs;
|
||||
Store<ESM::SoundGenerator> mSoundGens;
|
||||
Store<ESM::Sound> mSounds;
|
||||
Store<ESM::Spell> mSpells;
|
||||
Store<ESM::StartScript> mStartScripts;
|
||||
Store<ESM::Static> mStatics;
|
||||
Store<ESM::Weapon> mWeapons;
|
||||
|
||||
Store<ESM::GameSetting> mGameSettings;
|
||||
Store<ESM::Script> mScripts;
|
||||
|
||||
// Lists that need special rules
|
||||
Store<ESM::Cell> mCells;
|
||||
Store<ESM::Land> mLands;
|
||||
Store<ESM::LandTexture> mLandTextures;
|
||||
Store<ESM::Pathgrid> mPathgrids;
|
||||
|
||||
Store<ESM::MagicEffect> mMagicEffects;
|
||||
Store<ESM::Skill> mSkills;
|
||||
|
||||
// Special entry which is hardcoded and not loaded from an ESM
|
||||
Store<ESM::Attribute> mAttributes;
|
||||
|
||||
// Lookup of all IDs. Makes looking up references faster. Just
|
||||
// maps the id name to the record type.
|
||||
std::map<std::string, int> mIds;
|
||||
std::map<int, StoreBase *> mStores;
|
||||
|
||||
unsigned int mDynamicCount;
|
||||
|
||||
public:
|
||||
/// \todo replace with SharedIterator<StoreBase>
|
||||
typedef std::map<int, StoreBase *>::const_iterator iterator;
|
||||
|
||||
iterator begin() const {
|
||||
return mStores.begin();
|
||||
}
|
||||
|
||||
iterator end() const {
|
||||
return mStores.end();
|
||||
}
|
||||
|
||||
// Look up the given ID in 'all'. Returns 0 if not found.
|
||||
int find(const std::string &id) const
|
||||
{
|
||||
std::map<std::string, int>::const_iterator it = mIds.find(id);
|
||||
if (it == mIds.end()) {
|
||||
return 0;
|
||||
}
|
||||
return it->second;
|
||||
}
|
||||
|
||||
ESMStore()
|
||||
: mDynamicCount(0)
|
||||
{
|
||||
mStores[ESM::REC_ACTI] = &mActivators;
|
||||
mStores[ESM::REC_ALCH] = &mPotions;
|
||||
mStores[ESM::REC_APPA] = &mAppas;
|
||||
mStores[ESM::REC_ARMO] = &mArmors;
|
||||
mStores[ESM::REC_BODY] = &mBodyParts;
|
||||
mStores[ESM::REC_BOOK] = &mBooks;
|
||||
mStores[ESM::REC_BSGN] = &mBirthSigns;
|
||||
mStores[ESM::REC_CELL] = &mCells;
|
||||
mStores[ESM::REC_CLAS] = &mClasses;
|
||||
mStores[ESM::REC_CLOT] = &mClothes;
|
||||
mStores[ESM::REC_CNTC] = &mContChange;
|
||||
mStores[ESM::REC_CONT] = &mContainers;
|
||||
mStores[ESM::REC_CREA] = &mCreatures;
|
||||
mStores[ESM::REC_CREC] = &mCreaChange;
|
||||
mStores[ESM::REC_DIAL] = &mDialogs;
|
||||
mStores[ESM::REC_DOOR] = &mDoors;
|
||||
mStores[ESM::REC_ENCH] = &mEnchants;
|
||||
mStores[ESM::REC_FACT] = &mFactions;
|
||||
mStores[ESM::REC_GLOB] = &mGlobals;
|
||||
mStores[ESM::REC_GMST] = &mGameSettings;
|
||||
mStores[ESM::REC_INGR] = &mIngreds;
|
||||
mStores[ESM::REC_LAND] = &mLands;
|
||||
mStores[ESM::REC_LEVC] = &mCreatureLists;
|
||||
mStores[ESM::REC_LEVI] = &mItemLists;
|
||||
mStores[ESM::REC_LIGH] = &mLights;
|
||||
mStores[ESM::REC_LOCK] = &mLockpicks;
|
||||
mStores[ESM::REC_LTEX] = &mLandTextures;
|
||||
mStores[ESM::REC_MISC] = &mMiscItems;
|
||||
mStores[ESM::REC_NPC_] = &mNpcs;
|
||||
mStores[ESM::REC_NPCC] = &mNpcChange;
|
||||
mStores[ESM::REC_PGRD] = &mPathgrids;
|
||||
mStores[ESM::REC_PROB] = &mProbes;
|
||||
mStores[ESM::REC_RACE] = &mRaces;
|
||||
mStores[ESM::REC_REGN] = &mRegions;
|
||||
mStores[ESM::REC_REPA] = &mRepairs;
|
||||
mStores[ESM::REC_SCPT] = &mScripts;
|
||||
mStores[ESM::REC_SNDG] = &mSoundGens;
|
||||
mStores[ESM::REC_SOUN] = &mSounds;
|
||||
mStores[ESM::REC_SPEL] = &mSpells;
|
||||
mStores[ESM::REC_SSCR] = &mStartScripts;
|
||||
mStores[ESM::REC_STAT] = &mStatics;
|
||||
mStores[ESM::REC_WEAP] = &mWeapons;
|
||||
}
|
||||
|
||||
void load(ESM::ESMReader &esm);
|
||||
|
||||
template <class T>
|
||||
const Store<T> &get() const {
|
||||
throw std::runtime_error("Storage for this type not exist");
|
||||
}
|
||||
|
||||
template <class T>
|
||||
T *insert(const T &x) {
|
||||
Store<T> &store = const_cast<Store<T> &>(get<T>());
|
||||
T record = x;
|
||||
|
||||
std::ostringstream id;
|
||||
id << "$dynamic" << mDynamicCount++;
|
||||
record.mId = id.str();
|
||||
|
||||
T *ptr = store.insert(record);
|
||||
for (iterator it = mStores.begin(); it != mStores.end(); ++it) {
|
||||
if (it->second == &store) {
|
||||
mIds[ptr->mId] = it->first;
|
||||
}
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
|
||||
private:
|
||||
void setUp();
|
||||
};
|
||||
|
||||
template <>
|
||||
inline ESM::Cell *ESMStore::insert<ESM::Cell>(const ESM::Cell &cell) {
|
||||
return mCells.insert(cell);
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Activator> &ESMStore::get<ESM::Activator>() const {
|
||||
return mActivators;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Potion> &ESMStore::get<ESM::Potion>() const {
|
||||
return mPotions;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Apparatus> &ESMStore::get<ESM::Apparatus>() const {
|
||||
return mAppas;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Armor> &ESMStore::get<ESM::Armor>() const {
|
||||
return mArmors;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::BodyPart> &ESMStore::get<ESM::BodyPart>() const {
|
||||
return mBodyParts;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Book> &ESMStore::get<ESM::Book>() const {
|
||||
return mBooks;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::BirthSign> &ESMStore::get<ESM::BirthSign>() const {
|
||||
return mBirthSigns;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Class> &ESMStore::get<ESM::Class>() const {
|
||||
return mClasses;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Clothing> &ESMStore::get<ESM::Clothing>() const {
|
||||
return mClothes;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::LoadCNTC> &ESMStore::get<ESM::LoadCNTC>() const {
|
||||
return mContChange;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Container> &ESMStore::get<ESM::Container>() const {
|
||||
return mContainers;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Creature> &ESMStore::get<ESM::Creature>() const {
|
||||
return mCreatures;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::LoadCREC> &ESMStore::get<ESM::LoadCREC>() const {
|
||||
return mCreaChange;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Dialogue> &ESMStore::get<ESM::Dialogue>() const {
|
||||
return mDialogs;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Door> &ESMStore::get<ESM::Door>() const {
|
||||
return mDoors;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Enchantment> &ESMStore::get<ESM::Enchantment>() const {
|
||||
return mEnchants;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Faction> &ESMStore::get<ESM::Faction>() const {
|
||||
return mFactions;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Global> &ESMStore::get<ESM::Global>() const {
|
||||
return mGlobals;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Ingredient> &ESMStore::get<ESM::Ingredient>() const {
|
||||
return mIngreds;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::CreatureLevList> &ESMStore::get<ESM::CreatureLevList>() const {
|
||||
return mCreatureLists;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::ItemLevList> &ESMStore::get<ESM::ItemLevList>() const {
|
||||
return mItemLists;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Light> &ESMStore::get<ESM::Light>() const {
|
||||
return mLights;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Tool> &ESMStore::get<ESM::Tool>() const {
|
||||
return mLockpicks;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Miscellaneous> &ESMStore::get<ESM::Miscellaneous>() const {
|
||||
return mMiscItems;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::NPC> &ESMStore::get<ESM::NPC>() const {
|
||||
return mNpcs;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::LoadNPCC> &ESMStore::get<ESM::LoadNPCC>() const {
|
||||
return mNpcChange;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Probe> &ESMStore::get<ESM::Probe>() const {
|
||||
return mProbes;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Race> &ESMStore::get<ESM::Race>() const {
|
||||
return mRaces;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Region> &ESMStore::get<ESM::Region>() const {
|
||||
return mRegions;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Repair> &ESMStore::get<ESM::Repair>() const {
|
||||
return mRepairs;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::SoundGenerator> &ESMStore::get<ESM::SoundGenerator>() const {
|
||||
return mSoundGens;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Sound> &ESMStore::get<ESM::Sound>() const {
|
||||
return mSounds;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Spell> &ESMStore::get<ESM::Spell>() const {
|
||||
return mSpells;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::StartScript> &ESMStore::get<ESM::StartScript>() const {
|
||||
return mStartScripts;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Static> &ESMStore::get<ESM::Static>() const {
|
||||
return mStatics;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Weapon> &ESMStore::get<ESM::Weapon>() const {
|
||||
return mWeapons;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::GameSetting> &ESMStore::get<ESM::GameSetting>() const {
|
||||
return mGameSettings;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Script> &ESMStore::get<ESM::Script>() const {
|
||||
return mScripts;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Cell> &ESMStore::get<ESM::Cell>() const {
|
||||
return mCells;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Land> &ESMStore::get<ESM::Land>() const {
|
||||
return mLands;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::LandTexture> &ESMStore::get<ESM::LandTexture>() const {
|
||||
return mLandTextures;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Pathgrid> &ESMStore::get<ESM::Pathgrid>() const {
|
||||
return mPathgrids;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::MagicEffect> &ESMStore::get<ESM::MagicEffect>() const {
|
||||
return mMagicEffects;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Skill> &ESMStore::get<ESM::Skill>() const {
|
||||
return mSkills;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const Store<ESM::Attribute> &ESMStore::get<ESM::Attribute>() const {
|
||||
return mAttributes;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include <stdexcept>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
#include "esmstore.hpp"
|
||||
|
||||
namespace MWWorld
|
||||
{
|
||||
|
@ -27,35 +27,36 @@ namespace MWWorld
|
|||
return iter;
|
||||
}
|
||||
|
||||
Globals::Globals (const ESMS::ESMStore& store)
|
||||
Globals::Globals (const MWWorld::ESMStore& store)
|
||||
{
|
||||
for (ESMS::RecListT<ESM::Global>::MapType::const_iterator iter
|
||||
(store.globals.list.begin()); iter != store.globals.list.end(); ++iter)
|
||||
const MWWorld::Store<ESM::Global> &globals = store.get<ESM::Global>();
|
||||
MWWorld::Store<ESM::Global>::iterator iter = globals.begin();
|
||||
for (; iter != globals.end(); ++iter)
|
||||
{
|
||||
char type = ' ';
|
||||
Data value;
|
||||
|
||||
switch (iter->second.mType)
|
||||
switch (iter->mType)
|
||||
{
|
||||
case ESM::VT_Short:
|
||||
|
||||
type = 's';
|
||||
value.mShort = *reinterpret_cast<const Interpreter::Type_Float *> (
|
||||
&iter->second.mValue);
|
||||
&iter->mValue);
|
||||
break;
|
||||
|
||||
case ESM::VT_Int:
|
||||
|
||||
type = 'l';
|
||||
value.mLong = *reinterpret_cast<const Interpreter::Type_Float *> (
|
||||
&iter->second.mValue);
|
||||
&iter->mValue);
|
||||
break;
|
||||
|
||||
case ESM::VT_Float:
|
||||
|
||||
type = 'f';
|
||||
value.mFloat = *reinterpret_cast<const Interpreter::Type_Float *> (
|
||||
&iter->second.mValue);
|
||||
&iter->mValue);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -63,7 +64,7 @@ namespace MWWorld
|
|||
throw std::runtime_error ("unsupported global variable type");
|
||||
}
|
||||
|
||||
mVariables.insert (std::make_pair (iter->first, std::make_pair (type, value)));
|
||||
mVariables.insert (std::make_pair (iter->mId, std::make_pair (type, value)));
|
||||
}
|
||||
|
||||
if (mVariables.find ("dayspassed")==mVariables.end())
|
||||
|
|
|
@ -6,13 +6,10 @@
|
|||
|
||||
#include <components/interpreter/types.hpp>
|
||||
|
||||
namespace ESMS
|
||||
{
|
||||
struct ESMStore;
|
||||
}
|
||||
|
||||
namespace MWWorld
|
||||
{
|
||||
class ESMStore;
|
||||
|
||||
class Globals
|
||||
{
|
||||
public:
|
||||
|
@ -36,7 +33,7 @@ namespace MWWorld
|
|||
|
||||
public:
|
||||
|
||||
Globals (const ESMS::ESMStore& store);
|
||||
Globals (const MWWorld::ESMStore& store);
|
||||
|
||||
const Data& operator[] (const std::string& name) const;
|
||||
|
||||
|
|
|
@ -6,13 +6,12 @@
|
|||
|
||||
#include <components/esm/loadench.hpp>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
||||
#include "../mwmechanics/npcstats.hpp"
|
||||
|
||||
#include "esmstore.hpp"
|
||||
#include "class.hpp"
|
||||
|
||||
void MWWorld::InventoryStore::copySlots (const InventoryStore& store)
|
||||
|
@ -231,7 +230,7 @@ const MWMechanics::MagicEffects& MWWorld::InventoryStore::getMagicEffects()
|
|||
if (!enchantmentId.empty())
|
||||
{
|
||||
const ESM::Enchantment& enchantment =
|
||||
*MWBase::Environment::get().getWorld()->getStore().enchants.find (enchantmentId);
|
||||
*MWBase::Environment::get().getWorld()->getStore().get<ESM::Enchantment>().find (enchantmentId);
|
||||
|
||||
if (enchantment.mData.mType==ESM::Enchantment::ConstantEffect)
|
||||
mMagicEffects.add (enchantment.mEffects);
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
|
||||
#include "localscripts.hpp"
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
|
||||
#include "esmstore.hpp"
|
||||
#include "cellstore.hpp"
|
||||
|
||||
namespace
|
||||
|
@ -12,18 +10,18 @@ namespace
|
|||
MWWorld::CellRefList<T>& cellRefList, MWWorld::Ptr::CellStore *cell)
|
||||
{
|
||||
for (typename MWWorld::CellRefList<T>::List::iterator iter (
|
||||
cellRefList.list.begin());
|
||||
iter!=cellRefList.list.end(); ++iter)
|
||||
cellRefList.mList.begin());
|
||||
iter!=cellRefList.mList.end(); ++iter)
|
||||
{
|
||||
if (!iter->base->mScript.empty() && iter->mData.getCount())
|
||||
if (!iter->mBase->mScript.empty() && iter->mData.getCount())
|
||||
{
|
||||
localScripts.add (iter->base->mScript, MWWorld::Ptr (&*iter, cell));
|
||||
localScripts.add (iter->mBase->mScript, MWWorld::Ptr (&*iter, cell));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MWWorld::LocalScripts::LocalScripts (const ESMS::ESMStore& store) : mStore (store) {}
|
||||
MWWorld::LocalScripts::LocalScripts (const MWWorld::ESMStore& store) : mStore (store) {}
|
||||
|
||||
void MWWorld::LocalScripts::setIgnore (const Ptr& ptr)
|
||||
{
|
||||
|
@ -63,7 +61,7 @@ std::pair<std::string, MWWorld::Ptr> MWWorld::LocalScripts::getNext()
|
|||
|
||||
void MWWorld::LocalScripts::add (const std::string& scriptName, const Ptr& ptr)
|
||||
{
|
||||
if (const ESM::Script *script = mStore.scripts.find (scriptName))
|
||||
if (const ESM::Script *script = mStore.get<ESM::Script>().find (scriptName))
|
||||
{
|
||||
ptr.getRefData().setLocals (*script);
|
||||
|
||||
|
@ -73,23 +71,23 @@ void MWWorld::LocalScripts::add (const std::string& scriptName, const Ptr& ptr)
|
|||
|
||||
void MWWorld::LocalScripts::addCell (Ptr::CellStore *cell)
|
||||
{
|
||||
listCellScripts (*this, cell->activators, cell);
|
||||
listCellScripts (*this, cell->potions, cell);
|
||||
listCellScripts (*this, cell->appas, cell);
|
||||
listCellScripts (*this, cell->armors, cell);
|
||||
listCellScripts (*this, cell->books, cell);
|
||||
listCellScripts (*this, cell->clothes, cell);
|
||||
listCellScripts (*this, cell->containers, cell);
|
||||
listCellScripts (*this, cell->creatures, cell);
|
||||
listCellScripts (*this, cell->doors, cell);
|
||||
listCellScripts (*this, cell->ingreds, cell);
|
||||
listCellScripts (*this, cell->lights, cell);
|
||||
listCellScripts (*this, cell->lockpicks, cell);
|
||||
listCellScripts (*this, cell->miscItems, cell);
|
||||
listCellScripts (*this, cell->npcs, cell);
|
||||
listCellScripts (*this, cell->probes, cell);
|
||||
listCellScripts (*this, cell->repairs, cell);
|
||||
listCellScripts (*this, cell->weapons, cell);
|
||||
listCellScripts (*this, cell->mActivators, cell);
|
||||
listCellScripts (*this, cell->mPotions, cell);
|
||||
listCellScripts (*this, cell->mAppas, cell);
|
||||
listCellScripts (*this, cell->mArmors, cell);
|
||||
listCellScripts (*this, cell->mBooks, cell);
|
||||
listCellScripts (*this, cell->mClothes, cell);
|
||||
listCellScripts (*this, cell->mContainers, cell);
|
||||
listCellScripts (*this, cell->mCreatures, cell);
|
||||
listCellScripts (*this, cell->mDoors, cell);
|
||||
listCellScripts (*this, cell->mIngreds, cell);
|
||||
listCellScripts (*this, cell->mLights, cell);
|
||||
listCellScripts (*this, cell->mLockpicks, cell);
|
||||
listCellScripts (*this, cell->mMiscItems, cell);
|
||||
listCellScripts (*this, cell->mNpcs, cell);
|
||||
listCellScripts (*this, cell->mProbes, cell);
|
||||
listCellScripts (*this, cell->mRepairs, cell);
|
||||
listCellScripts (*this, cell->mWeapons, cell);
|
||||
}
|
||||
|
||||
void MWWorld::LocalScripts::clear()
|
||||
|
|
|
@ -6,13 +6,9 @@
|
|||
|
||||
#include "ptr.hpp"
|
||||
|
||||
namespace ESMS
|
||||
{
|
||||
struct ESMStore;
|
||||
}
|
||||
|
||||
namespace MWWorld
|
||||
{
|
||||
struct ESMStore;
|
||||
class CellStore;
|
||||
|
||||
/// \brief List of active local scripts
|
||||
|
@ -21,11 +17,11 @@ namespace MWWorld
|
|||
std::list<std::pair<std::string, Ptr> > mScripts;
|
||||
std::list<std::pair<std::string, Ptr> >::iterator mIter;
|
||||
MWWorld::Ptr mIgnore;
|
||||
const ESMS::ESMStore& mStore;
|
||||
const MWWorld::ESMStore& mStore;
|
||||
|
||||
public:
|
||||
|
||||
LocalScripts (const ESMS::ESMStore& store);
|
||||
LocalScripts (const MWWorld::ESMStore& store);
|
||||
|
||||
void setIgnore (const Ptr& ptr);
|
||||
///< Mark a single reference for ignoring during iteration over local scripts (will revoke
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
|
||||
#include <boost/any.hpp>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
|
||||
#include "esmstore.hpp"
|
||||
#include "ptr.hpp"
|
||||
#include "cellstore.hpp"
|
||||
|
||||
|
@ -20,29 +19,12 @@ namespace MWWorld
|
|||
ManualRef& operator= (const ManualRef&);
|
||||
|
||||
template<typename T>
|
||||
bool create (const ESMS::RecListT<T>& list, const std::string& name)
|
||||
bool create (const MWWorld::Store<T>& list, const std::string& name)
|
||||
{
|
||||
if (const T *instance = list.search (name))
|
||||
{
|
||||
LiveCellRef<T> ref;
|
||||
ref.base = instance;
|
||||
|
||||
mRef = ref;
|
||||
mPtr = Ptr (&boost::any_cast<LiveCellRef<T>&> (mRef), 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
bool create (const ESMS::RecListWithIDT<T>& list, const std::string& name)
|
||||
{
|
||||
if (const T *instance = list.search (name))
|
||||
{
|
||||
LiveCellRef<T> ref;
|
||||
ref.base = instance;
|
||||
ref.mBase = instance;
|
||||
|
||||
mRef = ref;
|
||||
mPtr = Ptr (&boost::any_cast<LiveCellRef<T>&> (mRef), 0);
|
||||
|
@ -55,29 +37,29 @@ namespace MWWorld
|
|||
|
||||
public:
|
||||
|
||||
ManualRef (const ESMS::ESMStore& store, const std::string& name)
|
||||
ManualRef (const MWWorld::ESMStore& store, const std::string& name)
|
||||
{
|
||||
// create
|
||||
if (!create (store.activators, name) &&
|
||||
!create (store.potions, name) &&
|
||||
!create (store.appas, name) &&
|
||||
!create (store.armors, name) &&
|
||||
!create (store.books, name) &&
|
||||
!create (store.clothes, name) &&
|
||||
!create (store.containers, name) &&
|
||||
!create (store.creatures, name) &&
|
||||
!create (store.doors, name) &&
|
||||
!create (store.ingreds, name) &&
|
||||
!create (store.creatureLists, name) &&
|
||||
!create (store.itemLists, name) &&
|
||||
!create (store.lights, name) &&
|
||||
!create (store.lockpicks, name) &&
|
||||
!create (store.miscItems, name) &&
|
||||
!create (store.npcs, name) &&
|
||||
!create (store.probes, name) &&
|
||||
!create (store.repairs, name) &&
|
||||
!create (store.statics, name) &&
|
||||
!create (store.weapons, name))
|
||||
if (!create (store.get<ESM::Activator>(), name) &&
|
||||
!create (store.get<ESM::Potion>(), name) &&
|
||||
!create (store.get<ESM::Apparatus>(), name) &&
|
||||
!create (store.get<ESM::Armor>(), name) &&
|
||||
!create (store.get<ESM::Book>(), name) &&
|
||||
!create (store.get<ESM::Clothing>(), name) &&
|
||||
!create (store.get<ESM::Container>(), name) &&
|
||||
!create (store.get<ESM::Creature>(), name) &&
|
||||
!create (store.get<ESM::Door>(), name) &&
|
||||
!create (store.get<ESM::Ingredient>(), name) &&
|
||||
!create (store.get<ESM::CreatureLevList>(), name) &&
|
||||
!create (store.get<ESM::ItemLevList>(), name) &&
|
||||
!create (store.get<ESM::Light>(), name) &&
|
||||
!create (store.get<ESM::Tool>(), name) &&
|
||||
!create (store.get<ESM::Miscellaneous>(), name) &&
|
||||
!create (store.get<ESM::NPC>(), name) &&
|
||||
!create (store.get<ESM::Probe>(), name) &&
|
||||
!create (store.get<ESM::Repair>(), name) &&
|
||||
!create (store.get<ESM::Static>(), name) &&
|
||||
!create (store.get<ESM::Weapon>(), name))
|
||||
throw std::logic_error ("failed to create manual cell ref for " + name);
|
||||
|
||||
// initialise
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
|
||||
#include "player.hpp"
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
@ -9,6 +8,7 @@
|
|||
#include "../mwmechanics/movement.hpp"
|
||||
#include "../mwmechanics/npcstats.hpp"
|
||||
|
||||
#include "esmstore.hpp"
|
||||
#include "class.hpp"
|
||||
|
||||
namespace MWWorld
|
||||
|
@ -17,8 +17,8 @@ namespace MWWorld
|
|||
mCellStore (0), mClass (0),
|
||||
mAutoMove (false), mForwardBackward (0)
|
||||
{
|
||||
mPlayer.base = player;
|
||||
mPlayer.ref.mRefID = "player";
|
||||
mPlayer.mBase = player;
|
||||
mPlayer.mRef.mRefID = "player";
|
||||
mName = player->mName;
|
||||
mMale = !(player->mFlags & ESM::NPC::Female);
|
||||
mRace = player->mRace;
|
||||
|
@ -27,7 +27,7 @@ namespace MWWorld
|
|||
playerPos[0] = playerPos[1] = playerPos[2] = 0;
|
||||
|
||||
/// \todo Do not make a copy of classes defined in esm/p records.
|
||||
mClass = new ESM::Class (*world.getStore().classes.find (player->mClass));
|
||||
mClass = new ESM::Class (*world.getStore().get<ESM::Class>().find (player->mClass));
|
||||
}
|
||||
|
||||
Player::~Player()
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue