Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heights in minimap are not the same as height differences reported with measurement tool #3808

Closed
DorpsGek opened this issue May 2, 2010 · 6 comments
Labels
component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented May 2, 2010

Alberth opened the ticket and wrote:

The minimap legend starts at 100m, and goes up to 500m in steps of 100m.
The first entry (100m) is at sea level.

One step up in the minimap legend (100m), is 4 Z height differences in the tiles. One Z height difference is reported as 50m by the measurement tool.

Thus the problem has two components:
- measurement tool should reduce height differences by a factor 2
- legends should start at 0m (sea at 0m makes so much more sense).

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/3808
@DorpsGek
Copy link
Member Author

DorpsGek commented May 2, 2010

Alberth wrote:

Attached patch fixes the reported height difference for the measurement tool.
The magic constant 25 however needs to be derived from the minimap instead.

Save game is a nice test case.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/3808#comment7974

@DorpsGek
Copy link
Member Author

DorpsGek commented May 3, 2010

chillcore wrote:

This patch fixes the smallmap not starting at level zero.
The height per entry is incremented by 50 meters.

For the moment it still uses strings defined in the language files. I tried using an enum instead but it proved not to be as easy as I thought.

Also the legend is split into two parts because having eight legend entries exceeds the gui button bar height.

The first entry in BuilLandLegend() uses the land colour for level zero. If sea colour would be prefered it is simply a matter of making it read:
_legend_land_contours[0].colour = MKCOLOUR(0xCA);

Also attached a screenshot that shows what this patch changes.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/3808#comment7976

@DorpsGek
Copy link
Member Author

DorpsGek commented May 5, 2010

chillcore wrote:

Attached small update to relect the changes made in r19758, 19759 and r19760.

This patch combines the measurement fix for the tooltips and the smallmap heightlegend extended to 8 entrys.

Changes: (starting from clean trunk)

- MINIMAP_HEIGHT_STEP is declared in landscape.h and is used in both smallmap_gui.cpp(height legend) and viewport.cpp(measurement tooltips).
- HEIGHT_LEGEND_STEP is declared in smallmap_gui.cpp and is used for building up the legend txt entries. (see todo)
- Tooltips return height difference correctly.
- Height legend is extended to 8 heightlevels
- Height legend starts at level 0
- Height legend is split to not exceed the Button bar height.

Todo:
- Break the legend in two columns in a less hackish way.
- Use HEIGHT_LEGEND_STEP to build up the height legend entry colours then move enum to .h file
- Adjust comments for Doxygen.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/3808#comment7988

@DorpsGek
Copy link
Member Author

DorpsGek commented May 5, 2010

chillcore wrote:

Sorry I was disturbed and uploaded the wrong patch.
Here is the correct one.

The only difference is the MINIMAP_HEIGHT_STEP value declaration.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/3808#comment7989

@DorpsGek
Copy link
Member Author

DorpsGek commented May 6, 2010

chillcore wrote:

Following some very helpful comments made by Alberth on the forums here is a new cleaned up version of the patch.

Changes: (from the previous version)
- Introduced new macro for breaking legend with configurable colour.
- Use 'static const int' instead of 'enum' in landcape.h.
- Removed HEIGHT_LEGEND_STEP.
- Removed the "+ 1" to make the legend start at level zero instead of subtracting 1 step afterwards in smallmap_gui.cpp.
- Corrected comment above the function in viewport.cpp.

Functionality is unchanged from the previous version.

Todo: ?

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/3808#comment7993

@DorpsGek
Copy link
Member Author

DorpsGek commented May 7, 2010

Alberth closed the ticket.

Reason for closing: Fixed

in r19767


This comment was imported from FlySpray: https://bugs.openttd.org/task/3808

@DorpsGek DorpsGek closed this as completed May 7, 2010
@DorpsGek DorpsGek added component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) bug labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant