mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-20 04:38:18 +07:00
Got rid of most of the original civ's Promotion icons and replaced with Unciv icons =)
This commit is contained in:
@ -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
|
||||
}
|
||||
|
||||
|
@ -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)")
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user