Patch: Filter by cargo [in trunk]

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

gule
Engineer
Engineer
Posts: 60
Joined: 16 Dec 2004 15:08
Location: Slovenia

Patch: Filter by cargo [in trunk]

Post by gule »

- in trunk, thanks to frosch and srb

- updated to r14564

- updated to r13085

Hello!

I split my patch Build and refit, into Filter by cargo and Build and refit. Here is only filter part of the patch.
You can filter vehicles by cargo that they can transport.
Attachments
Unnamed, 1st Jan 2000.png
Unnamed, 1st Jan 2000.png (83.67 KiB) Viewed 12376 times
filter_by_cargo_r14564.patch
(10.36 KiB) Downloaded 269 times
Last edited by gule on 13 Apr 2009 09:33, edited 4 times in total.
User avatar
Digitalfox
Chief Executive
Chief Executive
Posts: 710
Joined: 28 Oct 2004 04:42
Location: Catch the Fox if you can...

Re: Patch: Filter by cargo [r12791]

Post by Digitalfox »

Hey this is cool :mrgreen:

So what happens when theres wagons that support multiple cargos ( can't compile right now ) ?

Nice work :D
gule
Engineer
Engineer
Posts: 60
Joined: 16 Dec 2004 15:08
Location: Slovenia

Re: Patch: Filter by cargo [r12791]

Post by gule »

Digitalfox wrote:So what happens when theres wagons that support multiple cargos ( can't compile right now ) ?
When you select cargo you see all wagons which support this cargo, as default cargo or they can be refited to. So if wagon support coal and goods, you will see this wagon in coal filter and goods filter.
User avatar
cmoiromain
Chief Executive
Chief Executive
Posts: 655
Joined: 15 Jan 2007 21:45
Location: FRANCE
Contact:

Re: Patch: Filter by cargo [r12791]

Post by cmoiromain »

this patch looks pretty cool and really useful for me! Since I don't know how to compile, I'll wait until it gets in an IN build by someone (this shouldn't take long, when we see how many there are ATM...)
I am little, ugly, and nasty. How do you do?
User avatar
rbenevid
Traffic Manager
Traffic Manager
Posts: 192
Joined: 14 Oct 2004 20:08
Location: Brazil

Re: Patch: Filter by cargo [r12791]

Post by rbenevid »

This patch is so useful...... hope it gets in the trunk soon.
User avatar
leno4
Traffic Manager
Traffic Manager
Posts: 247
Joined: 10 Mar 2008 02:45
Location: Australia

Re: Patch: Filter by cargo [r12791]

Post by leno4 »

this is ownage thanks.
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: Patch: Filter by cargo [r12791]

Post by Roujin »

trunk plx :D
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
Trond
Tycoon
Tycoon
Posts: 973
Joined: 25 Jan 2008 07:32
Location: Gamle Ørnenuten

Re: Patch: Filter by cargo [r12791]

Post by Trond »

Yes, trunk plx! :wink:
..: Trond :.. because you deserve it! Image

The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell

MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
Ar4i
Traffic Manager
Traffic Manager
Posts: 153
Joined: 24 Jul 2006 10:40

Re: Patch: Filter by cargo [r12791]

Post by Ar4i »

This one very useful feature with all those train and industry packs. Especially given the fact that some trainsets would actually continuously add/remove different wagons through the whole game and would provide 2-3-4 wagons for one type of cargo.
User avatar
Timitry
Transport Coordinator
Transport Coordinator
Posts: 313
Joined: 01 Oct 2004 15:28
Contact:

Re: Patch: Filter by cargo [r12791]

Post by Timitry »

And it is especially useful as now you can have different trainsets loaded at once, and as there are wagons for each trainset it sometimes gets quite confusing ;-)
zombie
Traffic Manager
Traffic Manager
Posts: 153
Joined: 19 May 2005 22:19
Location: Germany

Re: Patch: Filter by cargo [r12791]

Post by zombie »

Hi.

Thanks for this great patch. I attached an updated patch file.

Kind regards

Zombie
Attachments
filter_by_cargo_r13059.patch
(9.7 KiB) Downloaded 222 times
OpenTTD: OpenTTD-Wiki
OpenTTDCoop: Blog, Wiki
My favorite patches: cargo destinations, shared infrastructure
zypa
Transport Coordinator
Transport Coordinator
Posts: 329
Joined: 30 Mar 2006 12:05
Location: Germany
Contact:

Re: Patch: Filter by cargo [r12791]

Post by zypa »

I would really love to see this patch in the trunk.
Is there any chance for that?
User avatar
Ammler
President
President
Posts: 953
Joined: 18 Jun 2006 18:18
Location: Switzerland
Contact:

Re: Patch: Filter by cargo [r12791]

Post by Ammler »

Heya

Is this patch extendable for i.e also filtering for the different GRF sets, since trunk allowes dynamic vehicle pool? (Dunno, if there is more, maybe you could split it to a Filterframework and then add different types of filter?)

Greets
Ammler
zombie
Traffic Manager
Traffic Manager
Posts: 153
Joined: 19 May 2005 22:19
Location: Germany

Re: Patch: Filter by cargo [r12791]

Post by zombie »

Hi.

Can anyone please provide a recent patch file? The shopping dialog has been transformed into a class and I'm failing doing it myself. My knowledge of C/C++ is kind of limited.

Kind regards

Zombie
OpenTTD: OpenTTD-Wiki
OpenTTDCoop: Blog, Wiki
My favorite patches: cargo destinations, shared infrastructure
gule
Engineer
Engineer
Posts: 60
Joined: 16 Dec 2004 15:08
Location: Slovenia

Re: Patch: Filter by cargo [r13085]

Post by gule »

zombie wrote:Can anyone please provide a recent patch file?
Updated version in first post.
Tiberius
Engineer
Engineer
Posts: 86
Joined: 17 Sep 2004 03:15

Re: Patch: Filter by cargo [r13085]

Post by Tiberius »

Update to r13374 for anyone who's interested in it :D

EDIT: change to svn-diff style, the code itself isn't altered.
Last edited by Tiberius on 05 Jul 2008 07:26, edited 1 time in total.
I may implement/fix/tweak/eat/ditch it soon (or in distant future, if at all, so don't hold your breath).
If anyone want to be the one please implement it for us all 8)
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Patch: Filter by cargo [r13085]

Post by planetmaker »

I like this patch as it avoids browsing through dozens of not needed wagons. Bonus: it's client only :P

A nice addition might be to sort engines, too: universal service, freight only & pax only.
zypa
Transport Coordinator
Transport Coordinator
Posts: 329
Joined: 30 Mar 2006 12:05
Location: Germany
Contact:

Re: Patch: Filter by cargo [r13085]

Post by zypa »

This is a _really_ useful patch.
Is there a chance that it will be included in the ottd trunk?
Tiberius
Engineer
Engineer
Posts: 86
Joined: 17 Sep 2004 03:15

Re: Patch: Filter by cargo [r13085]

Post by Tiberius »

Fixed a nasty negative array subscription, that crashes VS2008 optimized binary.
I may implement/fix/tweak/eat/ditch it soon (or in distant future, if at all, so don't hold your breath).
If anyone want to be the one please implement it for us all 8)
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Patch: Filter by cargo [r13085]

Post by planetmaker »

small bump to make it apply again to trunk
Attachments
filter_by_cargo_r13704.diff
filter-by-cargo for r13704
(9.69 KiB) Downloaded 205 times
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 10 guests