[patch] toggle terrain on minimap
Moderator: OpenTTD Developers
- 3D_Grabber
- Engineer
- Posts: 6
- Joined: 06 Jun 2006 21:58
- Location: Zürich, Switzerland
[patch] toggle terrain on minimap
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.
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
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.
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
- Attachments
-
- minimap_toggle_contours.patch
- (9.97 KiB) Downloaded 286 times
Re: [patch] toggle terrain on minimap
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.
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.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
- 3D_Grabber
- Engineer
- Posts: 6
- Joined: 06 Jun 2006 21:58
- Location: Zürich, Switzerland
Re: [patch] toggle terrain on minimap
thx,
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.
>> I'll fix itRegarding the coding style...
I am aware of this.big table with land legend colors gets removed
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
Great! This has annoyed me too The height-level legend is not necessary, imo.
Re: [patch] toggle terrain on minimap
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.
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
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.
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.
- Attachments
-
- minimap_toggle_contours-16069.patch
- Fixed version of patch, updated to 16069
- (9.92 KiB) Downloaded 239 times
If you need something, do it yourself or it will be never done.
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
-
- Route Supervisor
- Posts: 415
- Joined: 07 Oct 2004 10:05
Re: [patch] toggle terrain on minimap
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
Maybe like the "lock" feature on the transparent gui? (I like the ctrl-magic.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.
Greets
Ammler
Town Names: Portuguese Belarusian French Swiss · Temperate Lumber Mill
Still work in progress: OpenGFX or/and OpenSFX - Please help!
Re: [patch] toggle terrain on minimap
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...
If you need something, do it yourself or it will be never done.
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
Re: [patch] toggle terrain on minimap
or you could just right click, and read the description of what CTRL does on this button.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...
Re: [patch] toggle terrain on minimap
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....
If you need something, do it yourself or it will be never done.
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
Re: [patch] toggle terrain on minimap
so that is a problem of the documentation, not of ctrl
Re: [patch] toggle terrain on minimap
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
This feature with ctrl is less "hidden" then no inclusion.
Greets
Ammler
Town Names: Portuguese Belarusian French Swiss · Temperate Lumber Mill
Still work in progress: OpenGFX or/and OpenSFX - Please help!
-
- Chief Executive
- Posts: 658
- Joined: 11 Nov 2007 12:06
- Contact:
Re: [patch] toggle terrain on minimap
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
For Community Integrated Version http://code.google.com/p/civopenttd/
Re: [patch] toggle terrain on minimap
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.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
-
- Chief Executive
- Posts: 658
- Joined: 11 Nov 2007 12:06
- Contact:
Re: [patch] toggle terrain on minimap
ok i see were your coming from there cheers any ways
For Community Integrated Version http://code.google.com/p/civopenttd/
Re: [patch] toggle terrain on minimap
Bilbo's corrected version of the patch updated to current trunk.
- Attachments
-
- minimap_toggle_contours-16507.diff
- (12.15 KiB) Downloaded 238 times
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: [patch] toggle terrain on minimap
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
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
- Attachments
-
- minimap_toggle_contours_2.1-ottd_0.7.2.diff
- Minimap Toggle Contours 2.1 for OTTD 0.7.2
- (14.84 KiB) Downloaded 192 times
-
- minimap_toggle_contours_2.1-ottd_r17654.diff
- Minimap Toggle Contours 2.1 for OTTD r17654
- (11.38 KiB) Downloaded 213 times
Last edited by adf88 on 27 Sep 2009 14:51, edited 14 times in total.
don't worry, be happy and checkout my patches
Re: [patch] toggle terrain on minimap
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.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: [patch] toggle terrain on minimap
Yes, you right. I made suggested changes. Height legend is now only at "Contour" view, maybe add it to every view ?
don't worry, be happy and checkout my patches
Who is online
Users browsing this forum: No registered users and 49 guests