mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:53:51 +00:00
applying new interface vol.4, inconsistent
This commit is contained in:
parent
e628b23da6
commit
11567663a7
6 changed files with 58 additions and 41 deletions
|
@ -109,7 +109,7 @@ namespace MWScript
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -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::Cloth>().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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,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 MWWorld::CellList::ExtCells& extCells = MWBase::Environment::get().getWorld ()->getStore ().cells.extCells;
|
||||
for (MWWorld::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()
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -125,12 +132,19 @@ namespace MWScript
|
|||
|
||||
virtual void execute (Interpreter::Runtime& runtime)
|
||||
{
|
||||
const MWWorld::CellList::ExtCells& extCells = MWBase::Environment::get().getWorld ()->getStore ().cells.extCells;
|
||||
for (MWWorld::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()
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -328,7 +328,7 @@ namespace MWScript
|
|||
assert (ref);
|
||||
|
||||
const ESM::Class& class_ =
|
||||
*MWBase::Environment::get().getWorld()->getStore().classes.find (ref->mBase->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);
|
||||
}
|
||||
|
|
|
@ -473,19 +473,19 @@ namespace MWWorld
|
|||
}
|
||||
}
|
||||
|
||||
iterator interiorsBegin() const {
|
||||
iterator intBegin() const {
|
||||
return iterator(mSharedInt.begin());
|
||||
}
|
||||
|
||||
iterator interiorsEnd() const {
|
||||
iterator intEnd() const {
|
||||
return iterator(mSharedInt.end());
|
||||
}
|
||||
|
||||
iterator exteriorsBegin() const {
|
||||
iterator extBegin() const {
|
||||
return iterator(mSharedExt.begin());
|
||||
}
|
||||
|
||||
iterator exteriorsEnd() const {
|
||||
iterator extEnd() const {
|
||||
return iterator(mSharedExt.end());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue