From 1c5055c8ac41c5a7ea3c08b0248842a754f80c41 Mon Sep 17 00:00:00 2001 From: scrawl Date: Tue, 28 Aug 2012 18:49:44 +0200 Subject: [PATCH] fix a problem where hovering a marker would render it on top of the fog of war instead of below --- apps/openmw/mwgui/map_window.cpp | 12 ++++++++++++ apps/openmw/mwgui/map_window.hpp | 3 +++ 2 files changed, 15 insertions(+) diff --git a/apps/openmw/mwgui/map_window.cpp b/apps/openmw/mwgui/map_window.cpp index c5c3dff92..0d6300baa 100644 --- a/apps/openmw/mwgui/map_window.cpp +++ b/apps/openmw/mwgui/map_window.cpp @@ -93,6 +93,16 @@ void LocalMapBase::applyFogOfWar() } } +void LocalMapBase::onMarkerFocused (MyGUI::Widget* w1, MyGUI::Widget* w2) +{ + applyFogOfWar (); +} + +void LocalMapBase::onMarkerUnfocused (MyGUI::Widget* w1, MyGUI::Widget* w2) +{ + applyFogOfWar (); +} + void LocalMapBase::setActiveCell(const int x, const int y, bool interior) { if (x==mCurX && y==mCurY && mInterior==interior && !mChanged) return; // don't do anything if we're still in the same cell @@ -173,6 +183,8 @@ void LocalMapBase::setActiveCell(const int x, const int y, bool interior) markerWidget->setUserString("ToolTipLayout", "TextToolTip"); markerWidget->setUserString("Caption_Text", marker.name); markerWidget->setUserString("IsMarker", "true"); + markerWidget->eventMouseSetFocus += MyGUI::newDelegate(this, &LocalMapBase::onMarkerFocused); + markerWidget->eventMouseLostFocus += MyGUI::newDelegate(this, &LocalMapBase::onMarkerUnfocused); MarkerPosition markerPos; markerPos.interior = interior; diff --git a/apps/openmw/mwgui/map_window.hpp b/apps/openmw/mwgui/map_window.hpp index c69d8986c..1203233bf 100644 --- a/apps/openmw/mwgui/map_window.hpp +++ b/apps/openmw/mwgui/map_window.hpp @@ -41,6 +41,9 @@ namespace MWGui void applyFogOfWar(); + void onMarkerFocused(MyGUI::Widget* w1, MyGUI::Widget* w2); + void onMarkerUnfocused(MyGUI::Widget* w1, MyGUI::Widget* w2); + OEngine::GUI::Layout* mLayout; bool mMapDragAndDrop;