summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/ModHelpers/ModContentHelper.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Framework/ModHelpers/ModContentHelper.cs')
-rw-r--r--src/SMAPI/Framework/ModHelpers/ModContentHelper.cs16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/SMAPI/Framework/ModHelpers/ModContentHelper.cs b/src/SMAPI/Framework/ModHelpers/ModContentHelper.cs
index 74ea73de..6429f9bf 100644
--- a/src/SMAPI/Framework/ModHelpers/ModContentHelper.cs
+++ b/src/SMAPI/Framework/ModHelpers/ModContentHelper.cs
@@ -1,10 +1,8 @@
using System;
-using Microsoft.Xna.Framework.Content;
using StardewModdingAPI.Framework.Content;
using StardewModdingAPI.Framework.ContentManagers;
using StardewModdingAPI.Framework.Exceptions;
using StardewModdingAPI.Framework.Reflection;
-using StardewModdingAPI.Toolkit.Utilities.PathLookups;
namespace StardewModdingAPI.Framework.ModHelpers
{
@@ -23,9 +21,6 @@ namespace StardewModdingAPI.Framework.ModHelpers
/// <summary>The friendly mod name for use in errors.</summary>
private readonly string ModName;
- /// <summary>A lookup for relative paths within the <see cref="ContentManager.RootDirectory"/>.</summary>
- private readonly IFilePathLookup RelativePathLookup;
-
/// <summary>Simplifies access to private code.</summary>
private readonly Reflector Reflection;
@@ -39,9 +34,8 @@ namespace StardewModdingAPI.Framework.ModHelpers
/// <param name="mod">The mod using this instance.</param>
/// <param name="modName">The friendly mod name for use in errors.</param>
/// <param name="gameContentManager">The game content manager used for map tilesheets not provided by the mod.</param>
- /// <param name="relativePathLookup">A lookup for relative paths within the <paramref name="relativePathLookup"/>.</param>
/// <param name="reflection">Simplifies access to private code.</param>
- public ModContentHelper(ContentCoordinator contentCore, string modFolderPath, IModMetadata mod, string modName, IContentManager gameContentManager, IFilePathLookup relativePathLookup, Reflector reflection)
+ public ModContentHelper(ContentCoordinator contentCore, string modFolderPath, IModMetadata mod, string modName, IContentManager gameContentManager, Reflector reflection)
: base(mod)
{
string managedAssetPrefix = contentCore.GetManagedAssetPrefix(mod.Manifest.UniqueID);
@@ -49,7 +43,6 @@ namespace StardewModdingAPI.Framework.ModHelpers
this.ContentCore = contentCore;
this.ModContentManager = contentCore.CreateModContentManager(managedAssetPrefix, modName, modFolderPath, gameContentManager);
this.ModName = modName;
- this.RelativePathLookup = relativePathLookup;
this.Reflection = reflection;
}
@@ -57,8 +50,6 @@ namespace StardewModdingAPI.Framework.ModHelpers
public T Load<T>(string relativePath)
where T : notnull
{
- relativePath = this.RelativePathLookup.GetAssetName(relativePath);
-
IAssetName assetName = this.ContentCore.ParseAssetName(relativePath, allowLocales: false);
try
@@ -74,7 +65,6 @@ namespace StardewModdingAPI.Framework.ModHelpers
/// <inheritdoc />
public IAssetName GetInternalAssetName(string relativePath)
{
- relativePath = this.RelativePathLookup.GetAssetName(relativePath);
return this.ModContentManager.GetInternalAssetKey(relativePath);
}
@@ -85,9 +75,7 @@ namespace StardewModdingAPI.Framework.ModHelpers
if (data == null)
throw new ArgumentNullException(nameof(data), "Can't get a patch helper for a null value.");
- relativePath = relativePath != null
- ? this.RelativePathLookup.GetAssetName(relativePath)
- : $"temp/{Guid.NewGuid():N}";
+ relativePath ??= $"temp/{Guid.NewGuid():N}";
return new AssetDataForObject(
locale: this.ContentCore.GetLocale(),