Added more unit icons =)
Organized tileset image locations
Before Width: | Height: | Size: 876 B After Width: | Height: | Size: 876 B |
Before Width: | Height: | Size: 402 B After Width: | Height: | Size: 402 B |
Before Width: | Height: | Size: 787 B After Width: | Height: | Size: 787 B |
Before Width: | Height: | Size: 387 B After Width: | Height: | Size: 387 B |
Before Width: | Height: | Size: 682 B After Width: | Height: | Size: 682 B |
Before Width: | Height: | Size: 386 B After Width: | Height: | Size: 386 B |
Before Width: | Height: | Size: 876 B After Width: | Height: | Size: 876 B |
Before Width: | Height: | Size: 572 B After Width: | Height: | Size: 572 B |
Before Width: | Height: | Size: 871 B After Width: | Height: | Size: 871 B |
Before Width: | Height: | Size: 510 B After Width: | Height: | Size: 510 B |
Before Width: | Height: | Size: 388 B After Width: | Height: | Size: 388 B |
Before Width: | Height: | Size: 876 B After Width: | Height: | Size: 876 B |
Before Width: | Height: | Size: 861 B After Width: | Height: | Size: 861 B |
Before Width: | Height: | Size: 634 B After Width: | Height: | Size: 634 B |
Before Width: | Height: | Size: 641 B After Width: | Height: | Size: 641 B |
Before Width: | Height: | Size: 569 B After Width: | Height: | Size: 569 B |
Before Width: | Height: | Size: 394 B After Width: | Height: | Size: 394 B |
Before Width: | Height: | Size: 864 B After Width: | Height: | Size: 864 B |
Before Width: | Height: | Size: 776 B After Width: | Height: | Size: 776 B |
Before Width: | Height: | Size: 804 B After Width: | Height: | Size: 804 B |
Before Width: | Height: | Size: 387 B After Width: | Height: | Size: 387 B |
Before Width: | Height: | Size: 895 B After Width: | Height: | Size: 895 B |
Before Width: | Height: | Size: 726 B After Width: | Height: | Size: 726 B |
Before Width: | Height: | Size: 698 B After Width: | Height: | Size: 698 B |
Before Width: | Height: | Size: 388 B |
Before Width: | Height: | Size: 368 B After Width: | Height: | Size: 368 B |
BIN
android/Images/TileSets/FantasyHex/Units/Great War Infantry.png
Normal file
After Width: | Height: | Size: 371 B |
BIN
android/Images/TileSets/FantasyHex/Units/Infantry.png
Normal file
After Width: | Height: | Size: 371 B |
Before Width: | Height: | Size: 368 B After Width: | Height: | Size: 368 B |
BIN
android/Images/TileSets/FantasyHex/Units/Machine Gun.png
Normal file
After Width: | Height: | Size: 395 B |
Before Width: | Height: | Size: 375 B After Width: | Height: | Size: 375 B |
BIN
android/Images/TileSets/FantasyHex/Units/Submarine.png
Normal file
After Width: | Height: | Size: 197 B |
BIN
android/Images/TileSets/FantasyHex/Units/WaterUnit.png
Normal file
After Width: | Height: | Size: 230 B |
BIN
android/Images/TileSets/FantasyHex/Units/Work Boats.png
Normal file
After Width: | Height: | Size: 248 B |
Before Width: | Height: | Size: 377 B After Width: | Height: | Size: 377 B |
Before Width: | Height: | Size: 1016 KiB After Width: | Height: | Size: 1017 KiB |
@ -47,7 +47,7 @@ class CityTileGroup(private val city: CityInfo, tileInfo: TileInfo, tileSetStrin
|
||||
}
|
||||
}
|
||||
|
||||
featureLayerGroup.color.a=0.5f
|
||||
terrainFeatureLayerGroup.color.a=0.5f
|
||||
if (improvementImage != null) improvementImage!!.setColor(1f, 1f, 1f, 0.5f)
|
||||
if (resourceImage != null) resourceImage!!.setColor(1f, 1f, 1f, 0.5f)
|
||||
if (cityImage != null) cityImage!!.setColor(1f, 1f, 1f, 0.5f)
|
||||
|
@ -40,6 +40,7 @@ open class TileGroup(var tileInfo: TileInfo, var tileSetStrings:TileSetStrings)
|
||||
protected var terrainFeature:String?=null
|
||||
protected var cityImage: Image? = null
|
||||
protected var pixelMilitaryUnitImage: Image? = null
|
||||
protected var pixelCivilianUnitImage: Image? = null
|
||||
|
||||
val miscLayerGroup = Group().apply { isTransform=false; setSize(groupSize,groupSize) }
|
||||
var resourceImage: Actor? = null
|
||||
@ -213,6 +214,7 @@ open class TileGroup(var tileInfo: TileInfo, var tileSetStrings:TileSetStrings)
|
||||
updateTerrainBaseImage()
|
||||
updateTerrainFeatureImage()
|
||||
updatePixelMilitaryUnit(showMilitaryUnit)
|
||||
updatePixelCivilianUnit()
|
||||
updateCityImage()
|
||||
updateTileColor(tileIsViewable)
|
||||
|
||||
@ -407,7 +409,12 @@ open class TileGroup(var tileInfo: TileInfo, var tileSetStrings:TileSetStrings)
|
||||
} else {
|
||||
if (pixelMilitaryUnitImage == null) {
|
||||
var imageLocation = ""
|
||||
if (tileInfo.militaryUnit!!.type.isLandUnit() && ImageGetter.imageExists(tileSetStrings.landUnit))
|
||||
|
||||
|
||||
val specificUnitIconLocation = tileSetStrings.unitsLocation+tileInfo.militaryUnit!!.name
|
||||
if(ImageGetter.imageExists(specificUnitIconLocation))
|
||||
imageLocation = specificUnitIconLocation
|
||||
else if (tileInfo.militaryUnit!!.type.isLandUnit() && ImageGetter.imageExists(tileSetStrings.landUnit))
|
||||
imageLocation = tileSetStrings.landUnit
|
||||
else if (tileInfo.militaryUnit!!.type.isWaterUnit() && ImageGetter.imageExists(tileSetStrings.waterUnit))
|
||||
imageLocation = tileSetStrings.waterUnit
|
||||
@ -422,6 +429,29 @@ open class TileGroup(var tileInfo: TileInfo, var tileSetStrings:TileSetStrings)
|
||||
}
|
||||
}
|
||||
|
||||
fun updatePixelCivilianUnit() {
|
||||
if (tileInfo.civilianUnit==null) {
|
||||
if (pixelCivilianUnitImage != null) {
|
||||
pixelCivilianUnitImage!!.remove()
|
||||
pixelCivilianUnitImage = null
|
||||
}
|
||||
} else {
|
||||
if (pixelCivilianUnitImage == null) {
|
||||
var imageLocation = ""
|
||||
val specificUnitIconLocation = tileSetStrings.unitsLocation+tileInfo.civilianUnit!!.name
|
||||
if(ImageGetter.imageExists(specificUnitIconLocation))
|
||||
imageLocation = specificUnitIconLocation
|
||||
|
||||
if (imageLocation != "") {
|
||||
val pixelUnitImage = ImageGetter.getImage(imageLocation)
|
||||
terrainFeatureLayerGroup.addActor(pixelUnitImage)
|
||||
setHexagonImageSize(pixelUnitImage)// Treat this as A TILE, which gets overlayed on the base tile.
|
||||
pixelCivilianUnitImage=pixelUnitImage
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateImprovementImage(showResourcesAndImprovements: Boolean) {
|
||||
if (improvementImage != null) {
|
||||
improvementImage!!.remove()
|
||||
|
@ -6,19 +6,23 @@ class TileSetStrings {
|
||||
// this is so that when we have 100s of TileGroups, they won't all individually come up with all these strings themselves,
|
||||
// it gets pretty memory-intensive (10s of MBs which is a lot for lower-end phones)
|
||||
val tileSetLocation = "TileSets/"+ UnCivGame.Current.settings.tileSet +"/"
|
||||
|
||||
val hexagon = tileSetLocation+"Hexagon"
|
||||
val crosshatchHexagon = tileSetLocation+"CrosshatchHexagon"
|
||||
val cityTile = tileSetLocation+"City"
|
||||
val cityOverlay = tileSetLocation+"CityOverlay"
|
||||
val railroad = tileSetLocation+"Railroad"
|
||||
|
||||
val landUnit = tileSetLocation+"LandUnit"
|
||||
val waterUnit = tileSetLocation+"WaterUnit"
|
||||
val tilesLocation = tileSetLocation+"Tiles/"
|
||||
val cityTile = tilesLocation+"City"
|
||||
|
||||
val unitsLocation = tileSetLocation+"Units/"
|
||||
val landUnit = unitsLocation+"LandUnit"
|
||||
val waterUnit = unitsLocation+"WaterUnit"
|
||||
|
||||
private val baseTerrainToTile = HashMap<String,String>()
|
||||
fun getBaseTerrainTile(baseTerrain:String): String {
|
||||
if(!baseTerrainToTile.containsKey(baseTerrain))
|
||||
baseTerrainToTile[baseTerrain] = "$tileSetLocation$baseTerrain"
|
||||
baseTerrainToTile[baseTerrain] = "$tilesLocation$baseTerrain"
|
||||
return baseTerrainToTile[baseTerrain]!!
|
||||
}
|
||||
|
||||
@ -33,7 +37,7 @@ class TileSetStrings {
|
||||
private val baseTerrainToCityTile = HashMap<String,String>()
|
||||
fun getCityTile(baseTerrain:String): String {
|
||||
if(!baseTerrainToCityTile.containsKey(baseTerrain))
|
||||
baseTerrainToCityTile[baseTerrain] = "$tileSetLocation$baseTerrain+City"
|
||||
baseTerrainToCityTile[baseTerrain] = "$tilesLocation$baseTerrain+City"
|
||||
return baseTerrainToCityTile[baseTerrain]!!
|
||||
}
|
||||
|
||||
|