mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-07 00:41:39 +07:00
Civilopedia - Tweaks (#4990)
- Icon for BeliefType.Founder - Religion icons inverted in Civilopedia - Terrain icons in links and entry header centered
This commit is contained in:
BIN
android/Images/ReligionIcons/Founder.png
Normal file
BIN
android/Images/ReligionIcons/Founder.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.5 KiB |
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 972 KiB After Width: | Height: | Size: 975 KiB |
@ -2,6 +2,7 @@ package com.unciv.ui.civilopedia
|
||||
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.scenes.scene2d.Actor
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.Container
|
||||
import com.unciv.Constants
|
||||
import com.unciv.logic.map.TileInfo
|
||||
import com.unciv.models.ruleset.Ruleset
|
||||
@ -42,7 +43,7 @@ object CivilopediaImageGetters {
|
||||
group.showEntireMap = true
|
||||
group.forMapEditorIcon = true
|
||||
group.update()
|
||||
return group
|
||||
return Container(group)
|
||||
}
|
||||
|
||||
val construction = { name: String, size: Float ->
|
||||
@ -77,12 +78,21 @@ object CivilopediaImageGetters {
|
||||
}
|
||||
val belief = { name: String, size: Float ->
|
||||
// Kludge until we decide how exactly to show Religions
|
||||
if (ImageGetter.imageExists("ReligionIcons/$name")) {
|
||||
ImageGetter.getCircledReligionIcon(name, size)
|
||||
fun getInvertedCircledReligionIcon(iconName: String, size: Float) =
|
||||
ImageGetter.getCircledReligionIcon(iconName, size).apply {
|
||||
circle.color = Color.WHITE
|
||||
actor.color = Color.BLACK
|
||||
}
|
||||
if (ImageGetter.religionIconExists(name)) {
|
||||
getInvertedCircledReligionIcon(name, size)
|
||||
} else {
|
||||
val typeName = ImageGetter.ruleset.beliefs[name]?.type?.name
|
||||
if (typeName != null && ImageGetter.religionIconExists(typeName))
|
||||
getInvertedCircledReligionIcon(typeName, size)
|
||||
else null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Enum used as keys for Civilopedia "pages" (categories).
|
||||
*
|
||||
|
@ -303,13 +303,7 @@ class FormattedLine (
|
||||
val parts = iconToDisplay.split('/', limit = 2)
|
||||
if (parts.size != 2) return 0
|
||||
val category = CivilopediaCategories.fromLink(parts[0]) ?: return 0
|
||||
if (category.getImage == null) return 0
|
||||
|
||||
// That Enum custom property is a nullable reference to a lambda which
|
||||
// in turn is allowed to return null. Sorry, but without `!!` the code
|
||||
// won't compile and with we would get the incorrect warning.
|
||||
@Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
val image = category.getImage!!(parts[1], iconSize) ?: return 0
|
||||
val image = category.getImage?.invoke(parts[1], iconSize) ?: return 0
|
||||
|
||||
table.add(image).size(iconSize).padRight(iconPad)
|
||||
return 1
|
||||
|
@ -599,6 +599,7 @@ Unless otherwise specified, all the following are from [the Noun Project](https:
|
||||
* [Zoroastrianism](https://thenounproject.com/search/?q=Zoroastrianism&i=238059) by Dabid J. Pascual for Zoroastrianism
|
||||
* [praying](https://thenounproject.com/term/praying/740809/) by parkjisun for Religion (Civilopedia concept entry)
|
||||
* [praying](https://thenounproject.com/term/praying/886367/) by Gan Khoon Lay for Follower
|
||||
* [Hero](https://thenounproject.com/term/preacher/195465/) by Andrew J. Young for Founder
|
||||
|
||||
## Others
|
||||
|
||||
|
Reference in New Issue
Block a user