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

Tile Measurement Tool #283

Closed
DorpsGek opened this issue Aug 17, 2006 · 10 comments
Closed

Tile Measurement Tool #283

DorpsGek opened this issue Aug 17, 2006 · 10 comments
Labels
component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay

Comments

@DorpsGek
Copy link
Member

Meush opened the ticket and wrote:

This tool allows user to measure amount of highlighted tiles by pressing shift during "drag'n'dropping" (placing railway, signals, road, trees, buldozzing area, building bridges, levelling land)
It works also when "presizing" tunnels and docks.
This patch also measures height difference between start and end tile for easy construction planning.

This patch is (almost?) finished, so please voice your comments and tips on coding style and what else to do to get it committed. Thank you in advance

Attachments

Reported version: trunk
Operating system: All


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

glx wrote:

I only checked the style :)

Remove commented out code:
misc_gui.c:646-648
misc_gui.c:750-753
strings.h:5
viewport.c:2139

Don't add too many empty lines in VpSetPresizeRange() (viewport.c)
Check trailing white spaces/tabs
Add spaces where needed:
+ display_x = abs(TileX(to) - TileX(from))+1; <-- spaces around "+"

Respect coding style for if and switch: http://www.tt-forums.net/viewtopic.php?t=7933


This comment was imported from FlySpray: https://bugs.openttd.org/task/283#comment404

@DorpsGek
Copy link
Member Author

Meush wrote:

I cleaned it up a bit, thank you glx

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/283#comment407

@DorpsGek
Copy link
Member Author

Meush wrote:

Thanks to Tron for pointing multiple color markers in lang file

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/283#comment409

@DorpsGek
Copy link
Member Author

Meush wrote:

I've added more comments and made docks not show length tooltips (as long as we don't have bigger docks).
Unfortunatelly I stumbled upon a problem that tunnels (and docks before) don't show estimated cost (estimated cost works in all other functions besides VpSetPresizeRange, and I don't really see why)

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/283#comment445

@DorpsGek
Copy link
Member Author

Darkvater wrote:

I've looked at the patch (and rewritten about 90% of it ;p).

I have 5 points in which input/suggestions would be desired:

  1. You see the tooltip with SHIFT. Isn't it better to make it a patch option and always see it if on?
  2. Some tooltips have a newline in them ({}). The tooltip needs more height; so the StringID is checked. Not so nice and very rigid. Easiest solution would be to loop the string and check for newline characters. Is there perhaps a better way?
  3. CalcHeightDifference() is really sucky with height calculation on slopes. Really needs something better, have no idea yet. Input very much appreciated
  4. To show tooltip in viewport.c method is checked again for VMP_X_OR_Y/VPM_FIX_X/VPM_FIX_Y. Can this second check be skipped somehow (it's already checked in the switch statement before), without writing the code 3 times?
  5. There are 2 GuiShowTooltips functions. One without vararg, one with. Chosen because otherwise you would need to get the StringPtr and parse it to see how many parameters you need. Good, bad, suggestions?

I can get rid of points 2 and 5 by using MeusH's original GetStringPtr() function and scan that for parameters and the inevitable newline-scan. Advantage: unlimited newlines, only one GuiShowTooltips function. Disadvantage: pull out internal getstringptr function from strings.c, probably something else as well; forgot.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/283#comment459

@DorpsGek
Copy link
Member Author

Darkvater wrote:

New patch, points 3 and 4 still stand. 4 I can live with but point 3 is a real picker and I'm still out on what to do about it.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/283#comment460

@DorpsGek
Copy link
Member Author

Meush wrote:

Measuring height difference works fine on slopes.
My method was to measure height of opposite corners of both start and end tile, which just works :)
see http://img247.imageshack.us/img247/4526/measurementzw7.png

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/283#comment471

@DorpsGek
Copy link
Member Author

DorpsGek commented Sep 6, 2006

Darkvater wrote:

MeusH: you conveniently forgot the correct heightdiff for autorail, eg vertical/horizontal drag :)

I've finished the patch, but it needs polishment which I unfortunately really not have. It would need some cleanup, some higher compression hopefully.
Otherwise I think it works in all aspects.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/283#comment516

@DorpsGek
Copy link
Member Author

DorpsGek commented Sep 6, 2006

Meush wrote:

Thank you Darkvater.
You said about polishment and cleanup - do you mean checking the coding style and changing how all functions work?
I'd really like to see that committed, so I'll check the style, but I'm not really sure about functions - they look really ok for me.
Any other developers - is there something else to do before commit?


This comment was imported from FlySpray: https://bugs.openttd.org/task/283#comment517

@DorpsGek
Copy link
Member Author

Darkvater closed the ticket.

Reason for closing: Implemented

Damn flyspray, forget to close its bugs :s


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

@DorpsGek DorpsGek added component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay labels Apr 6, 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/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay
Projects
None yet
Development

No branches or pull requests

1 participant