diff --git a/android/Images/TileSets/FantasyHex/Coast.png b/android/Images/TileSets/FantasyHex/Coast.png index 748682e11c..c7d37eb026 100644 Binary files a/android/Images/TileSets/FantasyHex/Coast.png and b/android/Images/TileSets/FantasyHex/Coast.png differ diff --git a/android/Images/TileSets/FantasyHex/Desert+Flood plains.png b/android/Images/TileSets/FantasyHex/Desert+Flood plains.png index 4ca8063390..542b7200c8 100644 Binary files a/android/Images/TileSets/FantasyHex/Desert+Flood plains.png and b/android/Images/TileSets/FantasyHex/Desert+Flood plains.png differ diff --git a/android/Images/TileSets/FantasyHex/Desert.png b/android/Images/TileSets/FantasyHex/Desert.png index 1849f55712..558b6d8722 100644 Binary files a/android/Images/TileSets/FantasyHex/Desert.png and b/android/Images/TileSets/FantasyHex/Desert.png differ diff --git a/android/Images/TileSets/FantasyHex/Grassland+Marsh.png b/android/Images/TileSets/FantasyHex/Grassland+Marsh.png new file mode 100644 index 0000000000..35ad7c8bca Binary files /dev/null and b/android/Images/TileSets/FantasyHex/Grassland+Marsh.png differ diff --git a/android/Images/TileSets/FantasyHex/Lakes.png b/android/Images/TileSets/FantasyHex/Lakes.png new file mode 100644 index 0000000000..0a9f1326b1 Binary files /dev/null and b/android/Images/TileSets/FantasyHex/Lakes.png differ diff --git a/android/Images/TileSets/FantasyHex/MarshOverlay.png b/android/Images/TileSets/FantasyHex/MarshOverlay.png deleted file mode 100644 index 776297e9ea..0000000000 Binary files a/android/Images/TileSets/FantasyHex/MarshOverlay.png and /dev/null differ diff --git a/android/assets/game.atlas b/android/assets/game.atlas index 3bf50a9b45..1a49911ad7 100644 --- a/android/assets/game.atlas +++ b/android/assets/game.atlas @@ -2125,13 +2125,6 @@ TileSets/Default/MarshOverlay orig: 100, 100 offset: 0, 0 index: -1 -TileSets/FantasyHex/MarshOverlay - rotate: false - xy: 386, 538 - size: 100, 100 - orig: 100, 100 - offset: 0, 0 - index: -1 TileSets/ThorfMaps/MarshOverlay rotate: false xy: 386, 538 @@ -2189,40 +2182,40 @@ TileSets/FantasyHex/City offset: 0, 0 index: -1 TileSets/FantasyHex/Coast - rotate: false - xy: 912, 31 - size: 32, 27 - orig: 32, 27 - offset: 0, 0 - index: -1 -TileSets/FantasyHex/Desert - rotate: false - xy: 488, 540 - size: 32, 28 - orig: 32, 28 - offset: 0, 0 - index: -1 -TileSets/FantasyHex/Desert+Flood plains rotate: false xy: 334, 1050 size: 32, 28 orig: 32, 28 offset: 0, 0 index: -1 -TileSets/FantasyHex/Desert+Oasis +TileSets/FantasyHex/Desert rotate: false xy: 408, 744 size: 32, 28 orig: 32, 28 offset: 0, 0 index: -1 -TileSets/FantasyHex/Grassland +TileSets/FantasyHex/Desert+Flood plains rotate: false xy: 1458, 365 size: 32, 28 orig: 32, 28 offset: 0, 0 index: -1 +TileSets/FantasyHex/Desert+Oasis + rotate: false + xy: 878, 30 + size: 32, 28 + orig: 32, 28 + offset: 0, 0 + index: -1 +TileSets/FantasyHex/Grassland + rotate: false + xy: 1458, 335 + size: 32, 28 + orig: 32, 28 + offset: 0, 0 + index: -1 TileSets/FantasyHex/Grassland+Forest rotate: false xy: 2015, 1813 @@ -2230,6 +2223,13 @@ TileSets/FantasyHex/Grassland+Forest orig: 31, 29 offset: 0, 0 index: -1 +TileSets/FantasyHex/Grassland+Marsh + rotate: false + xy: 488, 539 + size: 32, 29 + orig: 32, 29 + offset: 0, 0 + index: -1 TileSets/FantasyHex/Hill rotate: false xy: 810, 26 @@ -2244,6 +2244,13 @@ TileSets/FantasyHex/Hill+Forest orig: 32, 45 offset: 0, 0 index: -1 +TileSets/FantasyHex/Lakes + rotate: false + xy: 912, 30 + size: 32, 28 + orig: 32, 28 + offset: 0, 0 + index: -1 TileSets/FantasyHex/Mountain rotate: false xy: 132, 542 @@ -2253,14 +2260,14 @@ TileSets/FantasyHex/Mountain index: -1 TileSets/FantasyHex/Ocean rotate: false - xy: 878, 30 + xy: 946, 30 size: 32, 28 orig: 32, 28 offset: 0, 0 index: -1 TileSets/FantasyHex/Plains rotate: false - xy: 1458, 335 + xy: 980, 30 size: 32, 28 orig: 32, 28 offset: 0, 0 @@ -2799,7 +2806,7 @@ UnitPromotionIcons/Boarding_Party_I_(Civ5) index: -1 UnitPromotionIcons/Bombardment_III_(Civ5) rotate: false - xy: 946, 38 + xy: 1014, 38 size: 20, 20 orig: 20, 20 offset: 0, 0 @@ -2834,7 +2841,7 @@ UnitPromotionIcons/Coastal_Raider_III_(Civ5) index: -1 UnitPromotionIcons/Coastal_Raider_II_(Civ5) rotate: false - xy: 968, 38 + xy: 1036, 38 size: 20, 20 orig: 20, 20 offset: 0, 0 @@ -2855,7 +2862,7 @@ UnitPromotionIcons/Cover_II_(Civ5) index: -1 UnitPromotionIcons/Cover_I_(Civ5) rotate: false - xy: 990, 38 + xy: 1058, 38 size: 20, 20 orig: 20, 20 offset: 0, 0 @@ -2869,7 +2876,7 @@ UnitPromotionIcons/Drill_III_(Civ5) index: -1 UnitPromotionIcons/Drill_II_(Civ5) rotate: false - xy: 1012, 38 + xy: 1080, 38 size: 20, 20 orig: 20, 20 offset: 0, 0 @@ -2883,7 +2890,7 @@ UnitPromotionIcons/Drill_I_(Civ5) index: -1 UnitPromotionIcons/Formation_II_(Civ5) rotate: false - xy: 1034, 38 + xy: 1102, 38 size: 20, 20 orig: 20, 20 offset: 0, 0 @@ -2897,7 +2904,7 @@ UnitPromotionIcons/Formation_I_(Civ5) index: -1 UnitPromotionIcons/Indirect_Fire_(Civ5) rotate: false - xy: 1056, 38 + xy: 1124, 38 size: 20, 20 orig: 20, 20 offset: 0, 0 @@ -2911,7 +2918,7 @@ UnitPromotionIcons/Logistics_(Civ5) index: -1 UnitPromotionIcons/March_(Civ5) rotate: false - xy: 1078, 38 + xy: 1146, 38 size: 20, 20 orig: 20, 20 offset: 0, 0 @@ -2925,7 +2932,7 @@ UnitPromotionIcons/Mobility_(Civ5) index: -1 UnitPromotionIcons/Range_(Civ5) rotate: false - xy: 1100, 38 + xy: 1168, 38 size: 20, 20 orig: 20, 20 offset: 0, 0 @@ -2939,98 +2946,98 @@ UnitPromotionIcons/Scouting_III_(Civ5) index: -1 UnitPromotionIcons/Scouting_II_(Civ5) rotate: false - xy: 1122, 38 + xy: 1190, 38 size: 20, 20 orig: 20, 20 offset: 0, 0 index: -1 UnitPromotionIcons/Scouting_I_(Civ5) rotate: false - xy: 1144, 38 + xy: 1212, 38 size: 20, 20 orig: 20, 20 offset: 0, 0 index: -1 UnitPromotionIcons/Sentry_(Civ5) rotate: false - xy: 1166, 38 + xy: 1234, 38 size: 20, 20 orig: 20, 20 offset: 0, 0 index: -1 UnitPromotionIcons/Shock_III_(Civ5) rotate: false - xy: 1188, 38 + xy: 1256, 38 size: 20, 20 orig: 20, 20 offset: 0, 0 index: -1 UnitPromotionIcons/Shock_II_(Civ5) rotate: false - xy: 1210, 38 + xy: 1278, 38 size: 20, 20 orig: 20, 20 offset: 0, 0 index: -1 UnitPromotionIcons/Shock_I_(Civ5) rotate: false - xy: 1232, 38 + xy: 1300, 38 size: 20, 20 orig: 20, 20 offset: 0, 0 index: -1 UnitPromotionIcons/Siege_(Civ5) rotate: false - xy: 1254, 38 + xy: 1322, 38 size: 20, 20 orig: 20, 20 offset: 0, 0 index: -1 UnitPromotionIcons/Targeting_III_(Civ5) rotate: false - xy: 1276, 38 + xy: 1344, 38 size: 20, 20 orig: 20, 20 offset: 0, 0 index: -1 UnitPromotionIcons/Targeting_II_(Civ5) rotate: false - xy: 1298, 38 + xy: 2000, 1150 size: 20, 20 orig: 20, 20 offset: 0, 0 index: -1 UnitPromotionIcons/Targeting_I_(Civ5) rotate: false - xy: 1320, 38 + xy: 1492, 407 size: 20, 20 orig: 20, 20 offset: 0, 0 index: -1 UnitPromotionIcons/Volley_(Civ5) rotate: false - xy: 1342, 38 + xy: 1492, 385 size: 20, 20 orig: 20, 20 offset: 0, 0 index: -1 UnitPromotionIcons/Wolfpack_III_(Civ5) rotate: false - xy: 2000, 1150 + xy: 1492, 363 size: 20, 20 orig: 20, 20 offset: 0, 0 index: -1 UnitPromotionIcons/Wolfpack_II_(Civ5) rotate: false - xy: 1492, 407 + xy: 1492, 341 size: 20, 20 orig: 20, 20 offset: 0, 0 index: -1 UnitPromotionIcons/Wolfpack_I_(Civ5) rotate: false - xy: 1492, 385 + xy: 442, 752 size: 20, 20 orig: 20, 20 offset: 0, 0 diff --git a/android/assets/game.png b/android/assets/game.png index a33696a21c..5aa58ee9ea 100644 Binary files a/android/assets/game.png and b/android/assets/game.png differ diff --git a/core/src/com/unciv/GameSettings.kt b/core/src/com/unciv/GameSettings.kt index 74f7cef0bc..6ea2709de5 100644 --- a/core/src/com/unciv/GameSettings.kt +++ b/core/src/com/unciv/GameSettings.kt @@ -11,7 +11,7 @@ class GameSettings { var hasCrashedRecently = false var soundEffectsVolume = 0.5f var turnsBetweenAutosaves = 1 - var tileSet:String = "Default" + var tileSet:String = "FantasyHex" fun save(){ GameSaver().setGeneralSettings(this) diff --git a/core/src/com/unciv/UnCivGame.kt b/core/src/com/unciv/UnCivGame.kt index 199948fdd4..81f41484bb 100644 --- a/core/src/com/unciv/UnCivGame.kt +++ b/core/src/com/unciv/UnCivGame.kt @@ -17,7 +17,7 @@ class UnCivGame : Game() { * This exists so that when debugging we can see the entire map. * Remember to turn this to false before commit and upload! */ - val viewEntireMapForDebug = false + val viewEntireMapForDebug = true // For when you need to test something in an advanced game and don't have time to faff around val superchargedForDebug = false diff --git a/core/src/com/unciv/ui/tilegroups/TileGroup.kt b/core/src/com/unciv/ui/tilegroups/TileGroup.kt index 231da08a67..547102d049 100644 --- a/core/src/com/unciv/ui/tilegroups/TileGroup.kt +++ b/core/src/com/unciv/ui/tilegroups/TileGroup.kt @@ -26,7 +26,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() { Layers: Base image + overlay Feature overlay / city overlay - Units, improvements, resources, border + Misc: Units, improvements, resources, border Circle, Crosshair, Fog layer City name */ @@ -51,7 +51,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() { protected var civilianUnitImage: UnitGroup? = null protected var militaryUnitImage: UnitGroup? = null - + val circleCrosshairFogLayerGroup = Group().apply { isTransform=false } 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 targete protected val fogImage = ImageGetter.getImage(tileSetLocation+"CrosshatchHexagon") @@ -68,6 +68,10 @@ open class TileGroup(var tileInfo: TileInfo) : Group() { val groupSize = 54f init { this.setSize(groupSize, groupSize) + this.addActor(baseLayerGroup) + this.addActor(featureLayerGroup) + this.addActor(miscLayerGroup) + this.addActor(circleCrosshairFogLayerGroup) updateTileImage(false) @@ -82,7 +86,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() { circleImage.width = 50f circleImage.height = 50f circleImage.center(this) - addActor(circleImage) + circleCrosshairFogLayerGroup.addActor(circleImage) circleImage.isVisible = false } @@ -92,7 +96,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() { fogImage.setOrigin(Align.center) fogImage.center(this) fogImage.color = Color.WHITE.cpy().apply { a = 0.2f } - addActor(fogImage) + circleCrosshairFogLayerGroup.addActor(fogImage) } private fun addCrosshairImage() { @@ -101,7 +105,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() { crosshairImage.center(this) crosshairImage.isVisible = false crosshairImage.color = Color.WHITE.cpy().apply { a = 0.5f } - addActor(crosshairImage) + circleCrosshairFogLayerGroup.addActor(crosshairImage) } fun showCrosshair() { @@ -134,11 +138,10 @@ open class TileGroup(var tileInfo: TileInfo) : Group() { tileBaseImage.y = -groupSize/6 tileBaseImage.toBack() - addActor(tileBaseImage) + baseLayerGroup.addActor(tileBaseImage) } fun addAcquirableIcon(){ - this. populationImage = ImageGetter.getStatIcon("Acquire") populationImage!!.run { color = Color.GREEN.cpy().lerp(Color.BLACK, 0.5f) @@ -146,7 +149,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() { center(this@TileGroup) x += 20 // right } - addActor(populationImage) + miscLayerGroup.addActor(populationImage) } fun addPopulationIcon() { @@ -158,7 +161,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() { center(this@TileGroup) x += 20 // right } - addActor(populationImage) + miscLayerGroup.addActor(populationImage) } protected fun removePopulationIcon() { @@ -219,13 +222,13 @@ open class TileGroup(var tileInfo: TileInfo) : Group() { setSize(40f, 40f) center(this@TileGroup) } - addActor(baseTerrainOverlayImage) + baseLayerGroup.addActor(baseTerrainOverlayImage) } private fun updateCityImage() { if (cityImage == null && tileInfo.isCityCenter()) { cityImage = ImageGetter.getImage("OtherIcons/City.png") - addActor(cityImage) + featureLayerGroup.addActor(cityImage) cityImage!!.run { setSize(60f, 60f) center(this@TileGroup) @@ -287,7 +290,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() { image.moveBy(relativeWorldPosition.y * i * 4, -relativeWorldPosition.x * i * 4) image.color = civColor - addActor(image) + miscLayerGroup.addActor(image) images.add(image) } } @@ -331,7 +334,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() { image.setOrigin(0f, 1f) // This is so that the rotation is calculated from the middle of the road and not the edge image.rotation = (180 / Math.PI * Math.atan2(relativeWorldPosition.y.toDouble(), relativeWorldPosition.x.toDouble())).toFloat() - addActor(image) + featureLayerGroup.addActor(image) } @@ -355,7 +358,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() { val terrainFeatureOverlayLocation = tileSetLocation +"$terrainFeature"+"Overlay" if(!ImageGetter.imageExists(terrainFeatureOverlayLocation)) return terrainFeatureOverlayImage = ImageGetter.getImage(terrainFeatureOverlayLocation) - addActor(terrainFeatureOverlayImage) + featureLayerGroup.addActor(terrainFeatureOverlayImage) terrainFeatureOverlayImage!!.run { setSize(30f, 30f) setColor(1f, 1f, 1f, 0.5f) @@ -373,7 +376,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() { if (tileInfo.improvement != null && showResourcesAndImprovements) { improvementImage = ImageGetter.getImprovementIcon(tileInfo.improvement!!) - addActor(improvementImage) + miscLayerGroup.addActor(improvementImage) improvementImage!!.run { setSize(20f, 20f) center(this@TileGroup) @@ -403,7 +406,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() { resourceImage!!.center(this) resourceImage!!.x = resourceImage!!.x - 22 // left resourceImage!!.y = resourceImage!!.y + 10 // top - addActor(resourceImage!!) + miscLayerGroup.addActor(resourceImage!!) } } @@ -419,7 +422,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() { newImage.blackSpinningCircle = ImageGetter.getCircle() .apply { rotation= oldUnitGroup.blackSpinningCircle!!.rotation} } - addActor(newImage) + miscLayerGroup.addActor(newImage) newImage.center(this) newImage.y += yFromCenter diff --git a/core/src/com/unciv/ui/worldscreen/TileGroupMap.kt b/core/src/com/unciv/ui/worldscreen/TileGroupMap.kt index 5ec8b9cff8..71f8cf4c4b 100644 --- a/core/src/com/unciv/ui/worldscreen/TileGroupMap.kt +++ b/core/src/com/unciv/ui/worldscreen/TileGroupMap.kt @@ -17,7 +17,6 @@ class TileGroupMap(tileGroups:Collection, padding:Float): Group tileGroup.setPosition(positionalVector.x * 0.8f * groupSize.toFloat(), positionalVector.y * 0.8f * groupSize.toFloat()) - addActor(tileGroup) topX = Math.max(topX, tileGroup.x + groupSize) topY = Math.max(topY, tileGroup.y + groupSize) bottomX = Math.min(bottomX, tileGroup.x) @@ -28,8 +27,25 @@ class TileGroupMap(tileGroups:Collection, padding:Float): Group group.moveBy(-bottomX + padding, -bottomY + padding) } - for(group in tileGroups.sortedByDescending { it.tileInfo.position.x + it.tileInfo.position.y }) - group.toFront() + val baseLayers = ArrayList() + val featureLayers = ArrayList() + val miscLayers = ArrayList() + val circleCrosshairFogLayers = ArrayList() + + for(group in tileGroups.sortedByDescending { it.tileInfo.position.x + it.tileInfo.position.y }){ + // now, we steal the subgroups from all the tilegroups, that's how we form layers! + baseLayers.add(group.baseLayerGroup.apply { setPosition(group.x,group.y) }) + featureLayers.add(group.featureLayerGroup.apply { setPosition(group.x,group.y) }) + miscLayers.add(group.miscLayerGroup.apply { setPosition(group.x,group.y) }) + circleCrosshairFogLayers.add(group.circleCrosshairFogLayerGroup.apply { setPosition(group.x,group.y) }) + } + for(group in baseLayers) addActor(group) + for(group in featureLayers) addActor(group) + for(group in miscLayers) addActor(group) + for(group in circleCrosshairFogLayers) addActor(group) + + for(group in tileGroups) addActor(group) // The above layers are for the visual layers, this is for the clicks + // there are tiles "below the zero", // so we zero out the starting position of the whole board so they will be displayed as well diff --git a/core/src/com/unciv/ui/worldscreen/TileMapHolder.kt b/core/src/com/unciv/ui/worldscreen/TileMapHolder.kt index 6053d8a575..1c75bebe29 100644 --- a/core/src/com/unciv/ui/worldscreen/TileMapHolder.kt +++ b/core/src/com/unciv/ui/worldscreen/TileMapHolder.kt @@ -179,7 +179,7 @@ class TileMapHolder(internal val worldScreen: WorldScreen, internal val tileMap: tileGroup.update(canSeeTile, showSubmarine) val unitsInTile = tileGroup.tileInfo.getUnits() - val canSeeEnemy = unitsInTile.isNotEmpty() && !unitsInTile.first().civInfo.isPlayerCivilization() + val canSeeEnemy = unitsInTile.isNotEmpty() && unitsInTile.first().civInfo.isAtWarWith(civInfo) && (showSubmarine || unitsInTile.firstOrNull {!it.isInvisible()}!=null) if(canSeeTile && canSeeEnemy) tileGroup.showCircle(Color.RED) // Display ALL viewable enemies with a red circle so that users don't need to go "hunting" for enemy units