Make player markers appear on inventory map

pull/76/head
David Cernat 8 years ago
parent 07acd7a721
commit 14bac1e533

@ -139,6 +139,7 @@ namespace MWGui
std::vector<MyGUI::Widget*> mDoorMarkerWidgets;
std::vector<MyGUI::Widget*> mMagicMarkerWidgets;
std::vector<MyGUI::Widget*> mCustomMarkerWidgets;
std::vector<MyGUI::Widget*> mPlayerMarkerWidgets;
virtual void updateCustomMarkers();
virtual void updatePlayerMarkers();

@ -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<MyGUI::Widget*>::iterator it = mPlayerMarkerWidgets.begin(); it != mPlayerMarkerWidgets.end(); ++it)
for (std::vector<MyGUI::Widget*>::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<MarkerWidget>("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);
}
}
}

Loading…
Cancel
Save