Got rid of most of the original civ's Promotion icons and replaced with Unciv icons =)

This commit is contained in:
Yair Morgenstern
2019-09-15 23:26:20 +03:00
parent 479b751cb3
commit 48ad8f3f88
44 changed files with 346 additions and 370 deletions

View File

@ -114,8 +114,8 @@ class EmpireOverviewScreen : CameraStageBaseScreen(){
private fun createTradeTable(trade: Trade, otherCiv:CivilizationInfo): Table {
val generalTable = Table(skin)
generalTable.add(createOffersTable(currentPlayerCivInfo,trade.ourOffers, trade.theirOffers.size))
generalTable.add(createOffersTable(otherCiv, trade.theirOffers, trade.ourOffers.size))
generalTable.add(createOffersTable(currentPlayerCivInfo,trade.ourOffers, trade.theirOffers.size)).top()
generalTable.add(createOffersTable(otherCiv, trade.theirOffers, trade.ourOffers.size)).top()
return generalTable
}

View File

@ -116,7 +116,34 @@ object ImageGetter {
return getStatIcon(construction)
}
fun getPromotionIcon(promotionName:String):Image{
fun getPromotionIcon(promotionName:String): Actor {
var level = 0
when {
promotionName.endsWith(" I") -> level=1
promotionName.endsWith(" II") -> level=2
promotionName.endsWith(" III") -> level=3
}
val basePromotionName = if(level==0) promotionName
else promotionName.substring(0, promotionName.length-level-1)
if(imageExists("UnitPromotionIcons/$basePromotionName")) {
val icon = getImage("UnitPromotionIcons/$basePromotionName")
icon.color = colorFromRGB(255,226,0)
var circle = icon.surroundWithCircle(30f)
circle.circle.color = colorFromRGB(0,12,49)
// circle = circle.surroundWithCircle(40f)
// circle.circle.color = colorFromRGB(255,226,0)
if(level!=0){
val starTable = Table().apply { defaults().pad(2f) }
for(i in 1..level) starTable.add(getImage("OtherIcons/Star")).size(8f)
starTable.centerX(circle)
starTable.y=5f
circle.addActor(starTable)
}
return circle
}
return getImage("UnitPromotionIcons/" + promotionName.replace(' ', '_') + "_(Civ5)")
}

View File

@ -184,7 +184,7 @@ class UnitTable(val worldScreen: WorldScreen) : Table(){
if(selectedUnit!=null) {
unitIconHolder.add(UnitGroup(selectedUnit!!,30f)).pad(5f)
for(promotion in selectedUnit!!.promotions.promotions)
promotionsTable.add(ImageGetter.getPromotionIcon(promotion)).size(20f)
promotionsTable.add(ImageGetter.getPromotionIcon(promotion))//.size(20f)
}