Fantasy hex tileset is go!
|
@ -3,6 +3,8 @@
|
|||
Flag Icons made by [Freepik](https://www.flaticon.com/authors/freepik) from [www.flaticon.com](https://www.flaticon.com)
|
||||
and licensed by Creative Commons 3.0
|
||||
|
||||
Tile icons for the "Fantasy Hex" tileset belong to CuddlyClover @ https://cuddlyclover.itch.io/fantasy-hex-tiles
|
||||
|
||||
All the following are from [the Noun Project](https://thenounproject.com) licenced under either Creative Commons or Public Domain
|
||||
|
||||
|
||||
|
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
BIN
android/Images/TileSets/Default/Hexagon.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 140 B After Width: | Height: | Size: 140 B |
BIN
android/Images/TileSets/FantasyHex/Coast.png
Normal file
After Width: | Height: | Size: 421 B |
BIN
android/Images/TileSets/FantasyHex/CrosshatchHexagon.png
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
android/Images/TileSets/FantasyHex/Desert.png
Normal file
After Width: | Height: | Size: 495 B |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 422 B After Width: | Height: | Size: 422 B |
BIN
android/Images/TileSets/FantasyHex/Hexagon.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
android/Images/TileSets/FantasyHex/Hill.png
Normal file
After Width: | Height: | Size: 666 B |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
BIN
android/Images/TileSets/FantasyHex/Mountain.png
Normal file
After Width: | Height: | Size: 601 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
BIN
android/Images/TileSets/FantasyHex/Ocean.png
Normal file
After Width: | Height: | Size: 413 B |
BIN
android/Images/TileSets/FantasyHex/Plains.png
Normal file
After Width: | Height: | Size: 421 B |
BIN
android/Images/TileSets/FantasyHex/Tundra.png
Normal file
After Width: | Height: | Size: 732 B |
BIN
android/Images/TileSets/FantasyHex/road.png
Normal file
After Width: | Height: | Size: 140 B |
Before Width: | Height: | Size: 882 KiB After Width: | Height: | Size: 882 KiB |
|
@ -21,8 +21,8 @@ android {
|
|||
applicationId "com.unciv.app"
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 28
|
||||
versionCode 216
|
||||
versionName "2.13.14"
|
||||
versionCode 217
|
||||
versionName "2.13.15"
|
||||
}
|
||||
|
||||
// Had to add this crap for Travis to build, it wanted to sign the app
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.badlogic.gdx.utils.Json
|
|||
import com.unciv.GameSettings
|
||||
import com.unciv.logic.map.TileMap
|
||||
import com.unciv.ui.saves.Gzip
|
||||
import com.unciv.ui.utils.ImageGetter
|
||||
|
||||
class GameSaver {
|
||||
private val saveFilesFolder = "SaveFiles"
|
||||
|
@ -54,7 +55,12 @@ class GameSaver {
|
|||
fun getGeneralSettings(): GameSettings {
|
||||
val settingsFile = getGeneralSettingsFile()
|
||||
if(!settingsFile.exists()) return GameSettings()
|
||||
return json().fromJson(GameSettings::class.java, settingsFile)
|
||||
val settings = json().fromJson(GameSettings::class.java, settingsFile)
|
||||
|
||||
val currentTileSets = ImageGetter.atlas.regions.filter { it.name.startsWith("TileSets") }
|
||||
.map { it.name.split("/")[1] }.distinct()
|
||||
if(settings.tileSet !in currentTileSets) settings.tileSet = "Default"
|
||||
return settings
|
||||
}
|
||||
|
||||
fun setGeneralSettings(gameSettings: GameSettings){
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane
|
|||
import com.badlogic.gdx.scenes.scene2d.ui.Table
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.TextButton
|
||||
import com.unciv.GameParameters
|
||||
import com.unciv.UnCivGame
|
||||
import com.unciv.logic.GameSaver
|
||||
import com.unciv.logic.map.TileMap
|
||||
import com.unciv.models.gamebasics.GameBasics
|
||||
|
@ -23,6 +24,8 @@ import com.unciv.ui.utils.onClick
|
|||
import com.unciv.ui.worldscreen.TileGroupMap
|
||||
|
||||
class MapEditorScreen(): CameraStageBaseScreen(){
|
||||
val tileSetLocation = "TileSets/"+UnCivGame.Current.settings.tileSet +"/"
|
||||
|
||||
var clearTerrainFeature=false
|
||||
var selectedTerrain : Terrain?=null
|
||||
var clearResource=false
|
||||
|
@ -39,7 +42,7 @@ class MapEditorScreen(): CameraStageBaseScreen(){
|
|||
}
|
||||
|
||||
fun getHex(color: Color, image: Actor?=null): Group {
|
||||
val hex = ImageGetter.getImage("TerrainIcons/Hexagon.png")
|
||||
val hex = ImageGetter.getImage(tileSetLocation + "Hexagon")
|
||||
hex.color = color
|
||||
hex.width*=0.3f
|
||||
hex.height*=0.3f
|
||||
|
@ -149,10 +152,10 @@ class MapEditorScreen(): CameraStageBaseScreen(){
|
|||
var color = Color.WHITE
|
||||
|
||||
if (terrain.type == TerrainType.TerrainFeature)
|
||||
iconPath = "TerrainIcons/${terrain.name}.png"
|
||||
iconPath = tileSetLocation + terrain.name+"Overlay"
|
||||
else {
|
||||
color = terrain.getColor()
|
||||
val imagePath = "TerrainIcons/" + terrain.name
|
||||
val imagePath = tileSetLocation + terrain.name+"Overlay"
|
||||
if (ImageGetter.imageExists(imagePath)) {
|
||||
iconPath = imagePath
|
||||
}
|
||||
|
|
|
@ -17,15 +17,16 @@ import com.unciv.ui.utils.UnitGroup
|
|||
import com.unciv.ui.utils.center
|
||||
|
||||
open class TileGroup(var tileInfo: TileInfo) : Group() {
|
||||
val tileSetLocation = "TerrainIcons/"+UnCivGame.Current.settings.tileSet +"/"
|
||||
val tileSetLocation = "TileSets/"+UnCivGame.Current.settings.tileSet +"/"
|
||||
|
||||
protected var hexagon :Image= ImageGetter.getImage("TerrainIcons/Hexagon.png")
|
||||
protected var hexagon :Image= ImageGetter.getImage(tileSetLocation+"Hexagon.png")
|
||||
protected var baseTerrainImage: Image? = null
|
||||
protected var baseTerrain:String=""
|
||||
protected var terrainFeatureImage: Image? = null
|
||||
protected var terrainFeature:String?=null
|
||||
protected var cityImage: Image? = null
|
||||
|
||||
|
||||
var resourceImage: Actor? = null
|
||||
var resource:String?=null
|
||||
var improvementImage: Actor? = null
|
||||
|
@ -36,8 +37,9 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
|
|||
protected var militaryUnitImage: UnitGroup? = null
|
||||
private val circleImage = ImageGetter.getCircle() // for blue and red circles on the tile
|
||||
private val crosshairImage = ImageGetter.getImage("OtherIcons/Crosshair.png") // for when a unit is targeted
|
||||
protected val fogImage = ImageGetter.getImage("TerrainIcons/CrosshatchHexagon")
|
||||
protected val fogImage = ImageGetter.getImage(tileSetLocation+"CrosshatchHexagon")
|
||||
var yieldGroup = YieldGroup()
|
||||
var lastIsRevealed = false
|
||||
|
||||
var showEntireMap = UnCivGame.Current.viewEntireMapForDebug
|
||||
|
||||
|
@ -46,11 +48,11 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
|
|||
var image: Image? = null
|
||||
}
|
||||
|
||||
val groupSize = 54f
|
||||
init {
|
||||
val groupSize = 54f
|
||||
this.setSize(groupSize, groupSize)
|
||||
|
||||
addHexagon(groupSize)
|
||||
updateTileImage(false)
|
||||
|
||||
addCircleImage()
|
||||
addFogImage(groupSize)
|
||||
|
@ -68,6 +70,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
|
|||
}
|
||||
|
||||
private fun addFogImage(groupSize: Float) {
|
||||
print("Adding fog image")
|
||||
val imageScale = groupSize * 1.5f / fogImage.width
|
||||
fogImage.setScale(imageScale)
|
||||
fogImage.setOrigin(Align.center)
|
||||
|
@ -89,9 +92,10 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
|
|||
crosshairImage.isVisible = true
|
||||
}
|
||||
|
||||
private fun addHexagon(groupSize: Float) {
|
||||
private fun updateTileImage(isRevealed: Boolean) {
|
||||
hexagon.remove()
|
||||
val terrainTileLocation = tileSetLocation+tileInfo.baseTerrain
|
||||
if(ImageGetter.imageExists(terrainTileLocation))
|
||||
if(!lastIsRevealed && isRevealed && ImageGetter.imageExists(terrainTileLocation))
|
||||
hexagon = ImageGetter.getImage(terrainTileLocation)
|
||||
|
||||
val imageScale = groupSize * 1.5f / hexagon.width
|
||||
|
@ -142,6 +146,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
|
|||
return
|
||||
}
|
||||
|
||||
updateTileImage(true)
|
||||
updateTerrainBaseImage()
|
||||
updateTerrainFeatureImage()
|
||||
updateCityImage()
|
||||
|
@ -162,6 +167,11 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
|
|||
|
||||
fogImage.toFront()
|
||||
fogImage.isVisible = !(isViewable || showEntireMap)
|
||||
circleImage.toFront()
|
||||
for(borderImage in borderImages.flatMap { it.value })
|
||||
borderImage.toFront()
|
||||
|
||||
lastIsRevealed = true
|
||||
}
|
||||
|
||||
private fun updateTerrainBaseImage() {
|
||||
|
@ -299,9 +309,11 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
|
|||
}
|
||||
|
||||
private fun updateTileColor(isViewable: Boolean) {
|
||||
hexagon.color =
|
||||
if (ImageGetter.imageExists(tileSetLocation + tileInfo.baseTerrain)) Color.WHITE // no need to color it, it's already colored
|
||||
else 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() {
|
||||
|
|
|
@ -33,7 +33,7 @@ class Minimap(val tileMapHolder: TileMapHolder) : ScrollPane(null){
|
|||
var bottomY = 0f
|
||||
|
||||
for (tileInfo in tileMapHolder.tileMap.values) {
|
||||
val hex = ImageGetter.getImage("TerrainIcons/Hexagon.png")
|
||||
val hex = ImageGetter.getImage("OtherIcons/Hexagon")
|
||||
|
||||
val positionalVector = HexMath().hex2WorldCoords(tileInfo.position)
|
||||
val groupSize = 10f
|
||||
|
|
|
@ -56,6 +56,8 @@ class WorldScreenOptionsTable(screen:WorldScreen) : PopupTable(screen){
|
|||
|
||||
addAutosaveTurnsSelectBox()
|
||||
|
||||
addTileSetSelectBox()
|
||||
|
||||
addSoundEffectsVolumeSlider()
|
||||
|
||||
addButton("Close"){ remove() }
|
||||
|
@ -101,6 +103,29 @@ class WorldScreenOptionsTable(screen:WorldScreen) : PopupTable(screen){
|
|||
})
|
||||
}
|
||||
|
||||
private fun addTileSetSelectBox() {
|
||||
add("Tileset".toLabel())
|
||||
|
||||
val tileSetSelectBox = SelectBox<String>(skin)
|
||||
val tileSetArray = Array<String>()
|
||||
val tileSets = ImageGetter.atlas.regions.filter { it.name.startsWith("TileSets") }
|
||||
.map { it.name.split("/")[1] }.distinct()
|
||||
for(tileset in tileSets) tileSetArray.add(tileset)
|
||||
tileSetSelectBox.items = tileSetArray
|
||||
tileSetSelectBox.selected = UnCivGame.Current.settings.tileSet
|
||||
add(tileSetSelectBox).pad(10f).row()
|
||||
|
||||
tileSetSelectBox.addListener(object : ChangeListener() {
|
||||
override fun changed(event: ChangeEvent?, actor: Actor?) {
|
||||
UnCivGame.Current.settings.tileSet = tileSetSelectBox.selected
|
||||
UnCivGame.Current.settings.save()
|
||||
UnCivGame.Current.worldScreen = WorldScreen()
|
||||
UnCivGame.Current.setWorldScreen()
|
||||
WorldScreenOptionsTable(UnCivGame.Current.worldScreen)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun addAutosaveTurnsSelectBox() {
|
||||
add("Turns between autosaves".toLabel())
|
||||
|
||||
|
|