mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-21 13:18:56 +07:00
Fixed problem with selecting city constructions option and AutoPlay (#11516)
This commit is contained in:
@ -35,6 +35,7 @@ import com.unciv.ui.components.extensions.withoutItem
|
|||||||
import com.unciv.ui.components.fonts.Fonts
|
import com.unciv.ui.components.fonts.Fonts
|
||||||
import com.unciv.ui.screens.civilopediascreen.CivilopediaCategories
|
import com.unciv.ui.screens.civilopediascreen.CivilopediaCategories
|
||||||
import com.unciv.ui.screens.civilopediascreen.FormattedLine
|
import com.unciv.ui.screens.civilopediascreen.FormattedLine
|
||||||
|
import com.unciv.ui.screens.worldscreen.WorldScreen
|
||||||
import kotlin.math.ceil
|
import kotlin.math.ceil
|
||||||
import kotlin.math.min
|
import kotlin.math.min
|
||||||
import kotlin.math.roundToInt
|
import kotlin.math.roundToInt
|
||||||
@ -709,7 +710,7 @@ class CityConstructions : IsPartOfGameInfoSerialization {
|
|||||||
val isCurrentPlayersTurn = city.civ.gameInfo.isUsersTurn()
|
val isCurrentPlayersTurn = city.civ.gameInfo.isUsersTurn()
|
||||||
|| !city.civ.gameInfo.gameParameters.isOnlineMultiplayer
|
|| !city.civ.gameInfo.gameParameters.isOnlineMultiplayer
|
||||||
if ((isCurrentPlayersTurn && (UncivGame.Current.settings.autoAssignCityProduction
|
if ((isCurrentPlayersTurn && (UncivGame.Current.settings.autoAssignCityProduction
|
||||||
|| UncivGame.Current.settings.autoPlay.fullAutoPlayAI)) // only automate if the active human player has the setting to automate production
|
|| UncivGame.Current.worldScreen!!.autoPlay.isAutoPlayingAndFullAutoPlayAI())) // only automate if the active human player has the setting to automate production
|
||||||
|| !city.civ.isHuman() || city.isPuppet) {
|
|| !city.civ.isHuman() || city.isPuppet) {
|
||||||
ConstructionAutomation(this).chooseNextConstruction()
|
ConstructionAutomation(this).chooseNextConstruction()
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ class AutoPlay(private var autoPlaySettings: GameSettings.GameSettingsAutoPlay)
|
|||||||
|
|
||||||
fun isAutoPlaying(): Boolean = turnsToAutoPlay > 0 || autoPlayTurnInProgress
|
fun isAutoPlaying(): Boolean = turnsToAutoPlay > 0 || autoPlayTurnInProgress
|
||||||
|
|
||||||
fun fullAutoPlayAI(): Boolean = isAutoPlaying() && autoPlaySettings.fullAutoPlayAI
|
fun isAutoPlayingAndFullAutoPlayAI(): Boolean = isAutoPlaying() && autoPlaySettings.fullAutoPlayAI
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true if we should play at least 1 more turn and we are not currenlty processing any AutoPlay
|
* @return true if we should play at least 1 more turn and we are not currenlty processing any AutoPlay
|
||||||
|
Reference in New Issue
Block a user