Resolved #1420 - Menu in the map editor no longer opens multiple times on subsequent clicks
This commit is contained in:
parent
110e7b7052
commit
3ea4f8bc82
4 changed files with 19 additions and 4 deletions
13
android/assets/mods/myFirstMod/jsons/Units.json
Normal file
13
android/assets/mods/myFirstMod/jsons/Units.json
Normal file
|
@ -0,0 +1,13 @@
|
|||
[
|
||||
{
|
||||
name:"Warrior",
|
||||
unitType:"Melee",
|
||||
movement:2,
|
||||
strength:12,
|
||||
cost: 40,
|
||||
hurryCostModifier:20,
|
||||
obsoleteTech:"Metal Casting",
|
||||
upgradesTo:"Swordsman",
|
||||
attackSound:"nonmetalhit"
|
||||
}
|
||||
]
|
|
@ -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
|
||||
|
|
|
@ -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 }
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue