Skip to content
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

Change: always allow to click on the toolbar icons for road/rail/dock/airport #8521

Merged
merged 4 commits into from Jan 8, 2021

Conversation

TrueBrain
Copy link
Member

@TrueBrain TrueBrain commented Jan 7, 2021

Fixes #8055.
Closes #8063.

Motivation / Problem

This is my take on #8055. I somewhat disagree with comments made in #8063, and I think not allowing people to build roads when the server has max-road-vehicles set to zero is silly. Expecting the user to change a GUI setting before he can, I do not see the point in that.

Description

This change allows a user to see what is available and what will become
available before it is available, instead of only disabling the button
with no further explanation. It also always allows building roads and
canals, even if no vehicles are available for road / water.

For rail/road/tram, a dropdown with available types is shown. If
none are available, it reads "None". If the type is not yet available,
it is greyed out.

For dock/airport, this always open the toolbar, but building airports,
docks, and depots buttons are disabled till vehicles are available
for those.

Road is the only exception, with the primary road always being
available. Here too, stations and depots are disabled till vehicles
become available. It does mean you can now always build roads to
for example help towns grow.

Disabled buttons show on their tooltip why they are disabled.

Imported 2 commits from #8063. With the removing of disable_unsuitable_building setting, CanBuildVehicleInfrastructure() now does much more what the name suggest, and how it is, with this PR, used in the code.

image

Limitations

  • I did make this consistent, which means that for airports this is slightly weird.
  • Removing the disable_unsuitable_building setting means there is now no way to already start building rail before engines are available. This might result in some people complaining about that.

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

@TrueBrain TrueBrain added the preview This PR is receiving preview builds label Jan 7, 2021
@DorpsGek DorpsGek temporarily deployed to preview-pr-8521 January 7, 2021 21:37 Inactive
@TrueBrain TrueBrain marked this pull request as ready for review January 7, 2021 22:07
@DorpsGek DorpsGek temporarily deployed to preview-pr-8521 January 7, 2021 22:07 Inactive
@DorpsGek DorpsGek temporarily deployed to preview-pr-8521 January 7, 2021 22:11 Inactive
@TrueBrain TrueBrain added this to the 1.11.0 milestone Jan 7, 2021
src/dock_gui.cpp Outdated Show resolved Hide resolved
@DorpsGek DorpsGek temporarily deployed to preview-pr-8521 January 7, 2021 22:53 Inactive
@DorpsGek DorpsGek temporarily deployed to preview-pr-8521 January 8, 2021 10:25 Inactive
@hpiirai
Copy link
Contributor

hpiirai commented Jan 8, 2021

I can see one problem with this change: Road stops can be useful for extending the coverage area of a station. This version removes that functionality when, for example, ships are available, but road vehicles are not.

@TrueBrain
Copy link
Member Author

I can see one problem with this change: Road stops can be useful for extending the coverage area of a station. This version removes that functionality when, for example, ships are available, but road vehicles are not.

So your complaint is that you can no longer by cheesy with road stations? :D

I guess what you mention is true, if you knew the GUI option, you could profit from this. Not sure it is a bad thing that we put everyone on the same level here. From a gameplay perspective, do you think this is a loss of functionality? Or more in the lines of fixing a way you could somewhat abuse the game? (honest question, looking for opinions)

@hpiirai
Copy link
Contributor

hpiirai commented Jan 8, 2021

I don’t really have an opinion on this. I can live without this slight abuse of the game, but I might believe that there are people who think otherwise.

@frosch123
Copy link
Member

For that purpose there are station NewGRF which add station tiles that look like regular houses. Point them to those instead.

src/road_gui.cpp Outdated Show resolved Hide resolved
TrueBrain and others added 4 commits January 8, 2021 16:30
…/airport

This change allows a user to see what is available and what will become
available before it is available, instead of only disabling the button
with no further explanation. It also always allows building roads and
canals, even if no vehicles are available for road / water.

For rail/road/tram, a dropdown with available types is shown. If
none are available, it reads "None". If the type is not yet available,
it is greyed out.

For dock/airport, this always open the toolbar, but building airports,
docks, and depots buttons are disabled till vehicles are available
for those.

Road is the only exception, with the primary road always being
available. Here too, stations and depots are disabled till vehicles
become available. It does mean you can now always build roads to
for example help towns grow.
This setting is no longer useful, as you can now always build roads,
canals, etc.
@DorpsGek DorpsGek temporarily deployed to preview-pr-8521 January 8, 2021 15:31 Inactive
@2TallTyler
Copy link
Member

Station tiles would require trains to be available. In my experience, the most common edge case where only ships and/or aircraft are available is a year 1700 start game using the Sailing Ships NewGRF. But there are several road vehicle sets which offer horse-drawn road vehicles at these early dates, including eGRVTS and Timberwolf's Road Vehicles, so I'm not sure this is a huge concern. I can't think of any scenarios where only aircraft would be available!

@TrueBrain TrueBrain merged commit 188bf0f into OpenTTD:master Jan 8, 2021
@TrueBrain TrueBrain deleted the toolbar-fixes branch January 8, 2021 15:43
@James103
Copy link
Contributor

James103 commented Jan 8, 2021

@2TallTyler An example would be if you load up the following newgrf (and nothing else) and start in 1700:

[game_creation]
starting_year = 1700

[newgrf]
54540101|E8E0A1499127415BF8D2F6AA0B065083|kaaskrokets_fictional_aircraft-1.0.2\kaas_planes.grf = 16777215

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preview This PR is receiving preview builds
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Road Construction UI unavailable
7 participants