Zooming Reinvented


This mod allows to heavily customise the zooming behaviour, in particular it allows to: - change how far you can zoom out (and still see the world) - change how aggressive the zooming is (equivalent to changing mouse wheel sensitivity) - change at what position and zoom level the map opens - zoom in or out instantly with a single key stroke See homepage/mod portal/readme for a full explanation of how this mod works. Please report any bugs and usability issues you find to help make this mod better - your feedback is much appreciated.

Utilities
5 years ago
0.17
79

b Weird behaviour after clicking on the alert & [SOLVED] Cannot zoom in at all

5 years ago

I can't zoom back in when going to map view. It continues to zoom out but not in.

Things get even weirder when you are clicking on an attack notification for another part of the map. It will put the map view there but you can't zoom in. After a few seconds, it returns to an extreme close up of your position rather than where you were looking on the map.

5 years ago
(updated 5 years ago)

I can't zoom back in when going to map view. It continues to zoom out but not in.

Could you please tell me what are the mod settings you set and your controls?

Things get even weirder when you are clicking on an attack notification for another part of the map.

Ups, missed that one. Seems I haven't clicked on the alerts lately. Thanks for the report.

I can see that clicking on the alert while in the 'zoom to world' view works ok (as long as user hovers over some object before zooming out back to world), but clicking on the alert in the map view, or while the map is closed, results in sudden zoom level and position changes on zooming out.

Having spent some time looking through what I can do about it, I am afraid that it might be another not-fixable one due to limitations in the modding API - I cannot see any way for the mod to detect when player clicks on the alert... I have asked on the forum about it.

An idea I have at the moment is to check whether the render mode (map closed, map opened in 'zoom to world' view, map opened in map view) has changed and the change wasn't done by the mod. If this is the case, I could disable zoom out, which would leave the only option to zoom in to 'zoom to world' view and as soon as you hover over an object, the mod would know the position (although not a zoom level). This functionality is already implemented (and can be switched on and off) for moving the map.

Alternatively, I could auto equip Binoculars when the mod detects that something else opened the map view. If the player used them there would be no weird behaviour. However I still don't know what I can do if player clicks the alert while already in the map view.

I could probably mute the alerts while in the map view, preventing the user from clicking them. Another limitation, but it would resolve the sudden big changes in zoom level or jumping to another position...

5 years ago

The only thing I changed from the default was to make the zoom less 'aggressive' per step from the default of 1.5 down to 1.2 which feels like what I am used to and comfortable with.

Definitely do NOT mute alerts while in map view. Alerts are critical and need to be able to be clicked on to take you to the map spot the alert is talking about. At that point, you should be able to zoom IN to get a closer look. If there is a local radar, you should be able to actually see what's happening.

Similarly, the ordinary map view should be able to be zoomed in. If I press M for example, and then scroll to zoom in, it should let me begin seeing what is happening just as it does in vanilla.

And finally, to be clear, at NO point am I able to zoom in with the map view. It lets me zoom out but not in.

5 years ago
(updated 5 years ago)

Similarly, the ordinary map view should be able to be zoomed in. If I press M for example, and then scroll to zoom in, it should let me begin seeing what is happening just as it does in vanilla.

It already works this way. Does it not for you?

And finally, to be clear, at NO point am I able to zoom in with the map view. It lets me zoom out but not in.

Can you please go to Settings / Controls, open search, type in "zoom" and tell me what you see there?

It all sounds as if you unassigned (or assigned to another key) a control called "Alternative zoom in".

5 years ago

My control settings:
https://i.imgur.com/EUQdrMP.png

So upon trying it again, what happens is if I scroll DOWN to zoom out, it zooms out.
If I scroll UP to zoom in, nothing changes on the screen BUT it seems to be keeping track of how many times I've done this because as soon as I scroll DOWN again to zoom out, it refreshes the map as if I HAD zoomed in.

So it does seem to be zooming in, just not updating the screen for some reason.

As for "does it not for you?" no, it does not. If I zoom in a LOT and then zoom out once to refresh the screen, it just shows the map super zoomed in. I never get to see the world details.

5 years ago
(updated 5 years ago)

Ok, I know what the problem is now, thanks. I will try to release a bug fix for it later today. For now, you can unassign "mouse wheel up" from "zoom in" and you will be able to zoom in on the map.

5 years ago
(updated 5 years ago)

The zooming in issue resolved in version 1.2.2. You can assign a control to "Zoom in", "Alternative zoom in" or both and it will work the same way.

Alert issue remains unresolved. I have raised a modding interface request that would allow me to fix it (together with a few other issues) - https://forums.factorio.com/viewtopic.php?f=28&t=69156.

5 years ago

There is a new zooming issue. Or rather, I am better able to articulate this one than before because I just ran some tests with it.

If you are in MAP mode and zooming, I can now zoom in and out. So that's fixed.

However, something very strange happens if I zoom in enough to see the world. If I then proceed to zoom back out to map view, it "remembers" my position and somehow locks me there.

I can pan the map or zoom in on a new spot just fine. But if I zoom OUT even one notch with the mouse wheel, it zips me back to that place it remembered.

Additionally, the threshold where it switches to world view is not the same as the threshold to switch back to map view. If I am in map mode and zoom in until I can see the world, it takes EIGHT steps of zooming out to get it back to map mode again. So the threshold is clearly in a different spot.

If any of this needs clarifying, please ask. I can make videos if necessary.

5 years ago
(updated 5 years ago)

I think you are talking about this:

Known Issues

Zooming in while in the map view does not respect 'Zoom sensitivity' and 'Max world zoom out' mod settings.

This is due to limitations in the modding API. It is not possible for a script to just zoom in the map in its current position, the only function available is to set it to a specific position and a zoom level. However, it is not possible to get the current map's position. Also, it is not possible to get a position of the mouse pointer, hence the mod is not be able to zoom in towards it. Finally, opening the 'zoom to world' view also requires to provide a position and a zoom level. Therefore, the only reasonable option was to leave the zooming in while in the map as it is in the base game.

As a workaround, you can use the Binoculars item. Note that it can only be used within the artillery range. Although it behaves like an artillery remote, don't worry - artillery will not fire at that location.

TL;DR There is nothing I can do. However, if this change to the modding API was done - https://forums.factorio.com/viewtopic.php?f=28&t=69156 - I would be able to fix this.

New response