mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-20 12:48:56 +07:00
Resolved #3035 - added nationsToRemove in modOptions
This commit is contained in:
@ -29,6 +29,7 @@ class ModOptions {
|
||||
var techsToRemove = HashSet<String>()
|
||||
var buildingsToRemove = HashSet<String>()
|
||||
var unitsToRemove = HashSet<String>()
|
||||
var nationsToRemove = HashSet<String>()
|
||||
var uniques = HashSet<String>()
|
||||
}
|
||||
|
||||
@ -77,6 +78,7 @@ class Ruleset {
|
||||
unitPromotions.putAll(ruleset.unitPromotions)
|
||||
units.putAll(ruleset.units)
|
||||
for (unitToRemove in ruleset.modOptions.unitsToRemove) units.remove(unitToRemove)
|
||||
for (nationToRemove in ruleset.modOptions.unitsToRemove) nations.remove(nationToRemove)
|
||||
mods += ruleset.mods
|
||||
}
|
||||
|
||||
@ -103,8 +105,8 @@ class Ruleset {
|
||||
if (modOptionsFile.exists()) {
|
||||
try {
|
||||
modOptions = jsonParser.getFromJson(ModOptions::class.java, modOptionsFile)
|
||||
} catch (ex: Exception) {
|
||||
}
|
||||
catch (ex:Exception){}
|
||||
}
|
||||
|
||||
val techFile = folderHandle.child("Techs.json")
|
||||
@ -186,12 +188,13 @@ class Ruleset {
|
||||
fun getEraNumber(era: String) = getEras().indexOf(era)
|
||||
fun getSummary(): String {
|
||||
val stringList = ArrayList<String>()
|
||||
if (modOptions.isBaseRuleset) stringList += "Base Ruleset\n"
|
||||
if (technologies.isNotEmpty()) stringList.add(technologies.size.toString() + " Techs")
|
||||
if (nations.isNotEmpty()) stringList.add(nations.size.toString() + " Nations")
|
||||
if (units.isNotEmpty()) stringList.add(units.size.toString() + " Units")
|
||||
if (buildings.isNotEmpty()) stringList.add(buildings.size.toString() + " Buildings")
|
||||
if (tileResources.isNotEmpty()) stringList.add(tileResources.size.toString() + " Resources")
|
||||
if (tileImprovements.isNotEmpty()) stringList.add(tileResources.size.toString() + " Improvements")
|
||||
if (tileImprovements.isNotEmpty()) stringList.add(tileImprovements.size.toString() + " Improvements")
|
||||
stringList += ""
|
||||
return stringList.joinToString()
|
||||
}
|
||||
|
@ -43,7 +43,13 @@ class ModManagementScreen: PickerScreen() {
|
||||
removeRightSideClickListeners()
|
||||
rightSideButton.enable()
|
||||
rightSideButton.setText("Download [${repo.name}]".tr())
|
||||
rightSideButton.onClick { downloadMod(repo.svn_url) }
|
||||
rightSideButton.onClick {
|
||||
rightSideButton.setText("Downloading...")
|
||||
rightSideButton.disable()
|
||||
downloadMod(repo.svn_url){
|
||||
rightSideButton.setText("Done!".tr())
|
||||
}
|
||||
}
|
||||
}
|
||||
downloadTable.add(downloadButton).row()
|
||||
}
|
||||
|
Reference in New Issue
Block a user