Page 2 of 3

Re: Patch: Filter by cargo [r13085]

Posted: 14 Jul 2008 23:05
by Tiberius
Thanks planetmaker :)

For those who wonder why this haven't went into trunk yet: OpenTTD official developers want to share the interface used to filter stations (which can select multiple cargo types at once), preferably share the same code.

Perhaps I should implement a whole new widget type for this ? I don't even know if enlarging 'data' in Widget from uint16 to uint32 is safe/the right thing to do(tm) for now ... :wink:

I may (or may not) implement it recently (or in distant future), but don't hold your breath. If anyone want to be the one please implement it for us all, meanwhile you can BuildOTTD yourself or try my patchpack 8)

Re: Patch: Filter by cargo [r13085]

Posted: 19 Jul 2008 00:11
by Tiberius
The second filter-by-cargo patch that uses station cargo filtering interface ... 8)
Not sharing the same code though, didn't come up a good way to do it ...

When opening a new vehicle-purchasing window it'll restore the last filter used with the same type of vehicles (road, train, ship, airplane).

Use CTRL to select multiple cargo types at once.
I was trying to link a Factory in the following picture, for example ...

NO = Show vehicles that takes no cargo at all (that is, locomotives)

Re: Patch: Filter by cargo [r13085]

Posted: 19 Jul 2008 02:59
by DJ Nekkid
i have a certain feeling that your approach (accorting to the screenie) witht teh small "icons" on the top with "ps, cl, ML, OL, LV, GD ... NO, ALL" will have some pain with window size if used with one or two (or rather a few) ECS vectors, or some other "new cargo" grfs... Altho, i heavent tested this, but it's just a notch I have...

Re: Patch: Filter by cargo [r13085]

Posted: 19 Jul 2008 05:24
by Tiberius
It will automatically enlarge the window to accommodate additional buttons for more cargo types introduced by NewGRFs (max 32 as OTTD allowed), like the screenshot below.

Since we know developers want the window as small as possible, make it easier porting OTTD to small-screen devices like NDS, PSP, S60 etc., therefore I decide to keep window sizes manageable from the beginning. Hey, perhaps someone will ask me to show these buttons in multiple rows later :roll:

Re: Patch: Filter by cargo [r13085]

Posted: 27 Jul 2008 05:33
by sir_schwick
I recently tried out this patch, as it was bundled with Roest's Patchpack. On the prescribed build(r1309 I think) most of the other patches work but this one is not present at all. I am also running ECS and its compatible grfs at the moment. Is Filter by Cargo compatible with ECS?

Re: Patch: Filter by cargo [r13085]

Posted: 27 Jul 2008 05:55
by planetmaker
sir_schwick wrote:Is Filter by Cargo compatible with ECS?
Look at the image caption in the posting imediately above your post.

Re: Patch: Filter by cargo [r13085]

Posted: 27 Jul 2008 11:28
by Timitry
Heyho!

I like that patch, looks really good!

2 things: First, the multiple rows-thing for the icons would be good, as the window shouldn't be too wide.
Second: Maybe this is already implemented, did not test it, but does it show a tooltip when right-klicking on or hovering over the cargo icons, telling you which cargo it is? As especially with ECSVectors it can be hard with the abbrevations...

Hope to see this in trunk soon!

Re: Patch: Filter by cargo [r13085]

Posted: 27 Jul 2008 16:02
by sir_schwick
planetmaker wrote:
sir_schwick wrote:Is Filter by Cargo compatible with ECS?
Look at the image caption in the posting imediately above your post.
Doh. Ummm, what else should I look for to solve the issue of not having your awesome patch working?

Re: Patch: Filter by cargo [r13085]

Posted: 04 Nov 2008 18:39
by gule
After a long long time I updated this patch to trunk. It is my version with dropdown.

Updated version in first post.

Re: Patch: Filter by cargo [r13085]

Posted: 05 Nov 2008 18:02
by Zuu
gule wrote:After a long long time I updated this patch to trunk. It is my version with dropdown.

Updated version in first post.
Congratulations for successful merge with trunk! :)

I see your first post is from April.

Re: Patch: Filter by cargo [r14564]

Posted: 25 Jan 2009 10:44
by planetmaker
small update

Re: Patch: Filter by cargo [r14564]

Posted: 13 Feb 2009 12:33
by 2007Alain2007
Hi i am under takeing a new patchs pack and would like to inclued your patch but i need help doing this

Re: Patch: Filter by cargo [r14564]

Posted: 28 Feb 2009 19:53
by ColdIce
the update is here

http://bugs.openttd.org/task/1941?strin ... &closedto=

the patch is down the list for r15591

Filter by cargo [r15776]

Posted: 20 Mar 2009 17:53
by planetmaker
Update for r15776

Re: Patch: Filter by cargo [r14564]

Posted: 21 Mar 2009 00:00
by frosch
Despite of the general list filtering stuff someone mentioned in the FS task:

1) What's the point of cargo_filter_xxx for every vehicle type, when only one is used?
(They were static in another version of the patch FS#2196, but now?)

2) cargo_type and capacity of xxxVehInfo as well as refit_mask should no longer be used in GUI code (also not in other code, except in authorized places :p ). Use Engine::CanCarryCargo(), Engine::GetDefaultCargoType(), Engine::GetDisplayDefaultCapacity(), GetUnionOfArticulatedRefitMasks() or GetIntersectionOfArticulatedRefitMasks(). (The last part was already fixed somewhen in FS#1941)

3) + this->cargos_dropdown_pos[CF_SHOW_ALL] = 0;
Uhm, CF_SHOW_ALL is -1.

Re: Patch: Filter by cargo [r14564]

Posted: 23 Mar 2009 02:41
by 2007Alain2007
trying my best to update just asking what WIDGET thing at the end do i use

{ WWT_DROPDOWN, RESIZE_RIGHT, COLOUR_GREY, 191, 293, 14, 25, 0x0, STR_SORT_CRITERIA_TIP},

think its this // BUILD_VEHICLE_WIDGET_SORT_DROPDOWN but every time i try i get an errour in game :(

Re: Patch: Filter by cargo [r14564]

Posted: 23 Mar 2009 12:41
by 2007Alain2007
I tryed my best to get this updated and have failed :( can any one help please by updateing it

Re: Patch: Filter by cargo [r14564]

Posted: 23 Mar 2009 12:54
by planetmaker
look at flyspray for a re-written version. I haven't tested it yet, though.

Re: Patch: Filter by cargo [r14564]

Posted: 23 Mar 2009 13:19
by 2007Alain2007
no there updated the widgets in the build_vehicle_gui

Re: Patch: Filter by cargo [in trunk]

Posted: 13 Apr 2009 09:32
by gule
In trunk (r16042) thanks to frosch and srb.