1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-19 19:53:53 +00:00

Merge branch 'bug-fix-7116' into 'master'

Fix #7116

Closes #7116

See merge request OpenMW/openmw!2550
This commit is contained in:
Alexei Kotov 2022-12-26 16:22:14 +00:00
commit 00b142eed7
2 changed files with 10 additions and 6 deletions

View file

@ -766,6 +766,7 @@ namespace MWGui
, mEventBoxLocal(nullptr)
, mGlobalMapRender(std::make_unique<MWRender::GlobalMap>(localMapRender->getRoot(), workQueue))
, mEditNoteDialog()
, mAllowZooming(Settings::Manager::getBool("allow zooming", "Map"))
{
static bool registered = false;
if (!registered)
@ -804,8 +805,7 @@ namespace MWGui
getWidget(mEventBoxGlobal, "EventBoxGlobal");
mEventBoxGlobal->eventMouseDrag += MyGUI::newDelegate(this, &MapWindow::onMouseDrag);
mEventBoxGlobal->eventMouseButtonPressed += MyGUI::newDelegate(this, &MapWindow::onDragStart);
const bool allowZooming = Settings::Manager::getBool("allow zooming", "Map");
if (allowZooming)
if (mAllowZooming)
mEventBoxGlobal->eventMouseWheel += MyGUI::newDelegate(this, &MapWindow::onMapZoomed);
mEventBoxGlobal->setDepth(Global_ExploreOverlayLayer);
@ -813,7 +813,7 @@ namespace MWGui
mEventBoxLocal->eventMouseDrag += MyGUI::newDelegate(this, &MapWindow::onMouseDrag);
mEventBoxLocal->eventMouseButtonPressed += MyGUI::newDelegate(this, &MapWindow::onDragStart);
mEventBoxLocal->eventMouseButtonDoubleClick += MyGUI::newDelegate(this, &MapWindow::onMapDoubleClicked);
if (allowZooming)
if (mAllowZooming)
mEventBoxLocal->eventMouseWheel += MyGUI::newDelegate(this, &MapWindow::onMapZoomed);
LocalMapBase::init(mLocalMap, mPlayerArrowLocal, getLocalViewingDistance());
@ -1061,6 +1061,7 @@ namespace MWGui
MyGUI::Colour::parse(MyGUI::LanguageManager::getInstance().replaceTags("#{fontcolour=normal}")));
markerWidget->setDepth(Global_MarkerLayer);
markerWidget->eventMouseDrag += MyGUI::newDelegate(this, &MapWindow::onMouseDrag);
if (mAllowZooming)
markerWidget->eventMouseWheel += MyGUI::newDelegate(this, &MapWindow::onMapZoomed);
markerWidget->eventMouseButtonPressed += MyGUI::newDelegate(this, &MapWindow::onDragStart);
@ -1351,6 +1352,7 @@ namespace MWGui
marker->eventMouseDrag += MyGUI::newDelegate(this, &MapWindow::onMouseDrag);
marker->eventMouseButtonPressed += MyGUI::newDelegate(this, &MapWindow::onDragStart);
marker->eventMouseButtonDoubleClick += MyGUI::newDelegate(this, &MapWindow::onCustomMarkerDoubleClicked);
if (mAllowZooming)
marker->eventMouseWheel += MyGUI::newDelegate(this, &MapWindow::onMapZoomed);
}
@ -1358,6 +1360,7 @@ namespace MWGui
{
marker->eventMouseDrag += MyGUI::newDelegate(this, &MapWindow::onMouseDrag);
marker->eventMouseButtonPressed += MyGUI::newDelegate(this, &MapWindow::onDragStart);
if (mAllowZooming)
marker->eventMouseWheel += MyGUI::newDelegate(this, &MapWindow::onMapZoomed);
}

View file

@ -330,6 +330,7 @@ namespace MWGui
EditNoteDialog mEditNoteDialog;
ESM::CustomMarker mEditingMarker;
bool mAllowZooming;
void onPinToggled() override;
void onTitleDoubleClicked() override;