Added Tilesets, for alternative tile images - this could be big!

Options table is now a table, not a list - more room for future options
This commit is contained in:
Yair Morgenstern 2019-03-19 17:09:51 +02:00
parent fd772a93a2
commit 21377f63e7
24 changed files with 179 additions and 103 deletions

View file

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -1992,20 +1992,118 @@ TerrainIcons/CrosshatchHexagon
orig: 273, 236
offset: 0, 0
index: -1
TerrainIcons/Flood plains
TerrainIcons/Default/Flood plainsOverlay
rotate: false
xy: 1150, 1438
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
TerrainIcons/Forest
TerrainIcons/Test/Flood plainsOverlay
rotate: false
xy: 1150, 1438
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
TerrainIcons/Default/ForestOverlay
rotate: false
xy: 844, 1030
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
TerrainIcons/Test/ForestOverlay
rotate: false
xy: 844, 1030
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
TerrainIcons/Default/HillOverlay
rotate: false
xy: 714, 724
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
TerrainIcons/Test/HillOverlay
rotate: false
xy: 714, 724
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
TerrainIcons/Default/JungleOverlay
rotate: false
xy: 1224, 826
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
TerrainIcons/Test/JungleOverlay
rotate: false
xy: 1224, 826
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
TerrainIcons/Default/LakesOverlay
rotate: false
xy: 1603, 1640
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
TerrainIcons/Test/LakesOverlay
rotate: false
xy: 1603, 1640
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
TerrainIcons/Default/MarshOverlay
rotate: false
xy: 1456, 1238
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
TerrainIcons/Test/MarshOverlay
rotate: false
xy: 1456, 1238
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
TerrainIcons/Default/MountainOverlay
rotate: false
xy: 1864, 1436
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
TerrainIcons/Test/MountainOverlay
rotate: false
xy: 1864, 1436
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
TerrainIcons/Default/OasisOverlay
rotate: false
xy: 1864, 1130
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
TerrainIcons/Test/OasisOverlay
rotate: false
xy: 1864, 1130
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
TerrainIcons/Hexagon
rotate: false
xy: 2, 1806
@ -2020,46 +2118,11 @@ TerrainIcons/HexagonBorder
orig: 139, 120
offset: 0, 0
index: -1
TerrainIcons/Hill
TerrainIcons/Test/Grasslands
rotate: false
xy: 714, 724
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
TerrainIcons/Jungle
rotate: false
xy: 1224, 826
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
TerrainIcons/Lakes
rotate: false
xy: 1603, 1640
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
TerrainIcons/Marsh
rotate: false
xy: 1456, 1238
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
TerrainIcons/Mountain
rotate: false
xy: 1864, 1436
size: 100, 100
orig: 100, 100
offset: 0, 0
index: -1
TerrainIcons/Oasis
rotate: false
xy: 1864, 1130
size: 100, 100
orig: 100, 100
xy: 1531, 1964
size: 32, 30
orig: 32, 30
offset: 0, 0
index: -1
TerrainIcons/road
@ -2491,273 +2554,273 @@ UnitPromotionIcons/Barrage_II_(Civ5)
index: -1
UnitPromotionIcons/Barrage_I_(Civ5)
rotate: false
xy: 1531, 1974
xy: 234, 79
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Blitz_(Civ5)
rotate: false
xy: 234, 79
xy: 2018, 700
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Boarding_Party_III_(Civ5)
rotate: false
xy: 2018, 700
xy: 1979, 598
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Boarding_Party_II_(Civ5)
rotate: false
xy: 1979, 598
xy: 1981, 1974
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Boarding_Party_I_(Civ5)
rotate: false
xy: 1981, 1974
xy: 106, 46
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Bombardment_III_(Civ5)
rotate: false
xy: 106, 46
xy: 1425, 294
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Bombardment_II_(Civ5)
rotate: false
xy: 1425, 294
xy: 1447, 294
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Bombardment_I_(Civ5)
rotate: false
xy: 1447, 294
xy: 2015, 1822
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Charge_(Civ5)
rotate: false
xy: 2015, 1822
xy: 1966, 942
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Coastal_Raider_III_(Civ5)
rotate: false
xy: 1966, 942
xy: 852, 192
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Coastal_Raider_II_(Civ5)
rotate: false
xy: 852, 192
xy: 256, 79
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Coastal_Raider_I_(Civ5)
rotate: false
xy: 1531, 1952
xy: 2018, 678
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Cover_II_(Civ5)
rotate: false
xy: 256, 79
xy: 1979, 576
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Cover_I_(Civ5)
rotate: false
xy: 2018, 678
xy: 1981, 1952
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Drill_III_(Civ5)
rotate: false
xy: 1979, 576
xy: 2003, 1974
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Drill_II_(Civ5)
rotate: false
xy: 1981, 1952
xy: 106, 24
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Drill_I_(Civ5)
rotate: false
xy: 2003, 1974
xy: 106, 2
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Formation_II_(Civ5)
rotate: false
xy: 106, 24
xy: 1425, 272
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Formation_I_(Civ5)
rotate: false
xy: 106, 2
xy: 2015, 1800
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Indirect_Fire_(Civ5)
rotate: false
xy: 1425, 272
xy: 1988, 942
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Logistics_(Civ5)
rotate: false
xy: 2015, 1800
xy: 852, 170
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/March_(Civ5)
rotate: false
xy: 1988, 942
xy: 874, 192
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Mobility_(Civ5)
rotate: false
xy: 852, 170
xy: 278, 79
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Range_(Civ5)
rotate: false
xy: 874, 192
xy: 2018, 656
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Scouting_III_(Civ5)
rotate: false
xy: 278, 79
xy: 1979, 554
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Scouting_II_(Civ5)
rotate: false
xy: 2018, 656
xy: 2003, 1952
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Scouting_I_(Civ5)
rotate: false
xy: 1979, 554
xy: 1425, 250
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Sentry_(Civ5)
rotate: false
xy: 2003, 1952
xy: 1447, 272
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Shock_III_(Civ5)
rotate: false
xy: 1425, 250
xy: 1469, 293
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Shock_II_(Civ5)
rotate: false
xy: 1447, 272
xy: 2015, 1778
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Shock_I_(Civ5)
rotate: false
xy: 1469, 293
xy: 852, 148
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Siege_(Civ5)
rotate: false
xy: 2015, 1778
xy: 874, 170
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Targeting_III_(Civ5)
rotate: false
xy: 852, 148
xy: 896, 192
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Targeting_II_(Civ5)
rotate: false
xy: 874, 170
xy: 300, 79
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Targeting_I_(Civ5)
rotate: false
xy: 896, 192
xy: 2018, 634
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Volley_(Civ5)
rotate: false
xy: 300, 79
xy: 1979, 532
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Wolfpack_III_(Civ5)
rotate: false
xy: 2018, 634
xy: 1425, 228
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Wolfpack_II_(Civ5)
rotate: false
xy: 1979, 532
xy: 1447, 250
size: 20, 20
orig: 20, 20
offset: 0, 0
index: -1
UnitPromotionIcons/Wolfpack_I_(Civ5)
rotate: false
xy: 1425, 228
xy: 1469, 271
size: 20, 20
orig: 20, 20
offset: 0, 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 879 KiB

After

Width:  |  Height:  |  Size: 882 KiB

View file

@ -687,7 +687,7 @@
Japanese:"表示オプション"
}
"Turns between autosaves:":{
"Turns between autosaves":{
Italian:"Turni tra autosalvataggi"
}
@ -721,7 +721,7 @@
Japanese:"隠す"
}
"worked tiles":{
"Worked tiles":{
Italian:"celle sfruttate"
Russian:"обработанные клетки"
French:"cases exploités"
@ -734,7 +734,7 @@
Japanese:"働いたタイル"
}
"resources and improvements":{
"Resources and improvements":{
Italian:"Risorse e miglioramenti"
Russian:"ресурсы и улучшения"
French:"ressources et améliorations"

View file

@ -11,6 +11,7 @@ class GameSettings {
var hasCrashedRecently = false
var soundEffectsVolume = 0.5f
var turnsBetweenAutosaves = 1
var tileSet:String = "Default"
fun save(){
GameSaver().setGeneralSettings(this)

View file

@ -1,7 +1,6 @@
package com.unciv.ui.tilegroups
import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.g2d.Batch
import com.badlogic.gdx.scenes.scene2d.Actor
import com.badlogic.gdx.scenes.scene2d.Group
import com.badlogic.gdx.scenes.scene2d.ui.Image
@ -18,7 +17,9 @@ import com.unciv.ui.utils.UnitGroup
import com.unciv.ui.utils.center
open class TileGroup(var tileInfo: TileInfo) : Group() {
protected val hexagon = ImageGetter.getImage("TerrainIcons/Hexagon.png")
val tileSetLocation = "TerrainIcons/"+UnCivGame.Current.settings.tileSet +"/"
protected var hexagon :Image= ImageGetter.getImage("TerrainIcons/Hexagon.png")
protected var baseTerrainImage: Image? = null
protected var baseTerrain:String=""
protected var terrainFeatureImage: Image? = null
@ -48,7 +49,9 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
init {
val groupSize = 54f
this.setSize(groupSize, groupSize)
addHexagon(groupSize)
addCircleImage()
addFogImage(groupSize)
addCrosshairImage()
@ -87,6 +90,10 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
}
private fun addHexagon(groupSize: Float) {
val terrainTileLocation = tileSetLocation+tileInfo.baseTerrain
if(ImageGetter.imageExists(terrainTileLocation))
hexagon = ImageGetter.getImage(terrainTileLocation)
val imageScale = groupSize * 1.5f / hexagon.width
hexagon.setScale(imageScale)
hexagon.setOrigin(Align.center)
@ -135,8 +142,8 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
return
}
updateTerrainFeatureImage()
updateTerrainBaseImage()
updateTerrainFeatureImage()
updateCityImage()
updateTileColor(isViewable)
@ -165,7 +172,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
baseTerrainImage=null
}
val imagePath = "TerrainIcons/" + tileInfo.baseTerrain
val imagePath = tileSetLocation + tileInfo.baseTerrain + "Overlay"
if (!ImageGetter.imageExists(imagePath)) return
baseTerrainImage = ImageGetter.getImage(imagePath)
baseTerrainImage!!.run {
@ -291,13 +298,10 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
}
override fun draw(batch: Batch?, parentAlpha: Float) {
super.draw(batch, parentAlpha)
}
private fun updateTileColor(isViewable: Boolean) {
hexagon.color = tileInfo.getBaseTerrain().getColor()
if (!isViewable) hexagon.color = hexagon.color.lerp(Color.BLACK, 0.6f)
else if(ImageGetter.imageExists(tileSetLocation+tileInfo.baseTerrain)) return // no need to color it, it's already colored
else hexagon.color = tileInfo.getBaseTerrain().getColor()
}
private fun updateTerrainFeatureImage() {
@ -307,7 +311,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
terrainFeatureImage = null
if(terrainFeature!=null) {
terrainFeatureImage = ImageGetter.getImage("TerrainIcons/$terrainFeature.png")
terrainFeatureImage = ImageGetter.getImage(tileSetLocation +"$terrainFeature"+"Overlay")
addActor(terrainFeatureImage)
terrainFeatureImage!!.run {
setSize(30f, 30f)

View file

@ -28,6 +28,9 @@ class TileGroupMap<T: TileGroup>(tileGroups:Collection<T>, padding:Float): Group
group.moveBy(-bottomX + padding, -bottomY + padding)
}
for(group in tileGroups.sortedByDescending { it.tileInfo.position.x + it.tileInfo.position.y })
group.toFront()
// there are tiles "below the zero",
// so we zero out the starting position of the whole board so they will be displayed as well
setSize(topX - bottomX + padding*2, topY - bottomY + padding*2)

View file

@ -5,7 +5,6 @@ import com.badlogic.gdx.graphics.g2d.Batch
import com.badlogic.gdx.scenes.scene2d.Actor
import com.badlogic.gdx.scenes.scene2d.ui.SelectBox
import com.badlogic.gdx.scenes.scene2d.ui.Slider
import com.badlogic.gdx.scenes.scene2d.ui.Table
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener
import com.badlogic.gdx.utils.Array
import com.unciv.UnCivGame
@ -42,12 +41,14 @@ class WorldScreenOptionsTable(screen:WorldScreen) : PopupTable(screen){
settings.save()
clear()
if (settings.showWorkedTiles) addButton("{Hide} {worked tiles}") { settings.showWorkedTiles = false; update() }
else addButton("{Show} {worked tiles}") { settings.showWorkedTiles = true; update() }
add("Worked tiles".toLabel())
if (settings.showWorkedTiles) addButton("Hide") { settings.showWorkedTiles = false; update() }
else addButton("Show") { settings.showWorkedTiles = true; update() }
add("Resources and improvements".toLabel())
if (settings.showResourcesAndImprovements)
addButton("{Hide} {resources and improvements}") { settings.showResourcesAndImprovements = false; update() }
else addButton("{Show} {resources and improvements}") { settings.showResourcesAndImprovements = true; update() }
addButton("Hide") { settings.showResourcesAndImprovements = false; update() }
else addButton("Show") { settings.showResourcesAndImprovements = true; update() }
addLanguageSelectBox()
@ -65,6 +66,8 @@ class WorldScreenOptionsTable(screen:WorldScreen) : PopupTable(screen){
}
private fun addSoundEffectsVolumeSlider() {
add("Sound effects volume".tr())
val soundEffectsVolumeSlider = Slider(0f, 1.0f, 0.1f, false, skin)
soundEffectsVolumeSlider.value = UnCivGame.Current.settings.soundEffectsVolume
soundEffectsVolumeSlider.addListener(object : ChangeListener() {
@ -74,11 +77,12 @@ class WorldScreenOptionsTable(screen:WorldScreen) : PopupTable(screen){
Sounds.play("click")
}
})
add("Sound effects volume".tr()).row()
add(soundEffectsVolumeSlider).row()
}
private fun addResolutionSelectBox() {
add("Resolution".toLabel())
val resolutionSelectBox = SelectBox<String>(skin)
val resolutionArray = Array<String>()
resolutionArray.addAll("900x600", "1050x700", "1200x800", "1500x1000")
@ -98,16 +102,15 @@ class WorldScreenOptionsTable(screen:WorldScreen) : PopupTable(screen){
}
private fun addAutosaveTurnsSelectBox() {
add("Turns between autosaves".toLabel())
val autosaveTurnsSelectBox = SelectBox<Int>(skin)
val autosaveTurnsArray = Array<Int>()
autosaveTurnsArray.addAll(1,2,5,10)
autosaveTurnsSelectBox.items = autosaveTurnsArray
autosaveTurnsSelectBox.selected = UnCivGame.Current.settings.turnsBetweenAutosaves
val table = Table()
table.add("Turns between autosaves:".toLabel())
table.add(autosaveTurnsSelectBox).pad(10f)
add(table).row()
add(autosaveTurnsSelectBox).pad(10f).row()
autosaveTurnsSelectBox.addListener(object : ChangeListener() {
override fun changed(event: ChangeEvent?, actor: Actor?) {
@ -119,6 +122,8 @@ class WorldScreenOptionsTable(screen:WorldScreen) : PopupTable(screen){
}
private fun addLanguageSelectBox() {
add("Language".toLabel())
val languageArray = Array<Language>()
GameBasics.Translations.getLanguages().map { Language(it) }.sortedByDescending { it.percentComplete }
.forEach { languageArray.add(it) }