This commit is contained in:
yairm210
2024-06-30 00:39:17 +03:00
parent 05ccc84201
commit 2f99b166eb
44 changed files with 666 additions and 136 deletions

View File

@ -401,7 +401,7 @@ class RulesetValidator(val ruleset: Ruleset) {
lines: RulesetErrorList,
tryFixUnknownUniques: Boolean
) {
if (ruleset.terrains.values.none { it.type == TerrainType.Land && !it.impassable })
if (ruleset.terrains.values.none { it.type == TerrainType.Land && !it.impassable && !it.hasUnique(UniqueType.NoNaturalGeneration) })
lines.add("No passable land terrains exist!", sourceObject = null)
for (terrain in ruleset.terrains.values) {

View File

@ -489,7 +489,7 @@ class ModManagementScreen private constructor(
val repoName = modFolder.name() // repo.name still has the replaced "-"'s
ToastPopup("[$repoName] Downloaded!", this@ModManagementScreen)
reloadCachesAfterModChange()
UncivGame.Current.translations.tryReadTranslationForCurrentLanguage()
updateInstalledModUIData(repoName)
refreshInstalledModTable()
lastSelectedButton?.let { syncOnlineSelected(repoName, it) }
@ -657,15 +657,16 @@ class ModManagementScreen private constructor(
private fun reloadCachesAfterModChange() {
RulesetCache.loadRulesets()
ImageGetter.reloadImages()
TileSetCache.loadTileSetConfigs()
ImageGetter.reloadImages()
UncivGame.Current.translations.tryReadTranslationForCurrentLanguage()
}
internal fun refreshOnlineModTable() {
if (runningSearchJob != null) {
ToastPopup("Sorting and filtering needs to wait until the online query finishes", this)
return // cowardice: prevent concurrent modification, avoid a manager layer
}
// if (runningSearchJob != null) {
// ToastPopup("Sorting and filtering needs to wait until the online query finishes", this)
// return // cowardice: prevent concurrent modification, avoid a manager layer
// }
val newHeaderText = optionsManager.getOnlineHeader()
onlineHeaderLabel?.setText(newHeaderText)