Mudlet: Feature Request: Mudlet Remember mapper zoom amount between sessions.

Created on 6 Mar 2019  ·  10Comments  ·  Source: Mudlet/Mudlet

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.

All 10 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!

:bulb: Don't forget that there is Area User Data nowadays so it is possible to store per-Area data - see setAreaUserData(...) and getAreaUserData(...) !

Old request, but ill chime in.
I agree that setMapZoom combined with setAreaUserData and getAreaUserData will help, however without a "getMapZoom" or a similar way to "get" the current zoom level, it will be somewhat arbitrarily or manually controlled. If i can detect change in the zoom level, then store it in areaUserData, then set it whenever map loads or areas changes, that would be perfect

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 setMapZoom() which I guess can be made to work with each other. However the 3D mapper is a right dog's breakfast. You have the (vertical) mouse wheel and the "Scale" control (the left most slider) which again sort of work together - but there are three other controls that set the eye/camera-coordinate positions and those collectively {in order left to right: z, y, x!} (via a sqrt(x^2 + y^2 + z^2) i.e. Pythagorus's famous formula) also control the effective zoom as well. working out the overall effect is not currently predictable... AFAICT

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.
(makes a note to investigate the 3d mapper :D)

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)

.... 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:

  • a sysMapperAreaViewedEvent that would fire as the area was changed (returning the old and new area IDs) and for it to fire just before the view was switched away from the old area.
  • something to return the current view mode {2D/3D view, current centre of view coordinates, 2D map (zoom only) or 3D map (zoom/scale setting and eye position coordinates)}

:thinking:

Probably also need Lua API means to setup all of those details as well...

Yes to the sysMapperAreaViewedEvent and its returns.
(needed to detect the change, store old zoom for old area, grab new zoom for new area)

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?
(normally i would advocate "doing things right" at the beginning, however I don't know the size of the demand for 3d, and I foresee enabling getters for those features would logically drive a demand for setters for changing mode and viewmode properties)

(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.

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.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wiploo picture wiploo  ·  3Comments

macjabeth picture macjabeth  ·  7Comments

Kebap picture Kebap  ·  7Comments

vadi2 picture vadi2  ·  8Comments

Kebap picture Kebap  ·  5Comments