mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-21 21:30:20 +07:00
Map editor leaves to main menu
This commit is contained in:
@ -72,7 +72,7 @@ class MultiplayerScreen(previousScreen: CameraStageBaseScreen) : PickerScreen()
|
|||||||
reloadGameListUI()
|
reloadGameListUI()
|
||||||
|
|
||||||
// A Button to add the currently running game to multiplayerGameList if not yet done
|
// A Button to add the currently running game to multiplayerGameList if not yet done
|
||||||
addCurrentGameButton()
|
// addCurrentGameButton()
|
||||||
|
|
||||||
//rightTable Setup
|
//rightTable Setup
|
||||||
copyUserIdButton.onClick {
|
copyUserIdButton.onClick {
|
||||||
|
@ -5,6 +5,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.TextButton
|
|||||||
import com.badlogic.gdx.scenes.scene2d.ui.TextField
|
import com.badlogic.gdx.scenes.scene2d.ui.TextField
|
||||||
import com.badlogic.gdx.utils.Json
|
import com.badlogic.gdx.utils.Json
|
||||||
import com.unciv.Constants
|
import com.unciv.Constants
|
||||||
|
import com.unciv.MenuScreen
|
||||||
import com.unciv.UncivGame
|
import com.unciv.UncivGame
|
||||||
import com.unciv.logic.MapSaver
|
import com.unciv.logic.MapSaver
|
||||||
import com.unciv.logic.map.MapType
|
import com.unciv.logic.map.MapType
|
||||||
@ -114,8 +115,8 @@ class MapEditorMenuPopup(mapEditorScreen: MapEditorScreen): Popup(mapEditorScree
|
|||||||
|
|
||||||
|
|
||||||
val exitMapEditorButton = "Exit map editor".toTextButton()
|
val exitMapEditorButton = "Exit map editor".toTextButton()
|
||||||
exitMapEditorButton.onClick { UncivGame.Current.setWorldScreen(); mapEditorScreen.dispose() }
|
|
||||||
add(exitMapEditorButton ).row()
|
add(exitMapEditorButton ).row()
|
||||||
|
exitMapEditorButton.onClick { mapEditorScreen.game.setScreen(MenuScreen()); mapEditorScreen.dispose() }
|
||||||
|
|
||||||
val closeOptionsButton = Constants.close.toTextButton()
|
val closeOptionsButton = Constants.close.toTextButton()
|
||||||
closeOptionsButton.onClick { close() }
|
closeOptionsButton.onClick { close() }
|
||||||
|
@ -5,12 +5,10 @@ import com.badlogic.gdx.math.Vector2
|
|||||||
import com.badlogic.gdx.scenes.scene2d.InputEvent
|
import com.badlogic.gdx.scenes.scene2d.InputEvent
|
||||||
import com.badlogic.gdx.scenes.scene2d.InputListener
|
import com.badlogic.gdx.scenes.scene2d.InputListener
|
||||||
import com.badlogic.gdx.scenes.scene2d.actions.Actions
|
import com.badlogic.gdx.scenes.scene2d.actions.Actions
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.TextButton
|
|
||||||
import com.unciv.logic.MapSaver
|
import com.unciv.logic.MapSaver
|
||||||
import com.unciv.logic.map.TileInfo
|
import com.unciv.logic.map.TileInfo
|
||||||
import com.unciv.logic.map.TileMap
|
import com.unciv.logic.map.TileMap
|
||||||
import com.unciv.models.ruleset.RulesetCache
|
import com.unciv.models.ruleset.RulesetCache
|
||||||
import com.unciv.models.translations.tr
|
|
||||||
import com.unciv.ui.utils.*
|
import com.unciv.ui.utils.*
|
||||||
|
|
||||||
class MapEditorScreen(): CameraStageBaseScreen() {
|
class MapEditorScreen(): CameraStageBaseScreen() {
|
||||||
@ -146,3 +144,4 @@ class MapEditorScreen(): CameraStageBaseScreen() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.unciv.ui.mapeditor
|
package com.unciv.ui.mapeditor
|
||||||
|
|
||||||
import com.unciv.ui.utils.AutoScrollPane as ScrollPane
|
|
||||||
import com.badlogic.gdx.graphics.Color
|
import com.badlogic.gdx.graphics.Color
|
||||||
import com.badlogic.gdx.scenes.scene2d.Actor
|
import com.badlogic.gdx.scenes.scene2d.Actor
|
||||||
import com.badlogic.gdx.scenes.scene2d.Group
|
import com.badlogic.gdx.scenes.scene2d.Group
|
||||||
@ -19,7 +18,6 @@ import com.unciv.ui.tilegroups.TileGroup
|
|||||||
import com.unciv.ui.tilegroups.TileSetStrings
|
import com.unciv.ui.tilegroups.TileSetStrings
|
||||||
import com.unciv.ui.utils.*
|
import com.unciv.ui.utils.*
|
||||||
|
|
||||||
|
|
||||||
class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(CameraStageBaseScreen.skin){
|
class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(CameraStageBaseScreen.skin){
|
||||||
private val tileSetLocation = "TileSets/"+ UncivGame.Current.settings.tileSet +"/"
|
private val tileSetLocation = "TileSets/"+ UncivGame.Current.settings.tileSet +"/"
|
||||||
|
|
||||||
@ -76,7 +74,7 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera
|
|||||||
sliderTab.add(slider)
|
sliderTab.add(slider)
|
||||||
|
|
||||||
add(sliderTab).row()
|
add(sliderTab).row()
|
||||||
add(ScrollPane(tabPickerTable).apply { this.width= mapEditorScreen.stage.width/3}).row()
|
add(AutoScrollPane(tabPickerTable).apply { this.width= mapEditorScreen.stage.width/3}).row()
|
||||||
|
|
||||||
add(editorPickTable).row()
|
add(editorPickTable).row()
|
||||||
}
|
}
|
||||||
@ -105,7 +103,7 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera
|
|||||||
}
|
}
|
||||||
improvementsTable.add(improvementImage).row()
|
improvementsTable.add(improvementImage).row()
|
||||||
}
|
}
|
||||||
editorPickTable.add(ScrollPane(improvementsTable)).height(scrollPanelHeight)
|
editorPickTable.add(AutoScrollPane(improvementsTable)).height(scrollPanelHeight)
|
||||||
|
|
||||||
val nationsTable = Table()
|
val nationsTable = Table()
|
||||||
for(nation in ruleset.nations.values){
|
for(nation in ruleset.nations.values){
|
||||||
@ -119,7 +117,7 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera
|
|||||||
nationsTable.add(nationImage).row()
|
nationsTable.add(nationImage).row()
|
||||||
}
|
}
|
||||||
|
|
||||||
editorPickTable.add(ScrollPane(nationsTable)).height(scrollPanelHeight)
|
editorPickTable.add(AutoScrollPane(nationsTable)).height(scrollPanelHeight)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getRedCross(size: Float, alpha: Float): Actor {
|
private fun getRedCross(size: Float, alpha: Float): Actor {
|
||||||
@ -152,14 +150,14 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera
|
|||||||
background = ImageGetter.getBackground(Color.GRAY.cpy().apply { a = 0.7f })
|
background = ImageGetter.getBackground(Color.GRAY.cpy().apply { a = 0.7f })
|
||||||
|
|
||||||
val terrainsAndResourcesTable = Table()
|
val terrainsAndResourcesTable = Table()
|
||||||
terrainsAndResourcesTable.add(ScrollPane(baseTerrainTable).apply { setScrollingDisabled(true,false) }).height(scrollPanelHeight)
|
terrainsAndResourcesTable.add(AutoScrollPane(baseTerrainTable).apply { setScrollingDisabled(true,false) }).height(scrollPanelHeight)
|
||||||
|
|
||||||
terrainsAndResourcesTable.add(ScrollPane(terrainFeaturesTable).apply { setScrollingDisabled(true,false) }).height(scrollPanelHeight)
|
terrainsAndResourcesTable.add(AutoScrollPane(terrainFeaturesTable).apply { setScrollingDisabled(true,false) }).height(scrollPanelHeight)
|
||||||
|
|
||||||
val resourcesTable = Table()
|
val resourcesTable = Table()
|
||||||
for(resource in resources) resourcesTable.add(resource).row()
|
for(resource in resources) resourcesTable.add(resource).row()
|
||||||
resourcesTable.pack()
|
resourcesTable.pack()
|
||||||
terrainsAndResourcesTable.add(ScrollPane(resourcesTable).apply { setScrollingDisabled(true,false) }).height(scrollPanelHeight).row()
|
terrainsAndResourcesTable.add(AutoScrollPane(resourcesTable).apply { setScrollingDisabled(true,false) }).height(scrollPanelHeight).row()
|
||||||
|
|
||||||
terrainsAndResourcesTable.pack()
|
terrainsAndResourcesTable.pack()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user