This commit is contained in:
ZaneYork 2020-10-19 11:07:00 +08:00
parent 5702bd335d
commit 855d427d3b
2 changed files with 5 additions and 3 deletions

View File

@ -33,10 +33,12 @@ namespace StardewModdingAPI
** Accessors ** Accessors
*********/ *********/
#if SMAPI_FOR_MOBILE #if SMAPI_FOR_MOBILE
/// <summary>The path to the storage base folder.</summary>
public static string StorageBasePath { get; } = Android.OS.Environment.ExternalStorageDirectory.Path;
/// <summary>The path to the game's save folder.</summary> /// <summary>The path to the game's save folder.</summary>
public static string StardewValleyBasePath { get; } = Path.Combine(Android.OS.Environment.ExternalStorageDirectory.Path, "StardewValley"); public static string StardewValleyBasePath { get; } = Path.Combine(EarlyConstants.StorageBasePath, "StardewValley");
/// <summary>The path to the internal folder.</summary> /// <summary>The path to the internal folder.</summary>
public static string ExecutionPath { get; } = Path.Combine(StardewValleyBasePath, "smapi-internal"); public static string ExecutionPath { get; } = Path.Combine(EarlyConstants.StardewValleyBasePath, "smapi-internal");
#else #else
/// <summary>The path to the game folder.</summary> /// <summary>The path to the game folder.</summary>
public static string ExecutionPath { get; } = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); public static string ExecutionPath { get; } = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

View File

@ -162,7 +162,7 @@ namespace StardewModdingAPI
modPath = "StardewValley/Mods"; 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(); this.core.RunInteractively();
typeof(MainActivity).GetField("_game1", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(this, this.core.Game); typeof(MainActivity).GetField("_game1", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(this, this.core.Game);