diff options
Diffstat (limited to 'src/SMAPI')
117 files changed, 647 insertions, 321 deletions
diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index 2d67284e..9ceaf11d 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -13,7 +13,7 @@ namespace StardewModdingAPI public static class Constants { /********* - ** Properties + ** Fields *********/ /// <summary>The directory path containing the current save's data (if a save is loaded).</summary> private static string RawSavePath => Context.IsSaveLoaded ? Path.Combine(Constants.SavesPath, Constants.GetSaveFolderName()) : null; @@ -29,7 +29,7 @@ namespace StardewModdingAPI ** Public ****/ /// <summary>SMAPI's current semantic version.</summary> - public static ISemanticVersion ApiVersion { get; } = new Toolkit.SemanticVersion("2.9.3"); + public static ISemanticVersion ApiVersion { get; } = new Toolkit.SemanticVersion("2.10.0"); /// <summary>The minimum supported version of Stardew Valley.</summary> public static ISemanticVersion MinimumGameVersion { get; } = new GameVersion("1.3.32"); diff --git a/src/SMAPI/Enums/LoadStage.cs b/src/SMAPI/Enums/LoadStage.cs new file mode 100644 index 00000000..6ff7de4f --- /dev/null +++ b/src/SMAPI/Enums/LoadStage.cs @@ -0,0 +1,36 @@ +namespace StardewModdingAPI.Enums +{ + /// <summary>A low-level stage in the game's loading process.</summary> + public enum LoadStage + { + /// <summary>A save is not loaded or loading.</summary> + None, + + /// <summary>The game is creating a new save slot, and has initialised the basic save info.</summary> + CreatedBasicInfo, + + /// <summary>The game is creating a new save slot, and has initialised the in-game locations.</summary> + CreatedLocations, + + /// <summary>The game is creating a new save slot, and has created the physical save files.</summary> + CreatedSaveFile, + + /// <summary>The game is loading a save slot, and has read the raw save data into <see cref="StardewValley.SaveGame.loaded"/>. Not applicable when connecting to a multiplayer host. This is equivalent to <see cref="StardewValley.SaveGame.getLoadEnumerator"/> value 20.</summary> + SaveParsed, + + /// <summary>The game is loading a save slot, and has applied the basic save info (including player data). Not applicable when connecting to a multiplayer host. Note that some basic info (like daily luck) is not initialised at this point. This is equivalent to <see cref="StardewValley.SaveGame.getLoadEnumerator"/> value 36.</summary> + SaveLoadedBasicInfo, + + /// <summary>The game is loading a save slot, and has applied the in-game location data. Not applicable when connecting to a multiplayer host. This is equivalent to <see cref="StardewValley.SaveGame.getLoadEnumerator"/> value 50.</summary> + SaveLoadedLocations, + + /// <summary>The final metadata has been loaded from the save file. This happens before the game applies problem fixes, checks for achievements, starts music, etc. Not applicable when connecting to a multiplayer host.</summary> + Preloaded, + + /// <summary>The save is fully loaded, but the world may not be fully initialised yet.</summary> + Loaded, + + /// <summary>The save is fully loaded, the world has been initialised, and <see cref="Context.IsWorldReady"/> is now true.</summary> + Ready + } +} diff --git a/src/SMAPI/Events/BuildingListChangedEventArgs.cs b/src/SMAPI/Events/BuildingListChangedEventArgs.cs index 0237342f..74f37710 100644 --- a/src/SMAPI/Events/BuildingListChangedEventArgs.cs +++ b/src/SMAPI/Events/BuildingListChangedEventArgs.cs @@ -21,6 +21,9 @@ namespace StardewModdingAPI.Events /// <summary>The buildings removed from the location.</summary> public IEnumerable<Building> Removed { get; } + /// <summary>Whether this is the location containing the local player.</summary> + public bool IsCurrentLocation => object.ReferenceEquals(this.Location, Game1.player?.currentLocation); + /********* ** Public methods diff --git a/src/SMAPI/Events/ButtonPressedEventArgs.cs b/src/SMAPI/Events/ButtonPressedEventArgs.cs index 9e6c187f..5d922666 100644 --- a/src/SMAPI/Events/ButtonPressedEventArgs.cs +++ b/src/SMAPI/Events/ButtonPressedEventArgs.cs @@ -7,7 +7,7 @@ namespace StardewModdingAPI.Events public |
