I would like to make map management a little nicer ie by placing the cursor on a specific quadrant always will maintain that position as we get closer.... The same effect is seen in google maps (https://maps.google.com/maps?)
Wasn't this requested some time ago? I think it's easy to implement
Never came to a consensus I guess :-[
mmm... didn't find any topic regading this.
Some questions arise, what happens if the mouse is not over the map (it's outside the map), or is over a window? We don't zoom?
I think zoom should be context sensitive. If you zoom on map, zoom the map. If you zoom on minimap, zoom the minimap. If you zoom on a dialogue or outside a zoom able element, don't zoom at all.
Sent from my iPhone using Tapatalk (http://tapatalk.com/m?id=1)
Quote from: Fabio on December 05, 2013, 05:53:24 PM
I think zoom should be context sensitive. If you zoom on map, zoom the map. If you zoom on minimap, zoom the minimap. If you zoom on a dialogue or outside a zoom able element, don't zoom at all.
Sent from my iPhone using Tapatalk (http://tapatalk.com/m?id=1)
That sounds good :thumbsup:
mmm.... Let's see, I think this is a easy one, I'll se what can I do. :)
But btw, Yona, I don't like reading you we ignore your requests. Have in mind we all code in our free time, and do our best. Your last request I can remember was semi-rejected for some solid reasoning. You can always code it yourself. ;)
But well, I thik I can implement this one, wait a bit.
I really appreciate your time ;)
Quote from: Yona-TYT on December 05, 2013, 06:36:09 PM
I really appreciate your time ;)
I really appreciate your patience. ;o)
This was not a hard change. I don't know if the whole community will prefer this behaviour over the old one, I think this one is better, but who knows.
So, I post the patch here and a binary, and if no one is against this change I'll submit the change, feel free to have your say.
Patch:
https://dl.dropboxusercontent.com/u/30024783/zoom_on_cursor.patch
Binary (remember to update your themes directory, last simutrans versions require a new one, this one (https://dl.dropboxusercontent.com/u/30024783/themes.zip)), you also might need http://www.microsoft.com/en-us/download/details.aspx?id=30679
https://dl.dropboxusercontent.com/u/30024783/simutrans-zomm_to_cursor.exe
Could you make this behavior default but unselectable via simuconf and/or display options (like inverted scrolling)?
Sent from my iPhone using Tapatalk (http://tapatalk.com/m?id=1)
Yes I can, but only if someone really wants the old behavior, no reason to keep code that no one uses in the game. ;)
Tbh, I do not like this behavior. Imho the cursor should be on the same tile after zoom than before. With the patch if you zoom in and then out again without moving the cursor will move the center of the screen, which seems counter-intuitive.
what about warping the mouse to the center after the zoom in then. It's that or I just allow the old way of zooming, making it customizable from the menu. What do you think?
Anyway I understand what you say, you just need to get used I think, this new feature allows you as a player to decide where exactly to zoom in, I think it's better, once you get used to it.
I agree with
Quote from: Dwachs on December 07, 2013, 03:54:03 PM
Tbh, I do not like this behavior. Imho the cursor should be on the same tile after zoom than before.
and want to add that the client should not change behaviour if this patch is included, but make the new behaviour optional.
Seems the implementation it's not very popular, does anybody actually like this new zoom? :)
Isn't keeping the cursor on the same tile what the request was about? That's how I understood it.
mmm... well, the request asked to zoom to the cursor, didn't asked to move the mouse to the center of screen afterwards.
But you got a point, it's the next step, maybe that will be very convenient, I'll get my hands on it.
Es-> Centrar y al mismo tiempo mantener el cursor en un cuadrante fijo sería más agradable, ¿no cree usted Markohs? ;)
En-> Centering while keeping the cursor in a fixed quadrant would be more nice, do not you think you Markohs? ;)
Yes, adding that. Let's see. :)
EDIT: Done.
Well, I accidentally overwrited the previous patch, new binary:
https://dl.dropboxusercontent.com/u/30024783/simutrans-zoom-to-cursor-2.exe (https://dl.dropboxusercontent.com/u/30024783/simutrans-zoom-to-cursor-2.exe)
And the patch:
https://dl.dropboxusercontent.com/u/30024783/zoom_on_cursor.patch (https://dl.dropboxusercontent.com/u/30024783/zoom_on_cursor.patch)
Try this again, please.
EDIT2: I see there is a slight error on mouse coords, it doesn't move eaxtly to the desred spot, just close. But that's the idea(I'll fix the bug, it's related to tool offsets, I think), do you like it more this way?
Quote from: Ters on December 07, 2013, 05:06:57 PM
Isn't keeping the cursor on the same tile what the request was about? That's how I understood it.
This is what I expected to see, too. Such that the cursor position does not change and after zooming also the same tile is marked as before. (try this in google maps) This would require to change the world view offset.
Pseudocode:
delta = cursor_pos - viewport->world_position
// zoom
...
// rescale delta to center
delta = (delta * new_rasterwidth) / old_rasterwidth
view_port->set_world_position( cursor_pos - delta)
will try this tomorrow.
It looks good, but the cursor moves a little :thumbsup:
Here is my approach to the matter. Please test.
http://simutrans-germany.com/files/upload/simgdi-zoomtocursor.zip
Quote from: Dwachs on December 08, 2013, 04:33:34 PM
Here is my approach to the matter. Please test.
http://simutrans-germany.com/files/upload/simgdi-zoomtocursor.zip (http://simutrans-germany.com/files/upload/simgdi-zoomtocursor.zip)
Does not start ???
(http://img440.imageshack.us/img440/6803/whcf.png)
Continuous zoom-in/zoom-out still shows a tendency to move the view sightly, but behaves way better than my solution, I like it.
Let's make this the new zoom? Removing the old one completely, imho.
I'm having a look to viewport_t::calc_offsets. I'd choose a more descriptive name, and try to re-use code from the rest of the class. Having it a look if you don't mind.
Try this one Yona
https://dl.dropboxusercontent.com/u/30024783/simutrans-unversioned.exe
And update the themes directory
Quote from: Markohs on December 08, 2013, 05:27:42 PM
Let's make this the new zoom? Removing the old one completely, imho.
I assume one gets (at least an approximation of) the old behaviour if one zooms with the cursor in the center. Also, if this is Google Maps emulation, zooming with the zoom buttons would still be independent of cursor position.
Quote from: Markohs on December 08, 2013, 05:28:40 PM
Try this one Yona
https://dl.dropboxusercontent.com/u/30024783/simutrans-unversioned.exe
And update the themes directory
Very nice, similar to google maps...jejeje
Well, too much transformations on your code for me to follow them, I have the intuition we could re-use more code from the class but we'd need to add new functions, so it's not really worth it I think.
I changed the function name to another polymorphic version of change_world_position, I think it makes much more sense this way, since it just moves the camera, but with extra restrictions.
This is ready for inclussion, imho. :)
https://dl.dropboxusercontent.com/u/30024783/zoom_on_cursor-2.patch (https://dl.dropboxusercontent.com/u/30024783/zoom_on_cursor-2.patch)
It's pretty cool we managed to implement this without touching simworld.cc/h , makes me feel the rearrangement I made months ago was worth something. :)
Es-> Hay un error al hacer zoom en los mapas grandes
Genere un mapa de 896x1536 y pruebe a ver
En-> There is an error when zooming on large maps
Generate a map 896x1536 and try to see
Wow, really good. This can surely replace the old code. And look that I was not in the supporting side when requested.
Quote from: Yona-TYT on December 08, 2013, 06:36:10 PM
Es-> Hay un error al hacer zoom en los mapas grandes
Genere un mapa de 896x1536 y pruebe a ver
En-> There is an error when zooming on large maps
Generate a map 896x1536 and try to see
(https://www.facebook.com/download/569114853176775/yiov.gif)
can't see your SS, yona, but I've been able to reproduce the bug.
Precision in 16 bit integers is overflowing, fixing it.
EDIT: Fixed, if someone detects new bugs, just tell us:
https://dl.dropboxusercontent.com/u/30024783/zoom_on_cursor-3.patch
https://dl.dropboxusercontent.com/u/30024783/simutrans-zoom-to-cursor-3.exe
QuoteGenerate a map 896x1536 and try to see
This is another error I guess(https://www.mediafire.com/convkey/9de5/6s4x7642aea9bl46g.jpg)
"I hope the picture look this time" :police:
If you give more details on how to reproduce that it would be more helpful :)
savegame and coordinates on the screen where are you zooming?
I suspect the problem is only present here
Anyways the coordinates are 380,1520
I linked the wrong binary, try this one:
https://dl.dropboxusercontent.com/u/30024783/simutrans-zoom-to-cursor-4.exe
Thanks Markohs works fine for me :thumbsup:
this is now in r6973. Thank you :)
Thx Dwachs!!!!
EN - Next time you say we ignore you, Yona, I'll hit you with a dirty sock in your face. ;)
ES - Como te vuelva a oir decir que te ignoramos, te voy a dar con un calcetín sucio en la cara, Yona. ;)
Quote from: Markohs on December 09, 2013, 07:12:13 PM
Thx Dwachs!!!!
EN - Next time you say we ignore you, Yona, I'll hit you with a dirty sock in your face. ;)
ES - Como te vuelva a oir decir que te ignoramos, te voy a dar con un calcetín sucio en la cara, Yona. ;)
:o :o :o
...jejejeje
Quote from: Markohs on December 09, 2013, 07:12:13 PMEN - Next time you say we ignore you, Yona, I'll hit you with a dirty sock in your face. ;)
I prefer a slimmy fish slap. (http://eelslap.com/)
hehe cool