diff --git a/android/Images/BuildingIcons/Machu Picchu.png b/android/Images/BuildingIcons/Machu Picchu.png index 81438f767c..f229990d24 100644 Binary files a/android/Images/BuildingIcons/Machu Picchu.png and b/android/Images/BuildingIcons/Machu Picchu.png differ diff --git a/android/Images/TileSets/Default/City.png b/android/Images/TileSets/Default/CityOverlay.png similarity index 100% rename from android/Images/TileSets/Default/City.png rename to android/Images/TileSets/Default/CityOverlay.png diff --git a/android/Images/TileSets/ThorfMaps/City.png b/android/Images/TileSets/ThorfMaps/CityOverlay.png similarity index 100% rename from android/Images/TileSets/ThorfMaps/City.png rename to android/Images/TileSets/ThorfMaps/CityOverlay.png diff --git a/android/assets/GameSettingsOld.json b/android/assets/GameSettingsOld.json new file mode 100644 index 0000000000..3dd822754d --- /dev/null +++ b/android/assets/GameSettingsOld.json @@ -0,0 +1 @@ +{showWorkedTiles:true,resolution:900x600,tutorialsShown:[OtherCivEncountered,CityFounded,BarbarianEncountered,ContactMe,TechPickerScreen,CityEntered,AfterCityEntered,EnemyCity,GoldenAge,SecondCity,LuxuryResource,StrategicResource,Unhappiness,NewGame,TileLayout,UnitSelected,TileClicked,InjuredUnits,WorkerTrained,CanEmbark,SiegeUnitTrained,EnemyCityNeedsConqueringWithMeleeUnit,NextTurn,PolicyPickerScreen,CityRange,ApolloProgram],soundEffectsVolume:0.1,tileSet:ThorfMaps} \ No newline at end of file diff --git a/android/assets/game.atlas b/android/assets/game.atlas index e40cb27607..30f278a5bf 100644 --- a/android/assets/game.atlas +++ b/android/assets/game.atlas @@ -249,7 +249,7 @@ BuildingIcons/Lighthouse orig: 100, 100 offset: 0, 0 index: -1 -BuildingIcons/Machu Pichu +BuildingIcons/Machu Picchu rotate: false xy: 336, 231 size: 100, 100 @@ -664,7 +664,7 @@ ImprovementIcons/Camp index: -1 ImprovementIcons/City ruins rotate: false - xy: 306, 844 + xy: 306, 946 size: 100, 100 orig: 100, 100 offset: 0, 0 @@ -1406,7 +1406,7 @@ StatIcons/Acquire index: -1 StatIcons/CityConnection rotate: false - xy: 306, 742 + xy: 306, 844 size: 100, 100 orig: 100, 100 offset: 0, 0 @@ -2020,16 +2020,16 @@ TechIcons/Writing orig: 100, 100 offset: 0, 0 index: -1 -TileSets/Default/City +TileSets/Default/CityOverlay rotate: false - xy: 306, 946 + xy: 306, 742 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -TileSets/ThorfMaps/City +TileSets/ThorfMaps/CityOverlay rotate: false - xy: 306, 946 + xy: 306, 742 size: 100, 100 orig: 100, 100 offset: 0, 0 diff --git a/android/assets/game.png b/android/assets/game.png index 1f279dd3fb..af52387b1a 100644 Binary files a/android/assets/game.png and b/android/assets/game.png differ diff --git a/android/build.gradle b/android/build.gradle index 14b50aeb7e..1a93956b0f 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -21,8 +21,8 @@ android { applicationId "com.unciv.app" minSdkVersion 14 targetSdkVersion 28 - versionCode 217 - versionName "2.13.15" + versionCode 218 + versionName "2.14.0" } // Had to add this crap for Travis to build, it wanted to sign the app diff --git a/core/src/com/unciv/logic/GameInfo.kt b/core/src/com/unciv/logic/GameInfo.kt index d1c26eea12..008d1ab76d 100644 --- a/core/src/com/unciv/logic/GameInfo.kt +++ b/core/src/com/unciv/logic/GameInfo.kt @@ -106,6 +106,8 @@ class GameInfo { tileMap.placeUnitNearTile(tile!!.position, unit, getBarbarianCivilization()) } + // All cross-game data which needs to be altered (e.g. when removing or changing a name of a building/tech) + // will be done here, and not in CivInfo.setTransients or CityInfo fun setTransients() { tileMap.gameInfo = this tileMap.setTransients() @@ -122,15 +124,14 @@ class GameInfo { if(getCurrentPlayerCivilization().difficulty!="Chieftain") difficulty= getCurrentPlayerCivilization().difficulty - for (civInfo in civilizations) civInfo.setTransients() - + // We have to remove all deprecated buildings from all cities BEFORE we update a single one, or run setTransients on the civs, + // because updating leads to getting the building uniques from the civ info, + // which in turn leads to us trying to get info on all the building in all the cities... + // which can fail if there's an "unregistered" building anywhere for (civInfo in civilizations) { - // we have to remove hydro plants from all cities BEFORE we update a single one, - // because updating leads to getting the building uniques from the civ info, - // which in turn leads to us trying to get info on all the building in all the cities... - // which can fail i there's an "unregistered" building anywhere for (cityInfo in civInfo.cities) { val cityConstructions = cityInfo.cityConstructions + // As of 2.9.6, removed hydro plant, since it requires rivers, which we do not yet have if ("Hydro Plant" in cityConstructions.builtBuildings) cityConstructions.builtBuildings.remove("Hydro Plant") @@ -138,8 +139,22 @@ class GameInfo { cityConstructions.currentConstruction = "" cityConstructions.chooseNextConstruction() } - } + // As of 2.14.1, changed Machu Pichu to Machu Picchu + val oldMachuName = "Machu Pichu" + val newMachuName = "Machu Picchu" + cityConstructions.builtBuildings.replaceAll { if (it == oldMachuName) newMachuName else it } + if (cityConstructions.currentConstruction == oldMachuName) + cityConstructions.currentConstruction = newMachuName + if (cityConstructions.inProgressConstructions.containsKey(oldMachuName)) { + cityConstructions.inProgressConstructions[newMachuName] = cityConstructions.inProgressConstructions[oldMachuName]!! + cityConstructions.inProgressConstructions.remove(oldMachuName) + } + } + } + + for (civInfo in civilizations) civInfo.setTransients() + for (civInfo in civilizations){ for (cityInfo in civInfo.cities) cityInfo.cityStats.update() } } diff --git a/core/src/com/unciv/logic/city/CityConstructions.kt b/core/src/com/unciv/logic/city/CityConstructions.kt index eec666d1bc..3a62c958d7 100644 --- a/core/src/com/unciv/logic/city/CityConstructions.kt +++ b/core/src/com/unciv/logic/city/CityConstructions.kt @@ -17,7 +17,7 @@ class CityConstructions { @Transient private var builtBuildingObjects=ArrayList() var builtBuildings = ArrayList() - private val inProgressConstructions = HashMap() + val inProgressConstructions = HashMap() var currentConstruction: String = "Monument" // default starting building! //region pure functions diff --git a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt index b5a8610e67..135979044a 100644 --- a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt +++ b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt @@ -339,6 +339,8 @@ class CivilizationInfo { diplomacy.values.forEach { it.civInfo=this} victoryManager.civInfo=this + + // As of 2.11.3 scienceVictory is deprecated if(victoryManager.currentsSpaceshipParts.values.sum() == 0 && scienceVictory.currentParts.values.sum()>0) victoryManager.currentsSpaceshipParts = scienceVictory.currentParts diff --git a/core/src/com/unciv/ui/pickerscreens/TechPickerScreen.kt b/core/src/com/unciv/ui/pickerscreens/TechPickerScreen.kt index c442d4c1d9..d5b227f9f4 100644 --- a/core/src/com/unciv/ui/pickerscreens/TechPickerScreen.kt +++ b/core/src/com/unciv/ui/pickerscreens/TechPickerScreen.kt @@ -74,10 +74,10 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen() selectTechnology(tech) }catch (ex:Exception){ val popup = PopupTable(this) - popup.addGoodSizedLabel("You've encountered an error that I've been trying to pin down for a while.") - popup.addGoodSizedLabel("If you could copy your game data (menu-save game-copy to clipboard - paste into an email to yairm210@hotmail.com)") - popup.addGoodSizedLabel("That would be really helpful to me, thanks!") - popup.addGoodSizedLabel("If you also add what tech you clicked on to get this error that would be even better!") + popup.addGoodSizedLabel("You've encountered an error that I've been trying to pin down for a while.").row() + popup.addGoodSizedLabel("If you could copy your game data (menu-save game-copy to clipboard - paste into an email to yairm210@hotmail.com)").row() + popup.addGoodSizedLabel("That would be really helpful to me, thanks!").row() + popup.addGoodSizedLabel("If you also add what tech you clicked on to get this error that would be even better!").row() popup.open() } } diff --git a/core/src/com/unciv/ui/saves/LoadScreen.kt b/core/src/com/unciv/ui/saves/LoadScreen.kt index ed90b043d0..8f0a8b8af7 100644 --- a/core/src/com/unciv/ui/saves/LoadScreen.kt +++ b/core/src/com/unciv/ui/saves/LoadScreen.kt @@ -97,9 +97,9 @@ class LoadScreen : PickerScreen() { } catch (ex:Exception){ val popup = PopupTable(this) - popup.addGoodSizedLabel("It looks like your saved game can't be loaded!") - popup.addGoodSizedLabel("If you could copy your game data (\"Copy saved game to clipboard\" - paste into an email to yairm210@hotmail.com)") - popup.addGoodSizedLabel("I could maybe help you figure out what went wrong, since this isn't supposed to happen!") + popup.addGoodSizedLabel("It looks like your saved game can't be loaded!").row() + popup.addGoodSizedLabel("If you could copy your game data (\"Copy saved game to clipboard\" - paste into an email to yairm210@hotmail.com)").row() + popup.addGoodSizedLabel("I could maybe help you figure out what went wrong, since this isn't supposed to happen!").row() popup.open() } } diff --git a/core/src/com/unciv/ui/tilegroups/TileGroup.kt b/core/src/com/unciv/ui/tilegroups/TileGroup.kt index dd74d8091f..7b559ddfd3 100644 --- a/core/src/com/unciv/ui/tilegroups/TileGroup.kt +++ b/core/src/com/unciv/ui/tilegroups/TileGroup.kt @@ -225,11 +225,11 @@ open class TileGroup(var tileInfo: TileInfo) : Group() { } private fun updateCityImage() { - if(!ImageGetter.imageExists(tileSetLocation+"City")) // have a city tile, don't need an overlay + if(!ImageGetter.imageExists(tileSetLocation+"CityOverlay")) // have a city tile, don't need an overlay return if (cityImage == null && tileInfo.isCityCenter()) { - cityImage = ImageGetter.getImage(tileSetLocation+"City") + cityImage = ImageGetter.getImage(tileSetLocation+"CityOverlay") featureLayerGroup.addActor(cityImage) cityImage!!.run { setSize(60f, 60f)