summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-08-03 19:11:39 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-08-03 19:11:39 -0400
commit2e442bf2ee9f7d73c935dfed95c996581a17e06f (patch)
tree9abcc5fc983002e73f7e82585f1aff12c62c495b /src/SMAPI/Framework
parent5b31be76dd90711ff475341de8dfdb6e1f50b98a (diff)
parent1bb51b2c41bf5acdffb8e25c37187e9bdf9d3dd4 (diff)
downloadSMAPI-2e442bf2ee9f7d73c935dfed95c996581a17e06f.tar.gz
SMAPI-2e442bf2ee9f7d73c935dfed95c996581a17e06f.tar.bz2
SMAPI-2e442bf2ee9f7d73c935dfed95c996581a17e06f.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Framework')
-rw-r--r--src/SMAPI/Framework/ModLoading/AssemblyLoader.cs1
-rw-r--r--src/SMAPI/Framework/SCore.cs10
2 files changed, 10 insertions, 1 deletions
diff --git a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs
index 3606eb66..2b71038a 100644
--- a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs
+++ b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs
@@ -61,6 +61,7 @@ namespace StardewModdingAPI.Framework.ModLoading
this.AssemblyDefinitionResolver = this.TrackForDisposal(new AssemblyDefinitionResolver());
this.AssemblyDefinitionResolver.AddSearchDirectory(Constants.ExecutionPath);
this.AssemblyDefinitionResolver.AddSearchDirectory(Constants.InternalFilesPath);
+ this.AssemblyDefinitionResolver.Add(AssemblyDefinition.ReadAssembly(typeof(SGame).Assembly.Location)); // for some reason Mono.Cecil can't resolve SMAPI in very specific cases involving unofficial 64-bit Stardew Valley when launched through Steam (for some players only)
// generate type => assembly lookup for types which should be rewritten
this.TypeAssemblies = new Dictionary<string, Assembly>();
diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs
index a34b3eff..3f97bd4e 100644
--- a/src/SMAPI/Framework/SCore.cs
+++ b/src/SMAPI/Framework/SCore.cs
@@ -257,6 +257,7 @@ namespace StardewModdingAPI.Framework
MiniMonoModHotfix.Apply();
HarmonyPatcher.Apply("SMAPI", this.Monitor,
new Game1Patcher(this.Reflection, this.OnLoadStageChanged),
+ new SaveGamePatcher(this.OnSaveFileReading),
new TitleMenuPatcher(this.OnLoadStageChanged)
);
@@ -1101,6 +1102,13 @@ namespace StardewModdingAPI.Framework
this.EventManager.ReturnedToTitle.RaiseEmpty();
}
+ /// <summary>Raised before the game begins reading a save file.</summary>
+ /// <param name="fileName">The save folder name.</param>
+ internal void OnSaveFileReading(string fileName)
+ {
+ Constants.LastRawSaveFileName = fileName;
+ }
+
/// <summary>Apply fixes to the save after it's loaded.</summary>
private void ApplySaveFixes()
{
@@ -1315,7 +1323,7 @@ namespace StardewModdingAPI.Framework
.ToArray();
if (installedNames.Any())
- this.Monitor.Log($" Found {string.Join(" and ", installedNames)} installed, which can conflict with SMAPI. If you experience errors or crashes, try disabling that software or adding an exception for SMAPI / Stardew Valley.");
+ this.Monitor.Log($"Found {string.Join(" and ", installedNames)} installed, which may conflict with SMAPI. If you experience errors or crashes, try disabling that software or adding an exception for SMAPI and Stardew Valley.", LogLevel.Warn);
else
this.Monitor.Log(" None found!");
}