mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-22 02:42:16 -04:00
Warn of rendering performance problems for split atlases
This commit is contained in:
parent
f0bd3cbb4e
commit
a11c3c4216
@ -129,6 +129,7 @@ class RulesetValidator(val ruleset: Ruleset) {
|
||||
checkMisspelledFolders(folder, lines)
|
||||
checkImagesFolders(folder, lines)
|
||||
checkUnknownJsonFilenames(folder, lines)
|
||||
warnSplitAtlasesPerformanceDegradation(folder, lines)
|
||||
}
|
||||
|
||||
private fun checkMisspelledFolders(
|
||||
@ -193,18 +194,31 @@ class RulesetValidator(val ruleset: Ruleset) {
|
||||
) {
|
||||
val jsonFolder = folder.child("jsons")
|
||||
if (!jsonFolder.exists()) return
|
||||
|
||||
|
||||
for (file in jsonFolder.list("json")) {
|
||||
if (file.name() in RulesetFile.entries.map { it.filename }) continue
|
||||
|
||||
var text = "File ${file.name()} is in the jsons folder but is not a recognized ruleset file"
|
||||
val possibleMisspellings = getPossibleMisspellings(file.name(), RulesetFile.entries.map { it.filename })
|
||||
if (possibleMisspellings.isNotEmpty())
|
||||
if (possibleMisspellings.isNotEmpty())
|
||||
text += "\nPossible misspelling of: " + possibleMisspellings.joinToString("/")
|
||||
lines.add(text, RulesetErrorSeverity.OK)
|
||||
}
|
||||
}
|
||||
|
||||
private fun warnSplitAtlasesPerformanceDegradation(
|
||||
folder: FileHandle,
|
||||
lines: RulesetErrorList
|
||||
) {
|
||||
if (folder.child("game2.png").exists()){
|
||||
lines.add(
|
||||
"Your images are being generated into multiple atlas files - this can cause lag for players. " +
|
||||
"Please consult https://yairm210.github.io/Unciv/Modders/Images-and-Audio/#rendering-performance on how to improve rendering performance.",
|
||||
RulesetErrorSeverity.WarningOptionsOnly, sourceObject = null
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun addModOptionsErrors(lines: RulesetErrorList, tryFixUnknownUniques: Boolean) {
|
||||
// Basic Unique validation (type, target, parameters) should always run.
|
||||
|
Loading…
x
Reference in New Issue
Block a user