diff --git a/android/assets/jsons/Translations/Diplomacy,Trade,Nations.json b/android/assets/jsons/Translations/Diplomacy,Trade,Nations.json index ad973b2419..e5c0641f9a 100644 --- a/android/assets/jsons/Translations/Diplomacy,Trade,Nations.json +++ b/android/assets/jsons/Translations/Diplomacy,Trade,Nations.json @@ -1111,7 +1111,7 @@ Italian:"67% di probabilità di ottenere 25 Oro e reclutare un'unità barbara da un accampamento catturato. -25% mantenimento delle unità terrestri." French:"67% de chance de gagner 25 or et d'enroler une unité barbare lors de la prise d'un campement barbare. -25% de coût de maintenance pour les unités terrestres." Simplified_Chinese:"击败蛮族营地中的蛮族单位有67%几率得到25金钱并使其加入,陆上单位维护费-25%" - Russian:"Шанс 67% получить 25 Золото и варварский юнит из захваченного лагеря. -25% к стоимости содержания наземных юнитов. + Russian:"Шанс 67% получить 25 Золото и варварский юнит из захваченного лагеря. -25% к стоимости содержания наземных юнитов." } "India":{ diff --git a/android/build.gradle b/android/build.gradle index 9796b8b98f..873d6946ca 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -21,8 +21,8 @@ android { applicationId "com.unciv.app" minSdkVersion 14 targetSdkVersion 29 - versionCode 294 - versionName "3.0.1" + versionCode 295 + versionName "3.0.2" } // Had to add this crap for Travis to build, it wanted to sign the app diff --git a/core/src/com/unciv/ui/pickerscreens/PolicyPickerScreen.kt b/core/src/com/unciv/ui/pickerscreens/PolicyPickerScreen.kt index 2acba0a31a..57a119a52b 100644 --- a/core/src/com/unciv/ui/pickerscreens/PolicyPickerScreen.kt +++ b/core/src/com/unciv/ui/pickerscreens/PolicyPickerScreen.kt @@ -10,14 +10,15 @@ import com.unciv.models.gamebasics.GameBasics import com.unciv.models.gamebasics.Policy import com.unciv.models.gamebasics.tr import com.unciv.ui.utils.* +import com.unciv.ui.worldscreen.WorldScreen -class PolicyPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen() { - +class PolicyPickerScreen(val worldScreen: WorldScreen) : PickerScreen() { + internal val viewingCiv: CivilizationInfo = worldScreen.viewingCiv private var pickedPolicy: Policy? = null init { - val policies = civInfo.policies + val policies = viewingCiv.policies displayTutorials("PolicyPickerScreen") rightSideButton.setText("{Adopt policy}\r\n(".tr() + policies.storedCulture + "/" + policies.getCultureNeededForNextPolicy() + ")") @@ -30,14 +31,14 @@ class PolicyPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen( else onBackButtonClicked { UnCivGame.Current.setWorldScreen() } rightSideButton.onClick("policy") { - civInfo.policies.adopt(pickedPolicy!!) + viewingCiv.policies.adopt(pickedPolicy!!) // If we've moved to another screen in the meantime (great person pick, victory screen) ignore this if(game.screen !is PolicyPickerScreen || !policies.canAdoptPolicy()){ game.setWorldScreen() dispose() } - else game.screen = PolicyPickerScreen(civInfo) // update policies + else game.screen = PolicyPickerScreen(worldScreen) // update policies } if(!UnCivGame.Current.worldScreen.isPlayersTurn) rightSideButton.disable() @@ -78,10 +79,11 @@ class PolicyPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen( } private fun pickPolicy(policy: Policy) { - if (civInfo.policies.isAdopted(policy.name) + if (!worldScreen.isPlayersTurn + || viewingCiv.policies.isAdopted(policy.name) || policy.name.endsWith("Complete") - || !civInfo.policies.isAdoptable(policy) - || !civInfo.policies.canAdoptPolicy()) { + || !viewingCiv.policies.isAdoptable(policy) + || !viewingCiv.policies.canAdoptPolicy()) { rightSideButton.disable() } else { rightSideButton.enable() @@ -106,9 +108,9 @@ class PolicyPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen( policyButton = TextButton(policy.name.tr(), skin) } - if (civInfo.policies.isAdopted(policy.name)) { // existing + if (viewingCiv.policies.isAdopted(policy.name)) { // existing policyButton.color = Color.GREEN - } else if (!civInfo.policies.isAdoptable(policy)) + } else if (!viewingCiv.policies.isAdoptable(policy)) // non-available { policyButton.color = Color.GRAY diff --git a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt index e0978de4e3..f1c976b633 100644 --- a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt +++ b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt @@ -75,7 +75,7 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() { if(viewingCiv.policies.adoptedPolicies.isNotEmpty() || viewingCiv.policies.canAdoptPolicy()) { val policyScreenButton = Button(skin) policyScreenButton.add(ImageGetter.getImage("PolicyIcons/Constitution")).size(30f).pad(15f) - policyScreenButton.onClick { game.screen = PolicyPickerScreen(viewingCiv) } + policyScreenButton.onClick { game.screen = PolicyPickerScreen(this) } techPolicyandVictoryHolder.add(policyScreenButton).pad(10f) } @@ -186,7 +186,7 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() { if(!isSomethingOpen) { when { !gameInfo.oneMoreTurnMode && gameInfo.civilizations.any { it.victoryManager.hasWon() } -> game.screen = VictoryScreen() - viewingCiv.policies.freePolicies > 0 -> game.screen = PolicyPickerScreen(viewingCiv) + viewingCiv.policies.freePolicies > 0 -> game.screen = PolicyPickerScreen(this) viewingCiv.greatPeople.freeGreatPeople > 0 -> game.screen = GreatPersonPickerScreen() viewingCiv.tradeRequests.isNotEmpty() -> TradePopup(this) viewingCiv.popupAlerts.any() -> AlertPopup(this, viewingCiv.popupAlerts.first()) @@ -298,7 +298,7 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() { game.screen = TechPickerScreen(viewingCiv.tech.freeTechs != 0, viewingCiv) return@onClick } else if (viewingCiv.policies.shouldOpenPolicyPicker) { - game.screen = PolicyPickerScreen(viewingCiv) + game.screen = PolicyPickerScreen(this) viewingCiv.policies.shouldOpenPolicyPicker = false return@onClick } diff --git a/core/src/com/unciv/ui/worldscreen/optionstable/WorldScreenMenuTable.kt b/core/src/com/unciv/ui/worldscreen/optionstable/WorldScreenMenuTable.kt index c840f95f66..10a60bbf2c 100644 --- a/core/src/com/unciv/ui/worldscreen/optionstable/WorldScreenMenuTable.kt +++ b/core/src/com/unciv/ui/worldscreen/optionstable/WorldScreenMenuTable.kt @@ -105,7 +105,7 @@ class WorldScreenMenuTable(val worldScreen: WorldScreen) : PopupTable(worldScree return@addButton } try { - val game = OnlineMultiplayer().tryDownloadGame(gameId) + val game = OnlineMultiplayer().tryDownloadGame(gameId.trim()) UnCivGame.Current.loadGame(game) } catch (ex: Exception) { badGameIdLabel.setText("Could not download game!".tr())