mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 14:24:43 -04: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:
parent
e442c4dcf1
commit
448b04fab8
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.graphics.Color
|
||||||
import com.badlogic.gdx.scenes.scene2d.Actor
|
import com.badlogic.gdx.scenes.scene2d.Actor
|
||||||
|
import com.badlogic.gdx.scenes.scene2d.ui.Container
|
||||||
import com.unciv.Constants
|
import com.unciv.Constants
|
||||||
import com.unciv.logic.map.TileInfo
|
import com.unciv.logic.map.TileInfo
|
||||||
import com.unciv.models.ruleset.Ruleset
|
import com.unciv.models.ruleset.Ruleset
|
||||||
@ -42,7 +43,7 @@ object CivilopediaImageGetters {
|
|||||||
group.showEntireMap = true
|
group.showEntireMap = true
|
||||||
group.forMapEditorIcon = true
|
group.forMapEditorIcon = true
|
||||||
group.update()
|
group.update()
|
||||||
return group
|
return Container(group)
|
||||||
}
|
}
|
||||||
|
|
||||||
val construction = { name: String, size: Float ->
|
val construction = { name: String, size: Float ->
|
||||||
@ -77,10 +78,19 @@ object CivilopediaImageGetters {
|
|||||||
}
|
}
|
||||||
val belief = { name: String, size: Float ->
|
val belief = { name: String, size: Float ->
|
||||||
// Kludge until we decide how exactly to show Religions
|
// Kludge until we decide how exactly to show Religions
|
||||||
if (ImageGetter.imageExists("ReligionIcons/$name")) {
|
fun getInvertedCircledReligionIcon(iconName: String, size: Float) =
|
||||||
ImageGetter.getCircledReligionIcon(name, size)
|
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
|
||||||
}
|
}
|
||||||
else null
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -303,13 +303,7 @@ class FormattedLine (
|
|||||||
val parts = iconToDisplay.split('/', limit = 2)
|
val parts = iconToDisplay.split('/', limit = 2)
|
||||||
if (parts.size != 2) return 0
|
if (parts.size != 2) return 0
|
||||||
val category = CivilopediaCategories.fromLink(parts[0]) ?: return 0
|
val category = CivilopediaCategories.fromLink(parts[0]) ?: return 0
|
||||||
if (category.getImage == null) return 0
|
val image = category.getImage?.invoke(parts[1], iconSize) ?: 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
|
|
||||||
|
|
||||||
table.add(image).size(iconSize).padRight(iconPad)
|
table.add(image).size(iconSize).padRight(iconPad)
|
||||||
return 1
|
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
|
* [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/740809/) by parkjisun for Religion (Civilopedia concept entry)
|
||||||
* [praying](https://thenounproject.com/term/praying/886367/) by Gan Khoon Lay for Follower
|
* [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
|
## Others
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user