diff --git a/RecrownedAthenaeum/ContentSystem/ContentManagerController.cs b/RecrownedAthenaeum/ContentSystem/ContentManagerController.cs index 8ef5fd2..e7749a7 100644 --- a/RecrownedAthenaeum/ContentSystem/ContentManagerController.cs +++ b/RecrownedAthenaeum/ContentSystem/ContentManagerController.cs @@ -1,4 +1,5 @@ using Microsoft.Xna.Framework.Content; +using RecrownedAthenaeum.ContentSystem.ContentResolvers; using System; using System.Collections.Generic; using System.Diagnostics; @@ -19,6 +20,10 @@ namespace RecrownedAthenaeum.ContentSystem /// Path modifiers to change the path in which the content manager looks to load a file. Used for better organizing things while not needing to type entire path. /// public readonly Dictionary contentPathModifier; + /// + /// Used when no path modifier is defined for that specific type. + /// + public IContentPathModifier normalPathModifier = new NormalContentResolver(); volatile float progress; volatile bool running; @@ -46,16 +51,22 @@ namespace RecrownedAthenaeum.ContentSystem private void Load(string assetName, Type type, bool usePathModifier) { + Debug.WriteLine("Loading asset: " + assetName); string path = assetName; if (usePathModifier) { - IContentPathModifier handler = contentPathModifier[type]; + IContentPathModifier handler; + if (contentPathModifier.ContainsKey(type)) + { + handler = contentPathModifier[type]; + } else + { + handler = normalPathModifier; + } path = handler.Modify(assetName); - } assets.Add(assetName, contentManager.Load(path)); - Debug.WriteLine("Loaded asset: " + assetName); } ///