SMAPI - Stardew Modding API

SMAPI - Stardew Modding API

971k Downloads

Expose batch cache invalidation to mods

Entoarox opened this issue ยท 3 comments

commented

Right now, mods can only invalidate files one at a time, this not only is cumbersome, but is bloating the log file extensively for mods like XnbLoader where a lot of files might need invalidation

commented

Looks workable yes :)

commented

Done in develop for the upcoming SMAPI 2.1 release.

commented

@Entoarox Would this overload work for you?

/// <summary>Remove matching assets from the content cache so they're reloaded on the next request. This will reload core game assets if needed, but references to the former asset will still show the previous content.</summary>
/// <param name="predicate">Matches the assets to invalidate.</param>
/// <returns>Returns whether any cache entries were invalidated.</returns>
bool InvalidateCache(Func<IAssetInfo, bool> predicate);