From d70d449c5c99e68677e83c66bdaf300be6b71ee2 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 25 Feb 2018 01:07:32 -0500 Subject: fix issue where replacing an asset via asset.AsImage() or asset.AsDictionary() has no effect --- src/SMAPI/Framework/Content/AssetDataForObject.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/SMAPI/Framework/Content/AssetDataForObject.cs') diff --git a/src/SMAPI/Framework/Content/AssetDataForObject.cs b/src/SMAPI/Framework/Content/AssetDataForObject.cs index f30003e4..90f9e2d4 100644 --- a/src/SMAPI/Framework/Content/AssetDataForObject.cs +++ b/src/SMAPI/Framework/Content/AssetDataForObject.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Microsoft.Xna.Framework.Graphics; @@ -16,7 +16,7 @@ namespace StardewModdingAPI.Framework.Content /// The content data being read. /// Normalises an asset key to match the cache key. public AssetDataForObject(string locale, string assetName, object data, Func getNormalisedPath) - : base(locale, assetName, data, getNormalisedPath) { } + : base(locale, assetName, data, getNormalisedPath, onDataReplaced: null) { } /// Construct an instance. /// The asset metadata. @@ -31,14 +31,14 @@ namespace StardewModdingAPI.Framework.Content /// The content being read isn't a dictionary. public IAssetDataForDictionary AsDictionary() { - return new AssetDataForDictionary(this.Locale, this.AssetName, this.GetData>(), this.GetNormalisedPath); + return new AssetDataForDictionary(this.Locale, this.AssetName, this.GetData>(), this.GetNormalisedPath, this.ReplaceWith); } /// Get a helper to manipulate the data as an image. /// The content being read isn't an image. public IAssetDataForImage AsImage() { - return new AssetDataForImage(this.Locale, this.AssetName, this.GetData(), this.GetNormalisedPath); + return new AssetDataForImage(this.Locale, this.AssetName, this.GetData(), this.GetNormalisedPath, this.ReplaceWith); } /// Get the data as a given type. -- cgit