[patch] advanced train purchase window

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
User avatar
RBC
Engineer
Engineer
Posts: 48
Joined: 19 Jun 2008 07:52
Location: Eibenstock (Germany)

[patch] advanced train purchase window

Post by RBC »

so I tried my best to get this done:
atpw_preview.png
atpw_preview.png (26.16 KiB) Viewed 5129 times
I split the engine list for trains into two parts. I find it very usefull when playing with newgrf-sets that have vast amounts of locomotives and wagons and especially when you have vehicles never expire.
It is turned off by default, activate it under advanced settings - interface.

I am not so deep in coding complex programs yet and open for hints. (also for coding style)
One question came across while coding that patch: should there be a check like

Code: Select all

if(type != VEH_TRAIN)
in the new struct, because for other types it will probably crash?

And as english is not my mother tongue, is the term "traction unit" (and even "locomotive") the correct one? In german I would name them "Lokomotive" and "Triebkopf".
Attachments
atpw_r26706.patch
(55.86 KiB) Downloaded 121 times
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: [patch] advanced train purchase window

Post by michael blunck »

RBC wrote: is the term "traction unit" (and even "locomotive") the correct one? In german I would name them "Lokomotive" and "Triebkopf".
"Triebkopf" -> "power car"

regards
Michael
Image
User avatar
RBC
Engineer
Engineer
Posts: 48
Joined: 19 Jun 2008 07:52
Location: Eibenstock (Germany)

Re: [patch] advanced train purchase window

Post by RBC »

updated. Also minor improvement: do not show sort option "maximum speed" for wagons when wagon speed limits are disabled.
Attachments
atpw_v2_r26706.patch
(55.85 KiB) Downloaded 104 times
Der_tolle_Emil
Engineer
Engineer
Posts: 33
Joined: 22 Nov 2004 08:36

Re: [patch] advanced train purchase window

Post by Der_tolle_Emil »

I really like this, should be quite handy depending on what NewGRFs are used - especially when vehicles never expire as the list can get incredibly long.

Regarding the translation: Locomotive should be fine but didn't the original use 'Engine'? At least this still shows up in the 'sort' drop down when selecting Classic (EngineID).
User avatar
kamnet
Moderator
Moderator
Posts: 8582
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: [patch] advanced train purchase window

Post by kamnet »

Provided that this follows strict OpenTTD coding guidelines, you should submit it for review by the devs. This would be a welcomed improvement to the menu.
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: [patch] advanced train purchase window

Post by Alberth »

kamnet wrote:Provided that this follows strict OpenTTD coding guidelines, you should submit it for review by the devs. This would be a welcomed improvement to the menu.
Don't bother in its current form.

Extending functionality by duplicating the entire build window code is not a feasible path solution.

Edit2: I am also having some reservations about the usefulness. A long list stays a long list even if you split it in some way. In my personal view, preferably, the length of the lists should near to the number of models that you actually use in the game.
User avatar
kamnet
Moderator
Moderator
Posts: 8582
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: [patch] advanced train purchase window

Post by kamnet »

I'm not really concerned about the long lists, just that separating out locomotives from wagons and having them both available for viewing would help me make better decisions as to which I would like to pair up, and save me some mouse clicks. While there are many players who do only use a few select models at any given time, there are also many players who take advantage of the diversity in many NewGRF sets.
Eddi
Tycoon
Tycoon
Posts: 8267
Joined: 17 Jan 2007 00:14

Re: [patch] advanced train purchase window

Post by Eddi »

proper filtering might be of more use for that


but much more important than correct code style is getting a well-designed UI first. i.e. one that adapts to both newcomers' and experienced players' needs without becoming overloaded.
hajo4
Engineer
Engineer
Posts: 13
Joined: 27 Aug 2014 08:34
Location: DE

Re: [patch] advanced train purchase window

Post by hajo4 »

RBC wrote:split the engine list .. usefull when playing with newgrf-sets that have vast amounts of locomotives
Can we have a sort/filter-option for that list,
along with a "preference/favorite"-setting for
each engine (e.g. as a pulldown-menu) ?

So the player could set them to
* obsolete (don't show in filtered list)
* bad/weak/old (show name in red)
* default
* good
* favorite (show in green)
--HaJo
lcd_47
Engineer
Engineer
Posts: 78
Joined: 27 Sep 2006 18:04

Re: [patch] advanced train purchase window

Post by lcd_47 »

I updated this patch to 1.6.1. I cleaned it up a little, added hiding / unhiding, and fixed a surprising number of bugs. The overall design still kind of sucks, mainly because the patch keeps the old purchase menu as an option, rather than replace it completely. However, having to use the default purchase menu with something like 2cc trains sucks a few orders of magnitude more. Enjoy.
Attachments
advanced_purchase-r27609.diff
(59.92 KiB) Downloaded 63 times
lcd_47
Engineer
Engineer
Posts: 78
Joined: 27 Sep 2006 18:04

Re: [patch] advanced train purchase window

Post by lcd_47 »

Update: fix a bug related to height calculation for the details panel.
Attachments
advanced_purchase-r27609-2.diff
(58.44 KiB) Downloaded 81 times
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 35 guests