[Patch] Improved Build Station GUI [r19159]
Moderator: OpenTTD Developers
- Vaulter
- Traffic Manager
- Posts: 185
- Joined: 21 Dec 2004 05:35
- Skype: andrey-zaharov
- Location: St. Petersburg, Russia
- Contact:
Re: [Patch] Improved Build Station GUI [r19159]
Here patch against 1.0.2 + some additions
Thanks for such good stuff!
Thanks for such good stuff!
- Attachments
-
- station-build-gui_v6.2.r20167.patch
- Patch against 1.0.2
- (37.01 KiB) Downloaded 884 times
-
- Tycoon
- Posts: 1829
- Joined: 10 Jul 2006 00:43
- Location: Spain
Re: [Patch] Improved Build Station GUI [r19159]
Thanks. It looks nice, but I see a problem: There are a empty space in the buttons, and tall sprites are cut. If the sprites are drawn 25 pixels down, most of them would fit in the space.
Sorry if my english is too poor, I want learn it, but it isn't too easy.
- [list][*]Why use PNG screenshots in 8 bpp games.
[*]Caravan site New Industry. · Spain set. · Some spanish trains for locomotion[*]Favourites:GRVTS · ECS · FIRS
Re: [Patch] Improved Build Station GUI [r19159]
Be aware that the patch from Vaulter is just a backport to 1.0.2, the trunk patch from sbr doesn't have this glitch:maquinista wrote:Thanks. It looks nice, but I see a problem: There are a empty space in the buttons, and tall sprites are cut. If the sprites are drawn 25 pixels down, most of them would fit in the space.
Town Names:


Still work in progress: OpenGFX or/and OpenSFX - Please help!
Re: [Patch] Improved Build Station GUI [r19159]
Hello scoz,
Attached is the patch (by sbr) updated to current trunk.
I have added the needed lines and code changes to make the patch work in current trunk.
Also I have unified the breaks in "case ...:" with the recent trunk change and I have added a few accolades that were missing in trunk (see line 366 in the patch for an example)
Also I have added 1 todo which is not a really a todo but a to check if I did it correctly.
Otherwise no changes have been made and functionality is the same as before.
ps:
Vaulter, changing the possible number of tracks to build or max lenght in one go is something for a separate patch.
Attached is the patch (by sbr) updated to current trunk.
I have added the needed lines and code changes to make the patch work in current trunk.
Also I have unified the breaks in "case ...:" with the recent trunk change and I have added a few accolades that were missing in trunk (see line 366 in the patch for an example)
Also I have added 1 todo which is not a really a todo but a to check if I did it correctly.
Otherwise no changes have been made and functionality is the same as before.
ps:
Vaulter, changing the possible number of tracks to build or max lenght in one go is something for a separate patch.

- Attachments
-
- station-build-gui_v6.3-r20527.diff
- (41.13 KiB) Downloaded 267 times
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
Re: [Patch] Improved Build Station GUI [r19159]
Just to clear this up, those curly brackets are not missing.ChillCore wrote:.... and I have added a few accolades that were missing in trunk (see line 366 in the patch for an example)
The aim in trunk is not to add curly brackets everywhere, but only when needed, ie when a local variable is defined inside a case.
Re: [Patch] Improved Build Station GUI [r19159]
I see. Thank you for the clarification Alberth.Alberth wrote: The aim in trunk is not to add curly brackets everywhere, but only when needed, ie when a local variable is defined inside a case.
Attached patch removes the unneeded curly braces I added to trunk outside the patch.
I have not yet looked at the rest of the code to see if some more could/should be removed.
- Attachments
-
- station-build-gui_v6.3.1-r20566.diff
- (40.11 KiB) Downloaded 254 times
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
Re: [Patch] Improved Build Station GUI [r19159]
After discussing this feature for a while, we have two suggestions to make.
The first one is somewhat complicated. Waypoints are basically the same thing than stations, and as a result their building window could also benefit from some of the features introduced by this patch. Because of this, the build waypoint window should be merged into the build station window as additional prerrequisite patches, and after that it would be trivial for both waypoints and station to use the new features. In the following screenshot, the suggested build waypoint window would only use the right part of the current build station window.

Codewise, both windows could share the same code but use different NWidgetPart arrays during creation (as done for the vehicle details window). Using NWID_SELECTION is a possibility too.
About the station name, we think that it should be shown more clearly. A possibility could be displaying the name of the currently selected station under the matrix. This also has the advantage of being in the part of the window that waypoints would need to use.
Before reaching these conclusions, I updated the three parts and fixed a few issues with 02 (the most important being that OpenTTD would crash if the station class dropdown was down and a station NewGRF was removed). IMO these three patches are ready for trunk inclusion, but I have not commited them just in case they need to be reworked because of the waypoint window unification. They can be found here.
The first one is somewhat complicated. Waypoints are basically the same thing than stations, and as a result their building window could also benefit from some of the features introduced by this patch. Because of this, the build waypoint window should be merged into the build station window as additional prerrequisite patches, and after that it would be trivial for both waypoints and station to use the new features. In the following screenshot, the suggested build waypoint window would only use the right part of the current build station window.
Codewise, both windows could share the same code but use different NWidgetPart arrays during creation (as done for the vehicle details window). Using NWID_SELECTION is a possibility too.
About the station name, we think that it should be shown more clearly. A possibility could be displaying the name of the currently selected station under the matrix. This also has the advantage of being in the part of the window that waypoints would need to use.
Before reaching these conclusions, I updated the three parts and fixed a few issues with 02 (the most important being that OpenTTD would crash if the station class dropdown was down and a station NewGRF was removed). IMO these three patches are ready for trunk inclusion, but I have not commited them just in case they need to be reworked because of the waypoint window unification. They can be found here.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: [Patch] Improved Build Station GUI [r19159]
An update against r21062:
- Show station name under the station class matrix.
- Move station type matrix code inside a separate widget.
- Use this widget to display waypoints in their window.
- Make the waypoint window support NewGRF reloading, resizable and able to restore its previous size.
- Attachments
-
- rail station and waypoint windows
- buildrailstation-waypointwindow.png (44.23 KiB) Viewed 6607 times
-
- station-build-gui_v7.0-hg-fa663195a4db_small-patches.tar
- against r21062, small patches, for '-p1' users
- (120 KiB) Downloaded 274 times
-
- station-build-gui_v7.0-r21062.patch
- for subversion users, with all the files included
- (59.06 KiB) Downloaded 211 times
Last edited by sbr on 16 Nov 2010 04:11, edited 1 time in total.
Re: [Patch] Improved Build Station GUI [r19159]
Nice!
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Re: [Patch] Improved Build Station GUI [r19159]
i love itwhen some random newbie (no offense) coder appears with an updated patch...
Nice work!
Hope this makes trunk soon...
Nice work!
Hope this makes trunk soon...
AroAI - A really feeble attempt at an AI
It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
Re: [Patch] Improved Build Station GUI [r19159]
would be great to have this default in Ottd
(and for the NewObjects too
)


Re: [Patch] Improved Build Station GUI [r19159]
You forgot to svn add the new file, so it's not in the diff.sbr wrote:An update against r21062:
- Show station name under the station class matrix.
- Move station type matrix code inside a separate widget.
- Use this widget to display waypoints in their window.
- Make the waypoint window support NewGRF reloading, resizable and able to restore its previous size.
Re: [Patch] Improved Build Station GUI [r19159]
I should have better check the svn diff. Attached is, hopefully, the correct patch file (the previous post is also updated).
There is still a lot of things to clean up to properly merge the BuildWaypoint and BuildRailStation windows. That patch present a way to do it even if far from perfect. Thanks for reviewing it.
There is still a lot of things to clean up to properly merge the BuildWaypoint and BuildRailStation windows. That patch present a way to do it even if far from perfect. Thanks for reviewing it.
- Attachments
-
- station-build-gui_v7.0-r21062.patch
- for subversion users
- (59.06 KiB) Downloaded 254 times
Re: [Patch] Improved Build Station GUI [r19159]
any chance this patch will ever make it to trunk ? seems to me (as just a plain user) far better than the current one in very way.
but dont know about any other clashes in code that i dont notice as just that plain user.
but dont know about any other clashes in code that i dont notice as just that plain user.
Re: [Patch] Improved Build Station GUI [r19159]
Yeah, selecting a picture is way nicer.Dante123 wrote:any chance this patch will ever make it to trunk ? seems to me (as just a plain user) far better than the current one in very way.
The matrix widget file is still not added (station-build-gui_v7.0-r21062.patch).
In addition, I wonder about airports.
Having them for other buildable things may be nice too, but I don't know whether there are any graphics for them (at least industries don't iirc).
Re: [Patch] Improved Build Station GUI [r19159]
I think that it could also be used for newobjects.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: [Patch] Improved Build Station GUI [r19159]
for that it would be extremely usefull.Terkhen wrote:I think that it could also be used for newobjects.
for example new graphics need 1 line of text for each view in in the current way. think of a newgrf that will add sound barrier graphics as new-objects, you end up with huge lists of text where you cant find back the graphics you want i guess.
Re: [Patch] Improved Build Station GUI [r19159]
I downloaded a few other patch versions, and found the widgets/station_type_matrix.cpp file. It appears to be very special purpose for station previewing.
The widget needs to be generalized first before being able to use it in an other context.
The widget needs to be generalized first before being able to use it in an other context.
Re: [Patch] Improved Build Station GUI [r19159]


Thank you for your Ideas!
Re: [Patch] Improved Build Station GUI [r19159]
Although I build the patch from scratch using the new NWidgetMatrix widget, I indeed used a lot of the ideas expressed here.Timmaexx wrote:Some parts of this Patch are now in trunk!
![]()
Thank you for your Ideas!
Thank you for your efforts.
Who is online
Users browsing this forum: No registered users and 7 guests