-
-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Mudlet Remember mapper zoom amount between sessions. #2388
Comments
I foresee setting zoom per-area being a massive amount of pain since it'll reset between areas on the first time and so on. Remembering zoom between restarts would be nice, meanwhile just throwing https://wiki.mudlet.org/w/Manual:Mapper_Functions#setMapZoom into a script is a trivial workaround for it! |
💡 Don't forget that there is Area User Data nowadays so it is possible to store per-Area data - see |
Old request, but ill chime in. |
The map zoom level is, unfortunately controlled in more than one way that do not communicate with each other. in the 2D map you have the (vertical) mouse wheel and the |
hahahaha currently I only use the 2D mapper so that would work ok for me :) |
3d mapping?? i didn't even know about that :D I also just use the 2d map. but with additional "get" methods for current zoom level (for 2d) and for positions and scale for 3d, im sure ppl would quickly make areas have persistent zoom and viewpoints :) Might need an event for the mouse wheel if there isnt one also. (this isnt a big deal for me though, as it only takes about 2 sec to scroll whatever area i enter to the correct scale anyways, and i could probably play around with setMapZoom to persist this, just would feel "clunky" having to set that manually, and not just persist whatever i zoomed to last time i visited that area) |
So you would want:
🤔 Probably also need Lua API means to setup all of those details as well... |
Yes to the sysMapperAreaViewedEvent and its returns. For getting all of the "viewmode" properties, i am not 100% sure you need to go full tilt initially. There is currently only the one "setMapZoom(zoom)" setter, meaning one could start with "getMapZoom()" getter. (meaning this would only work "properly" for 2D view mode initially. This could of course be expanded with 3d support, area granularity, storing zoom level in the map itself, or building in persistency into the application. However this could likely wait until there is a demand? (I don't know the overhead of setting up a new function in Mudlet, though i can envision that it is quite a bit (code, testing, documentation etc). As stated, this is not a critically needed feature for me. I have wanted to start taking a look at the code myself, could potentially be a motivator for me to get coding again :D) (I have to say i truly love Mudlet. It has brought joy of mudding back to me) |
I think at this point it would make sense for us to just build it in as a Mudlet feature, instead of making everyone re-code it themselves. We could store the map zoom per-area as an area userdata feature. |
If you enter a new area for the first time that does not have a zoom setting yet, start with the previous area's one. |
Is the bounty just for the 2D mapper (:relaxed:) or something that also works for the 3D one (:scream:)? |
We can start with 2D for now. |
This is intended to close Mudlet#2388. This enables the 2D (only) map zoom amounts for each map area to be save independently and restored when switching between areas in the mapper. It also saves the data between session. It extends the existing `setMapZoom(...)` API to take an optional second argument to specify the map area ID to set the zoom (which is a floating point number) for any existing area, not just the current one. It also adds a `getMapZoom(...)` function that, without any arguments, returns the currently used 2D map zoom value for the area currently being shown in the 2D mapper. If an area ID is provided it instead returns the value that was last used for that area - or the default value that is used initially on starting the profile or for an area that has not been viewed before. Importantly when switching between the areas in the 2D mapper the values are retained and applied so that one area can be zoomed in and another zoomed out and switching from the first to the second and back to the first means that the zoom level used in the first is reused when it is returned to. Deleting an area will forget the stored zoom level so if it is reused it starts from scratch. Code to save the zoom level for each area has also been implemented within the C++ core. It saves it in the Area User Data for current map formats (but removes it on loading so the user never sees it there) under a `system.fallback_XXXX` key but will save it directly in the binary data (which is more efficient) in the next format version whenever it is enabled. A new Mudlet event, which has been called `mapAreaViewedChangeEvent` has been added with two additional arguments being the area ID changed to followed by the one that it was changed from. I originally thought I would need it to handle saving the zoom level for each area via the Lua system but I found that that was not practicable. I'll leave it in for now but it could be removed if peer-review finds it not to be of use. Also, in refactoring `T2DMap::paintEvent(...)` I: Removed/combined some locals: * `(TArea*) playerArea` and `(TArea*) pPlayerArea` ==> `pArea` * `(TRoom*) playerRoom` ==> `pPlayerRoom` Remove unneeded (refactored out): * `(qreal) ox` * `(qreal) oy` Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
This is intended to close Mudlet#2388. This enables the 2D (only) map zoom amounts for each map area to be save independently and restored when switching between areas in the mapper. It also saves the data between session. It extends the existing `setMapZoom(...)` API to take an optional second argument to specify the map area ID to set the zoom (which is a floating point number) for any existing area, not just the current one. It also adds a `getMapZoom(...)` function that, without any arguments, returns the currently used 2D map zoom value for the area currently being shown in the 2D mapper. If an area ID is provided it instead returns the value that was last used for that area - or the default value that is used initially on starting the profile or for an area that has not been viewed before. Importantly when switching between the areas in the 2D mapper the values are retained and applied so that one area can be zoomed in and another zoomed out and switching from the first to the second and back to the first means that the zoom level used in the first is reused when it is returned to. Deleting an area will forget the stored zoom level so if it is reused it starts from scratch. Code to save the zoom level for each area has also been implemented within the C++ core. It saves it in the Area User Data for current map formats (but removes it on loading so the user never sees it there) under a `system.fallback_map2DZoom` key but will save it directly in the binary data (which is more efficient) in the next format version whenever it is enabled. A new Mudlet event, which has been called `mapAreaViewedChangeEvent` has been added with two additional arguments being the area ID changed to followed by the one that it was changed from. I originally thought I would need it to handle saving the zoom level for each area via the Lua system but I found that that was not practicable. I'll leave it in for now but it could be removed if peer-review finds it not to be of use. Also, in refactoring `T2DMap::paintEvent(...)` I: Removed/combined some locals: * `(TArea*) playerArea` and `(TArea*) pPlayerArea` ==> `pArea` * `(TRoom*) playerRoom` ==> `pPlayerRoom` Remove unneeded (refactored out): * `(qreal) ox` * `(qreal) oy` Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
This is intended to close Mudlet#2388. This enables the 2D (only) map zoom amounts for each map area to be save independently and restored when switching between areas in the mapper. It also saves the data between session. It extends the existing `setMapZoom(...)` API to take an optional second argument to specify the map area ID to set the zoom (which is a floating point number) for any existing area, not just the current one. It also adds a `getMapZoom(...)` function that, without any arguments, returns the currently used 2D map zoom value for the area currently being shown in the 2D mapper. If an area ID is provided it instead returns the value that was last used for that area - or the default value that is used initially on starting the profile or for an area that has not been viewed before. Importantly when switching between the areas in the 2D mapper the values are retained and applied so that one area can be zoomed in and another zoomed out and switching from the first to the second and back to the first means that the zoom level used in the first is reused when it is returned to. Deleting an area will forget the stored zoom level so if it is reused it starts from scratch. Code to save the zoom level for each area has also been implemented within the C++ core. It saves it in the Area User Data for current map formats (but removes it on loading so the user never sees it there) under a `system.fallback_map2DZoom` key but will save it directly in the binary data (which is more efficient) in the next format version whenever it is enabled. A new Mudlet event, which has been called `mapAreaViewedChangeEvent` has been added with two additional arguments being the area ID changed to followed by the one that it was changed from. I originally thought I would need it to handle saving the zoom level for each area via the Lua system but I found that that was not practicable. I'll leave it in for now but it could be removed if peer-review finds it not to be of use. Also, in refactoring `T2DMap::paintEvent(...)` I: Removed/combined some locals: * `(TArea*) playerArea` and `(TArea*) pPlayerArea` ==> `pArea` * `(TRoom*) playerRoom` ==> `pPlayerRoom` Remove unneeded (refactored out): * `(qreal) ox` * `(qreal) oy` Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
This is intended to close Mudlet#2388. This enables the 2D (only) map zoom amounts for each map area to be save independently and restored when switching between areas in the mapper. It also saves the data between session. It extends the existing `setMapZoom(...)` API to take an optional second argument to specify the map area ID to set the zoom (which is a floating point number) for any existing area, not just the current one. It also adds a `getMapZoom(...)` function that, without any arguments, returns the currently used 2D map zoom value for the area currently being shown in the 2D mapper. If an area ID is provided it instead returns the value that was last used for that area - or the default value that is used initially on starting the profile or for an area that has not been viewed before. Importantly when switching between the areas in the 2D mapper the values are retained and applied so that one area can be zoomed in and another zoomed out and switching from the first to the second and back to the first means that the zoom level used in the first is reused when it is returned to. Deleting an area will forget the stored zoom level so if it is reused it starts from scratch. Code to save the zoom level for each area has also been implemented within the C++ core. It saves it in the Area User Data for current map formats (but removes it on loading so the user never sees it there) under a `system.fallback_map2DZoom` key but will save it directly in the binary data (which is more efficient) in the next format version whenever it is enabled. A new Mudlet event, which has been called `mapAreaViewedChangeEvent` has been added with two additional arguments being the area ID changed to followed by the one that it was changed from. I originally thought I would need it to handle saving the zoom level for each area via the Lua system but I found that that was not practicable. I'll leave it in for now but it could be removed if peer-review finds it not to be of use. Also, in refactoring `T2DMap::paintEvent(...)` I: Removed/combined some locals: * `(TArea*) playerArea` and `(TArea*) pPlayerArea` ==> `pArea` * `(TRoom*) playerRoom` ==> `pPlayerRoom` Remove unneeded (refactored out): * `(qreal) ox` * `(qreal) oy` Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
This is intended to close #2388. This enables the 2D (only) map zoom amounts for each map area to be save independently and restored when switching between areas in the mapper. It also saves the data between session. It extends the existing `setMapZoom(...)` API to take an optional second argument to specify the map area ID to set the zoom (which is a floating point number) for any existing area, not just the current one. It also adds a `getMapZoom(...)` function that, without any arguments, returns the currently used 2D map zoom value for the area currently being shown in the 2D mapper. If an area ID is provided it instead returns the value that was last used for that area - or the default value that is used initially on starting the profile or for an area that has not been viewed before. Importantly when switching between the areas in the 2D mapper the values are retained and applied so that one area can be zoomed in and another zoomed out and switching from the first to the second and back to the first means that the zoom level used in the first is reused when it is returned to. Deleting an area will forget the stored zoom level so if it is reused it starts from scratch. Code to save the zoom level for each area has also been implemented within the C++ core. It saves it in the Area User Data for current map formats (but removes it on loading so the user never sees it there) under a `system.fallback_map2DZoom` key but will save it directly in the binary data (which is more efficient) in the next format version whenever it is enabled. A new Mudlet event, which has been called `sysMapAreaChanged` has been added with two additional arguments being the area ID changed to followed by the one that it was changed from. I originally thought I would need it to handle saving the zoom level for each area via the Lua system but I found that that was not practicable. Also, in refactoring `T2DMap::paintEvent(...)` I: Removed/combined some locals: * `(TArea*) playerArea` and `pPlayerArea` and `pArea`==> `pDrawnArea` * `(TRoom*) playerRoom` ==> `pPlayerRoom` Remove unneeded (refactored out): * `(qreal) ox` * `(qreal) oy` Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Awesome! |
Brief summary of issue / Description of requested feature:
Every time I close and relaunch Mudlet I zoom my mapper out to my desired preference using the mouse wheel.
if you hover your mouse cursor over the mapper and then use your mouse wheel you can zoom the mapper out or in.
What I would really love is if Mudlet could remember my last used zoom amount between sessions.
If you wanted to get REALLY fancy, you could have it remember the zoom settings per Area. That would actually be the ultimate feature!
Because some areas you just really want different zoom settings.
The text was updated successfully, but these errors were encountered: