mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-08 01:54:02 +07:00
Fix of the click on unknown civilization (#1989)
* Fix of the click on unknown civilization * Minor optimization * Better naming of variable
This commit is contained in:
parent
13d50f250c
commit
eb0fd17d9b
@ -70,13 +70,14 @@ class CityButton(val city: CityInfo, internal val tileGroup: WorldTileGroup, ski
|
||||
// clicking swings the button a little down to allow selection of units there.
|
||||
// this also allows to target selected units to move to the city tile from elsewhere.
|
||||
if (isButtonMoved) {
|
||||
val viewingCiv = UncivGame.Current.worldScreen.viewingCiv
|
||||
// second tap on the button will go to the city screen
|
||||
// if this city belongs to you
|
||||
if (UncivGame.Current.viewEntireMapForDebug || belongsToViewingCiv()) {
|
||||
UncivGame.Current.setScreen(CityScreen(city))
|
||||
} else {
|
||||
} else if (viewingCiv.knows(city.civInfo)) {
|
||||
// If city doesn't belong to you, go directly to its owner's diplomacy screen.
|
||||
val screen = DiplomacyScreen(UncivGame.Current.worldScreen.viewingCiv)
|
||||
val screen = DiplomacyScreen(viewingCiv)
|
||||
screen.updateRightSide(city.civInfo)
|
||||
UncivGame.Current.setScreen(screen)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user