mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-29 06:51:30 -04:00
Added translations in map editor
This commit is contained in:
parent
4728423a26
commit
7e274cae84
@ -21,8 +21,8 @@ android {
|
|||||||
applicationId "com.unciv.app"
|
applicationId "com.unciv.app"
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 302
|
versionCode 303
|
||||||
versionName "3.1.0-patch1"
|
versionName "3.1.1"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Had to add this crap for Travis to build, it wanted to sign the app
|
// Had to add this crap for Travis to build, it wanted to sign the app
|
||||||
|
@ -18,8 +18,8 @@ class MapEditorScreen(): CameraStageBaseScreen(){
|
|||||||
var tileMap = TileMap(GameParameters())
|
var tileMap = TileMap(GameParameters())
|
||||||
var mapName = "My first map"
|
var mapName = "My first map"
|
||||||
lateinit var mapHolder: TileGroupMap<TileGroup>
|
lateinit var mapHolder: TileGroupMap<TileGroup>
|
||||||
val tileEditorOptions = TileEditorOptionsTable(this)
|
private val tileEditorOptions = TileEditorOptionsTable(this)
|
||||||
val showHideEditorOptionsButton = TextButton(">",skin)
|
private val showHideEditorOptionsButton = TextButton(">",skin)
|
||||||
|
|
||||||
constructor(mapNameToLoad:String?):this(){
|
constructor(mapNameToLoad:String?):this(){
|
||||||
var mapToLoad = mapNameToLoad
|
var mapToLoad = mapNameToLoad
|
||||||
|
@ -3,7 +3,6 @@ package com.unciv.ui.mapeditor
|
|||||||
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
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.Label
|
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane
|
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.Table
|
import com.badlogic.gdx.scenes.scene2d.ui.Table
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.TextButton
|
import com.badlogic.gdx.scenes.scene2d.ui.TextButton
|
||||||
@ -15,12 +14,10 @@ import com.unciv.models.gamebasics.tile.Terrain
|
|||||||
import com.unciv.models.gamebasics.tile.TerrainType
|
import com.unciv.models.gamebasics.tile.TerrainType
|
||||||
import com.unciv.models.gamebasics.tile.TileImprovement
|
import com.unciv.models.gamebasics.tile.TileImprovement
|
||||||
import com.unciv.models.gamebasics.tile.TileResource
|
import com.unciv.models.gamebasics.tile.TileResource
|
||||||
|
import com.unciv.models.gamebasics.tr
|
||||||
import com.unciv.ui.tilegroups.TileGroup
|
import com.unciv.ui.tilegroups.TileGroup
|
||||||
import com.unciv.ui.tilegroups.TileSetStrings
|
import com.unciv.ui.tilegroups.TileSetStrings
|
||||||
import com.unciv.ui.utils.CameraStageBaseScreen
|
import com.unciv.ui.utils.*
|
||||||
import com.unciv.ui.utils.ImageGetter
|
|
||||||
import com.unciv.ui.utils.center
|
|
||||||
import com.unciv.ui.utils.onClick
|
|
||||||
|
|
||||||
class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(CameraStageBaseScreen.skin){
|
class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(CameraStageBaseScreen.skin){
|
||||||
val tileSetLocation = "TileSets/"+ UnCivGame.Current.settings.tileSet +"/"
|
val tileSetLocation = "TileSets/"+ UnCivGame.Current.settings.tileSet +"/"
|
||||||
@ -45,11 +42,11 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera
|
|||||||
setTerrainsAndResources()
|
setTerrainsAndResources()
|
||||||
|
|
||||||
val tabPickerTable = Table().apply { defaults().pad(10f) }
|
val tabPickerTable = Table().apply { defaults().pad(10f) }
|
||||||
val terrainsAndResourcesTabButton = TextButton("Terrains & Resources",skin)
|
val terrainsAndResourcesTabButton = TextButton("Terrains & Resources".tr(),skin)
|
||||||
.onClick { setTerrainsAndResources() }
|
.onClick { setTerrainsAndResources() }
|
||||||
tabPickerTable.add(terrainsAndResourcesTabButton)
|
tabPickerTable.add(terrainsAndResourcesTabButton)
|
||||||
|
|
||||||
val civLocationsButton = TextButton("Improvements",skin)
|
val civLocationsButton = TextButton("Improvements".tr(),skin)
|
||||||
.onClick { setImprovements() }
|
.onClick { setImprovements() }
|
||||||
tabPickerTable.add(civLocationsButton)
|
tabPickerTable.add(civLocationsButton)
|
||||||
tabPickerTable.pack()
|
tabPickerTable.pack()
|
||||||
@ -78,7 +75,7 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera
|
|||||||
clearSelection()
|
clearSelection()
|
||||||
selectedImprovement=improvement
|
selectedImprovement=improvement
|
||||||
val improvementIcon = getHex(Color.WHITE,ImageGetter.getImprovementIcon(improvement.name,40f))
|
val improvementIcon = getHex(Color.WHITE,ImageGetter.getImprovementIcon(improvement.name,40f))
|
||||||
setCurrentHex(improvementIcon, improvement.name+"\n"+improvement.clone().toString())
|
setCurrentHex(improvementIcon, improvement.name.tr()+"\n"+improvement.clone().toString())
|
||||||
}
|
}
|
||||||
improvementsTable.add(improvementImage).row()
|
improvementsTable.add(improvementImage).row()
|
||||||
}
|
}
|
||||||
@ -128,7 +125,7 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera
|
|||||||
group.onClick {
|
group.onClick {
|
||||||
clearSelection()
|
clearSelection()
|
||||||
selectedTerrain = terrain
|
selectedTerrain = terrain
|
||||||
setCurrentHex(tileInfo,terrain.name+"\n"+terrain.clone().toString())
|
setCurrentHex(tileInfo,terrain.name.tr()+"\n"+terrain.clone().toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
if (terrain.type == TerrainType.TerrainFeature)
|
if (terrain.type == TerrainType.TerrainFeature)
|
||||||
@ -163,7 +160,7 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera
|
|||||||
|
|
||||||
tileInfo.resource = resource.name
|
tileInfo.resource = resource.name
|
||||||
tileInfo.setTransients()
|
tileInfo.setTransients()
|
||||||
setCurrentHex(tileInfo,resource.name+"\n"+resource.clone().toString())
|
setCurrentHex(tileInfo,resource.name.tr()+"\n"+resource.clone().toString())
|
||||||
}
|
}
|
||||||
resources.add(resourceHex)
|
resources.add(resourceHex)
|
||||||
}
|
}
|
||||||
@ -258,7 +255,7 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera
|
|||||||
fun setCurrentHex(actor:Actor, text:String){
|
fun setCurrentHex(actor:Actor, text:String){
|
||||||
currentHex.remove()
|
currentHex.remove()
|
||||||
val currentHexTable = Table()
|
val currentHexTable = Table()
|
||||||
currentHexTable.add(Label(text,skin)).padRight(20f)
|
currentHexTable.add(text.toLabel()).padRight(20f)
|
||||||
currentHexTable.add(actor).pad(10f)
|
currentHexTable.add(actor).pad(10f)
|
||||||
currentHexTable.pack()
|
currentHexTable.pack()
|
||||||
currentHex=currentHexTable
|
currentHex=currentHexTable
|
||||||
|
Loading…
x
Reference in New Issue
Block a user