-
-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Public roads type selector #758
Public roads type selector #758
Conversation
…bel to scenario terraforming GUI Currently does not display the selected roadtype, and generating public roads still uses the default roadtype.
…an optional RoadType
This looks pretty good. |
…pdown instead of just the name
…an option in the scenario road types dropdown
915f833
to
0dd9f3a
Compare
…d to the existing terraforming window
0dd9f3a
to
43c34ad
Compare
…lapping dropdown triangle
8fae371
to
7361b77
Compare
…e in terraform_gui.cpp
…in PublicRoadsWindow
… global name for GUI and implementation
…indow opened Such that selection occurs with current road types
I've pushed a few changes to tidy up some minor things. I'm not really convinced about the button opening two windows which are partially linked. This seems somewhat strange and unexpected from a user interface point of view. Generally the public roads function only needs to be used once when setting up a scenario, whereas the landscape tools may be used frequently. Having the public roads window pop up every time the landscape window is requested is not likely to be appreciated by all scenario editor users. |
There is some precedent with the terraforming toolbar being linked with the rail/road/etc toolbars, but I see what you mean. |
I've made the changes so that the scenario editor toolbar is used. If you're all right with things as they are, I'm happy to merge this. |
I'm fine with your changes, go ahead. |
Thanks for this |
Motivation / Problem
Kale suggested in #jgr-patch-pack on the Discord to be able to select the road type of public roads. This was in the context of preventing towns from building on public roads; not doing so leads to these weird "tentacles" of housing along the public road:
Selecting a road type that prevents houses from being built next to it solves this problem; as the town is serviced and grows it will preferentially select its town roads over the public roads to build houses next to.
Plus it looks nicer to not have the town road stretch for miles between towns sometimes 😛
Description
This PR adds the ability to select a road type for public roads in the scenario editor.
When you are in the scenario editor, and click on the landscape generation button, the public roads window will open with it. This public roads window can be closed separately, and reopens when you click the landscape generation button again. When you close the main landscape generation window, the public roads window will also close.
The dropdown allows you to select a public road type. When you click the "Build public roads" button, it will use the selected road type instead of the default.
Images
Vanilla
With U&RaTT, and custom font
Limitations
The default road type is initialized on first opening the window, and will not change until you pick a new road type. When you build towns a different road type will be used. It is recommended to build towns before public roads.
Weird things happen when the available road types changes when you change GRFs. (Intended? since changing GRFs is always weird anyway)
Allowing public road type selection in a new game would require adding a new setting that depends on the available road types before they are fully loaded (i.e. when I tried migrating my code from the scenario editor to the new game menu, it was extremely glitchy and didn't work). This would come in a new PR.
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.