|
|
@ -302,30 +302,15 @@ namespace MWClass
|
|
|
|
|
|
|
|
|
|
|
|
std::string Door::getDestination (const MWWorld::LiveCellRef<ESM::Door>& door)
|
|
|
|
std::string Door::getDestination (const MWWorld::LiveCellRef<ESM::Door>& door)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
|
|
|
std::string dest = door.mRef.getDestCell();
|
|
|
|
|
|
|
|
if (dest.empty())
|
|
|
|
std::string dest;
|
|
|
|
|
|
|
|
if (door.mRef.getDestCell() != "")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// door leads to an interior, use interior name as tooltip
|
|
|
|
|
|
|
|
dest = door.mRef.getDestCell();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// door leads to exterior, use cell name (if any), otherwise translated region name
|
|
|
|
// door leads to exterior, use cell name (if any), otherwise translated region name
|
|
|
|
int x,y;
|
|
|
|
int x,y;
|
|
|
|
MWBase::Environment::get().getWorld()->positionToIndex (door.mRef.getDoorDest().pos[0], door.mRef.getDoorDest().pos[1], x, y);
|
|
|
|
auto world = MWBase::Environment::get().getWorld();
|
|
|
|
const ESM::Cell* cell = store.get<ESM::Cell>().find(x,y);
|
|
|
|
world->positionToIndex (door.mRef.getDoorDest().pos[0], door.mRef.getDoorDest().pos[1], x, y);
|
|
|
|
if (cell->mName != "")
|
|
|
|
const ESM::Cell* cell = world->getStore().get<ESM::Cell>().search(x,y);
|
|
|
|
dest = cell->mName;
|
|
|
|
dest = world->getCellName(cell);
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
const ESM::Region* region =
|
|
|
|
|
|
|
|
store.get<ESM::Region>().find(cell->mRegion);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//name as is, not a token
|
|
|
|
|
|
|
|
return MyGUI::TextIterator::toTagsString(region->mName);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return "#{sCell=" + dest + "}";
|
|
|
|
return "#{sCell=" + dest + "}";
|
|
|
|