mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-16 18:59:15 +07:00
Resolved #1420 - Menu in the map editor no longer opens multiple times on subsequent clicks
This commit is contained in:
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 {
|
release {
|
||||||
// Don't add local save files and fonts to release, obviously
|
// Don't add local save files and fonts to release, obviously
|
||||||
aaptOptions {
|
aaptOptions {
|
||||||
ignoreAssetsPattern "!SaveFiles:!fonts:!maps:!music"
|
ignoreAssetsPattern "!SaveFiles:!fonts:!maps:!music:!mods"
|
||||||
}
|
}
|
||||||
|
|
||||||
minifyEnabled false
|
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.DropBox
|
||||||
import com.unciv.ui.worldscreen.optionstable.PopupTable
|
import com.unciv.ui.worldscreen.optionstable.PopupTable
|
||||||
|
|
||||||
class MapEditorOptionsTable(mapEditorScreen: MapEditorScreen): PopupTable(mapEditorScreen){
|
class MapEditorMenuPopup(mapEditorScreen: MapEditorScreen): PopupTable(mapEditorScreen){
|
||||||
init{
|
init{
|
||||||
val mapNameEditor = TextField(mapEditorScreen.mapName, skin)
|
val mapNameEditor = TextField(mapEditorScreen.mapName, skin)
|
||||||
mapNameEditor.addListener{ mapEditorScreen.mapName=mapNameEditor.text; true }
|
mapNameEditor.addListener{ mapEditorScreen.mapName=mapNameEditor.text; true }
|
@ -65,9 +65,11 @@ class MapEditorScreen(): CameraStageBaseScreen(){
|
|||||||
stage.addActor(showHideEditorOptionsButton)
|
stage.addActor(showHideEditorOptionsButton)
|
||||||
|
|
||||||
|
|
||||||
val optionsMenuButton = TextButton("Options".tr(), skin)
|
val optionsMenuButton = TextButton("Menu".tr(), skin)
|
||||||
optionsMenuButton.onClick {
|
optionsMenuButton.onClick {
|
||||||
MapEditorOptionsTable(this)
|
if(stage.actors.any { it is MapEditorMenuPopup })
|
||||||
|
return@onClick // already open
|
||||||
|
MapEditorMenuPopup(this)
|
||||||
}
|
}
|
||||||
optionsMenuButton.label.setFontSize(24)
|
optionsMenuButton.label.setFontSize(24)
|
||||||
optionsMenuButton.labelCell.pad(20f)
|
optionsMenuButton.labelCell.pad(20f)
|
||||||
|
Reference in New Issue
Block a user