From fa68be2b190919eb43d0219d849bbcbd1280ff7b Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 10 Mar 2012 16:05:12 +0100 Subject: [PATCH] set map window cell name --- apps/openmw/mwgui/window_manager.cpp | 5 +++++ apps/openmw/mwgui/window_manager.hpp | 2 ++ apps/openmw/mwworld/scene.cpp | 13 +++++++++++++ 3 files changed, 20 insertions(+) diff --git a/apps/openmw/mwgui/window_manager.cpp b/apps/openmw/mwgui/window_manager.cpp index aca9fbd9a..347db09e2 100644 --- a/apps/openmw/mwgui/window_manager.cpp +++ b/apps/openmw/mwgui/window_manager.cpp @@ -401,3 +401,8 @@ const ESMS::ESMStore& WindowManager::getStore() const { return environment.mWorld->getStore(); } + +void WindowManager::setCellName(const std::string& cellName) +{ + map->setCellName(cellName); +} diff --git a/apps/openmw/mwgui/window_manager.hpp b/apps/openmw/mwgui/window_manager.hpp index 89ff4b9bb..258ab7993 100644 --- a/apps/openmw/mwgui/window_manager.hpp +++ b/apps/openmw/mwgui/window_manager.hpp @@ -151,6 +151,8 @@ namespace MWGui void updateSkillArea(); ///< update display of skills, factions, birth sign, reputation and bounty + void setCellName(const std::string& cellName); ///< set the cell name to display in the map window + template void removeDialog(T*& dialog); ///< Casts to OEngine::GUI::Layout and calls removeDialog, then resets pointer to nullptr. void removeDialog(OEngine::GUI::Layout* dialog); ///< Hides dialog and schedules dialog to be deleted. diff --git a/apps/openmw/mwworld/scene.cpp b/apps/openmw/mwworld/scene.cpp index e7a3f2d5d..a63f6d150 100644 --- a/apps/openmw/mwworld/scene.cpp +++ b/apps/openmw/mwworld/scene.cpp @@ -6,6 +6,8 @@ #include "../mwsound/soundmanager.hpp" +#include "../mwgui/window_manager.hpp" + #include "ptr.hpp" #include "environment.hpp" #include "player.hpp" @@ -118,6 +120,17 @@ namespace MWWorld // TODO orientation mEnvironment.mMechanicsManager->addActor (mWorld->getPlayer().getPlayer()); mEnvironment.mMechanicsManager->watchActor (mWorld->getPlayer().getPlayer()); + + // set map window cell name + if (!(mCurrentCell->cell->data.flags & ESM::Cell::Interior)) + { + if (mCurrentCell->cell->name != "") + mEnvironment.mWindowManager->setCellName( mCurrentCell->cell->name ); + else + mEnvironment.mWindowManager->setCellName( mCurrentCell->cell->region ); + } + else + mEnvironment.mWindowManager->setCellName( mCurrentCell->cell->name ); } void Scene::changeCell (int X, int Y, const ESM::Position& position, bool adjustPlayerPos)