diff --git a/android/Images.ReligionIcons/ReligionIcons/Religions.png b/android/Images.ReligionIcons/ReligionIcons/Religions.png new file mode 100644 index 0000000000..7cde1f5791 Binary files /dev/null and b/android/Images.ReligionIcons/ReligionIcons/Religions.png differ diff --git a/android/assets/ReligionIcons.atlas b/android/assets/ReligionIcons.atlas index 6dae6f5903..aee662f3de 100644 --- a/android/assets/ReligionIcons.atlas +++ b/android/assets/ReligionIcons.atlas @@ -81,6 +81,13 @@ ReligionIcons/Religion orig: 100, 100 offset: 0, 0 index: -1 +ReligionIcons/Religions + rotate: false + xy: 1084, 4 + size: 100, 100 + orig: 100, 100 + offset: 0, 0 + index: -1 ReligionIcons/Shinto rotate: false xy: 1192, 4 diff --git a/android/assets/jsons/translations/template.properties b/android/assets/jsons/translations/template.properties index 55665e1bad..517e247ee5 100644 --- a/android/assets/jsons/translations/template.properties +++ b/android/assets/jsons/translations/template.properties @@ -1384,6 +1384,7 @@ Allied with [civName] = Civilization Info = Relations = Trade request = +Garrisoned by unit = # Victory diff --git a/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyFunctions.kt b/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyFunctions.kt index 6e7d1931ab..d8783c0e45 100644 --- a/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyFunctions.kt +++ b/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyFunctions.kt @@ -28,7 +28,7 @@ class DiplomacyFunctions(val civInfo: Civilization){ } .sortedWith( compareByDescending { it.isMajorCiv() } - .thenBy (UncivGame.Current.settings.getCollatorFromLocale()) { it.civName.tr() } + .thenBy (UncivGame.Current.settings.getCollatorFromLocale()) { it.civName.tr(hideIcons = true) } ) diff --git a/core/src/com/unciv/models/ruleset/Belief.kt b/core/src/com/unciv/models/ruleset/Belief.kt index fae0d1dd6f..4879688b9d 100644 --- a/core/src/com/unciv/models/ruleset/Belief.kt +++ b/core/src/com/unciv/models/ruleset/Belief.kt @@ -71,7 +71,7 @@ class Belief() : RulesetObject() { name = "Religions" val lines = ArrayList() lines += FormattedLine(separator = true) - ruleset.religions.sortedWith(compareBy(UncivGame.Current.settings.getCollatorFromLocale()) { it.tr() }).forEach { + ruleset.religions.sortedWith(compareBy(UncivGame.Current.settings.getCollatorFromLocale()) { it.tr(hideIcons = true) }).forEach { lines += FormattedLine(it, icon = "Belief/$it") } civilopediaText = lines diff --git a/core/src/com/unciv/ui/images/ImageGetter.kt b/core/src/com/unciv/ui/images/ImageGetter.kt index 9ee66c5873..727d272034 100644 --- a/core/src/com/unciv/ui/images/ImageGetter.kt +++ b/core/src/com/unciv/ui/images/ImageGetter.kt @@ -274,13 +274,11 @@ object ImageGetter { fun getReligionIcon(iconName: String): Image { return getImage("ReligionIcons/$iconName") } fun getReligionPortrait(iconName: String, size: Float): Portrait { - if (religionIconExists(iconName)) { + if (religionIconExists(iconName)) return PortraitReligion(iconName, size) - } else { - val typeName = ruleset.beliefs[iconName]?.type?.name - if (typeName != null && religionIconExists(typeName)) - return PortraitReligion(typeName, size) - } + val typeName = ruleset.beliefs[iconName]?.type?.name + if (typeName != null && religionIconExists(typeName)) + return PortraitReligion(typeName, size) return PortraitReligion(iconName, size) } diff --git a/core/src/com/unciv/ui/screens/diplomacyscreen/DiplomacyScreen.kt b/core/src/com/unciv/ui/screens/diplomacyscreen/DiplomacyScreen.kt index 5f2167e259..d9d346f5fd 100644 --- a/core/src/com/unciv/ui/screens/diplomacyscreen/DiplomacyScreen.kt +++ b/core/src/com/unciv/ui/screens/diplomacyscreen/DiplomacyScreen.kt @@ -58,7 +58,6 @@ import com.unciv.ui.components.AutoScrollPane as ScrollPane * When [selectCiv] and [selectTrade] are supplied, that Trade for that Civilization is selected, used for the counter-offer option from `TradePopup`. * Note calling this with [selectCiv] a City State and [selectTrade] supplied is **not allowed**. */ -@Suppress("KDocUnresolvedReference") // Mentioning non-field parameters is flagged, but they work anyway class DiplomacyScreen( private val viewingCiv: Civilization, private val selectCiv: Civilization? = null, diff --git a/core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorEditSubTabs.kt b/core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorEditSubTabs.kt index 6553afc13b..1923346d31 100644 --- a/core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorEditSubTabs.kt +++ b/core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorEditSubTabs.kt @@ -304,7 +304,7 @@ class MapEditorEditStartsTab( private fun allowedNations() = ruleset.nations.values.asSequence() .filter { it.name !in disallowNations && !it.hasUnique(UniqueType.CityStateDeprecated) } private fun getNations() = allowedNations() - .sortedWith(compareBy{ it.isCityState }.thenBy(collator) { it.name.tr() }) + .sortedWith(compareBy{ it.isCityState }.thenBy(collator) { it.name.tr(hideIcons = true) }) .map { FormattedLine("[${it.name}] starting location", it.name, "Nation/${it.name}", size = 24) } .asIterable() diff --git a/core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorViewTab.kt b/core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorViewTab.kt index 3d1f85bf4b..4a45a1d6bf 100644 --- a/core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorViewTab.kt +++ b/core/src/com/unciv/ui/screens/mapeditorscreen/tabs/MapEditorViewTab.kt @@ -106,7 +106,7 @@ class MapEditorViewTab( naturalWonders.clear() tileMap.values.asSequence() .mapNotNull { it.naturalWonder } - .sortedWith(compareBy(collator) { it.tr() }) + .sortedWith(compareBy(collator) { it.tr(hideIcons = true) }) .forEach { naturalWonders.add(it, 1) } @@ -260,11 +260,11 @@ class MapEditorViewTab( startingLocationsByNation.asSequence() .filter { tile == null || tile in it.value } .mapNotNull { ruleset!!.nations[it.key] } - .sortedWith(compareBy{ it.isCityState }.thenBy(collator) { it.name.tr() }) + .sortedWith(compareBy{ it.isCityState }.thenBy(collator) { it.name.tr(hideIcons = true) }) private fun TileMap.getStartingLocationSummary() = startingLocationsByNation.asSequence() .mapNotNull { if (it.key in ruleset!!.nations) ruleset!!.nations[it.key]!! to it.value.size else null } - .sortedWith(compareBy>{ it.first.isCityState }.thenBy(collator) { it.first.name.tr() }) + .sortedWith(compareBy>{ it.first.isCityState }.thenBy(collator) { it.first.name.tr(hideIcons = true) }) .map { it.first.name to it.second } } diff --git a/core/src/com/unciv/ui/screens/newgamescreen/GameOptionsTable.kt b/core/src/com/unciv/ui/screens/newgamescreen/GameOptionsTable.kt index fd1514aa65..7ee7917296 100644 --- a/core/src/com/unciv/ui/screens/newgamescreen/GameOptionsTable.kt +++ b/core/src/com/unciv/ui/screens/newgamescreen/GameOptionsTable.kt @@ -516,7 +516,7 @@ private class RandomNationPickerPopup( init { val sortedNations = previousScreen.ruleset.nations.values .filter { it.isMajorCiv } - .sortedWith(compareBy(UncivGame.Current.settings.getCollatorFromLocale()) { it.name.tr() }) + .sortedWith(compareBy(UncivGame.Current.settings.getCollatorFromLocale()) { it.name.tr(hideIcons = true) }) allNationTables = ArrayList( sortedNations.map { NationTable(it, civBlocksWidth, 0f) } // no need for min height ) diff --git a/core/src/com/unciv/ui/screens/overviewscreen/CityOverviewTab.kt b/core/src/com/unciv/ui/screens/overviewscreen/CityOverviewTab.kt index 29510ebdbd..db0a08fe14 100644 --- a/core/src/com/unciv/ui/screens/overviewscreen/CityOverviewTab.kt +++ b/core/src/com/unciv/ui/screens/overviewscreen/CityOverviewTab.kt @@ -119,15 +119,15 @@ class CityOverviewTab( private fun getComparator() = Comparator { city2: City, city1: City -> when(persistableData.sortedBy) { - CITY -> collator.compare(city2.name.tr(), city1.name.tr()) + CITY -> collator.compare(city2.name.tr(hideIcons = true), city1.name.tr(hideIcons = true)) CONSTRUCTION -> collator.compare( - city2.cityConstructions.currentConstructionFromQueue.tr(), - city1.cityConstructions.currentConstructionFromQueue.tr()) + city2.cityConstructions.currentConstructionFromQueue.tr(hideIcons = true), + city1.cityConstructions.currentConstructionFromQueue.tr(hideIcons = true)) "Population" -> city2.population.population - city1.population.population WLTK -> city2.isWeLoveTheKingDayActive().compareTo(city1.isWeLoveTheKingDayActive()) GARRISON -> collator.compare( - city2.getGarrison()?.name?.tr() ?: "", - city1.getGarrison()?.name?.tr() ?: "", + city2.getGarrison()?.name?.tr(hideIcons = true) ?: "", + city1.getGarrison()?.name?.tr(hideIcons = true) ?: "", ) else -> { val stat = Stat.safeValueOf(persistableData.sortedBy)!! diff --git a/core/src/com/unciv/ui/screens/overviewscreen/EspionageOverviewScreen.kt b/core/src/com/unciv/ui/screens/overviewscreen/EspionageOverviewScreen.kt index b105c8768e..f00c31e0aa 100644 --- a/core/src/com/unciv/ui/screens/overviewscreen/EspionageOverviewScreen.kt +++ b/core/src/com/unciv/ui/screens/overviewscreen/EspionageOverviewScreen.kt @@ -128,9 +128,9 @@ class EspionageOverviewScreen(val civInfo: Civilization) : PickerScreen(true) { }.thenBy { it.civ.isCityState() }.thenBy(collator) { - it.civ.civName.tr() + it.civ.civName.tr(hideIcons = true) }.thenBy(collator) { - it.name.tr() + it.name.tr(hideIcons = true) } ) for (city in sortedCities) { diff --git a/core/src/com/unciv/ui/screens/overviewscreen/ResourcesOverviewTab.kt b/core/src/com/unciv/ui/screens/overviewscreen/ResourcesOverviewTab.kt index 86ec0ff021..67cacf3b3b 100644 --- a/core/src/com/unciv/ui/screens/overviewscreen/ResourcesOverviewTab.kt +++ b/core/src/com/unciv/ui/screens/overviewscreen/ResourcesOverviewTab.kt @@ -66,7 +66,7 @@ class ResourcesOverviewTab( .distinct() .sortedWith( compareBy { it.resourceType } - .thenBy(UncivGame.Current.settings.getCollatorFromLocale()) { it.name.tr() } + .thenBy(UncivGame.Current.settings.getCollatorFromLocale()) { it.name.tr(hideIcons = true) } ) .toList() private val origins: List = resourceDrilldown.asSequence() diff --git a/core/src/com/unciv/ui/screens/overviewscreen/WonderOverviewTab.kt b/core/src/com/unciv/ui/screens/overviewscreen/WonderOverviewTab.kt index 97b1210d38..da76226b68 100644 --- a/core/src/com/unciv/ui/screens/overviewscreen/WonderOverviewTab.kt +++ b/core/src/com/unciv/ui/screens/overviewscreen/WonderOverviewTab.kt @@ -184,7 +184,7 @@ class WonderInfo { ruleSet.buildings.values.asSequence() .filter { it.isWonder } // 100 is so wonders with no era get displayed after all eras, not before - .sortedWith(compareBy { wonderEraMap[it.name]?.eraNumber ?: 100 }.thenBy(collator) { it.name.tr() }) + .sortedWith(compareBy { wonderEraMap[it.name]?.eraNumber ?: 100 }.thenBy(collator) { it.name.tr(hideIcons = true) }) .withIndex() .associate { it.index to it.value.name } val wonderCount = allWonderMap.size diff --git a/docs/Modders/Images-and-Audio.md b/docs/Modders/Images-and-Audio.md index 8830dc597c..3c3881aa94 100644 --- a/docs/Modders/Images-and-Audio.md +++ b/docs/Modders/Images-and-Audio.md @@ -62,6 +62,11 @@ For example, [here](https://github.com/vegeta1k95/Civ-5-Icons) is mod showing ho The Unit Types as defined in [UnitTypes.json](../Other/Unit-related-JSON-files#unittypesjson) have no icons in the base game, but Civilopedia can decorate their entries if you supply images named 'Images/UnitTypeIcons/.png'. (while you're at it, you may override the default icon for the Unit Type _category header_ - it's 'UnitTypes.png' in the same folder, or the icons used for the movement domains - 'DomainLand', 'DomainWater', 'DomainAir') +### Adding icons for Beliefs + +The individual Beliefs - as opposed to Belief types, as defined in [Beliefs.json](../Other/Civilization-related-JSON-files#beliefsjson) have no icons in the base game, but Civilopedia can decorate their entries if you supply images named 'Images/ReligionIcons/.png'. +Civilopedia falls back to the icon for the Belief type - as you can see in the base game, but individual icons have precedence if they exist. + ## Sounds Standard values are below. The sounds themselves can be found [here](/sounds).