|
|
|
@ -775,8 +775,6 @@ namespace MWGui
|
|
|
|
|
if (MWBase::Environment::get().getWorld ()->isCellExterior ())
|
|
|
|
|
{
|
|
|
|
|
Ogre::Vector3 pos = MWBase::Environment::get().getWorld ()->getPlayerPtr().getRefData ().getBaseNode ()->_getDerivedPosition ();
|
|
|
|
|
Ogre::Quaternion orient = MWBase::Environment::get().getWorld ()->getPlayerPtr().getRefData ().getBaseNode ()->_getDerivedOrientation ();
|
|
|
|
|
Ogre::Vector2 dir (orient.yAxis ().x, orient.yAxis().y);
|
|
|
|
|
|
|
|
|
|
float worldX, worldY;
|
|
|
|
|
mGlobalMapRender->worldPosToImageSpace (pos.x, pos.y, worldX, worldY);
|
|
|
|
@ -785,12 +783,6 @@ namespace MWGui
|
|
|
|
|
|
|
|
|
|
mPlayerArrowGlobal->setPosition(MyGUI::IntPoint(worldX - 16, worldY - 16));
|
|
|
|
|
|
|
|
|
|
MyGUI::ISubWidget* main = mPlayerArrowGlobal->getSubWidgetMain();
|
|
|
|
|
MyGUI::RotatingSkin* rotatingSubskin = main->castType<MyGUI::RotatingSkin>();
|
|
|
|
|
rotatingSubskin->setCenter(MyGUI::IntPoint(16,16));
|
|
|
|
|
float angle = std::atan2(dir.x, dir.y);
|
|
|
|
|
rotatingSubskin->setAngle(angle);
|
|
|
|
|
|
|
|
|
|
// set the view offset so that player is in the center
|
|
|
|
|
MyGUI::IntSize viewsize = mGlobalMap->getSize();
|
|
|
|
|
MyGUI::IntPoint viewoffs(0.5*viewsize.width - worldX, 0.5*viewsize.height - worldY);
|
|
|
|
@ -818,6 +810,15 @@ namespace MWGui
|
|
|
|
|
mGlobalMap->setViewOffset(viewoffs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MapWindow::setGlobalMapPlayerDir(const float x, const float y)
|
|
|
|
|
{
|
|
|
|
|
MyGUI::ISubWidget* main = mPlayerArrowGlobal->getSubWidgetMain();
|
|
|
|
|
MyGUI::RotatingSkin* rotatingSubskin = main->castType<MyGUI::RotatingSkin>();
|
|
|
|
|
rotatingSubskin->setCenter(MyGUI::IntPoint(16,16));
|
|
|
|
|
float angle = std::atan2(x,y);
|
|
|
|
|
rotatingSubskin->setAngle(angle);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MapWindow::clear()
|
|
|
|
|
{
|
|
|
|
|
mMarkers.clear();
|
|
|
|
|