/************************/
        /* IAssetLoader methods */
        /************************/

        /// <summary>Loads default instances of any new assets created by this mod.</summary>
        /// <remarks>This is a replacement for the IAssetLoader system, which was deprecated in SMAPI v3.14.</remarks>
        private static void AssetRequested_LoadDefaults(object sender, StardewModdingAPI.Events.AssetRequestedEventArgs e)
        {
            if (TryGetDefault(e.Name.Name, out object defaultAsset)) //if a default instance exists for this asset
            {
                e.LoadFrom(() => defaultAsset, StardewModdingAPI.Events.AssetLoadPriority.Medium, null);
            }
        }
Example #2
0
 /// <summary>Loads the initial version of this mod's data asset.</summary>
 /// <remarks>This is a replacement for the IAssetLoader system, which was deprecated in SMAPI v3.14.</remarks>
 private static void Content_AssetRequested(object sender, StardewModdingAPI.Events.AssetRequestedEventArgs e)
 {
     if (e.Name.IsEquivalentTo(AssetName, false))                                                                      //if this is the exclusion data asset
     {
         e.LoadFrom(() => new Dictionary <string, string>(), StardewModdingAPI.Events.AssetLoadPriority.Medium, null); //load an empty asset
     }
 }