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