mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 22:37:02 -04:00
Added popup for "move and attack" bug that I can't figure out
This commit is contained in:
parent
f38da59fe9
commit
a5e1978a71
@ -97,7 +97,8 @@ class LoadScreen : PickerScreen() {
|
|||||||
catch (ex:Exception){
|
catch (ex:Exception){
|
||||||
val popup = PopupTable(this)
|
val popup = PopupTable(this)
|
||||||
popup.addGoodSizedLabel("It looks like your saved game can't be loaded!").row()
|
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("If you could copy your game data (\"Copy saved game to clipboard\" - ").row()
|
||||||
|
popup.addGoodSizedLabel(" 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.addGoodSizedLabel("I could maybe help you figure out what went wrong, since this isn't supposed to happen!").row()
|
||||||
popup.open()
|
popup.open()
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ import com.unciv.models.gamebasics.tr
|
|||||||
import com.unciv.models.gamebasics.unit.UnitType
|
import com.unciv.models.gamebasics.unit.UnitType
|
||||||
import com.unciv.ui.utils.*
|
import com.unciv.ui.utils.*
|
||||||
import com.unciv.ui.worldscreen.WorldScreen
|
import com.unciv.ui.worldscreen.WorldScreen
|
||||||
|
import com.unciv.ui.worldscreen.optionstable.PopupTable
|
||||||
import kotlin.math.max
|
import kotlin.math.max
|
||||||
|
|
||||||
class BattleTable(val worldScreen: WorldScreen): Table() {
|
class BattleTable(val worldScreen: WorldScreen): Table() {
|
||||||
@ -151,9 +152,21 @@ class BattleTable(val worldScreen: WorldScreen): Table() {
|
|||||||
if(attackableEnemy == null) attackButton.disable()
|
if(attackableEnemy == null) attackButton.disable()
|
||||||
else {
|
else {
|
||||||
attackButton.onClick {
|
attackButton.onClick {
|
||||||
battle.moveAndAttack(attacker,attackableEnemy!!)
|
try {
|
||||||
worldScreen.tileMapHolder.removeUnitActionOverlay=true // the overlay was one of attacking
|
battle.moveAndAttack(attacker, attackableEnemy)
|
||||||
worldScreen.shouldUpdate=true
|
worldScreen.tileMapHolder.removeUnitActionOverlay = true // the overlay was one of attacking
|
||||||
|
worldScreen.shouldUpdate = true
|
||||||
|
}
|
||||||
|
catch (ex:Exception){
|
||||||
|
val popup = PopupTable(worldScreen)
|
||||||
|
popup.addGoodSizedLabel("You've encountered a bug that I've been looking for for a while!").row()
|
||||||
|
popup.addGoodSizedLabel("If you could copy your game data (\"Copy saved game to clipboard\" - ").row()
|
||||||
|
popup.addGoodSizedLabel(" paste into an email to yairm210@hotmail.com)").row()
|
||||||
|
popup.addGoodSizedLabel("It would help me figure out what went wrong, since this isn't supposed to happen!").row()
|
||||||
|
popup.addGoodSizedLabel("If you could tell me which unit was selected and which unit you tried to attack,").row()
|
||||||
|
popup.addGoodSizedLabel(" that would be even better!").row()
|
||||||
|
popup.open()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user