mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 21:35:14 -04:00
Added a popup when trying and faiing to load a game, so people will send me emails when this happens
This commit is contained in:
parent
881f532bf7
commit
aea7d750fd
@ -96,7 +96,7 @@ class CityExpansionManager {
|
||||
}
|
||||
|
||||
fun takeOwnership(tileInfo: TileInfo){
|
||||
if(tileInfo.isCityCenter()) throw Exception("What?")
|
||||
if(tileInfo.isCityCenter()) throw Exception("What?!")
|
||||
if(tileInfo.getCity()!=null) tileInfo.getCity()!!.expansion.relinquishOwnership(tileInfo)
|
||||
|
||||
cityInfo.tiles = cityInfo.tiles.withItem(tileInfo.position)
|
||||
|
@ -11,6 +11,7 @@ import com.unciv.logic.GameSaver
|
||||
import com.unciv.models.gamebasics.tr
|
||||
import com.unciv.ui.pickerscreens.PickerScreen
|
||||
import com.unciv.ui.utils.*
|
||||
import com.unciv.ui.worldscreen.optionstable.PopupTable
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
@ -91,8 +92,17 @@ class LoadScreen : PickerScreen() {
|
||||
topTable.add(rightSideTable)
|
||||
|
||||
rightSideButton.onClick {
|
||||
try {
|
||||
UnCivGame.Current.loadGame(selectedSave)
|
||||
}
|
||||
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.open()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ class IdleUnitButton (internal val unitTable: UnitTable,
|
||||
enable()
|
||||
onClick {
|
||||
val tilesWithIdleUnits = getTilesWithIdleUnits()
|
||||
|
||||
if(tilesWithIdleUnits.isEmpty()) return@onClick
|
||||
val tileToSelect: TileInfo
|
||||
if (unitTable.selectedUnit==null || !tilesWithIdleUnits.contains(unitTable.selectedUnit!!.getTile()))
|
||||
tileToSelect = tilesWithIdleUnits[0]
|
||||
|
Loading…
x
Reference in New Issue
Block a user