diff --git a/apps/openmw/mwgui/layouts.hpp b/apps/openmw/mwgui/layouts.hpp index 20ee1a80c..1f0bdd0fa 100644 --- a/apps/openmw/mwgui/layouts.hpp +++ b/apps/openmw/mwgui/layouts.hpp @@ -73,6 +73,7 @@ namespace MWGui setCellName("No Cell Loaded"); getWidget(mMap, "Map"); + getWidget(mPlayerArrow, "Compass"); MyGUI::Button* button; getWidget(button, "WorldButton"); @@ -137,10 +138,16 @@ namespace MWGui { if (mVisible) return; MyGUI::IntSize size = mMap->getCanvasSize(); - MyGUI::IntPoint middle = MyGUI::IntPoint(x*size.width,y*size.height); + MyGUI::IntPoint middle = MyGUI::IntPoint((1/3.f + x/3.f)*size.width,(1/3.f + y/3.f)*size.height); MyGUI::IntCoord viewsize = mMap->getCoord(); MyGUI::IntPoint pos(0.5*viewsize.width - middle.left, 0.5*viewsize.height - middle.top); mMap->setViewOffset(pos); + + mPlayerArrow->setPosition(MyGUI::IntPoint(x*512-16, y*512-16)); + + MyGUI::ISubWidget* main = mPlayerArrow->getSubWidgetMain(); + MyGUI::RotatingSkin* rotatingSubskin = main->castType(); + rotatingSubskin->setAngle(3.141 * 0.5); } void onDragStart(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id) @@ -167,6 +174,7 @@ namespace MWGui private: std::string mPrefix; MyGUI::ScrollView* mMap; + MyGUI::ImageBox* mPlayerArrow; MyGUI::IntPoint mLastDragPos; int mCurX, mCurY; bool mInterior; diff --git a/apps/openmw/mwrender/localmap.cpp b/apps/openmw/mwrender/localmap.cpp index b7deb6f7f..e7a7c9f05 100644 --- a/apps/openmw/mwrender/localmap.cpp +++ b/apps/openmw/mwrender/localmap.cpp @@ -275,7 +275,7 @@ void LocalMap::setPlayerPosition (const Ogre::Vector3& position) texName = mInteriorName + "_" + coordStr(x,y); } - mEnvironment->mWindowManager->setPlayerPos(1/3.f + u/3.f, 1/3.f + v/3.f); + mEnvironment->mWindowManager->setPlayerPos(u, v); // explore radius (squared) const float sqrExploreRadius = 0.01 * sFogOfWarResolution*sFogOfWarResolution; diff --git a/files/mygui/core.skin b/files/mygui/core.skin index 83dcd4b9f..28838c234 100644 --- a/files/mygui/core.skin +++ b/files/mygui/core.skin @@ -14,4 +14,7 @@ + + + diff --git a/files/mygui/openmw_map_window_layout.xml b/files/mygui/openmw_map_window_layout.xml index 90ad70edb..0ec99f450 100644 --- a/files/mygui/openmw_map_window_layout.xml +++ b/files/mygui/openmw_map_window_layout.xml @@ -4,7 +4,7 @@ - + @@ -23,7 +23,10 @@ - + + + + @@ -42,11 +45,8 @@ - - - - +