Content Patcher

Content Patcher

378k Downloads

[Content Patcher] Can't `Load` `Fonts` json data unpacked from `StardewXnbHack`

NguyenYustar opened this issue ยท 1 comments

commented

As title says, Content Patcher throw the following error when "Action": "Load" a font json data file.

[23:08:37 INFO  SMAPI] SMAPI 3.8.1 with Stardew Valley 1.5.1 on MacOS Unix 18.7.0.0
[...]
[23:08:44 INFO  SMAPI]    Content Patcher 1.19.1 by Pathoschild | Loads content packs which edit game data, images, and maps without changing the game files.
[...]
[23:08:45 ERROR Content Patcher] Mod crashed when loading asset 'Fonts/SmallFont'. SMAPI will use the default asset instead. Error details:
StardewModdingAPI.Framework.Exceptions.SContentLoadException: The content manager failed loading content asset 'assets/Fonts/SmallFont.json' from SMAPI/avx.cp_vietnamesetranslation. ---> Newtonsoft.Json.JsonReaderException: Can't parse JSON file at [...]/assets/Fonts/SmallFont.json.
Technical details: Unable to find a constructor to use for type Microsoft.Xna.Framework.Graphics.SpriteFont. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute. Path 'Spacing', line 2, position 12.
  at StardewModdingAPI.Toolkit.Serialization.JsonHelper.ReadJsonFileIfExists[TModel] (System.String fullPath, StardewModdingAPI.Toolkit.Serialization.TModel& result) <0x15fc66f70 + 0x0048b> in <filename unknown>:0 
  at StardewModdingAPI.Framework.ContentManagers.ModContentManager.Load[T] (System.String assetName, LanguageCode language, Boolean useCache) <0x184cdd000 + 0x0066c> in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at StardewModdingAPI.Framework.ContentPack.LoadAsset[T] (System.String key) <0x184cdc900 + 0x00086> in <filename unknown>:0 
  at ContentPatcher.Framework.Patches.LoadPatch.Load[T] (IAssetInfo asset) <0x187b49260 + 0x00070> in <filename unknown>:0 
  at ContentPatcher.Framework.PatchManager.Load[T] (IAssetInfo asset) <0x187b48580 + 0x00789> in <filename unknown>:0 
  at StardewModdingAPI.Framework.ContentManagers.GameContentManager.ApplyLoader[T] (IAssetInfo info) <0x16dc0e740 + 0x0054d> in <filename unknown>:0 
commented

Hi! SMAPI doesn't support replacing font files yet. That's planned for an upcoming SMAPI release though, at which point it'll work with Content Patcher too.