diff --git a/apps/openmw/mwgui/layouts.cpp b/apps/openmw/mwgui/layouts.cpp index ebabc6faf..be8c0db17 100644 --- a/apps/openmw/mwgui/layouts.cpp +++ b/apps/openmw/mwgui/layouts.cpp @@ -142,3 +142,13 @@ void HUD::setValue(const std::string& id, const MWMechanics::DynamicStat& v } } } + +void HUD::setPlayerDir(const float x, const float y) +{ + MyGUI::ISubWidget* main = compass->getSubWidgetMain(); + MyGUI::RotatingSkin* rotatingSubskin = main->castType(); + rotatingSubskin->setCenter(MyGUI::IntPoint(16,16)); + float angle = std::atan2(x,y); + rotatingSubskin->setAngle(angle); +} + diff --git a/apps/openmw/mwgui/layouts.hpp b/apps/openmw/mwgui/layouts.hpp index 7ae28b4d8..240406018 100644 --- a/apps/openmw/mwgui/layouts.hpp +++ b/apps/openmw/mwgui/layouts.hpp @@ -46,6 +46,8 @@ namespace MWGui void setTriangleCount(size_t count); void setBatchCount(size_t count); + void setPlayerDir(const float x, const float y); + MyGUI::ProgressPtr health, magicka, stamina; MyGUI::ImageBox *weapImage, *spellImage; MyGUI::ProgressPtr weapStatus, spellStatus; diff --git a/apps/openmw/mwgui/window_manager.cpp b/apps/openmw/mwgui/window_manager.cpp index a263ee2a0..5137a109f 100644 --- a/apps/openmw/mwgui/window_manager.cpp +++ b/apps/openmw/mwgui/window_manager.cpp @@ -433,4 +433,5 @@ void WindowManager::setPlayerPos(const float x, const float y) void WindowManager::setPlayerDir(const float x, const float y) { map->setPlayerDir(x,y); + hud->setPlayerDir(x,y); } diff --git a/files/mygui/openmw_hud_layout.xml b/files/mygui/openmw_hud_layout.xml index 86f4df172..56708eb18 100644 --- a/files/mygui/openmw_hud_layout.xml +++ b/files/mygui/openmw_hud_layout.xml @@ -40,7 +40,7 @@ align="Right Bottom"> -