summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/ModHelpers/GameContentHelper.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Framework/ModHelpers/GameContentHelper.cs')
-rw-r--r--src/SMAPI/Framework/ModHelpers/GameContentHelper.cs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/SMAPI/Framework/ModHelpers/GameContentHelper.cs b/src/SMAPI/Framework/ModHelpers/GameContentHelper.cs
index 42a4de20..956bac7f 100644
--- a/src/SMAPI/Framework/ModHelpers/GameContentHelper.cs
+++ b/src/SMAPI/Framework/ModHelpers/GameContentHelper.cs
@@ -1,3 +1,5 @@
+#nullable disable
+
using System;
using System.Linq;
using StardewModdingAPI.Framework.Content;
@@ -58,13 +60,13 @@ namespace StardewModdingAPI.Framework.ModHelpers
/// <inheritdoc />
public IAssetName ParseAssetName(string rawName)
{
- return this.ContentCore.ParseAssetName(rawName);
+ return this.ContentCore.ParseAssetName(rawName, allowLocales: true);
}
/// <inheritdoc />
public T Load<T>(string key)
{
- IAssetName assetName = this.ContentCore.ParseAssetName(key);
+ IAssetName assetName = this.ContentCore.ParseAssetName(key, allowLocales: true);
return this.Load<T>(assetName);
}
@@ -73,7 +75,7 @@ namespace StardewModdingAPI.Framework.ModHelpers
{
try
{
- return this.GameContentManager.LoadLocalized<T>(assetName, this.CurrentLocaleConstant, useCache: false);
+ return this.GameContentManager.LoadLocalized<T>(assetName, this.CurrentLocaleConstant, useCache: true);
}
catch (Exception ex) when (ex is not SContentLoadException)
{
@@ -117,7 +119,7 @@ namespace StardewModdingAPI.Framework.ModHelpers
assetName ??= $"temp/{Guid.NewGuid():N}";
- return new AssetDataForObject(this.CurrentLocale, this.ContentCore.ParseAssetName(assetName), data, key => this.ParseAssetName(key).Name);
+ return new AssetDataForObject(this.CurrentLocale, this.ContentCore.ParseAssetName(assetName, allowLocales: true), data, key => this.ParseAssetName(key).Name);
}
/// <summary>Get the underlying game content manager.</summary>