diff --git a/android/src/com/unciv/game/AndroidLauncher.java b/android/src/com/unciv/app/AndroidLauncher.java similarity index 83% rename from android/src/com/unciv/game/AndroidLauncher.java rename to android/src/com/unciv/app/AndroidLauncher.java index 4bde36f300..fc038fceaa 100644 --- a/android/src/com/unciv/game/AndroidLauncher.java +++ b/android/src/com/unciv/app/AndroidLauncher.java @@ -11,6 +11,7 @@ public class AndroidLauncher extends AndroidApplication { protected void onCreate (Bundle savedInstanceState) { super.onCreate(savedInstanceState); AndroidApplicationConfiguration config = new AndroidApplicationConfiguration(); - initialize(new UnCivGame(), config); + String version = BuildConfig.VERSION_NAME; + initialize(new UnCivGame(version), config); } } diff --git a/core/src/com/unciv/UnCivGame.kt b/core/src/com/unciv/UnCivGame.kt index 199948fdd4..971f3f36c2 100644 --- a/core/src/com/unciv/UnCivGame.kt +++ b/core/src/com/unciv/UnCivGame.kt @@ -9,7 +9,7 @@ import com.unciv.ui.LanguagePickerScreen import com.unciv.ui.utils.ImageGetter import com.unciv.ui.worldscreen.WorldScreen -class UnCivGame : Game() { +class UnCivGame(val version: String) : Game() { var gameInfo: GameInfo = GameInfo() lateinit var settings : GameSettings diff --git a/core/src/com/unciv/logic/automation/Automation.kt b/core/src/com/unciv/logic/automation/Automation.kt index 52f6a19104..d41695c4fe 100644 --- a/core/src/com/unciv/logic/automation/Automation.kt +++ b/core/src/com/unciv/logic/automation/Automation.kt @@ -82,7 +82,7 @@ class Automation { && cityInfo.getTiles().any { it.isWater() && it.hasViewableResource(cityInfo.civInfo) && it.improvement == null } val isAtWar = cityInfo.civInfo.isAtWar() - val cityProduction = cityInfo.cityStats.currentCityStats.production.toFloat() + val cityProduction = cityInfo.cityStats.currentCityStats.production var buildingValues = HashMap() //Food buildings : Granary and lighthouse and hospital @@ -136,7 +136,7 @@ class Automation { //Wonders if (buildableWonders.isNotEmpty()) { val citiesBuildingWonders = cityInfo.civInfo.cities - .filter { it.cityConstructions.isBuildingWonder() }.size + .count { it.cityConstructions.isBuildingWonder() } val wonder = buildableWonders.getRandom() buildingValues[wonder.name] = wonder.cost / cityProduction * (citiesBuildingWonders + 1) / 5.0f } diff --git a/core/src/com/unciv/ui/pickerscreens/GreatPersonPickerScreen.kt b/core/src/com/unciv/ui/pickerscreens/GreatPersonPickerScreen.kt index 82b95b4616..f243914d10 100644 --- a/core/src/com/unciv/ui/pickerscreens/GreatPersonPickerScreen.kt +++ b/core/src/com/unciv/ui/pickerscreens/GreatPersonPickerScreen.kt @@ -5,7 +5,6 @@ import com.badlogic.gdx.scenes.scene2d.ui.Button import com.unciv.UnCivGame import com.unciv.logic.civilization.GreatPersonManager import com.unciv.models.gamebasics.GameBasics -import com.unciv.models.gamebasics.tr import com.unciv.models.gamebasics.unit.BaseUnit import com.unciv.ui.utils.ImageGetter import com.unciv.ui.utils.onClick diff --git a/core/src/com/unciv/ui/tilegroups/CityButton.kt b/core/src/com/unciv/ui/tilegroups/CityButton.kt index d3684dc5b8..05c93965ea 100644 --- a/core/src/com/unciv/ui/tilegroups/CityButton.kt +++ b/core/src/com/unciv/ui/tilegroups/CityButton.kt @@ -68,7 +68,6 @@ class CityButton(val city: CityInfo, internal val tileGroup: WorldTileGroup, ski } pack() setOrigin(Align.center) - toFront() touchable = Touchable.enabled } diff --git a/core/src/com/unciv/ui/worldscreen/optionstable/WorldScreenOptionsTable.kt b/core/src/com/unciv/ui/worldscreen/optionstable/WorldScreenOptionsTable.kt index 00e5a8d90d..3b65cceb30 100644 --- a/core/src/com/unciv/ui/worldscreen/optionstable/WorldScreenOptionsTable.kt +++ b/core/src/com/unciv/ui/worldscreen/optionstable/WorldScreenOptionsTable.kt @@ -60,6 +60,9 @@ class WorldScreenOptionsTable(screen:WorldScreen) : PopupTable(screen){ addSoundEffectsVolumeSlider() + add("Version".toLabel()) + add(UnCivGame.Current.version.toLabel()).row() + addButton("Close"){ remove() } pack() // Needed to show the background. diff --git a/desktop/src/com/unciv/app/desktop/DesktopLauncher.java b/desktop/src/com/unciv/app/desktop/DesktopLauncher.java index 1d56cd5314..402744a21d 100644 --- a/desktop/src/com/unciv/app/desktop/DesktopLauncher.java +++ b/desktop/src/com/unciv/app/desktop/DesktopLauncher.java @@ -20,6 +20,6 @@ class DesktopLauncher { TexturePacker.process(settings, "../images", ".", "game"); LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); - new LwjglApplication(new UnCivGame(), config); + new LwjglApplication(new UnCivGame("Desktop"), config); } } diff --git a/ios/src/com/unciv/game/IOSLauncher.java b/ios/src/com/unciv/app/IOSLauncher.java similarity index 89% rename from ios/src/com/unciv/game/IOSLauncher.java rename to ios/src/com/unciv/app/IOSLauncher.java index 4fbdc03c4d..e30fb35a68 100644 --- a/ios/src/com/unciv/game/IOSLauncher.java +++ b/ios/src/com/unciv/app/IOSLauncher.java @@ -10,7 +10,7 @@ class IOSLauncher extends IOSApplication.Delegate { @Override protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); - return new IOSApplication(new com.unciv.UnCivGame(), config); + return new IOSApplication(new com.unciv.UnCivGame("IOS"), config); } public static void main(String[] argv) {