Simple Originating-Mod display in Civilopedia (#9850)

* Simple Originating-Mod display in Civilopedia

* Simple Originating-Mod display in Civilopedia - patch
This commit is contained in:
SomeTroglodyte 2023-07-30 16:37:50 +02:00 committed by GitHub
parent df7fd27b94
commit bb7c75840e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -1592,6 +1592,7 @@ Domain: [param] =
Toggle UI (World Screen only) =
Overrides yields from underlying terrain =
No yields =
Mod: [modname] =
# Policies

View File

@ -2,6 +2,7 @@ package com.unciv.ui.screens.civilopediascreen
import com.badlogic.gdx.scenes.scene2d.ui.Table
import com.unciv.UncivGame
import com.unciv.models.ruleset.IRulesetObject
import com.unciv.models.ruleset.Ruleset
import com.unciv.models.stats.INamed
@ -82,6 +83,10 @@ interface ICivilopediaText {
if (outerNotEmpty) yield(FormattedLine())
yieldAll(getCivilopediaTextLines(ruleset))
}
if (this@ICivilopediaText is IRulesetObject && ruleset.mods.size > 1 && originRuleset.isNotEmpty()) {
yield(FormattedLine())
yield(FormattedLine("Mod: [$originRuleset]", starred = true, color = "#daa520"))
}
}
return SimpleCivilopediaText(newLines.toList())
}