diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-11-25 23:01:14 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-11-28 00:01:52 -0500 |
commit | d1d09ae1df63826dd453aa0347d668f420754ed7 (patch) | |
tree | 5c03ee1bd3cd658586755694940ac329491d6493 /src | |
parent | f87e65caf5a71b3ab129c7a0cfd14d49f68dd9c1 (diff) | |
download | SMAPI-d1d09ae1df63826dd453aa0347d668f420754ed7.tar.gz SMAPI-d1d09ae1df63826dd453aa0347d668f420754ed7.tar.bz2 SMAPI-d1d09ae1df63826dd453aa0347d668f420754ed7.zip |
add support for loading BmFont files for custom languages
Diffstat (limited to 'src')
-rw-r--r-- | src/SMAPI/Framework/ContentManagers/ModContentManager.cs | 11 | ||||
-rw-r--r-- | src/SMAPI/SMAPI.csproj | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/SMAPI/Framework/ContentManagers/ModContentManager.cs b/src/SMAPI/Framework/ContentManagers/ModContentManager.cs index bf0b54b9..beb90a5d 100644 --- a/src/SMAPI/Framework/ContentManagers/ModContentManager.cs +++ b/src/SMAPI/Framework/ContentManagers/ModContentManager.cs @@ -2,6 +2,7 @@ using System; using System.Globalization; using System.IO; using System.Linq; +using BmFont; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; @@ -129,6 +130,14 @@ namespace StardewModdingAPI.Framework.ContentManagers } break; + // unpacked Bitmap font + case ".fnt": + { + string source = File.ReadAllText(file.FullName); + asset = (T)(object)new XmlSource(source); + } + break; + // unpacked data case ".json": { @@ -171,7 +180,7 @@ namespace StardewModdingAPI.Framework.ContentManagers break; default: - throw GetContentError($"unknown file extension '{file.Extension}'; must be one of '.json', '.png', '.tbin', or '.xnb'."); + throw GetContentError($"unknown file extension '{file.Extension}'; must be one of '.fnt', '.json', '.png', '.tbin', or '.xnb'."); } } catch (Exception ex) when (!(ex is SContentLoadException)) diff --git a/src/SMAPI/SMAPI.csproj b/src/SMAPI/SMAPI.csproj index 4f9aa9b1..b99028da 100644 --- a/src/SMAPI/SMAPI.csproj +++ b/src/SMAPI/SMAPI.csproj @@ -31,6 +31,7 @@ <Reference Include="..\..\build\0Harmony.dll" Private="True" /> <Reference Include="Stardew Valley" HintPath="$(GamePath)\Stardew Valley.dll" Private="False" /> <Reference Include="StardewValley.GameData" HintPath="$(GamePath)\StardewValley.GameData.dll" Private="False" /> + <Reference Include="BmFont" HintPath="$(GamePath)\BmFont.dll" Private="False" /> <Reference Include="GalaxyCSharp" HintPath="$(GamePath)\GalaxyCSharp.dll" Private="False" /> <Reference Include="Lidgren.Network" HintPath="$(GamePath)\Lidgren.Network.dll" Private="False" /> <Reference Include="MonoGame.Framework" HintPath="$(GamePath)\MonoGame.Framework.dll" Private="False" /> |