[Patch] Enhanced minimap
Moderator: OpenTTD Developers
[Patch] Enhanced minimap
I merged and upgraded two patches:
- "Toggle terrain on minimap" by 3D_Grabber
- "Smallmap zoom/Minimap zoom" by NukeBuster
and that's how arose "Enhanced minimap" patch. Features:
- zooming in and out
- show land height on every type of view
Changes to original "Toggle terrain on minimap":
- disabled industries are not shown
- contour view is enabled (by "unclicking" current view)
- height legend
Changes to original "Smallmap zoom/Minimap zoom":
- mouse scroll support
- enlarged vehicles are not just a dots
- every industry on "Industry" view is visible as at least two pixels (industries do not disappear when zooming out)
- zoom in/out buttons become disabled when reached maximum zoom level
- "Toggle terrain on minimap" by 3D_Grabber
- "Smallmap zoom/Minimap zoom" by NukeBuster
and that's how arose "Enhanced minimap" patch. Features:
- zooming in and out
- show land height on every type of view
Changes to original "Toggle terrain on minimap":
- disabled industries are not shown
- contour view is enabled (by "unclicking" current view)
- height legend
Changes to original "Smallmap zoom/Minimap zoom":
- mouse scroll support
- enlarged vehicles are not just a dots
- every industry on "Industry" view is visible as at least two pixels (industries do not disappear when zooming out)
- zoom in/out buttons become disabled when reached maximum zoom level
- Attachments
-
- enhanced_minimap-r16579.patch
- Patch for OTTD r16579 and latter
- (36.77 KiB) Downloaded 203 times
-
- enhanced_minimap-0.7.1.patch
- Patch for OTTD 0.7.1
- (34.74 KiB) Downloaded 225 times
Last edited by adf88 on 24 Jun 2009 08:04, edited 4 times in total.
![Pleased :]](./images/smilies/pleased.gif)
Re: [Patch] Enhenced minimap
Even if for my personal use I prefer both patches in a single file (trying to apply both patches without having to resolve rejects by hand has been one of the biggest problem I had with my latest patchpacks), probably they should be kept as separate files because they do different things. I love the new features, specially being able to scroll with the mouse. Also, you have a typo in the title: the correct name should be "Enhanced minimap".
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] Enhenced minimap
one would typically handle that with a hg/git repository, patch queues, etc.Terkhen wrote:they should be kept as separate files
that way, one can update each patch individually, but easily generate a full patch(pack).
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: [Patch] Enhanced minimap
I just compiled this and it looks very nice.
Question though.
Would it not be possible to simply flip between normal game play and small map when changing amplification?
Yah Yah that would be perfect.
HackaLittleBit

Question though.
Would it not be possible to simply flip between normal game play and small map when changing amplification?
Yah Yah that would be perfect.

HackaLittleBit
Re: [Patch] Enhanced minimap
But what exactly you mean ? Please, give more precise description.
![Pleased :]](./images/smilies/pleased.gif)
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: [Patch] Enhanced minimap
Well the moment you loose usefull data. that is about the most zoomed in of the main screen. Automaticaly the zooming in (eg map getting smaller) would continue in full screen mode "small map" and then continue smaller and smaller (I use my mouse scroll button).Would it not be possible to simply flip between normal game play and small map when changing amplification?
I hope you understand but simply zooming in and out continuous.
EDIT: And switching modes automatically
Regards
Re: [Patch] Enhanced minimap
Now I have to unmerge smallmap zoom from my patchpack, so I can merge this in...
Thanks for this patch!
Thanks for this patch!
Melt with the Shadows,
Embrace your destiny...
Embrace your destiny...
Re: [Patch] Enhanced minimap
Unless other patch modified smallmap_gui.cpp this shouldn't be hard. Just revert this file to original and apply Enhanced Minimap. After that you'll need only revert changes made by "smallmap zoom" in other files. If you used this version you need only revert changes made to "ZoomLevel" enum in zoom_type.h.Thief^ wrote:Now I have to unmerge smallmap zoom from my patchpack, so I can merge this in...
I decided not to modify it. These modifications didn't fit there, and wasn't necessary. Instead of declaring new negative values I used original enum with negation operator in my code.
![Pleased :]](./images/smilies/pleased.gif)
Re: [Patch] Enhanced minimap
I found a bug, and fixed it. By mistake I changed two lines of "viewport" code. Scrolling zoomed out viewport was slower instead of faster - it was scrolling very slowly. Patches in the first post of this topic are fixed now. For those who applied a patch before this fix, I give only-bug-fix patches:
- Attachments
-
- emm_bugfix-0.7.1.patch
- (604 Bytes) Downloaded 190 times
-
- emm_bugfix-r16579.patch
- (604 Bytes) Downloaded 211 times
![Pleased :]](./images/smilies/pleased.gif)
Re: [Patch] Enhanced minimap
Hello,
I have just seen your patch.
I am currently trying to make the minimap support more heightlevels, i.e. if you click somewhere in the minimap the real map should scroll north according to the height at the point I clicked in minimap. With the current implementation of the minimap, if you click on the peak of some height mountain, you land somewhere on its ridge
However, I have not yet found the link between minimap and the tiles - how can I determine which tile I clicked? Can you give me some hint?
Thanks.
I have just seen your patch.
I am currently trying to make the minimap support more heightlevels, i.e. if you click somewhere in the minimap the real map should scroll north according to the height at the point I clicked in minimap. With the current implementation of the minimap, if you click on the peak of some height mountain, you land somewhere on its ridge

However, I have not yet found the link between minimap and the tiles - how can I determine which tile I clicked? Can you give me some hint?
Thanks.
Re: [Patch] Enhanced minimap
Hi.
I knew that Enhanced Minimap would collide with "more height levels". I even planned to write special implementation for this patch
. I can do it if you want.
However, if you want do it by yourself, then do it
.
You had to break something, Enhanced Minimap works fine alone. This is that piece of code (minimap click handle):
original:
patched:
And give me a link to the latest "more height levels" patch. I can't find it, your thread has 20 pages !
It's a good practice to keep latest patch in the first post of thread.
I knew that Enhanced Minimap would collide with "more height levels". I even planned to write special implementation for this patch

However, if you want do it by yourself, then do it

You had to break something, Enhanced Minimap works fine alone. This is that piece of code (minimap click handle):
original:
Code: Select all
Point pt = RemapCoords(this->scroll_x, this->scroll_y, 0);
Window *w = FindWindowById(WC_MAIN_WINDOW, 0);
w->viewport->follow_vehicle = INVALID_VEHICLE;
w->viewport->dest_scrollpos_x = pt.x + ((_cursor.pos.x - this->left + 2) << 4) - (w->viewport->virtual_width >> 1);
w->viewport->dest_scrollpos_y = pt.y + ((_cursor.pos.y - this->top - 16) << 4) - (w->viewport->virtual_height >> 1);
Code: Select all
Point pt = RemapCoords(this->scroll_x, this->scroll_y, 0);
Window *w = FindWindowById(WC_MAIN_WINDOW, 0);
w->viewport->follow_vehicle = INVALID_VEHICLE;
w->viewport->dest_scrollpos_x = pt.x + ScaleByZoom(((_cursor.pos.x - this->left + 2) << 4), this->zoom) - (w->viewport->virtual_width >> 1);
w->viewport->dest_scrollpos_y = pt.y + ScaleByZoom(((_cursor.pos.y - this->top - 16) << 4), this->zoom) - (w->viewport->virtual_height >> 1);
It's a good practice to keep latest patch in the first post of thread.
![Pleased :]](./images/smilies/pleased.gif)
Re: [Patch] Enhanced minimap
Try the last page.And give me a link to the latest "more height levels" patch. I can't find it, your thread has 20 pages !
It's a good practice to keep latest patch in the first post of thread.
I have no access to the first post and I do not want to start a seperate branch so I hope we can keep it there for a while to come.
Current version is v15.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
-
- Chief Executive
- Posts: 658
- Joined: 11 Nov 2007 12:06
- Contact:
Re: [Patch] Enhanced minimap
Great team work from you two i see keep up the good work
For Community Integrated Version http://code.google.com/p/civopenttd/
Re: [Patch] Enhanced minimap
I solved the problem I described here. Minimap should work with more heightlevels now.adf88 wrote:Hi.
And give me a link to the latest "more height levels" patch. I can't find it, your thread has 20 pages !
It's a good practice to keep latest patch in the first post of thread.
You can find the patch (1) on the first page of the more heightlevels thread now (with the problem of ChillCore not being able to edit this) and (2) near the end of that thread. You are right, it contains more than 20 pages, but the last version is always near the end, so having a look at the last one or two pages should almost always suffice.
Re: [Patch] Enhanced minimap
I found a little bug, adf88. When using both the "Show vegetation" and "Show contours" buttons, the height legend is not shown.
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] Enhanced minimap
It's not a bug. Every tile has some vegetation, so there is no place for showing height. Grass could be replaced with height color, but what about other land types ? Snow, sand, I would have to make a special height palette for them, or leave them unchanged. So finally I decided to leave all types of land and do not show height on vegetation map.
What do you think about it ? Should it be done in other way ?
I realised now, that I should disable "show height" button when switching to vegetation view.
What do you think about it ? Should it be done in other way ?
I realised now, that I should disable "show height" button when switching to vegetation view.
![Pleased :]](./images/smilies/pleased.gif)
Re: [Patch] Enhanced minimap
That sounds very logical: I should have checked "the bug" more before posting it. Your solution is good, disabling the height button when the vegetation is active should be enough.
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] Enhanced minimap
Actually you found a bug. You could expect that height should be displayed if the button can be pressed 
Patches are fixed now. Added one line to smallmap_gui.cpp:
---------------------------------------------------------------------
this->SetWidgetDisabledState(SM_WIDGET_CONTOUR, this->map_type == SMT_VEGETATION);
this->ResizeLegend();
this->SetDirty();
---------------------------------------------------------------------

Patches are fixed now. Added one line to smallmap_gui.cpp:
---------------------------------------------------------------------
- this->map_type = (SmallMapType)(widget - SM_WIDGET_CONTOUR);
this->LowerWidget(widget);
this->SetWidgetDisabledState(SM_WIDGET_CONTOUR, this->map_type == SMT_VEGETATION);
this->ResizeLegend();
this->SetDirty();
---------------------------------------------------------------------
![Pleased :]](./images/smilies/pleased.gif)
Who is online
Users browsing this forum: Amazon [Bot] and 11 guests