Page 1 of 3
[patch] toggle terrain on minimap
Posted: 09 Mar 2009 11:51
by 3D_Grabber
hi all,
one thing that annoyed me always, was that it wasn't possible to see
the industries and the terrain
at the same time on the minimap.
finally I set out to fix the issue once and for all (hopefully)
the patch changes the terrain ("contours") button behaviour from
radiobutton to checkbox. you can turn it on/off (toggle) independently from the
other selections.
this makes it possible to see the terrain togheter with the industries, vehicles, routes, owner etc.

- minimap with industries and terrain
- toggle_terrain.PNG (11.22 KiB) Viewed 11038 times
i tried to keep my modifications "minimally invasive".
only a few dozend lines in one single source file are changed (smallmap_gui.cpp).
this is my 1st patch.
what do you think?
cheers
Re: [patch] toggle terrain on minimap
Posted: 09 Mar 2009 12:11
by Zuu
Nice work,
Regarding the coding style:
* You have some extra tabs at on two lines I can find. (Highlight tabs and you will find them on line 268 and 271 in your patch file)
* You add an extra white line at line 218 and 296.
* Line 272 can be discussed if it should be added or not. But the code block above (line 266-270) should be indented one more step as you can see other case blocks are.
Otherwise I have not came to a conclusion if your way to implement the feature is the best possible or if there exist other ways. But it seams quite clean still. It seams a bit strange that the big table with land legend colors gets removed but guess there is a reason why it is so.
Re: [patch] toggle terrain on minimap
Posted: 09 Mar 2009 12:43
by 3D_Grabber
thx,
Regarding the coding style...
>> I'll fix it
big table with land legend colors gets removed
I am aware of this.
It's a trade-off. the other possibility would be to display the
height-level legend together with whatever other legend that is selected.
this would probably clutter the ui a lot.
since the height level legend just adds some virtual scale without real
playing value (IMO), I decided not to display it.
Re: [patch] toggle terrain on minimap
Posted: 09 Mar 2009 14:05
by Dimme
Great! This has annoyed me too

The height-level legend is not necessary, imo.
Re: [patch] toggle terrain on minimap
Posted: 09 Mar 2009 15:37
by FooBar
Nice! I'd love to see this feature in trunk some time.
About the land height legend:
Maybe you can include a check to only display that legend if none of the other options are selected. So basically if you have the land height level together with some other option enabled, the legend of that other option takes precedence. If you only have the land height level option enabled, it displays the land level legend.
Re: [patch] toggle terrain on minimap
Posted: 18 Apr 2009 00:42
by Bilbo
The patch no longer apply to current trunk.
Also, the original "landscape" mode had different colors for roads (black) and rails (grey). The railroads+roads mode (button right next to the town button) in the original minimap had this feature too, however in patched version when I activate this mode, both roads and railroads are black on the minimap. I found the cause (GetSmallMapRoutesPixels used _smallmap_vehicles_andor instead of _smallmap_contours_andor like it was in original minimap) and fixed that too.
I am attaching updated and fixed patch.
Re: [patch] toggle terrain on minimap
Posted: 22 Apr 2009 08:20
by chrissicom
It would be nice if I could still select just landscape with this patch

With the patch I can only view something else or something else and landscape but not landscape alone.
Re: [patch] toggle terrain on minimap
Posted: 23 Apr 2009 12:45
by Ammler
chrissicom wrote:It would be nice if I could still select just landscape with this patch

With the patch I can only view something else or something else and landscape but not landscape alone.
Maybe like the "lock" feature on the transparent gui? (I like the ctrl-magic.
Greets
Ammler
Re: [patch] toggle terrain on minimap
Posted: 23 Apr 2009 13:49
by Bilbo
I personally don't like the CTRL-magic, that way half of the functions are "hidden" and you have to remember what exactly the CTRL-click on the widget does, unless you want to experient and see parhaps later if it is not something destructive...
Re: [patch] toggle terrain on minimap
Posted: 23 Apr 2009 13:56
by Eddi
Bilbo wrote:I personally don't like the CTRL-magic, that way half of the functions are "hidden" and you have to remember what exactly the CTRL-click on the widget does, unless you want to experient and see parhaps later if it is not something destructive...
or you could just right click, and read the description of what CTRL does on this button.
Re: [patch] toggle terrain on minimap
Posted: 23 Apr 2009 14:06
by Bilbo
While that is true on some occasions, there are still places that lack these descriptions. Like the list of stations, right click won't tell you that ctrl-click will oven a new viewport with that station....
Re: [patch] toggle terrain on minimap
Posted: 23 Apr 2009 17:43
by Eddi
so that is a problem of the documentation, not of ctrl
Re: [patch] toggle terrain on minimap
Posted: 23 Apr 2009 18:21
by Ammler
Still better to use ctrl than to change old behaviour which some would miss...
This feature with ctrl is less "hidden" then no inclusion.
Greets
Ammler
Re: [patch] toggle terrain on minimap
Posted: 05 May 2009 00:11
by 2007Alain2007
Could we use this not only for the terrain but for all of them becuse some times you want to see trains and Industry and other things would that be hard to do
Re: [patch] toggle terrain on minimap
Posted: 06 May 2009 09:45
by Roujin
2007Alain2007 wrote:Could we use this not only for the terrain but for all of them becuse some times you want to see trains and Industry and other things would that be hard to do
The problem with this idea is that some of the modes are not compatible with others. For example you cannot display the owner of some tracks and the type of tracks (road? rail?) at the same time.
Re: [patch] toggle terrain on minimap
Posted: 06 May 2009 09:49
by 2007Alain2007
ok i see were your coming from there cheers any ways
Re: [patch] toggle terrain on minimap
Posted: 03 Jun 2009 13:08
by Terkhen
Bilbo's corrected version of the patch updated to current trunk.
Re: [patch] toggle terrain on minimap
Posted: 16 Jun 2009 12:02
by adf88
I rewrote the patch from the beginning. Now it works properly - turned off industries are not shown on the map.
Original "Contours" view can be used by unclicking selected view button. As in previous patch "land" button works independently from view buttons and is only a switch between land height/green background.
Also there is no height legend. I think it's useless. However I can change the patch to show this legend. What's your opinion ? Where show it ? At every view if "land" is pressed ?
//EDIT: Legend is present now, at every view but only if the height is shown.
//EDIT2: Updated to 0.7.2 and r17288
//EDIT3: Fixed coding rules, updated to r17654
Re: [patch] toggle terrain on minimap
Posted: 16 Jun 2009 20:14
by Terkhen
I prefer the new behaviour for the contour button you implemented, adf88. I have two comments about it, though. The first is a problem that you share with the first implementation of the patch: I don't think that you should change the names of anything in the trunk code (for example the change from SM_WIDGET_CONTOUR to SM_WIDGET_TOGGLELANDHEIGHT). The second thing is that you should not remove the height legend, because then this patch makes two changes instead of a single one, and patches should be as small as posible.
Re: [patch] toggle terrain on minimap
Posted: 16 Jun 2009 21:51
by adf88
Yes, you right. I made suggested changes. Height legend is now only at "Contour" view, maybe add it to every view ?