From 4b2d4a38775f44c1e769913a68d7e2aa48a4d41c Mon Sep 17 00:00:00 2001 From: lishaoxia1985 <49801619+lishaoxia1985@users.noreply.github.com> Date: Mon, 6 Feb 2023 20:21:46 +0800 Subject: [PATCH] Gradle update, offerButton.isEnabled = false in initial (#8600) --- android/src/com/unciv/app/CustomFileLocationHelperAndroid.kt | 2 +- build.gradle.kts | 2 +- core/src/com/unciv/ui/trade/TradeTable.kt | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 5 +++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/android/src/com/unciv/app/CustomFileLocationHelperAndroid.kt b/android/src/com/unciv/app/CustomFileLocationHelperAndroid.kt index dcd680e9fe..567f5ffef3 100644 --- a/android/src/com/unciv/app/CustomFileLocationHelperAndroid.kt +++ b/android/src/com/unciv/app/CustomFileLocationHelperAndroid.kt @@ -28,7 +28,7 @@ class CustomFileLocationHelperAndroid(private val activity: Activity) : CustomFi cursor.use { // we should have a direct URI to a file, so first is enough if (it?.moveToFirst() == true) { - it.getString(it.getColumnIndex(OpenableColumns.DISPLAY_NAME)) + it.getString(it.getColumnIndexOrThrow(OpenableColumns.DISPLAY_NAME)) } else "" } } diff --git a/build.gradle.kts b/build.gradle.kts index 72fb997de7..58d373f72c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -23,7 +23,7 @@ buildscript { dependencies { classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${com.unciv.build.BuildConfig.kotlinVersion}") classpath("de.richsource.gradle.plugins:gwt-gradle-plugin:0.6") - classpath("com.android.tools.build:gradle:7.1.3") + classpath("com.android.tools.build:gradle:7.4.1") classpath("com.mobidevelop.robovm:robovm-gradle-plugin:2.3.1") } } diff --git a/core/src/com/unciv/ui/trade/TradeTable.kt b/core/src/com/unciv/ui/trade/TradeTable.kt index 1e73c56b42..5d5b66cce9 100644 --- a/core/src/com/unciv/ui/trade/TradeTable.kt +++ b/core/src/com/unciv/ui/trade/TradeTable.kt @@ -10,13 +10,13 @@ import com.unciv.ui.utils.extensions.isEnabled import com.unciv.ui.utils.extensions.onClick import com.unciv.ui.utils.extensions.toTextButton -class TradeTable(val otherCivilization: Civilization, stage: DiplomacyScreen): Table(BaseScreen.skin) { +class TradeTable(private val otherCivilization: Civilization, stage: DiplomacyScreen): Table(BaseScreen.skin) { val currentPlayerCiv = otherCivilization.gameInfo.getCurrentPlayerCivilization() var tradeLogic = TradeLogic(currentPlayerCiv,otherCivilization) var offerColumnsTable = OfferColumnsTable(tradeLogic, stage) { onChange() } // This is so that after a trade has been traded, we can switch out the offersToDisplay to start anew - this is the easiest way private var offerColumnsTableWrapper = Table() - val offerButton = "Offer trade".toTextButton() + private val offerButton = "Offer trade".toTextButton().apply{ isEnabled = false } private fun isTradeOffered() = otherCivilization.tradeRequests.any { it.requestingCiv == currentPlayerCiv.civName } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ffed3a254e..0a4a206e4c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Mon Feb 06 15:51:42 CST 2023 distributionBase=GRADLE_USER_HOME +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip -zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME