OpenTTD

Tasklist

FS#4102 - Detailed performance rating window is too narrow for some currencies

Attached to Project: OpenTTD
Opened by Christian Hattemer (Krille) - Tuesday, 31 August 2010, 20:48 GMT
Last edited by Remko Bijker (Rubidium) - Friday, 22 October 2010, 16:33 GMT
Type Patch
Category Interface
Status Closed
Assigned To No-one
Operating System All
Severity Low
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

When using e.g. Euro as the currency the detailed performance rating window is too narrow to show the whole numbers, even for a new game.

The window width calculation renders a string with a fixed value. Due to the exchange rates that may result into a very large amount which is heavily shortened by {CURRCOMPACT} then. For Euro the result is 2,000M, while the actual values are wider. For pounds it's 1,000,000k, which results into enough space.

The patch tries to fix that by making the example value smaller so that the example string will be longer in some cases and adds some extra fixed space to account for the cases where it's shorter now.

For a new game all strings fit into the window now.

The patch also makes the window resize accordingly when changing the currency in-game, it did only when changing the language.
This task depends upon

Closed by  Remko Bijker (Rubidium)
Friday, 22 October 2010, 16:33 GMT
Reason for closing:  Implemented
Additional comments about closing:  In r21010
Comment by Remko Bijker (Rubidium) - Thursday, 09 September 2010, 20:42 GMT
If I'm using a font twice as big as the normal font those 11 pixels will likely not be enough. So there needs to be a more thorough examination on what the widest values are going to be and how to figure that out. Maybe checking the currency and inverse-applying the rate on the number before passing it through CURRCOMPACT? That would probably do the trick, wouldn't it?
Comment by Christian Hattemer (Krille) - Sunday, 12 September 2010, 21:31 GMT
Thanks for the hint, it's working even better now.

Loading...