Bug #1150

too wide sprites in purchase list

Added by planetmaker over 10 years ago. Updated about 10 years ago.

Status:NewStart date:2010-07-26
Priority:NormalDue date:
Assignee:-% Done:


Target version:-


Looking at http://hg.openttd.org/openttd/trunk.hg/rev/33d14671534c which is a follow-up to http://dev.openttdcoop.org/issues/1128 it should probably be considered to shorten the sprites in the purchase view as it will start to glitch as soon as people assign custom names to vehicle types.

Maybe smaller-scale versions and / or with the flag in the background can be provided instead of the current situation.

Great_Prenhattan_Transport__18-01-1950.png (38.9 KB) planetmaker, 2010-07-26 10:14

Great_Prenhattan_Transport__31-03-1950.png (39.6 KB) planetmaker, 2010-07-26 10:14


#1 Updated by planetmaker over 10 years ago

Attached two screenshots which show for a few wagons and engines the effect

#2 Updated by DJNekkid over 10 years ago

or we can revert the offset, and add the spaces again? :)

#3 Updated by Ammler over 10 years ago

or just note in the Readme, that renaming can cause glitches...

#4 Updated by Rubidium over 10 years ago

No, that breaks (similarly) with right-to-left languages.

Even then, for left-to-right languages, if the use removes the spaces the same issue exists.

#5 Updated by planetmaker over 10 years ago

Point is: we probably have to cater for an arbitrary custom string and cannot really assume that custom user-provided strings follow our design-rules.

#6 Updated by DJNekkid over 10 years ago

Then I vote for a new action0 property, or a var2 callback, "cannot rename vehicle" :)

And tbh, imho, if people start to rename the vehicles i think that is their problem, and not ours. We provide a (hopefully) good set that people use, and imho is the flag and the power-icon one of the trademarks of the 2cc-set.

By default is the purchase window 60 px (or 61 if we dont count 1px separation between gfx and text). Flag + icon is 32px currently, but can probably shave of 1px (currently 2px separation between icon and flag).
1 px between text and icon
13 px of icon
1 px between icon and flag
18 px of flag
1 px between flag and train
=34 px

61-34 = 27 px for the train.

There is currently 53px used for the train. (total 94px from left border to the text).

#7 Updated by DJNekkid about 10 years ago

This goes more to people like alberth and rubidum;

what about (if I/we provide sprites) a "stringcode" for the flag and the "icon"? That way we go around the problem, and the nice gfx bits are still applied :)

#8 Updated by Rubidium about 10 years ago

In OpenTTD string codes are resolved to plain text and that text is resolved to characters in a font, which are then drawn. Those characters are basically black/white, but can be recoloured. In no case would you get properly coloured flags using this method.

As such the use of string codes to solve your problem the proposed way is a bigger hack than using the SETX string code.

#9 Updated by DJNekkid about 10 years ago

i just had an idea, and as there are other icons ingame(bus, plane, ship, X, etc :)), i thought this might be a viable workaround :)

Also available in: Atom PDF