From 855d427d3b579426165195f837df61588f9d8c53 Mon Sep 17 00:00:00 2001 From: ZaneYork Date: Mon, 19 Oct 2020 11:07:00 +0800 Subject: [PATCH] Bug fix --- src/SMAPI/Constants.cs | 6 ++++-- src/SMAPI/SMainActivity.cs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index 9af0f5ce..936111d9 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -33,10 +33,12 @@ namespace StardewModdingAPI ** Accessors *********/ #if SMAPI_FOR_MOBILE + /// The path to the storage base folder. + public static string StorageBasePath { get; } = Android.OS.Environment.ExternalStorageDirectory.Path; /// The path to the game's save folder. - public static string StardewValleyBasePath { get; } = Path.Combine(Android.OS.Environment.ExternalStorageDirectory.Path, "StardewValley"); + public static string StardewValleyBasePath { get; } = Path.Combine(EarlyConstants.StorageBasePath, "StardewValley"); /// The path to the internal folder. - public static string ExecutionPath { get; } = Path.Combine(StardewValleyBasePath, "smapi-internal"); + public static string ExecutionPath { get; } = Path.Combine(EarlyConstants.StardewValleyBasePath, "smapi-internal"); #else /// The path to the game folder. public static string ExecutionPath { get; } = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); diff --git a/src/SMAPI/SMainActivity.cs b/src/SMAPI/SMainActivity.cs index a7a0d78f..00da6ede 100644 --- a/src/SMAPI/SMainActivity.cs +++ b/src/SMAPI/SMainActivity.cs @@ -162,7 +162,7 @@ namespace StardewModdingAPI modPath = "StardewValley/Mods"; } - this.core = new SCore(System.IO.Path.Combine(Constants.DataPath, modPath), false); + this.core = new SCore(System.IO.Path.Combine(EarlyConstants.StorageBasePath, modPath), false); this.core.RunInteractively(); typeof(MainActivity).GetField("_game1", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(this, this.core.Game);