mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-09 20:29:50 +07:00
Added thin line around tech icons in tech screen
This commit is contained in:
parent
0d19bf9cef
commit
889a2c5946
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 |
@ -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
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user