3d mapper creation at clicking#3451
Conversation
3dMapper only created if the button 2d/3d is clicked
It was possible to create an embedded and a dockwindow mapper at the same time. If clicked on the 2d/3d button that would create a crash. with this change it is only possible to create an embedded mapper if there is no dockwindow mapper.
|
Hey there! Thanks for helping Mudlet improve. 🌟 Test versionsYou can directly test the changes here:
No need to install anything - just unzip and run. |
src/dlgMapper.cpp
Outdated
| if (glWidget->isVisible()) { | ||
| d3buttons->setVisible(true); | ||
| } else { | ||
| // Use timer do not let the buttons dissappear |
There was a problem hiding this comment.
I don't understand this, what does it mean?
There was a problem hiding this comment.
I'm not sure if everyone had this issue. But for me in 4.6.1 if i change between 2d/3d Mapper view. The mapper buttons reloaded strangely sometimes (and also disappeared).
this fixes it for me.
There was a problem hiding this comment.
Does a timer of 0 also work?
Try a comment of // workaround for buttons reloading oddly
There was a problem hiding this comment.
No. A timer of 0 doesn't work.
If this timer could potentially create other issues I'll revert it because the buttons reloading strangely/disappearing is a minor issue (they reappear after clicking on the mapper or reloading the window)
| auto pW = mDockWidgetMap.value(windowname); | ||
| auto pM = mpHost->mpDockableMapWidget; | ||
| if (pM) { | ||
| return {false, "cannot create mapper. Do you already use a map window?"}; |
There was a problem hiding this comment.
🚨 Too late for this PR - but this QString should be QStringLiteral(...) wrapped as it is a text for the Lua API and as such is NOT to be translated {if it was a GUI text then it should have a tr(...) wrapping} either way - it is not desirable to have raw C++ strings used to initialise QStrings.

Brief overview of PR changes/additions
With this PR the 3d Mapper is only created if clicked on the 2d/3d button
Motivation for adding to Mudlet
Some people which didn't even use the 3d mapper had problems caused by it.
Other info (issues closed, discussion etc)
fixed by the way button dissapearance if clicking 2d/3d button
also changed createMapper that is no longer possible to create an embedded mapper and a dockwindow mapper at the same time (which caused crash of the Mudlet application)