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 orig: 273, 236
offset: 0, 0 offset: 0, 0
index: -1 index: -1
TerrainIcons/Flood plains TerrainIcons/Default/Flood plainsOverlay
rotate: false rotate: false
xy: 1150, 1438 xy: 1150, 1438
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 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 rotate: false
xy: 844, 1030 xy: 844, 1030
size: 100, 100 size: 100, 100
orig: 100, 100 orig: 100, 100
offset: 0, 0 offset: 0, 0
index: -1 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 TerrainIcons/Hexagon
rotate: false rotate: false
xy: 2, 1806 xy: 2, 1806
@ -2020,46 +2118,11 @@ TerrainIcons/HexagonBorder
orig: 139, 120 orig: 139, 120
offset: 0, 0 offset: 0, 0
index: -1 index: -1
TerrainIcons/Hill TerrainIcons/Test/Grasslands
rotate: false rotate: false
xy: 714, 724 xy: 1531, 1964
size: 100, 100 size: 32, 30
orig: 100, 100 orig: 32, 30
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
offset: 0, 0 offset: 0, 0
index: -1 index: -1
TerrainIcons/road TerrainIcons/road
@ -2491,273 +2554,273 @@ UnitPromotionIcons/Barrage_II_(Civ5)
index: -1 index: -1
UnitPromotionIcons/Barrage_I_(Civ5) UnitPromotionIcons/Barrage_I_(Civ5)
rotate: false rotate: false
xy: 1531, 1974 xy: 234, 79
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Blitz_(Civ5) UnitPromotionIcons/Blitz_(Civ5)
rotate: false rotate: false
xy: 234, 79 xy: 2018, 700
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Boarding_Party_III_(Civ5) UnitPromotionIcons/Boarding_Party_III_(Civ5)
rotate: false rotate: false
xy: 2018, 700 xy: 1979, 598
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Boarding_Party_II_(Civ5) UnitPromotionIcons/Boarding_Party_II_(Civ5)
rotate: false rotate: false
xy: 1979, 598 xy: 1981, 1974
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Boarding_Party_I_(Civ5) UnitPromotionIcons/Boarding_Party_I_(Civ5)
rotate: false rotate: false
xy: 1981, 1974 xy: 106, 46
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Bombardment_III_(Civ5) UnitPromotionIcons/Bombardment_III_(Civ5)
rotate: false rotate: false
xy: 106, 46 xy: 1425, 294
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Bombardment_II_(Civ5) UnitPromotionIcons/Bombardment_II_(Civ5)
rotate: false rotate: false
xy: 1425, 294 xy: 1447, 294
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Bombardment_I_(Civ5) UnitPromotionIcons/Bombardment_I_(Civ5)
rotate: false rotate: false
xy: 1447, 294 xy: 2015, 1822
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Charge_(Civ5) UnitPromotionIcons/Charge_(Civ5)
rotate: false rotate: false
xy: 2015, 1822 xy: 1966, 942
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Coastal_Raider_III_(Civ5) UnitPromotionIcons/Coastal_Raider_III_(Civ5)
rotate: false rotate: false
xy: 1966, 942 xy: 852, 192
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Coastal_Raider_II_(Civ5) UnitPromotionIcons/Coastal_Raider_II_(Civ5)
rotate: false rotate: false
xy: 852, 192 xy: 256, 79
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Coastal_Raider_I_(Civ5) UnitPromotionIcons/Coastal_Raider_I_(Civ5)
rotate: false rotate: false
xy: 1531, 1952 xy: 2018, 678
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Cover_II_(Civ5) UnitPromotionIcons/Cover_II_(Civ5)
rotate: false rotate: false
xy: 256, 79 xy: 1979, 576
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Cover_I_(Civ5) UnitPromotionIcons/Cover_I_(Civ5)
rotate: false rotate: false
xy: 2018, 678 xy: 1981, 1952
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Drill_III_(Civ5) UnitPromotionIcons/Drill_III_(Civ5)
rotate: false rotate: false
xy: 1979, 576 xy: 2003, 1974
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Drill_II_(Civ5) UnitPromotionIcons/Drill_II_(Civ5)
rotate: false rotate: false
xy: 1981, 1952 xy: 106, 24
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Drill_I_(Civ5) UnitPromotionIcons/Drill_I_(Civ5)
rotate: false rotate: false
xy: 2003, 1974 xy: 106, 2
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Formation_II_(Civ5) UnitPromotionIcons/Formation_II_(Civ5)
rotate: false rotate: false
xy: 106, 24 xy: 1425, 272
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Formation_I_(Civ5) UnitPromotionIcons/Formation_I_(Civ5)
rotate: false rotate: false
xy: 106, 2 xy: 2015, 1800
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Indirect_Fire_(Civ5) UnitPromotionIcons/Indirect_Fire_(Civ5)
rotate: false rotate: false
xy: 1425, 272 xy: 1988, 942
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Logistics_(Civ5) UnitPromotionIcons/Logistics_(Civ5)
rotate: false rotate: false
xy: 2015, 1800 xy: 852, 170
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/March_(Civ5) UnitPromotionIcons/March_(Civ5)
rotate: false rotate: false
xy: 1988, 942 xy: 874, 192
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Mobility_(Civ5) UnitPromotionIcons/Mobility_(Civ5)
rotate: false rotate: false
xy: 852, 170 xy: 278, 79
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Range_(Civ5) UnitPromotionIcons/Range_(Civ5)
rotate: false rotate: false
xy: 874, 192 xy: 2018, 656
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Scouting_III_(Civ5) UnitPromotionIcons/Scouting_III_(Civ5)
rotate: false rotate: false
xy: 278, 79 xy: 1979, 554
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Scouting_II_(Civ5) UnitPromotionIcons/Scouting_II_(Civ5)
rotate: false rotate: false
xy: 2018, 656 xy: 2003, 1952
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Scouting_I_(Civ5) UnitPromotionIcons/Scouting_I_(Civ5)
rotate: false rotate: false
xy: 1979, 554 xy: 1425, 250
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Sentry_(Civ5) UnitPromotionIcons/Sentry_(Civ5)
rotate: false rotate: false
xy: 2003, 1952 xy: 1447, 272
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Shock_III_(Civ5) UnitPromotionIcons/Shock_III_(Civ5)
rotate: false rotate: false
xy: 1425, 250 xy: 1469, 293
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Shock_II_(Civ5) UnitPromotionIcons/Shock_II_(Civ5)
rotate: false rotate: false
xy: 1447, 272 xy: 2015, 1778
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Shock_I_(Civ5) UnitPromotionIcons/Shock_I_(Civ5)
rotate: false rotate: false
xy: 1469, 293 xy: 852, 148
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Siege_(Civ5) UnitPromotionIcons/Siege_(Civ5)
rotate: false rotate: false
xy: 2015, 1778 xy: 874, 170
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Targeting_III_(Civ5) UnitPromotionIcons/Targeting_III_(Civ5)
rotate: false rotate: false
xy: 852, 148 xy: 896, 192
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Targeting_II_(Civ5) UnitPromotionIcons/Targeting_II_(Civ5)
rotate: false rotate: false
xy: 874, 170 xy: 300, 79
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Targeting_I_(Civ5) UnitPromotionIcons/Targeting_I_(Civ5)
rotate: false rotate: false
xy: 896, 192 xy: 2018, 634
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Volley_(Civ5) UnitPromotionIcons/Volley_(Civ5)
rotate: false rotate: false
xy: 300, 79 xy: 1979, 532
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Wolfpack_III_(Civ5) UnitPromotionIcons/Wolfpack_III_(Civ5)
rotate: false rotate: false
xy: 2018, 634 xy: 1425, 228
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Wolfpack_II_(Civ5) UnitPromotionIcons/Wolfpack_II_(Civ5)
rotate: false rotate: false
xy: 1979, 532 xy: 1447, 250
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
UnitPromotionIcons/Wolfpack_I_(Civ5) UnitPromotionIcons/Wolfpack_I_(Civ5)
rotate: false rotate: false
xy: 1425, 228 xy: 1469, 271
size: 20, 20 size: 20, 20
orig: 20, 20 orig: 20, 20
offset: 0, 0 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:"表示オプション" Japanese:"表示オプション"
} }
"Turns between autosaves:":{ "Turns between autosaves":{
Italian:"Turni tra autosalvataggi" Italian:"Turni tra autosalvataggi"
} }
@ -721,7 +721,7 @@
Japanese:"隠す" Japanese:"隠す"
} }
"worked tiles":{ "Worked tiles":{
Italian:"celle sfruttate" Italian:"celle sfruttate"
Russian:"обработанные клетки" Russian:"обработанные клетки"
French:"cases exploités" French:"cases exploités"
@ -734,7 +734,7 @@
Japanese:"働いたタイル" Japanese:"働いたタイル"
} }
"resources and improvements":{ "Resources and improvements":{
Italian:"Risorse e miglioramenti" Italian:"Risorse e miglioramenti"
Russian:"ресурсы и улучшения" Russian:"ресурсы и улучшения"
French:"ressources et améliorations" French:"ressources et améliorations"

View file

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

View file

@ -1,7 +1,6 @@
package com.unciv.ui.tilegroups package com.unciv.ui.tilegroups
import com.badlogic.gdx.graphics.Color 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.Actor
import com.badlogic.gdx.scenes.scene2d.Group import com.badlogic.gdx.scenes.scene2d.Group
import com.badlogic.gdx.scenes.scene2d.ui.Image import com.badlogic.gdx.scenes.scene2d.ui.Image
@ -18,7 +17,9 @@ import com.unciv.ui.utils.UnitGroup
import com.unciv.ui.utils.center import com.unciv.ui.utils.center
open class TileGroup(var tileInfo: TileInfo) : Group() { 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 baseTerrainImage: Image? = null
protected var baseTerrain:String="" protected var baseTerrain:String=""
protected var terrainFeatureImage: Image? = null protected var terrainFeatureImage: Image? = null
@ -48,7 +49,9 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
init { init {
val groupSize = 54f val groupSize = 54f
this.setSize(groupSize, groupSize) this.setSize(groupSize, groupSize)
addHexagon(groupSize) addHexagon(groupSize)
addCircleImage() addCircleImage()
addFogImage(groupSize) addFogImage(groupSize)
addCrosshairImage() addCrosshairImage()
@ -87,6 +90,10 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
} }
private fun addHexagon(groupSize: Float) { 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 val imageScale = groupSize * 1.5f / hexagon.width
hexagon.setScale(imageScale) hexagon.setScale(imageScale)
hexagon.setOrigin(Align.center) hexagon.setOrigin(Align.center)
@ -135,8 +142,8 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
return return
} }
updateTerrainFeatureImage()
updateTerrainBaseImage() updateTerrainBaseImage()
updateTerrainFeatureImage()
updateCityImage() updateCityImage()
updateTileColor(isViewable) updateTileColor(isViewable)
@ -165,7 +172,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
baseTerrainImage=null baseTerrainImage=null
} }
val imagePath = "TerrainIcons/" + tileInfo.baseTerrain val imagePath = tileSetLocation + tileInfo.baseTerrain + "Overlay"
if (!ImageGetter.imageExists(imagePath)) return if (!ImageGetter.imageExists(imagePath)) return
baseTerrainImage = ImageGetter.getImage(imagePath) baseTerrainImage = ImageGetter.getImage(imagePath)
baseTerrainImage!!.run { 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) { private fun updateTileColor(isViewable: Boolean) {
hexagon.color = tileInfo.getBaseTerrain().getColor()
if (!isViewable) hexagon.color = hexagon.color.lerp(Color.BLACK, 0.6f) 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() { private fun updateTerrainFeatureImage() {
@ -307,7 +311,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
terrainFeatureImage = null terrainFeatureImage = null
if(terrainFeature!=null) { if(terrainFeature!=null) {
terrainFeatureImage = ImageGetter.getImage("TerrainIcons/$terrainFeature.png") terrainFeatureImage = ImageGetter.getImage(tileSetLocation +"$terrainFeature"+"Overlay")
addActor(terrainFeatureImage) addActor(terrainFeatureImage)
terrainFeatureImage!!.run { terrainFeatureImage!!.run {
setSize(30f, 30f) 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) 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", // there are tiles "below the zero",
// so we zero out the starting position of the whole board so they will be displayed as well // 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) 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.Actor
import com.badlogic.gdx.scenes.scene2d.ui.SelectBox import com.badlogic.gdx.scenes.scene2d.ui.SelectBox
import com.badlogic.gdx.scenes.scene2d.ui.Slider 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.scenes.scene2d.utils.ChangeListener
import com.badlogic.gdx.utils.Array import com.badlogic.gdx.utils.Array
import com.unciv.UnCivGame import com.unciv.UnCivGame
@ -42,12 +41,14 @@ class WorldScreenOptionsTable(screen:WorldScreen) : PopupTable(screen){
settings.save() settings.save()
clear() clear()
if (settings.showWorkedTiles) addButton("{Hide} {worked tiles}") { settings.showWorkedTiles = false; update() } add("Worked tiles".toLabel())
else addButton("{Show} {worked tiles}") { settings.showWorkedTiles = true; update() } if (settings.showWorkedTiles) addButton("Hide") { settings.showWorkedTiles = false; update() }
else addButton("Show") { settings.showWorkedTiles = true; update() }
add("Resources and improvements".toLabel())
if (settings.showResourcesAndImprovements) if (settings.showResourcesAndImprovements)
addButton("{Hide} {resources and improvements}") { settings.showResourcesAndImprovements = false; update() } addButton("Hide") { settings.showResourcesAndImprovements = false; update() }
else addButton("{Show} {resources and improvements}") { settings.showResourcesAndImprovements = true; update() } else addButton("Show") { settings.showResourcesAndImprovements = true; update() }
addLanguageSelectBox() addLanguageSelectBox()
@ -65,6 +66,8 @@ class WorldScreenOptionsTable(screen:WorldScreen) : PopupTable(screen){
} }
private fun addSoundEffectsVolumeSlider() { private fun addSoundEffectsVolumeSlider() {
add("Sound effects volume".tr())
val soundEffectsVolumeSlider = Slider(0f, 1.0f, 0.1f, false, skin) val soundEffectsVolumeSlider = Slider(0f, 1.0f, 0.1f, false, skin)
soundEffectsVolumeSlider.value = UnCivGame.Current.settings.soundEffectsVolume soundEffectsVolumeSlider.value = UnCivGame.Current.settings.soundEffectsVolume
soundEffectsVolumeSlider.addListener(object : ChangeListener() { soundEffectsVolumeSlider.addListener(object : ChangeListener() {
@ -74,11 +77,12 @@ class WorldScreenOptionsTable(screen:WorldScreen) : PopupTable(screen){
Sounds.play("click") Sounds.play("click")
} }
}) })
add("Sound effects volume".tr()).row()
add(soundEffectsVolumeSlider).row() add(soundEffectsVolumeSlider).row()
} }
private fun addResolutionSelectBox() { private fun addResolutionSelectBox() {
add("Resolution".toLabel())
val resolutionSelectBox = SelectBox<String>(skin) val resolutionSelectBox = SelectBox<String>(skin)
val resolutionArray = Array<String>() val resolutionArray = Array<String>()
resolutionArray.addAll("900x600", "1050x700", "1200x800", "1500x1000") resolutionArray.addAll("900x600", "1050x700", "1200x800", "1500x1000")
@ -98,16 +102,15 @@ class WorldScreenOptionsTable(screen:WorldScreen) : PopupTable(screen){
} }
private fun addAutosaveTurnsSelectBox() { private fun addAutosaveTurnsSelectBox() {
add("Turns between autosaves".toLabel())
val autosaveTurnsSelectBox = SelectBox<Int>(skin) val autosaveTurnsSelectBox = SelectBox<Int>(skin)
val autosaveTurnsArray = Array<Int>() val autosaveTurnsArray = Array<Int>()
autosaveTurnsArray.addAll(1,2,5,10) autosaveTurnsArray.addAll(1,2,5,10)
autosaveTurnsSelectBox.items = autosaveTurnsArray autosaveTurnsSelectBox.items = autosaveTurnsArray
autosaveTurnsSelectBox.selected = UnCivGame.Current.settings.turnsBetweenAutosaves autosaveTurnsSelectBox.selected = UnCivGame.Current.settings.turnsBetweenAutosaves
val table = Table() add(autosaveTurnsSelectBox).pad(10f).row()
table.add("Turns between autosaves:".toLabel())
table.add(autosaveTurnsSelectBox).pad(10f)
add(table).row()
autosaveTurnsSelectBox.addListener(object : ChangeListener() { autosaveTurnsSelectBox.addListener(object : ChangeListener() {
override fun changed(event: ChangeEvent?, actor: Actor?) { override fun changed(event: ChangeEvent?, actor: Actor?) {
@ -119,6 +122,8 @@ class WorldScreenOptionsTable(screen:WorldScreen) : PopupTable(screen){
} }
private fun addLanguageSelectBox() { private fun addLanguageSelectBox() {
add("Language".toLabel())
val languageArray = Array<Language>() val languageArray = Array<Language>()
GameBasics.Translations.getLanguages().map { Language(it) }.sortedByDescending { it.percentComplete } GameBasics.Translations.getLanguages().map { Language(it) }.sortedByDescending { it.percentComplete }
.forEach { languageArray.add(it) } .forEach { languageArray.add(it) }