Added thin line around tech icons in tech screen

This commit is contained in:
Yair Morgenstern 2022-12-16 00:33:19 +02:00
parent 0d19bf9cef
commit 889a2c5946
6 changed files with 1157 additions and 1167 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 439 KiB

After

Width:  |  Height:  |  Size: 530 KiB

View File

@ -61,7 +61,7 @@ open class Notification() : IsPartOfGameInfoSerialization {
if (icons.isEmpty()) return
for (icon in icons.reversed()) {
val image: Actor = when {
ruleset.technologies.containsKey(icon) -> ImageGetter.getTechIcon(icon)
ruleset.technologies.containsKey(icon) -> ImageGetter.getTechIconGroup(icon, iconSize)
ruleset.nations.containsKey(icon) -> ImageGetter.getNationIndicator(
ruleset.nations[icon]!!,
iconSize

View File

@ -23,5 +23,5 @@ class IconCircleGroup(size: Float, val actor: Actor, resizeActor: Boolean = true
addActor(actor)
}
override fun draw(batch: Batch?, parentAlpha: Float) = super.draw(batch, parentAlpha)
override fun draw(batch: Batch?, parentAlpha: Float) = super.draw(batch, parentAlpha*color.a)
}

View File

@ -12,7 +12,6 @@ import com.badlogic.gdx.scenes.scene2d.Actor
import com.badlogic.gdx.scenes.scene2d.Group
import com.badlogic.gdx.scenes.scene2d.ui.Image
import com.badlogic.gdx.scenes.scene2d.ui.Table
import com.badlogic.gdx.scenes.scene2d.utils.Drawable
import com.badlogic.gdx.scenes.scene2d.utils.NinePatchDrawable
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable
import com.badlogic.gdx.utils.Align
@ -369,12 +368,12 @@ object ImageGetter {
return iconGroup
}
fun getTechIconGroup(techName: String, circleSize: Float) = getTechIcon(techName).surroundWithCircle(circleSize)
fun getTechIcon(techName: String): Image {
val techIconColor = ruleset.eras[ruleset.technologies[techName]?.era()]?.getColor()
?: return getWhiteDot()
return getImage("TechIcons/$techName").apply { color = techIconColor.darken(0.6f) }
fun getTechIconGroup(techName: String, circleSize: Float): IconCircleGroup {
val techIconColor = ruleset.eras[ruleset.technologies[techName]?.era()]?.getColor()?.darken(0.6f)
?: Color.BLACK
return getImage("TechIcons/$techName").apply { color = techIconColor }
.surroundWithCircle(circleSize)
.surroundWithThinCircle(techIconColor)
}
fun getProgressBarVertical(width: Float, height: Float, percentComplete: Float, progressColor: Color, backgroundColor: Color): Group {

View File

@ -313,6 +313,8 @@ fun Actor.surroundWithCircle(size: Float, resizeActor: Boolean = true, color: Co
return IconCircleGroup(size, this, resizeActor, color)
}
fun Actor.surroundWithThinCircle(color: Color): IconCircleGroup = surroundWithCircle(width*1.05f, false, color)
fun Actor.addBorder(size:Float, color: Color, expandCell:Boolean = false): Table {
val table = Table()