Continuation of #590 - "Machu Picchu" instead of "Machu Pichu"

Changed info in saved games to fit the change
This commit is contained in:
Yair Morgenstern 2019-03-21 12:53:41 +02:00
parent 3f6dead4c6
commit 775055902f
13 changed files with 44 additions and 26 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -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}

View File

@ -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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 940 KiB

After

Width:  |  Height:  |  Size: 940 KiB

View File

@ -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

View File

@ -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()
}
}

View File

@ -17,7 +17,7 @@ class CityConstructions {
@Transient private var builtBuildingObjects=ArrayList<Building>()
var builtBuildings = ArrayList<String>()
private val inProgressConstructions = HashMap<String, Int>()
val inProgressConstructions = HashMap<String, Int>()
var currentConstruction: String = "Monument" // default starting building!
//region pure functions

View File

@ -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

View File

@ -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()
}
}

View File

@ -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()
}
}

View File

@ -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)