Skip to content

Gate CityView behind own/spy/spectator and fix spectator city select - #15387

Closed
Fanfblrik wants to merge 1 commit into
yairm210:masterfrom
Fanfblrik:feature/spectator-city-select-rebased
Closed

Gate CityView behind own/spy/spectator and fix spectator city select#15387
Fanfblrik wants to merge 1 commit into
yairm210:masterfrom
Fanfblrik:feature/spectator-city-select-rebased

Conversation

@Fanfblrik

Copy link
Copy Markdown
Contributor

Summary

  • Follow-up to the review on closed allow spectator to select city #15376 and the tryGetCityView work in RFC: Views #15280. Replaces Gate CityView behind own/spy/spectator and fix spectator city select #15386 (rebased onto current master after selectedGameView / FoW unification).
  • CityView can only be constructed when the viewer owns the city, has a set-up spy there, or is a spectator (require(canSeeInternals())). UI opens CityScreen through tryGetCityView / GameView.tryGetCityView, so an unauthorized CityScreen cannot be created.
  • Spectator city selection on the map (first click / tile click, like units) uses ForeignCityView.canSelectOnMap() instead of an isSpectator() special-case in CityButton. Spies still cannot select a foreign city as the WorldScreen attacker (bombard), only open it via tryGetCityView.

Test plan

  • As spectator, first-click a city button: city is selected in the unit table (name, strength, bombard stats)
  • Second-click / right-click: CityScreen opens
  • Click the city tile (not the button): same selection as own-civ click-to-select
  • As a normal player, own cities still select and open as before
  • Foreign city without a set-up spy: no CityScreen, diplomacy/info popup as before
  • Set-up spy: View / second click opens CityScreen; first click does not select that city for bombard
  • Notification / overview / capital hotkey / improvement picker city links still open CityScreen for allowed cities only

Follows review on yairm210#15376: CityScreen is only reachable via tryGetCityView, and map selection uses ForeignCityView.canSelectOnMap instead of an isSpectator special-case in CityButton.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@Fanfblrik

Copy link
Copy Markdown
Contributor Author

Superseded by a rebased PR after master CityScreen/TileView migration conflicts: will link the new PR once created.

Made with Cursor

@Fanfblrik

Copy link
Copy Markdown
Contributor Author

Superseded by #15389 (rebased onto current master after CityScreen/TileView migration conflicts).

@Fanfblrik

Copy link
Copy Markdown
Contributor Author

Closed in favor of #15389.

@Fanfblrik Fanfblrik closed this Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant