mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-07 00:41:39 +07:00
Keep opened mods open and at top of list when reloading mods in 'locate mod errors' tab
This commit is contained in:
@ -32,7 +32,7 @@ import com.unciv.ui.screens.basescreen.BaseScreen
|
|||||||
* @param initContent Optional lambda with [innerTable] as parameter, to help initialize content.
|
* @param initContent Optional lambda with [innerTable] as parameter, to help initialize content.
|
||||||
*/
|
*/
|
||||||
class ExpanderTab(
|
class ExpanderTab(
|
||||||
title: String,
|
val title: String,
|
||||||
fontSize: Int = Constants.headingFontSize,
|
fontSize: Int = Constants.headingFontSize,
|
||||||
icon: Actor? = null,
|
icon: Actor? = null,
|
||||||
startsOutOpened: Boolean = true,
|
startsOutOpened: Boolean = true,
|
||||||
|
@ -78,6 +78,9 @@ class ModCheckTab(
|
|||||||
modCheckFirstRun = false
|
modCheckFirstRun = false
|
||||||
if (modCheckBaseSelect == null) return
|
if (modCheckBaseSelect == null) return
|
||||||
|
|
||||||
|
val openedExpanderTitles = modCheckResultTable.children.filterIsInstance<ExpanderTab>()
|
||||||
|
.filter { it.isOpen }.map { it.title }.toSet()
|
||||||
|
|
||||||
modCheckResultTable.clear()
|
modCheckResultTable.clear()
|
||||||
|
|
||||||
val rulesetErrors = RulesetCache.loadRulesets()
|
val rulesetErrors = RulesetCache.loadRulesets()
|
||||||
@ -92,7 +95,7 @@ class ModCheckTab(
|
|||||||
modCheckBaseSelect!!.isDisabled = true
|
modCheckBaseSelect!!.isDisabled = true
|
||||||
|
|
||||||
Concurrency.run("ModChecker") {
|
Concurrency.run("ModChecker") {
|
||||||
for (mod in RulesetCache.values.sortedBy { it.name }) {
|
for (mod in RulesetCache.values.sortedBy { it.name }.sortedByDescending { it.name in openedExpanderTitles }) {
|
||||||
if (base != MOD_CHECK_WITHOUT_BASE && mod.modOptions.isBaseRuleset) continue
|
if (base != MOD_CHECK_WITHOUT_BASE && mod.modOptions.isBaseRuleset) continue
|
||||||
|
|
||||||
val modLinks =
|
val modLinks =
|
||||||
@ -121,7 +124,7 @@ class ModCheckTab(
|
|||||||
.apply { color = Color.BLACK }
|
.apply { color = Color.BLACK }
|
||||||
.surroundWithCircle(30f, color = iconColor)
|
.surroundWithCircle(30f, color = iconColor)
|
||||||
|
|
||||||
val expanderTab = ExpanderTab(mod.name, icon = icon, startsOutOpened = false) {
|
val expanderTab = ExpanderTab(mod.name, icon = icon, startsOutOpened = mod.name in openedExpanderTitles) {
|
||||||
it.defaults().align(Align.left)
|
it.defaults().align(Align.left)
|
||||||
if (!noProblem && mod.folderLocation != null) {
|
if (!noProblem && mod.folderLocation != null) {
|
||||||
val replaceableUniques = getDeprecatedReplaceableUniques(mod)
|
val replaceableUniques = getDeprecatedReplaceableUniques(mod)
|
||||||
|
Reference in New Issue
Block a user