示例#1
0
 public void ReloadAll()
 {
     foreach (Pair <string, LoadedContentItem <T> > item in ModContentLoader <T> .LoadAllForMod(mod))
     {
         string first = item.First;
         first = first.Replace('\\', '/');
         string text = GenFilePaths.ContentPath <T>();
         if (first.StartsWith(text))
         {
             first = first.Substring(text.Length);
         }
         if (first.EndsWith(Path.GetExtension(first)))
         {
             first = first.Substring(0, first.Length - Path.GetExtension(first).Length);
         }
         if (contentList.ContainsKey(first))
         {
             Log.Warning("Tried to load duplicate " + typeof(T) + " with path: " + item.Second.internalFile + " and internal path: " + first);
         }
         else
         {
             contentList.Add(first, item.Second.contentItem);
             if (item.Second.extraDisposable != null)
             {
                 extraDisposables.Add(item.Second.extraDisposable);
             }
         }
     }
 }
示例#2
0
 public void ReloadAll()
 {
     foreach (LoadedContentItem <T> item in ModContentLoader <T> .LoadAllForMod(this.mod))
     {
         if (this.contentList.ContainsKey(item.internalPath))
         {
             Log.Warning("Tried to load duplicate " + typeof(T) + " with path: " + item.internalPath);
         }
         else
         {
             this.contentList.Add(item.internalPath, item.contentItem);
         }
     }
 }
 public void ReloadAll()
 {
     foreach (LoadedContentItem <T> current in ModContentLoader <T> .LoadAllForMod(this.mod))
     {
         if (this.contentList.ContainsKey(current.internalPath))
         {
             Log.Warning(string.Concat(new object[]
             {
                 "Tried to load duplicate ",
                 typeof(T),
                 " with path: ",
                 current.internalPath
             }), false);
         }
         else
         {
             this.contentList.Add(current.internalPath, current.contentItem);
         }
     }
 }