mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-10 07:16:54 +07:00
Keep opened mods open and at top of list when reloading mods in 'locate mod errors' tab
This commit is contained in:
parent
83655bbd34
commit
4dbed12e45
@ -32,7 +32,7 @@ import com.unciv.ui.screens.basescreen.BaseScreen
|
||||
* @param initContent Optional lambda with [innerTable] as parameter, to help initialize content.
|
||||
*/
|
||||
class ExpanderTab(
|
||||
title: String,
|
||||
val title: String,
|
||||
fontSize: Int = Constants.headingFontSize,
|
||||
icon: Actor? = null,
|
||||
startsOutOpened: Boolean = true,
|
||||
|
@ -78,6 +78,9 @@ class ModCheckTab(
|
||||
modCheckFirstRun = false
|
||||
if (modCheckBaseSelect == null) return
|
||||
|
||||
val openedExpanderTitles = modCheckResultTable.children.filterIsInstance<ExpanderTab>()
|
||||
.filter { it.isOpen }.map { it.title }.toSet()
|
||||
|
||||
modCheckResultTable.clear()
|
||||
|
||||
val rulesetErrors = RulesetCache.loadRulesets()
|
||||
@ -92,7 +95,7 @@ class ModCheckTab(
|
||||
modCheckBaseSelect!!.isDisabled = true
|
||||
|
||||
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
|
||||
|
||||
val modLinks =
|
||||
@ -121,7 +124,7 @@ class ModCheckTab(
|
||||
.apply { color = Color.BLACK }
|
||||
.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)
|
||||
if (!noProblem && mod.folderLocation != null) {
|
||||
val replaceableUniques = getDeprecatedReplaceableUniques(mod)
|
||||
|
Loading…
Reference in New Issue
Block a user