mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 14:24:43 -04:00
Hopefully the yield in the city screen looks better now
Added mountains
This commit is contained in:
parent
c807ee5098
commit
ce9d68e375
@ -352,11 +352,13 @@ All the following are from [the Noun Project](https://thenounproject.com) licenc
|
|||||||
## Others
|
## Others
|
||||||
|
|
||||||
* [Circle](https://thenounproject.com/term/circle/1841891/) By Aybige
|
* [Circle](https://thenounproject.com/term/circle/1841891/) By Aybige
|
||||||
* [Arrow](https://thenounproject.com/term/arrow/18123/) By Joe Mortell
|
* [Arrow](https://thenounproject.com/term/arrow/18123/) By Joe Mortell for movement
|
||||||
|
* https://thenounproject.com/term/arrow/2032227/
|
||||||
* [Connection](https://thenounproject.com/search/?q=connection&i=1521886) By Travis Avery
|
* [Connection](https://thenounproject.com/search/?q=connection&i=1521886) By Travis Avery
|
||||||
* [Skull](https://thenounproject.com/search/?q=Skull&i=1030702) By Vladimir Belochkin
|
* [Skull](https://thenounproject.com/search/?q=Skull&i=1030702) By Vladimir Belochkin for disbanding units
|
||||||
* [Crosshair](https://thenounproject.com/search/?q=crosshairs&i=916030) By Bakunetsu Kaito
|
* [Crosshair](https://thenounproject.com/search/?q=crosshairs&i=916030) By Bakunetsu Kaito
|
||||||
* [City](https://thenounproject.com/search/?q=city&i=571332) By Felix Westphal
|
* [City](https://thenounproject.com/search/?q=city&i=571332) By Felix Westphal
|
||||||
* [Fire](https://thenounproject.com/search/?q=Fire&i=96564) By Lloyd Humphreys
|
* [Fire](https://thenounproject.com/search/?q=Fire&i=96564) By Lloyd Humphreys for
|
||||||
* [Sleep](https://thenounproject.com/search/?q=sleep&i=1760085) By Saeful Muslim
|
* [Sleep](https://thenounproject.com/search/?q=sleep&i=1760085) By Saeful Muslim
|
||||||
* [Banner](https://thenounproject.com/term/banner/866282/) By Emir Palavan for embarked units
|
* [Banner](https://thenounproject.com/term/banner/866282/) By Emir Palavan for embarked units
|
||||||
|
* [Arrow](https://thenounproject.com/term/arrow/18123/) By uzeir syarief for moving between idle units
|
Binary file not shown.
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 2.7 KiB |
BIN
android/Images/TerrainIcons/Hill.png
Normal file
BIN
android/Images/TerrainIcons/Hill.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
BIN
android/Images/TerrainIcons/Mountain.png
Normal file
BIN
android/Images/TerrainIcons/Mountain.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 792 KiB After Width: | Height: | Size: 792 KiB |
@ -59,6 +59,12 @@
|
|||||||
defenceBonus: 0.25,
|
defenceBonus: 0.25,
|
||||||
RGB: [74,81,40]
|
RGB: [74,81,40]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name:"Mountain",
|
||||||
|
type:"Land",
|
||||||
|
impassable:true,
|
||||||
|
RGB: [89, 45, 0]
|
||||||
|
},
|
||||||
|
|
||||||
// Terrain features
|
// Terrain features
|
||||||
{
|
{
|
||||||
|
@ -3,7 +3,7 @@ package com.unciv
|
|||||||
import com.unciv.logic.GameSaver
|
import com.unciv.logic.GameSaver
|
||||||
|
|
||||||
class GameSettings {
|
class GameSettings {
|
||||||
var showWorkedTiles: Boolean = true
|
var showWorkedTiles: Boolean = false
|
||||||
var showResourcesAndImprovements: Boolean = true
|
var showResourcesAndImprovements: Boolean = true
|
||||||
var language: String = "English"
|
var language: String = "English"
|
||||||
var resolution: String = "1050x700"
|
var resolution: String = "1050x700"
|
||||||
|
@ -94,6 +94,7 @@ class WorkerAutomation(val unit: MapUnit) {
|
|||||||
(it.civilianUnit== null || it == currentTile)
|
(it.civilianUnit== null || it == currentTile)
|
||||||
&& it.improvement == null
|
&& it.improvement == null
|
||||||
&& it.isLand()
|
&& it.isLand()
|
||||||
|
&& !it.getBaseTerrain().impassable
|
||||||
&& it.canBuildImprovement(chooseImprovement(it), unit.civInfo)
|
&& it.canBuildImprovement(chooseImprovement(it), unit.civInfo)
|
||||||
&& {val city=it.getCity(); city==null || it.getCity()?.civInfo == unit.civInfo}() // don't work tiles belonging to another civ
|
&& {val city=it.getCity(); city==null || it.getCity()?.civInfo == unit.civInfo}() // don't work tiles belonging to another civ
|
||||||
}.sortedByDescending { getPriority(it, unit.civInfo) }.toMutableList()
|
}.sortedByDescending { getPriority(it, unit.civInfo) }.toMutableList()
|
||||||
|
@ -113,6 +113,7 @@ class MapUnit {
|
|||||||
|
|
||||||
fun canPassThrough(tile: TileInfo):Boolean{
|
fun canPassThrough(tile: TileInfo):Boolean{
|
||||||
val tileOwner = tile.getOwner()
|
val tileOwner = tile.getOwner()
|
||||||
|
if(tile.getBaseTerrain().impassable) return false
|
||||||
val isOcean = tile.baseTerrain == "Ocean" // profiling showed that 3.5% of all nextTurn time is taken up by string equals in this function =|
|
val isOcean = tile.baseTerrain == "Ocean" // profiling showed that 3.5% of all nextTurn time is taken up by string equals in this function =|
|
||||||
if(tile.isWater() && type.isLandUnit()){
|
if(tile.isWater() && type.isLandUnit()){
|
||||||
val techUniques = civInfo.tech.getUniques()
|
val techUniques = civInfo.tech.getUniques()
|
||||||
|
@ -290,8 +290,12 @@ open class RandomMapGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun randomizeTile(tileInfo: TileInfo){
|
fun randomizeTile(tileInfo: TileInfo){
|
||||||
RandomMapGenerator().addRandomTerrainFeature(tileInfo)
|
if(tileInfo.getBaseTerrain().type==TerrainType.Land && Math.random()<0.05f){
|
||||||
RandomMapGenerator().addRandomResourceToTile(tileInfo)
|
tileInfo.baseTerrain = "Mountain"
|
||||||
RandomMapGenerator().maybeAddAncientRuins(tileInfo)
|
tileInfo.setTransients()
|
||||||
|
}
|
||||||
|
addRandomTerrainFeature(tileInfo)
|
||||||
|
addRandomResourceToTile(tileInfo)
|
||||||
|
maybeAddAncientRuins(tileInfo)
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -13,7 +13,7 @@ import kotlin.math.abs
|
|||||||
open class TileInfo {
|
open class TileInfo {
|
||||||
@Transient lateinit var tileMap: TileMap
|
@Transient lateinit var tileMap: TileMap
|
||||||
@Transient var owningCity:CityInfo?=null
|
@Transient var owningCity:CityInfo?=null
|
||||||
@Transient lateinit var baseTerrainObject:Terrain
|
@Transient private lateinit var baseTerrainObject:Terrain
|
||||||
|
|
||||||
var militaryUnit:MapUnit?=null
|
var militaryUnit:MapUnit?=null
|
||||||
var civilianUnit:MapUnit?=null
|
var civilianUnit:MapUnit?=null
|
||||||
@ -253,6 +253,7 @@ open class TileInfo {
|
|||||||
if(!defencePercentString.startsWith("-")) defencePercentString = "+$defencePercentString"
|
if(!defencePercentString.startsWith("-")) defencePercentString = "+$defencePercentString"
|
||||||
SB.appendln("[$defencePercentString] to unit defence".tr())
|
SB.appendln("[$defencePercentString] to unit defence".tr())
|
||||||
}
|
}
|
||||||
|
if(getBaseTerrain().impassable) SB.appendln("Impassible")
|
||||||
|
|
||||||
return SB.toString().trim()
|
return SB.toString().trim()
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ class Terrain : NamedStats(), ICivilopedia {
|
|||||||
var RGB: List<Int>? = null
|
var RGB: List<Int>? = null
|
||||||
var movementCost = 1
|
var movementCost = 1
|
||||||
var defenceBonus:Float = 0f
|
var defenceBonus:Float = 0f
|
||||||
var impassible = false
|
var impassable = false
|
||||||
|
|
||||||
fun getColor(): Color = colorFromRGB(RGB!![0], RGB!![1], RGB!![2])
|
fun getColor(): Color = colorFromRGB(RGB!![0], RGB!![1], RGB!![2])
|
||||||
}
|
}
|
@ -1,9 +1,11 @@
|
|||||||
package com.unciv.ui.cityscreen
|
package com.unciv.ui.cityscreen
|
||||||
|
|
||||||
|
import com.badlogic.gdx.graphics.Color
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.HorizontalGroup
|
import com.badlogic.gdx.scenes.scene2d.ui.HorizontalGroup
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.Table
|
import com.badlogic.gdx.scenes.scene2d.ui.Table
|
||||||
import com.unciv.models.stats.Stats
|
import com.unciv.models.stats.Stats
|
||||||
import com.unciv.ui.utils.ImageGetter
|
import com.unciv.ui.utils.ImageGetter
|
||||||
|
import com.unciv.ui.utils.surroundWithCircle
|
||||||
|
|
||||||
class YieldGroup : HorizontalGroup() {
|
class YieldGroup : HorizontalGroup() {
|
||||||
|
|
||||||
@ -15,24 +17,28 @@ class YieldGroup : HorizontalGroup() {
|
|||||||
pack()
|
pack()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getIcon(statName: String) =
|
||||||
|
ImageGetter.getStatIcon(statName).surroundWithCircle(20f)
|
||||||
|
.apply { circle.color= Color.BLACK;circle.color.a=0.5f }
|
||||||
|
|
||||||
private fun getStatIconsTable(statName: String, number: Int): Table {
|
private fun getStatIconsTable(statName: String, number: Int): Table {
|
||||||
val table = Table()
|
val table = Table()
|
||||||
when (number) {
|
when (number) {
|
||||||
1 -> table.add(ImageGetter.getStatIcon(statName)).size(20f)
|
1 -> table.add(getIcon(statName))
|
||||||
2 -> {
|
2 -> {
|
||||||
table.add(ImageGetter.getStatIcon(statName)).size(20f).row()
|
table.add(getIcon(statName)).row()
|
||||||
table.add(ImageGetter.getStatIcon(statName)).size(20f)
|
table.add(getIcon(statName))
|
||||||
}
|
}
|
||||||
3 -> {
|
3 -> {
|
||||||
table.add(ImageGetter.getStatIcon(statName)).size(20f).colspan(2).row()
|
table.add(getIcon(statName)).colspan(2).row()
|
||||||
table.add(ImageGetter.getStatIcon(statName)).size(20f)
|
table.add(getIcon(statName))
|
||||||
table.add(ImageGetter.getStatIcon(statName)).size(20f)
|
table.add(getIcon(statName))
|
||||||
}
|
}
|
||||||
4 -> {
|
4 -> {
|
||||||
table.add(ImageGetter.getStatIcon(statName)).size(20f)
|
table.add(getIcon(statName))
|
||||||
table.add(ImageGetter.getStatIcon(statName)).size(20f).row()
|
table.add(getIcon(statName)).row()
|
||||||
table.add(ImageGetter.getStatIcon(statName)).size(20f)
|
table.add(getIcon(statName))
|
||||||
table.add(ImageGetter.getStatIcon(statName)).size(20f)
|
table.add(getIcon(statName))
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
val largeImage = ImageGetter.getStatIcon(statName)
|
val largeImage = ImageGetter.getStatIcon(statName)
|
||||||
|
@ -17,6 +17,7 @@ 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")
|
protected val hexagon = ImageGetter.getImage("TerrainIcons/Hexagon.png")
|
||||||
|
protected var baseTerrainImage: Image? = null
|
||||||
protected var terrainFeatureImage: Image? = null
|
protected var terrainFeatureImage: Image? = null
|
||||||
protected var cityImage: Image? = null
|
protected var cityImage: Image? = null
|
||||||
|
|
||||||
@ -44,9 +45,22 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
|
|||||||
addCircleImage()
|
addCircleImage()
|
||||||
addFogImage(groupSize)
|
addFogImage(groupSize)
|
||||||
addCrosshairImage()
|
addCrosshairImage()
|
||||||
|
addBaseTerrainImage()
|
||||||
isTransform = false
|
isTransform = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun addBaseTerrainImage() {
|
||||||
|
val imagePath = "TerrainIcons/"+tileInfo.baseTerrain
|
||||||
|
if(!ImageGetter.imageExists(imagePath)) return
|
||||||
|
baseTerrainImage = ImageGetter.getImage(imagePath)
|
||||||
|
baseTerrainImage!!.run {
|
||||||
|
color.a=0.25f
|
||||||
|
setSize(40f,40f)
|
||||||
|
center(this@TileGroup)
|
||||||
|
}
|
||||||
|
addActor(baseTerrainImage)
|
||||||
|
}
|
||||||
|
|
||||||
private fun addCircleImage() {
|
private fun addCircleImage() {
|
||||||
circleImage.width = 50f
|
circleImage.width = 50f
|
||||||
circleImage.height = 50f
|
circleImage.height = 50f
|
||||||
|
@ -53,8 +53,12 @@ object ImageGetter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun imageExists(fileName:String): Boolean {
|
||||||
|
return atlas.findRegion(fileName)!=null
|
||||||
|
}
|
||||||
|
|
||||||
fun techIconExists(techName:String): Boolean {
|
fun techIconExists(techName:String): Boolean {
|
||||||
return atlas.findRegion("TechIcons/$techName")!=null
|
return imageExists("TechIcons/$techName")
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getStatIcon(statName: String): Image {
|
fun getStatIcon(statName: String): Image {
|
||||||
|
@ -268,9 +268,9 @@ class WorldScreen : CameraStageBaseScreen() {
|
|||||||
&& civInfo.viewableTiles.any { it.getUnits().any { unit -> unit.civInfo.isBarbarianCivilization() } })
|
&& civInfo.viewableTiles.any { it.getUnits().any { unit -> unit.civInfo.isBarbarianCivilization() } })
|
||||||
displayTutorials("BarbarianEncountered")
|
displayTutorials("BarbarianEncountered")
|
||||||
if(civInfo.cities.size > 2) displayTutorials("SecondCity")
|
if(civInfo.cities.size > 2) displayTutorials("SecondCity")
|
||||||
if(civInfo.happiness<0) displayTutorials("Unhappiness")
|
if(civInfo.happiness < 0) displayTutorials("Unhappiness")
|
||||||
if(civInfo.goldenAges.isGoldenAge()) displayTutorials("GoldenAge")
|
if(civInfo.goldenAges.isGoldenAge()) displayTutorials("GoldenAge")
|
||||||
if(gameInfo.turns>=100) displayTutorials("ContactMe")
|
if(gameInfo.turns >= 100) displayTutorials("ContactMe")
|
||||||
val resources = civInfo.getCivResources()
|
val resources = civInfo.getCivResources()
|
||||||
if(resources.keys.any { it.resourceType==ResourceType.Luxury }) displayTutorials("LuxuryResource")
|
if(resources.keys.any { it.resourceType==ResourceType.Luxury }) displayTutorials("LuxuryResource")
|
||||||
if(resources.keys.any { it.resourceType==ResourceType.Strategic}) displayTutorials("StrategicResource")
|
if(resources.keys.any { it.resourceType==ResourceType.Strategic}) displayTutorials("StrategicResource")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user