mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-13 19:39:34 +07:00
Added confirmation popup when deleting maps
This commit is contained in:
parent
d3a6417996
commit
17b3069668
android/assets/jsons/Translations
core/src/com/unciv/ui/saves
@ -458,7 +458,21 @@
|
|||||||
Portuguese:"Salvo em"
|
Portuguese:"Salvo em"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Options
|
////////////// Load map
|
||||||
|
|
||||||
|
"Load map":{
|
||||||
|
}
|
||||||
|
|
||||||
|
"Are you sure you want to delete this map?":{
|
||||||
|
}
|
||||||
|
|
||||||
|
"Upload":{
|
||||||
|
}
|
||||||
|
|
||||||
|
"Could not upload map!":{
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////// Options
|
||||||
|
|
||||||
"Options":{
|
"Options":{
|
||||||
Italian:"Opzioni"
|
Italian:"Opzioni"
|
||||||
|
@ -14,13 +14,14 @@ import com.unciv.ui.pickerscreens.PickerScreen
|
|||||||
import com.unciv.ui.utils.disable
|
import com.unciv.ui.utils.disable
|
||||||
import com.unciv.ui.utils.enable
|
import com.unciv.ui.utils.enable
|
||||||
import com.unciv.ui.utils.onClick
|
import com.unciv.ui.utils.onClick
|
||||||
|
import com.unciv.ui.worldscreen.optionstable.YesNoPopupTable
|
||||||
|
|
||||||
class LoadMapScreen(previousMap: TileMap) : PickerScreen(){
|
class LoadMapScreen(previousMap: TileMap) : PickerScreen(){
|
||||||
var chosenMap = ""
|
var chosenMap = ""
|
||||||
val deleteMapButton = TextButton("Delete map",skin)
|
val deleteMapButton = TextButton("Delete map",skin)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
rightSideButton.setText("Load map")
|
rightSideButton.setText("Load map".tr())
|
||||||
rightSideButton.onClick {
|
rightSideButton.onClick {
|
||||||
UnCivGame.Current.screen = MapEditorScreen(chosenMap)
|
UnCivGame.Current.screen = MapEditorScreen(chosenMap)
|
||||||
dispose()
|
dispose()
|
||||||
@ -50,8 +51,10 @@ class LoadMapScreen(previousMap: TileMap) : PickerScreen(){
|
|||||||
rightSideTable.add(loadFromClipboardButton).row()
|
rightSideTable.add(loadFromClipboardButton).row()
|
||||||
|
|
||||||
deleteMapButton.onClick {
|
deleteMapButton.onClick {
|
||||||
MapSaver().deleteMap(chosenMap)
|
YesNoPopupTable("Are you sure you want to delete this map?", {
|
||||||
UnCivGame.Current.screen = LoadMapScreen(previousMap)
|
MapSaver().deleteMap(chosenMap)
|
||||||
|
UnCivGame.Current.screen = LoadMapScreen(previousMap)
|
||||||
|
}, this)
|
||||||
}
|
}
|
||||||
deleteMapButton.disable()
|
deleteMapButton.disable()
|
||||||
deleteMapButton.color = Color.RED
|
deleteMapButton.color = Color.RED
|
||||||
|
Loading…
Reference in New Issue
Block a user