Resolved #1420 - Menu in the map editor no longer opens multiple times on subsequent clicks

This commit is contained in:
Yair Morgenstern 2019-12-06 10:12:16 +02:00
parent 110e7b7052
commit 3ea4f8bc82
4 changed files with 19 additions and 4 deletions

View file

@ -0,0 +1,13 @@
[
{
name:"Warrior",
unitType:"Melee",
movement:2,
strength:12,
cost: 40,
hurryCostModifier:20,
obsoleteTech:"Metal Casting",
upgradesTo:"Swordsman",
attackSound:"nonmetalhit"
}
]

View file

@ -41,7 +41,7 @@ android {
release {
// Don't add local save files and fonts to release, obviously
aaptOptions {
ignoreAssetsPattern "!SaveFiles:!fonts:!maps:!music"
ignoreAssetsPattern "!SaveFiles:!fonts:!maps:!music:!mods"
}
minifyEnabled false

View file

@ -18,7 +18,7 @@ import com.unciv.ui.utils.onClick
import com.unciv.ui.worldscreen.optionstable.DropBox
import com.unciv.ui.worldscreen.optionstable.PopupTable
class MapEditorOptionsTable(mapEditorScreen: MapEditorScreen): PopupTable(mapEditorScreen){
class MapEditorMenuPopup(mapEditorScreen: MapEditorScreen): PopupTable(mapEditorScreen){
init{
val mapNameEditor = TextField(mapEditorScreen.mapName, skin)
mapNameEditor.addListener{ mapEditorScreen.mapName=mapNameEditor.text; true }

View file

@ -65,9 +65,11 @@ class MapEditorScreen(): CameraStageBaseScreen(){
stage.addActor(showHideEditorOptionsButton)
val optionsMenuButton = TextButton("Options".tr(), skin)
val optionsMenuButton = TextButton("Menu".tr(), skin)
optionsMenuButton.onClick {
MapEditorOptionsTable(this)
if(stage.actors.any { it is MapEditorMenuPopup })
return@onClick // already open
MapEditorMenuPopup(this)
}
optionsMenuButton.label.setFontSize(24)
optionsMenuButton.labelCell.pad(20f)