Allow dragging map even when a marker is hovered

deque
scrawl 10 years ago
parent 603e558fb7
commit 18be152ab1

@ -319,12 +319,11 @@ namespace MWGui
markerWidget->setUserString("ToolTipType", "Layout");
markerWidget->setUserString("ToolTipLayout", "TextToolTipOneLine");
markerWidget->setUserString("Caption_TextOneLine", MyGUI::TextIterator::toTagsString(marker.mNote));
markerWidget->setColour(MyGUI::Colour(1.0,0.3,0.3));
markerWidget->setNormalColour(MyGUI::Colour(1.0,0.3,0.3));
markerWidget->setHoverColour(MyGUI::Colour(1.0,0.5,0.5));
markerWidget->setUserData(marker);
markerWidget->setNeedMouseFocus(true);
markerWidget->eventMouseButtonDoubleClick += MyGUI::newDelegate(this, &LocalMapBase::onCustomMarkerDoubleClicked);
customMarkerCreated(markerWidget);
mCustomMarkerWidgets.push_back(markerWidget);
}
redraw();
@ -411,6 +410,7 @@ namespace MWGui
// Used by tooltips to not show the tooltip if marker is hidden by fog of war
markerWidget->setUserString("IsMarker", "true");
markerWidget->setUserData(markerPos);
doorMarkerCreated(markerWidget);
mDoorMarkerWidgets.push_back(markerWidget);
}
@ -753,6 +753,8 @@ namespace MWGui
markerWidget->setUserString("ToolTipLayout", "TextToolTipOneLine");
markerWidget->setUserString("Caption_TextOneLine", name);
markerWidget->setDepth(Global_MarkerLayer);
markerWidget->eventMouseDrag += MyGUI::newDelegate(this, &MapWindow::onMouseDrag);
markerWidget->eventMouseButtonPressed += MyGUI::newDelegate(this, &MapWindow::onDragStart);
++_counter;
CellId cell;
@ -928,6 +930,19 @@ namespace MWGui
(*it)->setVisible(alpha == 1);
}
void MapWindow::customMarkerCreated(MyGUI::Widget *marker)
{
marker->eventMouseDrag += MyGUI::newDelegate(this, &MapWindow::onMouseDrag);
marker->eventMouseButtonPressed += MyGUI::newDelegate(this, &MapWindow::onDragStart);
marker->eventMouseButtonDoubleClick += MyGUI::newDelegate(this, &MapWindow::onCustomMarkerDoubleClicked);
}
void MapWindow::doorMarkerCreated(MyGUI::Widget *marker)
{
marker->eventMouseDrag += MyGUI::newDelegate(this, &MapWindow::onMouseDrag);
marker->eventMouseButtonPressed += MyGUI::newDelegate(this, &MapWindow::onDragStart);
}
// -------------------------------------------------------------------
EditNoteDialog::EditNoteDialog()

@ -119,7 +119,8 @@ namespace MWGui
virtual void notifyPlayerUpdate() {}
virtual void notifyMapChanged() {}
virtual void onCustomMarkerDoubleClicked(MyGUI::Widget* sender) {}
virtual void customMarkerCreated(MyGUI::Widget* marker) {}
virtual void doorMarkerCreated(MyGUI::Widget* marker) {}
void updateMagicMarkers();
void addDetectionMarkers(int type);
@ -199,6 +200,7 @@ namespace MWGui
void onMouseDrag(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id);
void onWorldButtonClicked(MyGUI::Widget* _sender);
void onMapDoubleClicked(MyGUI::Widget* sender);
void onCustomMarkerDoubleClicked(MyGUI::Widget* sender);
void onNoteEditOk();
void onNoteEditDelete();
void onNoteEditDeleteConfirm();
@ -235,7 +237,9 @@ namespace MWGui
virtual void onPinToggled();
virtual void onTitleDoubleClicked();
virtual void onCustomMarkerDoubleClicked(MyGUI::Widget* sender);
virtual void doorMarkerCreated(MyGUI::Widget* marker);
virtual void customMarkerCreated(MyGUI::Widget *marker);
virtual void notifyPlayerUpdate();

Loading…
Cancel
Save