TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ OnceFailedLoadingAnAsset()

void Terraria.ModLoader.Mod.OnceFailedLoadingAnAsset ( string assetPath,
Exception e )
inlinepackageinherited

Definition at line 574 of file Mod.cs.

575 {
577 {
578 Logging.Terraria.Error((object)("Failed to load asset: \"" + assetPath + "\""), e);
580 }
581 else if (e is AssetLoadException)
582 {
583 List<string> list = RootContentSource.EnumerateAssets().ToList();
585 foreach (string key in (IEnumerable<string>)list)
586 {
587 string keyWithoutExtension = key.Substring(0, key.LastIndexOf("."));
588 string extension = RootContentSource.GetExtension(keyWithoutExtension);
589 if (extension != null)
590 {
591 cleanKeys.Add(key.Substring(0, key.LastIndexOf(extension)));
592 }
593 }
595 RootContentSource.Rejections.TryGetRejections(reasons);
598 }
599 else
600 {
601 AssetExceptions.Add(e);
602 }
603 }
IContentSource RootContentSource
Definition Mod.cs:116
List< Exception > AssetExceptions
Definition Mod.cs:45
bool initialTransferComplete
Definition Mod.cs:43
static void ShowFailedToLoadAssetError(Exception exception, string filePath)

References Terraria.ModLoader.Mod.AssetExceptions, Terraria.ModLoader.Mod.initialTransferComplete, Terraria.ModLoader.Mod.RootContentSource, Terraria.UI.FancyErrorPrinter.ShowFailedToLoadAssetError(), and Terraria.ModLoader.Logging.Terraria.

Referenced by Terraria.ModLoader.Mod.PrepareAssets().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: