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 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 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 PeterN force-pushed the PeterN:show-coverage branch from ffe94aa to dfa21e9 Mar 30, 2019
@PeterN
Copy link
Member Author

PeterN commented Mar 30, 2019

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

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

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 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 PeterN:show-coverage branch from 1a6ba41 to 363ce58 Apr 6, 2019
@PeterN
Copy link
Member Author

PeterN commented Apr 6, 2019

Fixed up and rebased to master.

@PeterN PeterN force-pushed the PeterN:show-coverage branch from 363ce58 to 19587d0 Apr 10, 2019
@PeterN PeterN force-pushed the PeterN:show-coverage branch from 19587d0 to 86b925b Apr 22, 2019
src/viewport.cpp Outdated Show resolved Hide resolved
src/viewport_func.h Outdated Show resolved Hide resolved
@PeterN PeterN force-pushed the PeterN:show-coverage branch from 86b925b to 364a6fa Apr 22, 2019
@PeterN PeterN force-pushed the PeterN:show-coverage branch from 364a6fa to cdd5847 Apr 22, 2019
@PeterN
Copy link
Member Author

PeterN commented Apr 22, 2019

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

@nielsmh
Copy link
Contributor

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.
@PeterN PeterN force-pushed the PeterN:show-coverage branch from 7a20305 to b2888e0 Apr 25, 2019
@nielsmh nielsmh merged commit 81d335b into OpenTTD:master Apr 25, 2019
8 checks passed
8 checks passed
OpenTTD CI Build #20190425.2 succeeded
Details
OpenTTD CI (Linux commit-checker) Linux commit-checker succeeded
Details
OpenTTD CI (Linux linux-amd64-clang-3.8) Linux linux-amd64-clang-3.8 succeeded
Details
OpenTTD CI (Linux linux-amd64-gcc-6) Linux linux-amd64-gcc-6 succeeded
Details
OpenTTD CI (Linux linux-i386-gcc-6) Linux linux-i386-gcc-6 succeeded
Details
OpenTTD CI (MacOS) MacOS succeeded
Details
OpenTTD CI (Windows Win32) Windows Win32 succeeded
Details
OpenTTD CI (Windows Win64) Windows Win64 succeeded
Details
@PeterN PeterN deleted the PeterN:show-coverage branch Apr 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.