summaryrefslogtreecommitdiff
path: root/src/SMAPI/Context.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-04-11 20:32:00 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-04-11 20:32:00 -0400
commitb9bc1a6d17cafa0a97b46ffecda432cfc2f23b51 (patch)
tree319498e8724137a5680186645ca8324f2949eba3 /src/SMAPI/Context.cs
parent46141a7af21a921284bc82d49d888da864887d6e (diff)
parent2d47e479a5e48a575db3ca9998653c0435419440 (diff)
downloadSMAPI-b9bc1a6d17cafa0a97b46ffecda432cfc2f23b51.tar.gz
SMAPI-b9bc1a6d17cafa0a97b46ffecda432cfc2f23b51.tar.bz2
SMAPI-b9bc1a6d17cafa0a97b46ffecda432cfc2f23b51.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Context.cs')
-rw-r--r--src/SMAPI/Context.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/SMAPI/Context.cs b/src/SMAPI/Context.cs
index 119e14c8..7ed9b052 100644
--- a/src/SMAPI/Context.cs
+++ b/src/SMAPI/Context.cs
@@ -1,4 +1,4 @@
-using StardewModdingAPI.Events;
+using StardewModdingAPI.Events;
using StardewValley;
using StardewValley.Menus;
@@ -25,6 +25,12 @@ namespace StardewModdingAPI
/// <summary>Whether the game is currently running the draw loop. This isn't relevant to most mods, since you should use <see cref="GraphicsEvents.OnPostRenderEvent"/> to draw to the screen.</summary>
public static bool IsInDrawLoop { get; internal set; }
+ /// <summary>Whether <see cref="IsWorldReady"/> and the player loaded the save in multiplayer mode (regardless of whether any other players are connected).</summary>
+ public static bool IsMultiplayer => Context.IsWorldReady && Game1.multiplayerMode != Game1.singlePlayer;
+
+ /// <summary>Whether <see cref="IsWorldReady"/> and the current player is the main player. This is always true in single-player, and true when hosting in multiplayer.</summary>
+ public static bool IsMainPlayer => Context.IsWorldReady && Game1.IsMasterGame;
+
/****
** Internal
****/