Restored techButton visualization

This commit is contained in:
Yair Morgenstern
2020-09-03 12:37:04 +03:00
parent 1b3469ea2e
commit 3eb9b36550
6 changed files with 3103 additions and 3092 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 991 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 898 KiB

After

Width:  |  Height:  |  Size: 881 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 483 KiB

After

Width:  |  Height:  |  Size: 500 KiB

View File

@ -15,9 +15,11 @@ class TechButton(techName:String, private val techManager: TechManager, isWorldS
init {
touchable = Touchable.enabled
background = ImageGetter.getRoundedEdgeTableBackground(null,false)
background = ImageGetter.getDrawable("OtherIcons/techButtonBackground").apply { setMinSize(0f,0f) }
pad(10f)
if (ImageGetter.techIconExists(techName))
add(ImageGetter.getTechIconGroup(techName, 60f))
add(ImageGetter.getTechIconGroup(techName, 60f)).left()
val rightSide = Table()
val techCost = techManager.costOfTech(techName)
@ -69,6 +71,8 @@ class TechButton(techName:String, private val techManager: TechManager, isWorldS
.apply { color = Color.BLACK }.surroundWithCircle(techIconSize))
if (isWorldScreen) rightSide.add(techEnabledIcons)
else rightSide.add(techEnabledIcons).width(225f)
else rightSide.add(techEnabledIcons)
// .width(techEnabledIcons.children.size * (techIconSize+6f))
.minWidth(150f)
}
}

View File

@ -115,11 +115,11 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo, centerOnTech: Tec
techTable.add(era.toLabel().addBorder(2f, color)).fill().colspan(columnSpan)
}
for (i in 0..9) {
for (rowIndex in 0..9) {
techTable.row().pad(5f).padRight(40f)
for (j in techMatrix.indices) {
val tech = techMatrix[j][i]
for (columnIndex in techMatrix.indices) {
val tech = techMatrix[columnIndex][rowIndex]
if (tech == null)
techTable.add() // empty cell