Added button to reload all rulesets - very helpful if you're working on mods and adding things gradually :)

This commit is contained in:
Yair Morgenstern 2022-02-06 22:07:56 +02:00
parent 9da66c8c08
commit c9d487638c
3 changed files with 7 additions and 1 deletions

View File

@ -550,6 +550,7 @@ Continuous rendering =
When disabled, saves battery life but certain animations will be suspended =
Order trade offers by amount =
Check extension mods based on vanilla =
Reload mods =
Checking mods for errors... =
No problems found. =
Autoupdate mod uniques =

View File

@ -53,7 +53,7 @@ class Building : RulesetStatsObject(), INonPerpetualConstruction {
/** Used for AlertType.WonderBuilt, and as sub-text in Nation and Tech descriptions */
fun getShortDescription(ruleset: Ruleset): String { // should fit in one line
val infoList = mutableListOf<String>()
(this as Stats).toString().also { if (it.isNotEmpty()) infoList += it }
this.clone().toString().also { if (it.isNotEmpty()) infoList += it }
for ((key, value) in getStatPercentageBonuses(null))
infoList += "+${value.toInt()}% ${key.name.tr()}"

View File

@ -263,6 +263,11 @@ class OptionsPopup(val previousScreen: BaseScreen) : Popup(previousScreen) {
private fun getModCheckTab() = Table(BaseScreen.skin).apply {
defaults().pad(10f).align(Align.top)
val reloadModsButton = "Reload mods".toTextButton().onClick {
RulesetCache.loadRulesets()
runModChecker(modCheckCheckBox!!.isChecked)
}
add(reloadModsButton).row()
modCheckCheckBox = "Check extension mods based on vanilla".toCheckBox {
runModChecker(it)
}