Resolved #424 - added confirm box when declaring war

This commit is contained in:
Yair Morgenstern 2019-01-23 20:16:34 +02:00
parent b60df3ce85
commit a4175438a3
2 changed files with 4 additions and 3 deletions

View File

@ -750,8 +750,6 @@
"Stopped population growth":{}
"In resistance for another [numberOfTurns] turns":{}
// todo
// Tech picker
"Pick a tech":{
Italian:"Scegli una tecnologia"
@ -3948,6 +3946,7 @@
Portuguese:"Declarar guerra"
German:"Krieg erklären"
}
"Declare war on [civName]?":{}
"[civName] has declared war on us!":{
Italian:"[civName] ci ha dichiarato guerra!"

View File

@ -5,6 +5,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.*
import com.unciv.UnCivGame
import com.unciv.models.gamebasics.tr
import com.unciv.ui.utils.*
import com.unciv.ui.worldscreen.optionstable.YesNoPopupTable
class DiplomacyScreen:CameraStageBaseScreen(){
@ -61,8 +62,9 @@ class DiplomacyScreen:CameraStageBaseScreen(){
declareWarButton.setText(declareWarButton.text.toString() + " ($turnsToPeaceTreaty)")
}
declareWarButton.onClick {
YesNoPopupTable("Declare war on [${civ.civName}]?".tr(),{
civDiplomacy.declareWar()
updateLeftSideTable()
updateLeftSideTable()}, this@DiplomacyScreen)
}
civTable.add(declareWarButton).row()
}