mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-03 06:04:02 +07:00
Getting to map editor from the main screen is much nicer
This commit is contained in:
parent
5aae57d848
commit
081f8cb4a6
@ -69,28 +69,29 @@ class MenuScreen: CameraStageBaseScreen() {
|
||||
private fun openMapEditorPopup() {
|
||||
|
||||
val mapEditorPopup = Popup(this)
|
||||
mapEditorPopup.defaults().pad(10f)
|
||||
|
||||
mapEditorPopup.addGoodSizedLabel("Map editor".tr()).row()
|
||||
val tableBackground = ImageGetter.getBackground(colorFromRGB(29, 102, 107))
|
||||
|
||||
// Create a new map
|
||||
mapEditorPopup.addButton("New map") {
|
||||
game.setScreen(NewMapScreen())
|
||||
mapEditorPopup.close()
|
||||
}
|
||||
val newMapButton = getTableBlock("New map", "OtherIcons/New") { game.setScreen(NewMapScreen()) }
|
||||
newMapButton.background = tableBackground
|
||||
mapEditorPopup.add(newMapButton).row()
|
||||
|
||||
// Load the map
|
||||
mapEditorPopup.addButton("Load map") {
|
||||
val loadMapButton = getTableBlock("Load map", "OtherIcons/Load") {
|
||||
val loadMapScreen = LoadMapScreen(null)
|
||||
loadMapScreen.closeButton.isVisible = true
|
||||
loadMapScreen.closeButton.onClick {
|
||||
game.setWorldScreen()
|
||||
game.setScreen(MenuScreen())
|
||||
loadMapScreen.dispose()
|
||||
}
|
||||
game.setScreen(loadMapScreen)
|
||||
mapEditorPopup.close()
|
||||
}
|
||||
loadMapButton.background = tableBackground
|
||||
mapEditorPopup.add(loadMapButton).row()
|
||||
|
||||
mapEditorPopup.add(getTableBlock("Close", "OtherIcons/Close") { mapEditorPopup.close() }
|
||||
.apply { background=tableBackground })
|
||||
|
||||
mapEditorPopup.addCloseButton()
|
||||
mapEditorPopup.open(force = true)
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@ package com.unciv.ui.mapeditor
|
||||
import com.unciv.ui.utils.AutoScrollPane as ScrollPane
|
||||
import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.Table
|
||||
import com.unciv.MenuScreen
|
||||
import com.unciv.UncivGame
|
||||
import com.unciv.logic.map.MapGenerator
|
||||
import com.unciv.logic.map.MapParameters
|
||||
@ -21,7 +22,7 @@ class NewMapScreen : PickerScreen() {
|
||||
private var generatedMap: TileMap? = null
|
||||
|
||||
init {
|
||||
setDefaultCloseAction()
|
||||
setDefaultCloseAction(MenuScreen())
|
||||
|
||||
val newMapScreenOptionsTable = Table(skin).apply {
|
||||
pad(10f)
|
||||
|
@ -231,7 +231,7 @@ object ImageGetter {
|
||||
Constants.modernEra -> techIconColor = colorFromRGB(33, 150, 243)
|
||||
Constants.informationEra -> techIconColor = colorFromRGB(0, 150, 136)
|
||||
Constants.futureEra -> techIconColor = colorFromRGB(76,176,81)
|
||||
else -> Color.WHITE
|
||||
else -> Color.WHITE.cpy()
|
||||
}
|
||||
return getImage("TechIcons/$techName").apply { color = techIconColor.lerp(Color.BLACK,0.6f) }
|
||||
.surroundWithCircle(circleSize)
|
||||
|
Loading…
Reference in New Issue
Block a user