From 14bac1e53338aaa522d624671fc3fd3d954939c3 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sun, 9 Oct 2016 13:41:00 +0300 Subject: [PATCH] Make player markers appear on inventory map --- apps/openmw/mwgui/mapwindow.hpp | 1 + apps/openmw/mwmp/GUIController.cpp | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwgui/mapwindow.hpp b/apps/openmw/mwgui/mapwindow.hpp index bdb6ee00c..79684217e 100644 --- a/apps/openmw/mwgui/mapwindow.hpp +++ b/apps/openmw/mwgui/mapwindow.hpp @@ -139,6 +139,7 @@ namespace MWGui std::vector mDoorMarkerWidgets; std::vector mMagicMarkerWidgets; std::vector mCustomMarkerWidgets; + std::vector mPlayerMarkerWidgets; virtual void updateCustomMarkers(); virtual void updatePlayerMarkers(); diff --git a/apps/openmw/mwmp/GUIController.cpp b/apps/openmw/mwmp/GUIController.cpp index 2ee4c91c2..84561d307 100644 --- a/apps/openmw/mwmp/GUIController.cpp +++ b/apps/openmw/mwmp/GUIController.cpp @@ -263,9 +263,10 @@ void mwmp::GUIController::SetMapVisibility(int pid, bool state) void mwmp::GUIController::updatePlayersMarkers(MWGui::LocalMapBase *localMapBase) { printf("updatePlayersMarkers!!!\n"); - for (std::vector::iterator it = mPlayerMarkerWidgets.begin(); it != mPlayerMarkerWidgets.end(); ++it) + for (std::vector::iterator it = localMapBase->mPlayerMarkerWidgets.begin(); it != localMapBase->mPlayerMarkerWidgets.end(); ++it) + MyGUI::Gui::getInstance().destroyWidget(*it); - mPlayerMarkerWidgets.clear(); + localMapBase->mPlayerMarkerWidgets.clear(); for (int dX = -localMapBase->mCellDistance; dX <= localMapBase->mCellDistance; ++dX) { @@ -288,6 +289,7 @@ void mwmp::GUIController::updatePlayersMarkers(MWGui::LocalMapBase *localMapBase MyGUI::IntCoord widgetCoord(widgetPos.left - 8, widgetPos.top - 8, 16, 16); MarkerWidget* markerWidget = localMapBase->mLocalMap->createWidget("CustomMarkerButton", widgetCoord, MyGUI::Align::Default); + markerWidget->setDepth(0); // Local_MarkerAboveFogLayer markerWidget->setUserString("ToolTipType", "Layout"); markerWidget->setUserString("ToolTipLayout", "TextToolTipOneLine"); @@ -297,7 +299,7 @@ void mwmp::GUIController::updatePlayersMarkers(MWGui::LocalMapBase *localMapBase markerWidget->setUserData(marker); markerWidget->setNeedMouseFocus(true); //localMapBase->customMarkerCreated(markerWidget); - mPlayerMarkerWidgets.push_back(markerWidget); + localMapBase->mPlayerMarkerWidgets.push_back(markerWidget); } } }