mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 13:55:54 -04:00
Fixed gold tile cost bug
This commit is contained in:
parent
50c2ad4573
commit
7e6fa0e895
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 873 KiB After Width: | Height: | Size: 885 KiB |
@ -248,5 +248,9 @@ open class TileInfo {
|
|||||||
return city!=null && city.workedTiles.contains(position)
|
return city!=null && city.workedTiles.contains(position)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun arialDistanceTo(otherTile:TileInfo): Int = (abs(position.x-otherTile.position.x) + abs(position.y-otherTile.position.y)).toInt()
|
fun arialDistanceTo(otherTile:TileInfo): Int {
|
||||||
|
val xDelta = position.x-otherTile.position.x
|
||||||
|
val yDelta = position.y-otherTile.position.y
|
||||||
|
return listOf(abs(xDelta),abs(yDelta), abs(xDelta-yDelta)).max()!!.toInt()
|
||||||
|
}
|
||||||
}
|
}
|
@ -42,8 +42,9 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen()
|
|||||||
touchable = Touchable.enabled
|
touchable = Touchable.enabled
|
||||||
defaults().pad(10f)
|
defaults().pad(10f)
|
||||||
background = ImageGetter.getDrawable("OtherIcons/civTableBackground.png")
|
background = ImageGetter.getDrawable("OtherIcons/civTableBackground.png")
|
||||||
if(ImageGetter.techIconExists(techName))
|
if(ImageGetter.techIconExists(techName)) {
|
||||||
add(ImageGetter.getTechIcon(techName)).size(40f)
|
add(ImageGetter.getTechIconGroup(techName))
|
||||||
|
}
|
||||||
add(text)
|
add(text)
|
||||||
pack()
|
pack()
|
||||||
}
|
}
|
||||||
@ -62,7 +63,7 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen()
|
|||||||
}
|
}
|
||||||
|
|
||||||
val eras = ArrayList<Label>()
|
val eras = ArrayList<Label>()
|
||||||
for(i in techMatrix.indices) eras.add(Label("",CameraStageBaseScreen.skin))
|
for(i in techMatrix.indices) eras.add(Label("",CameraStageBaseScreen.skin).apply { setFontColor(Color.WHITE) })
|
||||||
eras.forEach { topTable.add(it) }
|
eras.forEach { topTable.add(it) }
|
||||||
|
|
||||||
for (i in 0..9) {
|
for (i in 0..9) {
|
||||||
|
@ -56,10 +56,6 @@ object ImageGetter {
|
|||||||
return atlas.findRegion("TechIcons/$techName")!=null
|
return atlas.findRegion("TechIcons/$techName")!=null
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getTechIcon(techName: String): Image {
|
|
||||||
return getImage("TechIcons/$techName")
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getStatIcon(statName: String): Image {
|
fun getStatIcon(statName: String): Image {
|
||||||
return ImageGetter.getImage("StatIcons/$statName")
|
return ImageGetter.getImage("StatIcons/$statName")
|
||||||
.apply { setSize(20f,20f)}
|
.apply { setSize(20f,20f)}
|
||||||
@ -137,4 +133,14 @@ object ImageGetter {
|
|||||||
}
|
}
|
||||||
return group
|
return group
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getTechIconGroup(techName: String): Group {
|
||||||
|
val techIconGroup = Group()
|
||||||
|
techIconGroup.setSize(60f,60f)
|
||||||
|
techIconGroup.addActor(ImageGetter.getImage("OtherIcons/Circle").apply { setSize(60f,60f) })
|
||||||
|
val techIcon = getImage("TechIcons/$techName").apply { setSize(40f,40f)}
|
||||||
|
techIcon.center(techIconGroup)
|
||||||
|
techIconGroup.addActor(techIcon)
|
||||||
|
return techIconGroup
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -168,7 +168,7 @@ class WorldScreen : CameraStageBaseScreen() {
|
|||||||
val tech = civInfo.tech.currentTechnology()!!
|
val tech = civInfo.tech.currentTechnology()!!
|
||||||
val techHeight = 30f
|
val techHeight = 30f
|
||||||
if(ImageGetter.techIconExists(tech))
|
if(ImageGetter.techIconExists(tech))
|
||||||
techButton.add(ImageGetter.getTechIcon(tech)).size(techHeight)
|
techButton.add(ImageGetter.getTechIconGroup(tech))
|
||||||
val advancementGroup = Table()
|
val advancementGroup = Table()
|
||||||
val percentIncomplete = civInfo.tech.remainingScienceToTech(tech) / civInfo.tech.costOfTech(tech).toFloat()
|
val percentIncomplete = civInfo.tech.remainingScienceToTech(tech) / civInfo.tech.costOfTech(tech).toFloat()
|
||||||
val incompletionHeight = techHeight * percentIncomplete
|
val incompletionHeight = techHeight * percentIncomplete
|
||||||
|
Loading…
x
Reference in New Issue
Block a user