[Patch] Improved Build Station GUI [r19159]

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

scoz
Engineer
Engineer
Posts: 19
Joined: 21 Dec 2008 09:22

Re: [Patch] Improved Build Station GUI

Post by scoz »

TrainTraveller wrote:

Code: Select all

Me being stupid
I blame solar flares <_< I swore when I glanced at a std::vector page there was a clear function but when I went back to find it I couldn't ;_; Fixed on my end and it'll be in the next bug fix(which appears to pop up when you have only newgrf stations that use the default station class instead of their own)

yorick
Engineer
Engineer
Posts: 80
Joined: 23 Mar 2008 08:53

Re: [Patch] Improved Build Station GUI

Post by yorick »

I made the GUI resizeable some time ago, it's here :p

User avatar
Expresso
Tycoon
Tycoon
Posts: 1753
Joined: 09 Aug 2004 00:14
Location: Gouda, the Netherlands

Re: [Patch] Improved Build Station GUI

Post by Expresso »

Could you get rid of the platform legnth en number of platforms selectors?

They could be replaced by something which shows how many platforms and at which length are legal for the currently selected platform type. imho this would make the interface more intuitive.

Another option would be to make a patch setting which allows you to select whether you'd want to use the platform length/number of platforms selectors or not.

User avatar
ostlandr
Chairman
Chairman
Posts: 882
Joined: 12 May 2007 01:09
Location: Northeastern USA

Re: [Patch] Improved Build Station GUI

Post by ostlandr »

Nice one, TrainTraveller! That is a hack in the classic sense of the word.
TrainTraveller wrote:
scoz wrote:Fixed bug found by TrainTraveller(thanks!) and it now recreates the list every time the window is opened(incase you add/remove newgrfs during the game or something?).
Nice, thanks :-)
Any particular reason you are using:

Code: Select all

_railstation.station_classes.erase(_railstation.station_classes.begin(), _railstation.station_classes.end());
Instead of just:

Code: Select all

_railstation.station_classes.clear();
Who is John Galt?

User avatar
andythenorth
Tycoon
Tycoon
Posts: 5199
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: [Patch] Improved Build Station GUI

Post by andythenorth »

scoz wrote:Attached pic is probably a lot better than any description I could come up with :p Changes the station gui replacing the dropdown station class with a list, and the station type list with with a preview image list
Looks great. Really helpful.

I was wondering if the station GUI can be made pinnable. I've just had a look and I think it might be a no, due to the way other dialogs appear/disappear when using the rail construction toolbar. Pinning would be another nice improvement, but this improved GUI is great anyway. :P

cheers,

Andy

User avatar
Timitry
Transport Coordinator
Transport Coordinator
Posts: 313
Joined: 01 Oct 2004 15:28
Contact:

Re: [Patch] Improved Build Station GUI

Post by Timitry »

Simply amazing, if the window will be resizable, it'll be perfect!
Thanks & good luck with trunk inclusion!

scoz
Engineer
Engineer
Posts: 19
Joined: 21 Dec 2008 09:22

Re: [Patch] Improved Build Station GUI

Post by scoz »

Expresso wrote:Could you get rid of the platform legnth en number of platforms selectors?

They could be replaced by something which shows how many platforms and at which length are legal for the currently selected platform type. imho this would make the interface more intuitive.

Another option would be to make a patch setting which allows you to select whether you'd want to use the platform length/number of platforms selectors or not.
Not exactly sure what you mean. The buttons currently get disabled if that length/platform option isn't available. Do you mean like they should disappear completely? Or remove the interface completely and have drag'n'drop only?

I will look at see if I can make it pinable but that might be better suited to another patch that makes all station building windows pinnable 'shrug

User avatar
Expresso
Tycoon
Tycoon
Posts: 1753
Joined: 09 Aug 2004 00:14
Location: Gouda, the Netherlands

Re: [Patch] Improved Build Station GUI

Post by Expresso »

scoz wrote:
Expresso wrote:Could you get rid of the platform legnth en number of platforms selectors?

They could be replaced by something which shows how many platforms and at which length are legal for the currently selected platform type. imho this would make the interface more intuitive.

Another option would be to make a patch setting which allows you to select whether you'd want to use the platform length/number of platforms selectors or not.
Not exactly sure what you mean. The buttons currently get disabled if that length/platform option isn't available. Do you mean like they should disappear completely? Or remove the interface completely and have drag'n'drop only?
The station construction window becomes quite large with your patch, getting rid of the length/width selectors will return some valuable screen surface.

Also, the station construction window currently displays what cargo can be delivered to/picked up from the catchment area of the to be built station. Shouldn't that information be in a pop-up when the user is dragging the area where the station is to be built? Maybe shift could be used to get that pop-up to show up (to be consistent with the rest of the UI)?

Errr... all this sounds like a bit over the top for this patch, maybe a good idea for a follow-up?

TrainTraveller
Engineer
Engineer
Posts: 6
Joined: 31 Dec 2008 19:00

Re: [Patch] Improved Build Station GUI

Post by TrainTraveller »

I've found a bug when scrolling with a scroll wheel: you can only scroll when over the scrollbar, not when over the actual content. See the following screenshot: Scrolling in the (bright) green areas works, scrolling in the red area doesn't:
railgui_scrollbug.png
railgui_scrollbug.png (49.09 KiB) Viewed 3552 times

scoz
Engineer
Engineer
Posts: 19
Joined: 21 Dec 2008 09:22

Re: [Patch] Improved Build Station GUI

Post by scoz »

TrainTraveller wrote:I've found a bug when scrolling with a scroll wheel: you can only scroll when over the scrollbar, not when over the actual content. See the following screenshot: Scrolling in the (bright) green areas works, scrolling in the red area doesn't:
Any chance you could give me a couple examples of windows that do scroll with the scroll wheel? Or did the original station do so? My laptop's trackpad does a "virtual" scroll that doesn't work in most cases so no handy way to test it personally(I'll see if I can borrow a usb mouse from a friend or something this weekend).

TrainTraveller
Engineer
Engineer
Posts: 6
Joined: 31 Dec 2008 19:00

Re: [Patch] Improved Build Station GUI

Post by TrainTraveller »

scoz wrote:Any chance you could give me a couple examples of windows that do scroll with the scroll wheel?
As far as I know all windows that show a scrollbar allow scrolling with the mouse wheel over the content. For example, the list of towns, list of trains, list of industries, etc :-)

Edit: I've poked around and found the cause of the problem. Scrolling over content is only done when the next widget (widget[i+1]) is of the type WWT_SCROLLBAR of WWT_SCROLL2BAR (see DispatchMouseWheelEvent() in window.cpp). So changing:

Code: Select all

// improved newstations gui additions
{  WWT_SCROLLBAR,   RESIZE_NONE,  ..
{ WWT_SCROLL2BAR,   RESIZE_NONE,  ..
{     WWT_MATRIX,   RESIZE_NONE,  ..
To:

Code: Select all

// improved newstations gui additions
{     WWT_MATRIX,   RESIZE_NONE,  ..
{  WWT_SCROLLBAR,   RESIZE_NONE,  ..
{ WWT_SCROLL2BAR,   RESIZE_NONE,  ..
Seems to fix the scrolling problem for the first list. However, this causes other problems (clicking on items in the list no longer has effect for example :-)). Anyway, I hope this points you in the right direction of fixing the problem :-)

Moriarty
Tycoon
Tycoon
Posts: 1395
Joined: 12 Jun 2004 00:37
Location: United Kingdom of Great Britain and Northern Ireland
Contact:

Re: [Patch] Improved Build Station GUI

Post by Moriarty »

CommanderZ wrote::shock: Why didn't anyone make this sooner? It is now so obvious, how user un-friendly the default station UI is...
I don't mean to disparage this work, it's quite nice, however there don't appear to be any differences to the default station UI in a default game - this interface only comes into its own when you're playing with extra station GRF's.

Teeg
Engineer
Engineer
Posts: 55
Joined: 31 Jul 2007 23:57

Re: [Patch] Improved Build Station GUI

Post by Teeg »

Considering that the default game only has one single station design, and this patch is meant to assist those who take pride in complex stations, I'd consider that a feature, not a drawback.

scoz
Engineer
Engineer
Posts: 19
Joined: 21 Dec 2008 09:22

Re: [Patch] Improved Build Station GUI

Post by scoz »

TrainTraveller wrote:
scoz wrote:Any chance you could give me a couple examples of windows that do scroll with the scroll wheel?
As far as I know all windows that show a scrollbar allow scrolling with the mouse wheel over the content. For example, the list of towns, list of trains, list of industries, etc :-)
Ha should have refreshed the thread. I go and figure it out, come back to post and say I fixed it and you've already done my work for me. :P Anyways that fix is in for the station classes list but adding scrolling to the station buttons will wait until I make it resizeable(namely after I go about my plan to make it resizeable it will be scrollable as well). Hoping to crush the bug with only 1 station class tomorrow so hopefully tomorrow night I'll have v3 up with the bug(and stupid)squashing.

PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Re: [Patch] Improved Build Station GUI

Post by PhilSophus »

scoz wrote:The buttons currently get disabled if that length/platform option isn't available. Do you mean like they should disappear completely? Or remove the interface completely and have drag'n'drop only?
Removing the buttons completely would be very bad, unless you gave the information on valid combinations of platform count/length in a different form.

IMHO, disappearing completely would be an alternative if the other buttons stayed at their place (i.e. [1] [disabled_2] [3] would become [1] [space] [3], but not [1] [3]), so that you still have visual feedback of allowed combinations. Since, the difference to the existing approach is small, it's probably not worth the effort.
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008

Slye_Fox
Traffic Manager
Traffic Manager
Posts: 164
Joined: 21 Aug 2004 14:27
Location: London, UK
Contact:

Re: [Patch] Improved Build Station GUI

Post by Slye_Fox »

Sorry to go offtopic, but what station grfs are those int he pics?
Image

User avatar
Gremnon
Tycoon
Tycoon
Posts: 1517
Joined: 16 Sep 2005 12:23
Skype: the_gremnon
Location: /home
Contact:

Re: [Patch] Improved Build Station GUI

Post by Gremnon »

Industrial Stations Renewal 0.8.0

scoz
Engineer
Engineer
Posts: 19
Joined: 21 Dec 2008 09:22

Re: [Patch] Improved Build Station GUI

Post by scoz »

Sorry I'm being so late with finishing the resizeable-ness :( Moved in to the dorms and friends keep showing up and stealing me off to places. Should be finished around Friday.

User avatar
Expresso
Tycoon
Tycoon
Posts: 1753
Joined: 09 Aug 2004 00:14
Location: Gouda, the Netherlands

Re: [Patch] Improved Build Station GUI

Post by Expresso »

PhilSophus wrote:
scoz wrote:The buttons currently get disabled if that length/platform option isn't available. Do you mean like they should disappear completely? Or remove the interface completely and have drag'n'drop only?
Removing the buttons completely would be very bad, unless you gave the information on valid combinations of platform count/length in a different form.

IMHO, disappearing completely would be an alternative if the other buttons stayed at their place (i.e. [1] [disabled_2] [3] would become [1] [space] [3], but not [1] [3]), so that you still have visual feedback of allowed combinations. Since, the difference to the existing approach is small, it's probably not worth the effort.
Well, you could modify the selection area to reflect the allowed station sizes.

For example: if a station building is only allowed to be built at a size of 1x3, the area rectangle should display only that size - no bigger size, no smaller size. If a specific platform has a minimum length/width and a maximum length/width, the area selector should become no smaller then the minimally allowed area and not bigger then the maximum allowed area. If a platform type only allows say either 2x(any size) or 4x(any size) the selection rectangle should be able to reflect that too by only resizing in hops - in this case only for the width.

If it is done in this way, you'll still have your visual feedback without losing valuable screen-space to some buttons and a more intuitive user interface too.

User avatar
CommanderZ
Tycoon
Tycoon
Posts: 1872
Joined: 07 Apr 2008 18:29
Location: Czech Republic
Contact:

Re: [Patch] Improved Build Station GUI

Post by CommanderZ »

Idea - what about hiding the right half of the window for the default stations (or sets with only one station) and display it only for the more advanced station sets?

Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 8 guests