tweak new validation error text
This commit is contained in:
parent
7c6da8e5ec
commit
ae36b9b166
|
@ -432,16 +432,14 @@ namespace StardewModdingAPI.Framework.ContentManagers
|
||||||
this.Monitor.VerboseLog($"Fixing tilesheet paths for map '{relativeMapPath}' from mod '{this.ModName}'...");
|
this.Monitor.VerboseLog($"Fixing tilesheet paths for map '{relativeMapPath}' from mod '{this.ModName}'...");
|
||||||
foreach (TileSheet tilesheet in map.TileSheets)
|
foreach (TileSheet tilesheet in map.TileSheets)
|
||||||
{
|
{
|
||||||
// validate image source
|
|
||||||
if (string.IsNullOrWhiteSpace(tilesheet.ImageSource))
|
|
||||||
{
|
|
||||||
throw new SContentLoadException(ContentLoadErrorType.InvalidData, $"Could not load tilesheet '{tilesheet.Id}' for mod {this.ModName} - no image source found.");
|
|
||||||
}
|
|
||||||
|
|
||||||
// get image source
|
// get image source
|
||||||
tilesheet.ImageSource = this.NormalizePathSeparators(tilesheet.ImageSource);
|
tilesheet.ImageSource = this.NormalizePathSeparators(tilesheet.ImageSource);
|
||||||
string imageSource = tilesheet.ImageSource;
|
string imageSource = tilesheet.ImageSource;
|
||||||
|
|
||||||
|
// validate image source
|
||||||
|
if (string.IsNullOrWhiteSpace(imageSource))
|
||||||
|
throw new SContentLoadException(ContentLoadErrorType.InvalidData, $"{this.ModName} loaded map '{relativeMapPath}' with invalid tilesheet '{tilesheet.Id}'. This tilesheet has no image source.");
|
||||||
|
|
||||||
// reverse incorrect eager tilesheet path prefixing
|
// reverse incorrect eager tilesheet path prefixing
|
||||||
if (fixEagerPathPrefixes && relativeMapFolder.Length > 0 && imageSource.StartsWith(relativeMapFolder))
|
if (fixEagerPathPrefixes && relativeMapFolder.Length > 0 && imageSource.StartsWith(relativeMapFolder))
|
||||||
imageSource = imageSource[(relativeMapFolder.Length + 1)..];
|
imageSource = imageSource[(relativeMapFolder.Length + 1)..];
|
||||||
|
|
Loading…
Reference in New Issue