Patch: Station-gui-Upgrade

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
Haukinger
Engineer
Engineer
Posts: 110
Joined: 15 Mar 2006 16:38

Patch: Station-gui-Upgrade

Post by Haukinger »

Some time ago, I complained about the station-gui not showing exact numbers. (here)
I made a patch to change the look of the station-gui, see attachment.

EDIT: cargos with quantity 0 are now displayed
EDIT: drawing inside of window only, first column moves depending on longest visible station name
Attachments
newer look
newer look
station gui table 02.png (17.03 KiB) Viewed 2943 times
station_gui_table.diff
for r4780
no more drawing outside the window
(2.85 KiB) Downloaded 124 times
Last edited by Haukinger on 08 May 2006 10:31, edited 2 times in total.
User avatar
Born Acorn
Tycoon
Tycoon
Posts: 7596
Joined: 10 Dec 2002 20:36
Skype: bornacorn
Location: Wrexham, Wales
Contact:

Post by Born Acorn »

This gui could do with some sorting options like the Industry Directory window. Is that possible? Sort by type/goods waiting etc
Image
Haukinger
Engineer
Engineer
Posts: 110
Joined: 15 Mar 2006 16:38

Post by Haukinger »

I think that's possible. But I don't know how... I'm just scratching the surface of ottd-patching ;)
I want to make the table a bit more static. Does anyone know where a station records which cargo it 'creates' ?
When a train is in the station and loading, that type of cargo will disappear from the station-gui if the train loads all. I want it to stay in the gui (as 0, of course)

EDIT: done.
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

Haukinger wrote: I want to make the table a bit more static. Does anyone know where a station records which cargo it 'creates' ?
A station creates no cargo, it get's it from the industry nearby.
That is saved here: station->goods[cargotype]

How does the window look if the station offers 4 or more cargotypes?
Haukinger
Engineer
Engineer
Posts: 110
Joined: 15 Mar 2006 16:38

Post by Haukinger »

How does the window look if the station offers 4 or more cargotypes?
You don't want to know :)
It writes over the borders of the window and leaves ugly artifacts on the map, if you don't make the window large enough...
As said before, I'm new to ottd-patching and have yet to master the secrets of the gui.
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

how about making a filter, so you say only look at stations, that delivers goods (even though some of them currently got 0)
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

Haukinger wrote: You don't want to know :)
It writes over the borders of the window and leaves ugly artifacts on the map, if you don't make the window large enough...
As said before, I'm new to ottd-patching and have yet to master the secrets of the gui.
I know what's happening, i only wanted to know if you know that this can happen. it's not nice that it happens but make the windows big enough for every language text is impossible i think. But normally you only have text. But in the worst case you can have 13 cargo types in one line, and putting that onto one line will look afwul.

Taking a smaller font size will reduce the text width too. The normal value has 4 places. I never seen a station with > 2300 cargo waiting. So reduce the unused place between the text and the small picture for the next cargo. Maybe you need to make the window itself wider.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

gigajum wrote:I never seen a station with > 2300 cargo waiting.
I take it you haven't looked at an oil or water station lately?
Those can end up with ~1,000,000 litres of oil or water, easily.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

DaleStan wrote:
gigajum wrote:I never seen a station with > 2300 cargo waiting.
I take it you haven't looked at an oil or water station lately?
Those can end up with ~1,000,000 litres of oil or water, easily.
if i remember correct, the value of the variable has only 1000. The text output only adds the three 0 to make litres out of it. But i'm not 100% sure about that without looking at the code.
User avatar
Korenn
Tycoon
Tycoon
Posts: 1735
Joined: 26 Mar 2004 01:27
Location: Netherlands
Contact:

Post by Korenn »

correct. but the player doesn't know that. can be quite confusing if it says only 1.000 units in the list but there's 1.000.000 litres waiting.
sc79
Director
Director
Posts: 586
Joined: 22 Feb 2005 09:51

Post by sc79 »

I think it would be more confusing if everything else shows 1-2000 units as a lot of cargo waiting, while the same figure for oil/water is practically nothing.
Id be more inclined to use standard volumes relative to station and train maxes, rather than the cosmetic litres value.

Certainly I'd much rather drop the 3 zeros and get another 1-2 cargos within the standard window size.
Sacro
Tycoon
Tycoon
Posts: 1145
Joined: 18 Jun 2005 21:08
Location: Here
Contact:

Post by Sacro »

Why not postfix them with K, M, G, T etc ?
We Am De Best

Host of ThroughTheTube site
Haukinger
Engineer
Engineer
Posts: 110
Joined: 15 Mar 2006 16:38

Post by Haukinger »

This litre-thing is - for me - confusing and unnecessary. The game could use tons or barrels or whatever to keep the numbers consistent...
Many different cargos in one station is no problem IMHO, 1024x768 is enough for 12 cargos. Btw, long trains are a problem, too. If you build a 60-unit train, even the scrollbar in the depot view ceases to work.
The position of the first column is chosen to allow longer station-names. To adapt it to the longest actual station-name is possible, this looks like that:
Attachments
adaptive column-one-position
adaptive column-one-position
station gui table 03.png (5.69 KiB) Viewed 2670 times
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 18 guests