diff --git a/src/SMAPI/Framework/Events/EventManager.cs b/src/SMAPI/Framework/Events/EventManager.cs
index dfc289ed..fa4d564d 100644
--- a/src/SMAPI/Framework/Events/EventManager.cs
+++ b/src/SMAPI/Framework/Events/EventManager.cs
@@ -1,6 +1,4 @@
-using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
-using System.Reflection;
using StardewModdingAPI.Events;
namespace StardewModdingAPI.Framework.Events
@@ -15,166 +13,166 @@ namespace StardewModdingAPI.Framework.Events
/****
** Display
****/
- /// Raised after a game menu is opened, closed, or replaced.
+ ///
public readonly ManagedEvent MenuChanged;
- /// Raised before the game draws anything to the screen in a draw tick, as soon as the sprite batch is opened. The sprite batch may be closed and reopened multiple times after this event is called, but it's only raised once per draw tick. This event isn't useful for drawing to the screen, since the game will draw over it.
+ ///
public readonly ManagedEvent Rendering;
- /// Raised after the game draws to the sprite patch in a draw tick, just before the final sprite batch is rendered to the screen. Since the game may open/close the sprite batch multiple times in a draw tick, the sprite batch may not contain everything being drawn and some things may already be rendered to the screen. Content drawn to the sprite batch at this point will be drawn over all vanilla content (including menus, HUD, and cursor).
+ ///
public readonly ManagedEvent Rendered;
- /// Raised before the game world is drawn to the screen.
+ ///
public readonly ManagedEvent RenderingWorld;
- /// Raised after the game world is drawn to the sprite patch, before it's rendered to the screen.
+ ///
public readonly ManagedEvent RenderedWorld;
- /// When a menu is open ( isn't null), raised before that menu is drawn to the screen.
+ ///
public readonly ManagedEvent RenderingActiveMenu;
- /// When a menu is open ( isn't null), raised after that menu is drawn to the sprite batch but before it's rendered to the screen.
+ ///
public readonly ManagedEvent RenderedActiveMenu;
- /// Raised before drawing the HUD (item toolbar, clock, etc) to the screen.
+ ///
public readonly ManagedEvent RenderingHud;
- /// Raised after drawing the HUD (item toolbar, clock, etc) to the sprite batch, but before it's rendered to the screen.
+ ///
public readonly ManagedEvent RenderedHud;
- /// Raised after the game window is resized.
+ ///
public readonly ManagedEvent WindowResized;
/****
** Game loop
****/
- /// Raised after the game is launched, right before the first update tick.
+ ///
public readonly ManagedEvent GameLaunched;
- /// Raised before the game performs its overall update tick (≈60 times per second).
+ ///
public readonly ManagedEvent UpdateTicking;
- /// Raised after the game performs its overall update tick (≈60 times per second).
+ ///
public readonly ManagedEvent UpdateTicked;
- /// Raised once per second before the game performs its overall update tick.
+ ///
public readonly ManagedEvent OneSecondUpdateTicking;
- /// Raised once per second after the game performs its overall update tick.
+ ///
public readonly ManagedEvent OneSecondUpdateTicked;
- /// Raised before the game creates the save file.
+ ///
public readonly ManagedEvent SaveCreating;
- /// Raised after the game finishes creating the save file.
+ ///
public readonly ManagedEvent SaveCreated;
- /// Raised before the game begins writes data to the save file (except the initial save creation).
+ ///
public readonly ManagedEvent Saving;
- /// Raised after the game finishes writing data to the save file (except the initial save creation).
+ ///
public readonly ManagedEvent Saved;
- /// Raised after the player loads a save slot and the world is initialized.
+ ///
public readonly ManagedEvent SaveLoaded;
- /// Raised after the game begins a new day, including when loading a save.
+ ///
public readonly ManagedEvent DayStarted;
- /// Raised before the game ends the current day. This happens before it starts setting up the next day and before .
+ ///
public readonly ManagedEvent DayEnding;
- /// Raised after the in-game clock time changes.
+ ///
public readonly ManagedEvent TimeChanged;
- /// Raised after the game returns to the title screen.
+ ///
public readonly ManagedEvent ReturnedToTitle;
/****
** Input
****/
- /// Raised after the player presses or releases any buttons on the keyboard, controller, or mouse.
+ ///
public readonly ManagedEvent ButtonsChanged;
- /// Raised after the player presses a button on the keyboard, controller, or mouse.
+ ///
public readonly ManagedEvent ButtonPressed;
- /// Raised after the player released a button on the keyboard, controller, or mouse.
+ ///
public readonly ManagedEvent ButtonReleased;
- /// Raised after the player moves the in-game cursor.
+ ///
public readonly ManagedEvent CursorMoved;
- /// Raised after the player scrolls the mouse wheel.
+ ///
public readonly ManagedEvent MouseWheelScrolled;
/****
** Multiplayer
****/
- /// Raised after the mod context for a peer is received. This happens before the game approves the connection (), so the player doesn't yet exist in the game. This is the earliest point where messages can be sent to the peer via SMAPI.
+ ///
public readonly ManagedEvent PeerContextReceived;
- /// Raised after a peer connection is approved by the game.
+ ///
public readonly ManagedEvent PeerConnected;
- /// Raised after a mod message is received over the network.
+ ///
public readonly ManagedEvent ModMessageReceived;
- /// Raised after the connection with a peer is severed.
+ ///
public readonly ManagedEvent PeerDisconnected;
/****
** Player
****/
- /// Raised after items are added or removed to a player's inventory.
+ ///
public readonly ManagedEvent InventoryChanged;
- /// Raised after a player skill level changes. This happens as soon as they level up, not when the game notifies the player after their character goes to bed.
+ ///
public readonly ManagedEvent LevelChanged;
- /// Raised after a player warps to a new location.
+ ///
public readonly ManagedEvent Warped;
/****
** World
****/
- /// Raised after a game location is added or removed.
+ ///
public readonly ManagedEvent LocationListChanged;
- /// Raised after buildings are added or removed in a location.
+ ///
public readonly ManagedEvent BuildingListChanged;
- /// Raised after debris are added or removed in a location.
+ ///
public readonly ManagedEvent DebrisListChanged;
- /// Raised after large terrain features (like bushes) are added or removed in a location.
+ ///
public readonly ManagedEvent LargeTerrainFeatureListChanged;
- /// Raised after NPCs are added or removed in a location.
+ ///
public readonly ManagedEvent NpcListChanged;
- /// Raised after objects are added or removed in a location.
+ ///
public readonly ManagedEvent ObjectListChanged;
- /// Raised after items are added or removed from a chest.
+ ///
public readonly ManagedEvent ChestInventoryChanged;
- /// Raised after terrain features (like floors and trees) are added or removed in a location.
+ ///
public readonly ManagedEvent TerrainFeatureListChanged;
- /// Raised after furniture are added or removed in a location.
+ ///
public readonly ManagedEvent FurnitureListChanged;
/****
** Specialized
****/
- /// Raised when the low-level stage in the game's loading process has changed. See notes on .
+ ///
public readonly ManagedEvent LoadStageChanged;
- /// Raised before the game performs its overall update tick (≈60 times per second). See notes on .
+ ///
public readonly ManagedEvent UnvalidatedUpdateTicking;
- /// Raised after the game performs its overall update tick (≈60 times per second). See notes on .
+ ///
public readonly ManagedEvent UnvalidatedUpdateTicked;
@@ -247,12 +245,5 @@ namespace StardewModdingAPI.Framework.Events
this.UnvalidatedUpdateTicking = ManageEventOf(nameof(IModEvents.Specialized), nameof(ISpecializedEvents.UnvalidatedUpdateTicking), isPerformanceCritical: true);
this.UnvalidatedUpdateTicked = ManageEventOf(nameof(IModEvents.Specialized), nameof(ISpecializedEvents.UnvalidatedUpdateTicked), isPerformanceCritical: true);
}
-
- /// Get all managed events.
- public IEnumerable GetAllEvents()
- {
- foreach (FieldInfo field in this.GetType().GetFields())
- yield return (IManagedEvent)field.GetValue(this);
- }
}
}
diff --git a/src/SMAPI/Framework/Events/ManagedEvent.cs b/src/SMAPI/Framework/Events/ManagedEvent.cs
index f48c3aeb..a200393d 100644
--- a/src/SMAPI/Framework/Events/ManagedEvent.cs
+++ b/src/SMAPI/Framework/Events/ManagedEvent.cs
@@ -33,10 +33,10 @@ namespace StardewModdingAPI.Framework.Events
/*********
** Accessors
*********/
- /// A human-readable name for the event.
+ ///
public string EventName { get; }
- /// Whether the event is typically called at least once per second.
+ ///
public bool IsPerformanceCritical { get; }
diff --git a/src/SMAPI/Framework/Events/ManagedEventHandler.cs b/src/SMAPI/Framework/Events/ManagedEventHandler.cs
index b32a2a22..28e88be0 100644
--- a/src/SMAPI/Framework/Events/ManagedEventHandler.cs
+++ b/src/SMAPI/Framework/Events/ManagedEventHandler.cs
@@ -39,9 +39,7 @@ namespace StardewModdingAPI.Framework.Events
this.SourceMod = sourceMod;
}
- /// Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
- /// An object to compare with this instance.
- /// is not the same type as this instance.
+ ///
public int CompareTo(object obj)
{
if (!(obj is ManagedEventHandler other))
diff --git a/src/SMAPI/Framework/Events/ModDisplayEvents.cs b/src/SMAPI/Framework/Events/ModDisplayEvents.cs
index 54d40dee..48f55324 100644
--- a/src/SMAPI/Framework/Events/ModDisplayEvents.cs
+++ b/src/SMAPI/Framework/Events/ModDisplayEvents.cs
@@ -1,79 +1,78 @@
using System;
using StardewModdingAPI.Events;
-using StardewValley;
namespace StardewModdingAPI.Framework.Events
{
- /// Events related to UI and drawing to the screen.
+ ///
internal class ModDisplayEvents : ModEventsBase, IDisplayEvents
{
/*********
** Accessors
*********/
- /// Raised after a game menu is opened, closed, or replaced.
+ ///
public event EventHandler MenuChanged
{
add => this.EventManager.MenuChanged.Add(value, this.Mod);
remove => this.EventManager.MenuChanged.Remove(value);
}
- /// Raised before the game draws anything to the screen in a draw tick, as soon as the sprite batch is opened. The sprite batch may be closed and reopened multiple times after this event is called, but it's only raised once per draw tick. This event isn't useful for drawing to the screen, since the game will draw over it.
+ ///
public event EventHandler Rendering
{
add => this.EventManager.Rendering.Add(value, this.Mod);
remove => this.EventManager.Rendering.Remove(value);
}
- /// Raised after the game draws to the sprite patch in a draw tick, just before the final sprite batch is rendered to the screen. Since the game may open/close the sprite batch multiple times in a draw tick, the sprite batch may not contain everything being drawn and some things may already be rendered to the screen. Content drawn to the sprite batch at this point will be drawn over all vanilla content (including menus, HUD, and cursor).
+ ///
public event EventHandler Rendered
{
add => this.EventManager.Rendered.Add(value, this.Mod);
remove => this.EventManager.Rendered.Remove(value);
}
- /// Raised before the game world is drawn to the screen. This event isn't useful for drawing to the screen, since the game will draw over it.
+ ///
public event EventHandler RenderingWorld
{
add => this.EventManager.RenderingWorld.Add(value, this.Mod);
remove => this.EventManager.RenderingWorld.Remove(value);
}
- /// Raised after the game world is drawn to the sprite patch, before it's rendered to the screen. Content drawn to the sprite batch at this point will be drawn over the world, but under any active menu, HUD elements, or cursor.
+ ///
public event EventHandler RenderedWorld
{
add => this.EventManager.RenderedWorld.Add(value, this.Mod);
remove => this.EventManager.RenderedWorld.Remove(value);
}
- /// When a menu is open ( isn't null), raised before that menu is drawn to the screen. This includes the game's internal menus like the title screen. Content drawn to the sprite batch at this point will appear under the menu.
+ ///
public event EventHandler RenderingActiveMenu
{
add => this.EventManager.RenderingActiveMenu.Add(value, this.Mod);
remove => this.EventManager.RenderingActiveMenu.Remove(value);
}
- /// When a menu is open ( isn't null), raised after that menu is drawn to the sprite batch but before it's rendered to the screen. Content drawn to the sprite batch at this point will appear over the menu and menu cursor.
+ ///
public event EventHandler RenderedActiveMenu
{
add => this.EventManager.RenderedActiveMenu.Add(value, this.Mod);
remove => this.EventManager.RenderedActiveMenu.Remove(value);
}
- /// Raised before drawing the HUD (item toolbar, clock, etc) to the screen. The vanilla HUD may be hidden at this point (e.g. because a menu is open). Content drawn to the sprite batch at this point will appear under the HUD.
+ ///
public event EventHandler RenderingHud
{
add => this.EventManager.RenderingHud.Add(value, this.Mod);
remove => this.EventManager.RenderingHud.Remove(value);
}
- /// Raised after drawing the HUD (item toolbar, clock, etc) to the sprite batch, but before it's rendered to the screen. The vanilla HUD may be hidden at this point (e.g. because a menu is open). Content drawn to the sprite batch at this point will appear over the HUD.
+ ///
public event EventHandler RenderedHud
{
add => this.EventManager.RenderedHud.Add(value, this.Mod);
remove => this.EventManager.RenderedHud.Remove(value);
}
- /// Raised after the game window is resized.
+ ///
public event EventHandler WindowResized
{
add => this.EventManager.WindowResized.Add(value, this.Mod);
diff --git a/src/SMAPI/Framework/Events/ModEvents.cs b/src/SMAPI/Framework/Events/ModEvents.cs
index 1d1c92c6..0c365d42 100644
--- a/src/SMAPI/Framework/Events/ModEvents.cs
+++ b/src/SMAPI/Framework/Events/ModEvents.cs
@@ -2,31 +2,31 @@ using StardewModdingAPI.Events;
namespace StardewModdingAPI.Framework.Events
{
- /// Manages access to events raised by SMAPI.
+ ///
internal class ModEvents : IModEvents
{
/*********
** Accessors
*********/
- /// Events related to UI and drawing to the screen.
+ ///
public IDisplayEvents Display { get; }
- /// Events linked to the game's update loop. The update loop runs roughly ≈60 times/second to run game logic like state changes, action handling, etc. These can be useful, but you should consider more semantic events like if possible.
+ ///
public IGameLoopEvents GameLoop { get; }
- /// Events raised when the player provides input using a controller, keyboard, or mouse.
+ ///
public IInputEvents Input { get; }
- /// Events raised for multiplayer messages and connections.
+ ///
public IMultiplayerEvents Multiplayer { get; }
- /// Events raised when the player data changes.
+ ///
public IPlayerEvents Player { get; }
- /// Events raised when something changes in the world.
+ ///
public IWorldEvents World { get; }
- /// Events serving specialized edge cases that shouldn't be used by most mods.
+ ///
public ISpecializedEvents Specialized { get; }
diff --git a/src/SMAPI/Framework/Events/ModGameLoopEvents.cs b/src/SMAPI/Framework/Events/ModGameLoopEvents.cs
index 1150d641..5f0db369 100644
--- a/src/SMAPI/Framework/Events/ModGameLoopEvents.cs
+++ b/src/SMAPI/Framework/Events/ModGameLoopEvents.cs
@@ -3,104 +3,104 @@ using StardewModdingAPI.Events;
namespace StardewModdingAPI.Framework.Events
{
- /// Events linked to the game's update loop. The update loop runs roughly ≈60 times/second to run game logic like state changes, action handling, etc. These can be useful, but you should consider more semantic events like if possible.
+ ///
internal class ModGameLoopEvents : ModEventsBase, IGameLoopEvents
{
/*********
** Accessors
*********/
- /// Raised after the game is launched, right before the first update tick.
+ ///
public event EventHandler GameLaunched
{
add => this.EventManager.GameLaunched.Add(value, this.Mod);
remove => this.EventManager.GameLaunched.Remove(value);
}
- /// Raised before the game performs its overall update tick (≈60 times per second).
+ ///
public event EventHandler UpdateTicking
{
add => this.EventManager.UpdateTicking.Add(value, this.Mod);
remove => this.EventManager.UpdateTicking.Remove(value);
}
- /// Raised after the game performs its overall update tick (≈60 times per second).
+ ///
public event EventHandler UpdateTicked
{
add => this.EventManager.UpdateTicked.Add(value, this.Mod);
remove => this.EventManager.UpdateTicked.Remove(value);
}
- /// Raised once per second before the game state is updated.
+ ///
public event EventHandler OneSecondUpdateTicking
{
add => this.EventManager.OneSecondUpdateTicking.Add(value, this.Mod);
remove => this.EventManager.OneSecondUpdateTicking.Remove(value);
}
- /// Raised once per second after the game state is updated.
+ ///
public event EventHandler OneSecondUpdateTicked
{
add => this.EventManager.OneSecondUpdateTicked.Add(value, this.Mod);
remove => this.EventManager.OneSecondUpdateTicked.Remove(value);
}
- /// Raised before the game creates a new save file.
+ ///
public event EventHandler SaveCreating
{
add => this.EventManager.SaveCreating.Add(value, this.Mod);
remove => this.EventManager.SaveCreating.Remove(value);
}
- /// Raised after the game finishes creating the save file.
+ ///
public event EventHandler SaveCreated
{
add => this.EventManager.SaveCreated.Add(value, this.Mod);
remove => this.EventManager.SaveCreated.Remove(value);
}
- /// Raised before the game begins writes data to the save file.
+ ///
public event EventHandler Saving
{
add => this.EventManager.Saving.Add(value, this.Mod);
remove => this.EventManager.Saving.Remove(value);
}
- /// Raised after the game finishes writing data to the save file.
+ ///
public event EventHandler Saved
{
add => this.EventManager.Saved.Add(value, this.Mod);
remove => this.EventManager.Saved.Remove(value);
}
- /// Raised after the player loads a save slot and the world is initialized.
+ ///
public event EventHandler SaveLoaded
{
add => this.EventManager.SaveLoaded.Add(value, this.Mod);
remove => this.EventManager.SaveLoaded.Remove(value);
}
- /// Raised after the game begins a new day (including when the player loads a save).
+ ///
public event EventHandler DayStarted
{
add => this.EventManager.DayStarted.Add(value, this.Mod);
remove => this.EventManager.DayStarted.Remove(value);
}
- /// Raised before the game ends the current day. This happens before it starts setting up the next day and before .
+ ///
public event EventHandler DayEnding
{
add => this.EventManager.DayEnding.Add(value, this.Mod);
remove => this.EventManager.DayEnding.Remove(value);
}
- /// Raised after the in-game clock time changes.
+ ///
public event EventHandler TimeChanged
{
add => this.EventManager.TimeChanged.Add(value, this.Mod);
remove => this.EventManager.TimeChanged.Remove(value);
}
- /// Raised after the game returns to the title screen.
+ ///
public event EventHandler ReturnedToTitle
{
add => this.EventManager.ReturnedToTitle.Add(value, this.Mod);
diff --git a/src/SMAPI/Framework/Events/ModInputEvents.cs b/src/SMAPI/Framework/Events/ModInputEvents.cs
index 6f423e5d..40edf806 100644
--- a/src/SMAPI/Framework/Events/ModInputEvents.cs
+++ b/src/SMAPI/Framework/Events/ModInputEvents.cs
@@ -3,41 +3,41 @@ using StardewModdingAPI.Events;
namespace StardewModdingAPI.Framework.Events
{
- /// Events raised when the player provides input using a controller, keyboard, or mouse.
+ ///
internal class ModInputEvents : ModEventsBase, IInputEvents
{
/*********
** Accessors
*********/
- /// Raised after the player presses or releases any buttons on the keyboard, controller, or mouse.
+ ///
public event EventHandler ButtonsChanged
{
add => this.EventManager.ButtonsChanged.Add(value, this.Mod);
remove => this.EventManager.ButtonsChanged.Remove(value);
}
- /// Raised after the player presses a button on the keyboard, controller, or mouse.
+ ///
public event EventHandler ButtonPressed
{
add => this.EventManager.ButtonPressed.Add(value, this.Mod);
remove => this.EventManager.ButtonPressed.Remove(value);
}
- /// Raised after the player releases a button on the keyboard, controller, or mouse.
+ ///
public event EventHandler ButtonReleased
{
add => this.EventManager.ButtonReleased.Add(value, this.Mod);
remove => this.EventManager.ButtonReleased.Remove(value);
}
- /// Raised after the player moves the in-game cursor.
+ ///
public event EventHandler CursorMoved
{
add => this.EventManager.CursorMoved.Add(value, this.Mod);
remove => this.EventManager.CursorMoved.Remove(value);
}
- /// Raised after the player scrolls the mouse wheel.
+ ///
public event EventHandler MouseWheelScrolled
{
add => this.EventManager.MouseWheelScrolled.Add(value, this.Mod);
diff --git a/src/SMAPI/Framework/Events/ModMultiplayerEvents.cs b/src/SMAPI/Framework/Events/ModMultiplayerEvents.cs
index 2f9b9482..b90f64fa 100644
--- a/src/SMAPI/Framework/Events/ModMultiplayerEvents.cs
+++ b/src/SMAPI/Framework/Events/ModMultiplayerEvents.cs
@@ -3,34 +3,34 @@ using StardewModdingAPI.Events;
namespace StardewModdingAPI.Framework.Events
{
- /// Events raised for multiplayer messages and connections.
+ ///
internal class ModMultiplayerEvents : ModEventsBase, IMultiplayerEvents
{
/*********
** Accessors
*********/
- /// Raised after the mod context for a peer is received. This happens before the game approves the connection (), so the player doesn't yet exist in the game. This is the earliest point where messages can be sent to the peer via SMAPI.
+ ///
public event EventHandler PeerContextReceived
{
add => this.EventManager.PeerContextReceived.Add(value, this.Mod);
remove => this.EventManager.PeerContextReceived.Remove(value);
}
- /// Raised after a peer connection is approved by the game.
+ ///
public event EventHandler PeerConnected
{
add => this.EventManager.PeerConnected.Add(value, this.Mod);
remove => this.EventManager.PeerConnected.Remove(value);
}
- /// Raised after a mod message is received over the network.
+ ///
public event EventHandler ModMessageReceived
{
add => this.EventManager.ModMessageReceived.Add(value, this.Mod);
remove => this.EventManager.ModMessageReceived.Remove(value);
}
- /// Raised after the connection with a peer is severed.
+ ///
public event EventHandler PeerDisconnected
{
add => this.EventManager.PeerDisconnected.Add(value, this.Mod);
diff --git a/src/SMAPI/Framework/Events/ModPlayerEvents.cs b/src/SMAPI/Framework/Events/ModPlayerEvents.cs
index 240beb8d..b2d89e9a 100644
--- a/src/SMAPI/Framework/Events/ModPlayerEvents.cs
+++ b/src/SMAPI/Framework/Events/ModPlayerEvents.cs
@@ -3,27 +3,27 @@ using StardewModdingAPI.Events;
namespace StardewModdingAPI.Framework.Events
{
- /// Events raised when the player data changes.
+ ///
internal class ModPlayerEvents : ModEventsBase, IPlayerEvents
{
/*********
** Accessors
*********/
- /// Raised after items are added or removed to a player's inventory. NOTE: this event is currently only raised for the local player.
+ ///
public event EventHandler InventoryChanged
{
add => this.EventManager.InventoryChanged.Add(value, this.Mod);
remove => this.EventManager.InventoryChanged.Remove(value);
}
- /// Raised after a player skill level changes. This happens as soon as they level up, not when the game notifies the player after their character goes to bed. NOTE: this event is currently only raised for the local player.
+ ///
public event EventHandler LevelChanged
{
add => this.EventManager.LevelChanged.Add(value, this.Mod);
remove => this.EventManager.LevelChanged.Remove(value);
}
- /// Raised after a player warps to a new location. NOTE: this event is currently only raised for the local player.
+ ///
public event EventHandler Warped
{
add => this.EventManager.Warped.Add(value, this.Mod);
diff --git a/src/SMAPI/Framework/Events/ModSpecialisedEvents.cs b/src/SMAPI/Framework/Events/ModSpecialisedEvents.cs
index 1d6788e1..7980208b 100644
--- a/src/SMAPI/Framework/Events/ModSpecialisedEvents.cs
+++ b/src/SMAPI/Framework/Events/ModSpecialisedEvents.cs
@@ -3,27 +3,27 @@ using StardewModdingAPI.Events;
namespace StardewModdingAPI.Framework.Events
{
- /// Events serving specialized edge cases that shouldn't be used by most mods.
+ ///
internal class ModSpecializedEvents : ModEventsBase, ISpecializedEvents
{
/*********
** Accessors
*********/
- /// Raised when the low-level stage in the game's loading process has changed. This is an advanced event for mods which need to run code at specific points in the loading process. The available stages or when they happen might change without warning in future versions (e.g. due to changes in the game's load process), so mods using this event are more likely to break or have bugs. Most mods should use instead.
+ ///
public event EventHandler LoadStageChanged
{
add => this.EventManager.LoadStageChanged.Add(value, this.Mod);
remove => this.EventManager.LoadStageChanged.Remove(value);
}
- /// Raised before the game state is updated (≈60 times per second), regardless of normal SMAPI validation. This event is not thread-safe and may be invoked while game logic is running asynchronously. Changes to game state in this method may crash the game or corrupt an in-progress save. Do not use this event unless you're fully aware of the context in which your code will be run. Mods using this event will trigger a stability warning in the SMAPI console.
+ ///
public event EventHandler UnvalidatedUpdateTicking
{
add => this.EventManager.UnvalidatedUpdateTicking.Add(value, this.Mod);
remove => this.EventManager.UnvalidatedUpdateTicking.Remove(value);
}
- /// Raised after the game state is updated (≈60 times per second), regardless of normal SMAPI validation. This event is not thread-safe and may be invoked while game logic is running asynchronously. Changes to game state in this method may crash the game or corrupt an in-progress save. Do not use this event unless you're fully aware of the context in which your code will be run. Mods using this event will trigger a stability warning in the SMAPI console.
+ ///
public event EventHandler UnvalidatedUpdateTicked
{
add => this.EventManager.UnvalidatedUpdateTicked.Add(value, this.Mod);
diff --git a/src/SMAPI/Framework/Events/ModWorldEvents.cs b/src/SMAPI/Framework/Events/ModWorldEvents.cs
index f4c40abc..a7b7d799 100644
--- a/src/SMAPI/Framework/Events/ModWorldEvents.cs
+++ b/src/SMAPI/Framework/Events/ModWorldEvents.cs
@@ -3,69 +3,69 @@ using StardewModdingAPI.Events;
namespace StardewModdingAPI.Framework.Events
{
- /// Events raised when something changes in the world.
+ ///
internal class ModWorldEvents : ModEventsBase, IWorldEvents
{
/*********
** Accessors
*********/
- /// Raised after a game location is added or removed.
+ ///
public event EventHandler LocationListChanged
{
add => this.EventManager.LocationListChanged.Add(value, this.Mod);
remove => this.EventManager.LocationListChanged.Remove(value);
}
- /// Raised after buildings are added or removed in a location.
+ ///
public event EventHandler BuildingListChanged
{
add => this.EventManager.BuildingListChanged.Add(value, this.Mod);
remove => this.EventManager.BuildingListChanged.Remove(value);
}
- /// Raised after debris are added or removed in a location.
+ ///
public event EventHandler DebrisListChanged
{
add => this.EventManager.DebrisListChanged.Add(value, this.Mod);
remove => this.EventManager.DebrisListChanged.Remove(value);
}
- /// Raised after large terrain features (like bushes) are added or removed in a location.
+ ///
public event EventHandler LargeTerrainFeatureListChanged
{
add => this.EventManager.LargeTerrainFeatureListChanged.Add(value, this.Mod);
remove => this.EventManager.LargeTerrainFeatureListChanged.Remove(value);
}
- /// Raised after NPCs are added or removed in a location.
+ ///
public event EventHandler NpcListChanged
{
add => this.EventManager.NpcListChanged.Add(value, this.Mod);
remove => this.EventManager.NpcListChanged.Remove(value);
}
- /// Raised after objects are added or removed in a location.
+ ///
public event EventHandler ObjectListChanged
{
add => this.EventManager.ObjectListChanged.Add(value, this.Mod);
remove => this.EventManager.ObjectListChanged.Remove(value);
}
- /// Raised after items are added or removed from a chest.
+ ///
public event EventHandler ChestInventoryChanged
{
add => this.EventManager.ChestInventoryChanged.Add(value, this.Mod);
remove => this.EventManager.ChestInventoryChanged.Remove(value);
}
- /// Raised after terrain features (like floors and trees) are added or removed in a location.
+ ///
public event EventHandler TerrainFeatureListChanged
{
add => this.EventManager.TerrainFeatureListChanged.Add(value, this.Mod);
remove => this.EventManager.TerrainFeatureListChanged.Remove(value);
}
- /// Raised after furniture are added or removed in a location.
+ ///
public event EventHandler FurnitureListChanged
{
add => this.EventManager.FurnitureListChanged.Add(value, this.Mod);
diff --git a/src/SMAPI/Framework/Input/GamePadStateBuilder.cs b/src/SMAPI/Framework/Input/GamePadStateBuilder.cs
index 3a99214f..ad254828 100644
--- a/src/SMAPI/Framework/Input/GamePadStateBuilder.cs
+++ b/src/SMAPI/Framework/Input/GamePadStateBuilder.cs
@@ -85,8 +85,7 @@ namespace StardewModdingAPI.Framework.Input
this.RightStickPos = sticks.Right;
}
- /// Override the states for a set of buttons.
- /// The button state overrides.
+ ///
public GamePadStateBuilder OverrideButtons(IDictionary overrides)
{
if (!this.IsConnected)
@@ -151,7 +150,7 @@ namespace StardewModdingAPI.Framework.Input
return this;
}
- /// Get the currently pressed buttons.
+ ///
public IEnumerable GetPressedButtons()
{
if (!this.IsConnected)
@@ -191,7 +190,7 @@ namespace StardewModdingAPI.Framework.Input
}
}
- /// Get the equivalent state.
+ ///
public GamePadState GetState()
{
this.State ??= new GamePadState(
diff --git a/src/SMAPI/Framework/Input/KeyboardStateBuilder.cs b/src/SMAPI/Framework/Input/KeyboardStateBuilder.cs
index 620ad442..eadb7a8a 100644
--- a/src/SMAPI/Framework/Input/KeyboardStateBuilder.cs
+++ b/src/SMAPI/Framework/Input/KeyboardStateBuilder.cs
@@ -31,8 +31,7 @@ namespace StardewModdingAPI.Framework.Input
this.PressedButtons.Add(button);
}
- /// Override the states for a set of buttons.
- /// The button state overrides.
+ ///
public KeyboardStateBuilder OverrideButtons(IDictionary overrides)
{
foreach (var pair in overrides)
@@ -51,14 +50,14 @@ namespace StardewModdingAPI.Framework.Input
return this;
}
- /// Get the currently pressed buttons.
+ ///
public IEnumerable GetPressedButtons()
{
foreach (Keys key in this.PressedButtons)
yield return key.ToSButton();
}
- /// Get the equivalent state.
+ ///
public KeyboardState GetState()
{
return
diff --git a/src/SMAPI/Framework/Input/MouseStateBuilder.cs b/src/SMAPI/Framework/Input/MouseStateBuilder.cs
index a1ac5492..c2a0891b 100644
--- a/src/SMAPI/Framework/Input/MouseStateBuilder.cs
+++ b/src/SMAPI/Framework/Input/MouseStateBuilder.cs
@@ -51,8 +51,7 @@ namespace StardewModdingAPI.Framework.Input
this.ScrollWheelValue = state.ScrollWheelValue;
}
- /// Override the states for a set of buttons.
- /// The button state overrides.
+ ///
public MouseStateBuilder OverrideButtons(IDictionary overrides)
{
foreach (var pair in overrides)
@@ -67,7 +66,7 @@ namespace StardewModdingAPI.Framework.Input
return this;
}
- /// Get the currently pressed buttons.
+ ///
public IEnumerable GetPressedButtons()
{
foreach (var pair in this.ButtonStates)
@@ -77,7 +76,7 @@ namespace StardewModdingAPI.Framework.Input
}
}
- /// Get the equivalent state.
+ ///
public MouseState GetState()
{
this.State ??= new MouseState(
diff --git a/src/SMAPI/Mod.cs b/src/SMAPI/Mod.cs
index 0e5be1c1..9af55cd4 100644
--- a/src/SMAPI/Mod.cs
+++ b/src/SMAPI/Mod.cs
@@ -8,25 +8,27 @@ namespace StardewModdingAPI
/*********
** Accessors
*********/
- /// Provides simplified APIs for writing mods.
+ ///
public IModHelper Helper { get; internal set; }
- /// Writes messages to the console and log file.
+ ///
public IMonitor Monitor { get; internal set; }
- /// The mod's manifest.
+ ///
public IManifest ModManifest { get; internal set; }
/*********
** Public methods
*********/
- /// The mod entry point, called after the mod is first loaded.
- /// Provides simplified APIs for writing mods.
+ ///
public abstract void Entry(IModHelper helper);
- /// Get an API that other mods can access. This is always called after .
- public virtual object GetApi() => null;
+ ///
+ public virtual object GetApi()
+ {
+ return null;
+ }
/// Release or reset unmanaged resources.
public void Dispose()