Changed stockpile names to be human readable

This commit is contained in:
yairm210
2025-02-13 20:31:59 +02:00
parent 95c9018b89
commit 5dc4a28707
3 changed files with 17 additions and 13 deletions

View File

@ -478,7 +478,7 @@ enum class UniqueParameterType(
Stockpile("stockpile", "Mana", "The name of any stockpiled resource") {
override fun getKnownValuesForAutocomplete(ruleset: Ruleset): Set<String> {
return ruleset.tileResources.filter { it.value.isStockpiled }.keys +
Stat.entries.map { it.name } + SubStat.StoredFood.name + SubStat.GoldenAgePoints.name
Stat.entries.map { it.name } + SubStat.StoredFood.text + SubStat.GoldenAgePoints.text
}
},

View File

@ -2,21 +2,14 @@ package com.unciv.models.stats
import com.unciv.logic.civilization.NotificationIcon
enum class SubStat(val icon: String) : GameResource {
GoldenAgePoints(NotificationIcon.Happiness),
TotalCulture(NotificationIcon.Culture),
StoredFood(NotificationIcon.Food),
enum class SubStat(val text: String, val icon: String) : GameResource {
GoldenAgePoints("Golde Age points", NotificationIcon.Happiness),
TotalCulture("Total Culture", NotificationIcon.Culture),
StoredFood("Stored Food", NotificationIcon.Food),
;
companion object {
val useableToBuy = setOf(GoldenAgePoints, StoredFood)
val civWideSubStats = setOf(GoldenAgePoints, TotalCulture)
fun safeValueOf(name: String): SubStat? {
return when (name) {
GoldenAgePoints.name -> GoldenAgePoints
TotalCulture.name -> TotalCulture
StoredFood.name -> StoredFood
else -> null
}
}
fun safeValueOf(name: String): SubStat? = entries.firstOrNull { it.text == name }
}
}

View File

@ -235,6 +235,17 @@ don't have enough left in stock.
To use, you need to first define a TileResources with the "Stockpiled" Unique. Then you can reference
them in other Uniques.
## Stockpile
Something that can be added to a civ
Allowed values:
- stockpiled resource (see above)
- Stat name - for global stats, not city stats
- `Stored Food` (for cities)
- `Golden Age points`
## technologyFilter
At the moment only implemented for [ModOptions.techsToRemove](Mod-file-structure/5-Miscellaneous-JSON-files.md#modoptionsjson).