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

Feature: Show coverage area for existing stations and towns #7446

Merged
merged 3 commits into from Apr 25, 2019

Conversation

@PeterN
Copy link
Member

@PeterN PeterN commented Mar 30, 2019

This PR adds the following:

  • Button in station window to toggle showing coverage area.
  • Button in town window to toggle showing covered tiles.
  • When placing a new station part, if the part would touch an existing station, that station's coverage area is drawn.
@andythenorth
Copy link
Contributor

@andythenorth andythenorth commented Mar 30, 2019

Station with coverage toggled off. After closing the window, coverage is shown.

7446_close_bug_1

7446_close_bug_2

@PeterN
Copy link
Member Author

@PeterN PeterN commented Mar 30, 2019

Logic fail. Logic now tweaked. Logic better. (I hope.)

@PeterN PeterN force-pushed the show-coverage branch 2 times, most recently from dccdbb0 to 5126218 Mar 31, 2019
@andythenorth
Copy link
Contributor

@andythenorth andythenorth commented Apr 6, 2019

Caught a bug:

  • find an existing rail station, but do not open the station window
  • open the station construction tool and add one or more tiles directly to the existing station
  • coverage will correctly be shown
  • leave the mouse hovered over the station, then use esc to clear the construction tool
  • coverage will continue to be shown, it should be cleared at this point

@andythenorth
Copy link
Contributor

@andythenorth andythenorth commented Apr 6, 2019

Works for me.

There's a case where coverage turns off when station building tools are selected. It's kind of unexpected, but it's consistent and not broken.

@PeterN PeterN force-pushed the show-coverage branch from 1a6ba41 to 363ce58 Apr 6, 2019
@PeterN
Copy link
Member Author

@PeterN PeterN commented Apr 6, 2019

Fixed up and rebased to master.

src/viewport.cpp Outdated Show resolved Hide resolved
src/viewport_func.h Outdated Show resolved Hide resolved
@PeterN
Copy link
Member Author

@PeterN PeterN commented Apr 22, 2019

Updated so that town coverage (if shown) stays on when placing a station.

@nielsmh
Copy link
Contributor

@nielsmh nielsmh commented Apr 24, 2019

Two minor issues:

  • Pushing Ctrl while building a station, and the station is in a would-join position does not remove the would-be-joined-to station's coverage immediately, but if you move the selection to a different tile and back while holding Ctrl it no longer shows the would-be-joined-to station's coverage. Same if you release Ctrl.
  • Hovering over the "Build a separate station" option in the "Join station" window highlights the coverage of the first station in the list, instead of showing only the new station coverage.

@nielsmh nielsmh merged commit 81d335b into OpenTTD:master Apr 25, 2019
8 checks passed
@PeterN PeterN deleted the show-coverage branch Apr 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants