mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-11 03:18:18 +07:00
Deprecation message options only (#5352)
* Do not show RulesetErrorSeverity.WarningOptionsOnly on new game screen * Do not show RulesetErrorSeverity.WarningOptionsOnly on new game screen - fresh atlas
This commit is contained in:
parent
fb30a76e85
commit
6cfc0a82d8
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 1010 KiB After Width: | Height: | Size: 1.0 MiB |
@ -39,13 +39,13 @@ class ModOptions : IHasUniques {
|
||||
var buildingsToRemove = HashSet<String>()
|
||||
var unitsToRemove = HashSet<String>()
|
||||
var nationsToRemove = HashSet<String>()
|
||||
|
||||
|
||||
|
||||
var lastUpdated = ""
|
||||
var modUrl = ""
|
||||
var author = ""
|
||||
var modSize = 0
|
||||
|
||||
|
||||
val maxXPfromBarbarians = 30
|
||||
|
||||
override var uniques = ArrayList<String>()
|
||||
@ -265,7 +265,14 @@ class Ruleset {
|
||||
}
|
||||
|
||||
fun hasReligion() = beliefs.any() && modWithReligionLoaded
|
||||
|
||||
|
||||
/** Used for displaying a RuleSet's name */
|
||||
override fun toString() = when {
|
||||
name.isNotEmpty() -> name
|
||||
mods.isEmpty() -> BaseRuleset.Civ_V_Vanilla.fullName //todo differentiate once more than 1 BaseRuleset
|
||||
else -> "Combined RuleSet"
|
||||
}
|
||||
|
||||
fun getSummary(): String {
|
||||
val stringList = ArrayList<String>()
|
||||
if (modOptions.isBaseRuleset) stringList += "Base Ruleset"
|
||||
@ -320,10 +327,10 @@ class Ruleset {
|
||||
|
||||
|
||||
class RulesetError(val text:String, val errorSeverityToReport: RulesetErrorSeverity)
|
||||
enum class RulesetErrorSeverity{
|
||||
enum class RulesetErrorSeverity {
|
||||
OK,
|
||||
Warning,
|
||||
WarningOptionsOnly,
|
||||
Warning,
|
||||
Error,
|
||||
}
|
||||
|
||||
@ -336,13 +343,17 @@ class Ruleset {
|
||||
add(RulesetError(text, errorSeverityToReport))
|
||||
}
|
||||
|
||||
fun getFinalSeverity(): RulesetErrorSeverity {
|
||||
private fun getFinalSeverity(): RulesetErrorSeverity {
|
||||
if (isEmpty()) return RulesetErrorSeverity.OK
|
||||
return this.maxOf { it.errorSeverityToReport }
|
||||
}
|
||||
|
||||
/** @return `true` means severe errors make the mod unplayable */
|
||||
fun isError() = getFinalSeverity() == RulesetErrorSeverity.Error
|
||||
/** @return `true` means problems exist, Options screen mod checker or unit tests for vanilla ruleset should complain */
|
||||
fun isNotOK() = getFinalSeverity() != RulesetErrorSeverity.OK
|
||||
/** @return `true` means at least errors impacting gameplay exist, new game screen should warn or block */
|
||||
fun isWarnUser() = getFinalSeverity() >= RulesetErrorSeverity.Warning
|
||||
|
||||
fun getErrorText() =
|
||||
filter { it.errorSeverityToReport != RulesetErrorSeverity.WarningOptionsOnly }
|
||||
@ -383,7 +394,7 @@ class Ruleset {
|
||||
checkUniques(building, lines, UniqueType.UniqueComplianceErrorSeverity.RulesetInvariant)
|
||||
|
||||
}
|
||||
|
||||
|
||||
for (nation in nations.values) {
|
||||
if (nation.cities.isEmpty() && !nation.isSpectator() && !nation.isBarbarian()) {
|
||||
lines += "${nation.name} can settle cities, but has no city names!"
|
||||
@ -516,7 +527,7 @@ class Ruleset {
|
||||
if (eras.isEmpty()) {
|
||||
lines += "Eras file is empty! This will likely lead to crashes. Ask the mod maker to update this mod!"
|
||||
}
|
||||
|
||||
|
||||
for (era in eras.values) {
|
||||
for (wonder in era.startingObsoleteWonders)
|
||||
if (wonder !in buildings)
|
||||
|
@ -80,7 +80,7 @@ class ModCheckboxTable(
|
||||
|
||||
// Check over complete combination of selected mods
|
||||
val complexModLinkCheck = RulesetCache.checkCombinedModLinks(mods)
|
||||
if (complexModLinkCheck.isNotOK()) {
|
||||
if (complexModLinkCheck.isWarnUser()) {
|
||||
lastToast?.close()
|
||||
val toastMessage = (
|
||||
if (complexModLinkCheck.isError()) "The mod combination you selected is incorrectly defined!"
|
||||
|
@ -34,7 +34,7 @@ import com.badlogic.gdx.utils.Array as GdxArray
|
||||
|
||||
/**
|
||||
* The Options (Settings) Popup
|
||||
* @param previousScreen Tha caller - note if this is a [WorldScreen] or [MainMenuScreen] they will be rebuilt when major options change.
|
||||
* @param previousScreen The caller - note if this is a [WorldScreen] or [MainMenuScreen] they will be rebuilt when major options change.
|
||||
*/
|
||||
//region Fields
|
||||
class OptionsPopup(val previousScreen: CameraStageBaseScreen) : Popup(previousScreen) {
|
||||
@ -275,13 +275,13 @@ class OptionsPopup(val previousScreen: CameraStageBaseScreen) : Popup(previousSc
|
||||
val lines = ArrayList<FormattedLine>()
|
||||
var noProblem = true
|
||||
for (mod in RulesetCache.values.sortedBy { it.name }) {
|
||||
val label = if (mod.name.isEmpty()) BaseRuleset.Civ_V_Vanilla.fullName else mod.name
|
||||
lines += FormattedLine("$label{}", starred = true, header = 3)
|
||||
// Appending {} is a dirty trick to deactivate the automatic translation which would drop [] from unique messages
|
||||
lines += FormattedLine("$mod{}", starred = true, header = 3)
|
||||
|
||||
val modLinks =
|
||||
if (complex) RulesetCache.checkCombinedModLinks(linkedSetOf(mod.name))
|
||||
else mod.checkModLinks()
|
||||
for (error in modLinks) {
|
||||
for (error in modLinks.sortedByDescending { it.errorSeverityToReport }) {
|
||||
val color = when (error.errorSeverityToReport) {
|
||||
Ruleset.RulesetErrorSeverity.OK -> "#0F0"
|
||||
Ruleset.RulesetErrorSeverity.Warning,
|
||||
|
Loading…
Reference in New Issue
Block a user