Patch: Filter by cargo [in trunk]
Moderator: OpenTTD Developers
Re: Patch: Filter by cargo [r13085]
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 ...
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
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 ...
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
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
If anyone want to be the one please implement it for us all
Re: Patch: Filter by cargo [r13085]
The second filter-by-cargo patch that uses station cargo filtering interface ...
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)
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)
- Attachments
-
- filter-by-cargo.png (16.93 KiB) Viewed 4630 times
-
- filter-by-cargo_v2_r13733.patch
- (16.89 KiB) Downloaded 109 times
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
If anyone want to be the one please implement it for us all
Re: Patch: Filter by cargo [r13085]
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]
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
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
- Attachments
-
- filter-by-cargo-ECS.png (10.62 KiB) Viewed 4598 times
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
If anyone want to be the one please implement it for us all
-
- Engineer
- Posts: 22
- Joined: 26 Jul 2008 03:09
Re: Patch: Filter by cargo [r13085]
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?
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Patch: Filter by cargo [r13085]
Look at the image caption in the posting imediately above your post.sir_schwick wrote:Is Filter by Cargo compatible with ECS?
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: Patch: Filter by cargo [r13085]
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!
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!
-
- Engineer
- Posts: 22
- Joined: 26 Jul 2008 03:09
Re: Patch: Filter by cargo [r13085]
Doh. Ummm, what else should I look for to solve the issue of not having your awesome patch working?planetmaker wrote:Look at the image caption in the posting imediately above your post.sir_schwick wrote:Is Filter by Cargo compatible with ECS?
Re: Patch: Filter by cargo [r13085]
After a long long time I updated this patch to trunk. It is my version with dropdown.
Updated version in first post.
Updated version in first post.
Re: Patch: Filter by cargo [r13085]
Congratulations for successful merge with trunk!gule wrote:After a long long time I updated this patch to trunk. It is my version with dropdown.
Updated version in first post.
I see your first post is from April.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Patch: Filter by cargo [r14564]
small update
- Attachments
-
- filter_by_cargo_r15263.diff
- update for r15263
- (11.43 KiB) Downloaded 112 times
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
-
- Chief Executive
- Posts: 658
- Joined: 11 Nov 2007 12:06
- Contact:
Re: Patch: Filter by cargo [r14564]
Hi i am under takeing a new patchs pack and would like to inclued your patch but i need help doing this
For Community Integrated Version http://code.google.com/p/civopenttd/
Re: Patch: Filter by cargo [r14564]
the update is here
http://bugs.openttd.org/task/1941?strin ... &closedto=
the patch is down the list for r15591
http://bugs.openttd.org/task/1941?strin ... &closedto=
the patch is down the list for r15591
The rest is confetti!
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Filter by cargo [r15776]
Update for r15776
- Attachments
-
- filter_by_cargo_r15776.diff
- (11.37 KiB) Downloaded 100 times
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: Patch: Filter by cargo [r14564]
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 ). 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.
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 ). 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.
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
-
- Chief Executive
- Posts: 658
- Joined: 11 Nov 2007 12:06
- Contact:
Re: Patch: Filter by cargo [r14564]
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
{ 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
For Community Integrated Version http://code.google.com/p/civopenttd/
-
- Chief Executive
- Posts: 658
- Joined: 11 Nov 2007 12:06
- Contact:
Re: Patch: Filter by cargo [r14564]
I tryed my best to get this updated and have failed can any one help please by updateing it
For Community Integrated Version http://code.google.com/p/civopenttd/
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Patch: Filter by cargo [r14564]
look at flyspray for a re-written version. I haven't tested it yet, though.
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
-
- Chief Executive
- Posts: 658
- Joined: 11 Nov 2007 12:06
- Contact:
Re: Patch: Filter by cargo [r14564]
no there updated the widgets in the build_vehicle_gui
For Community Integrated Version http://code.google.com/p/civopenttd/
Re: Patch: Filter by cargo [in trunk]
In trunk (r16042) thanks to frosch and srb.
Who is online
Users browsing this forum: No registered users and 17 guests