summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Framework')
-rw-r--r--src/SMAPI/Framework/Content/AssetDataForImage.cs6
-rw-r--r--src/SMAPI/Framework/Input/SInputState.cs2
-rw-r--r--src/SMAPI/Framework/Models/SConfig.cs3
3 files changed, 7 insertions, 4 deletions
diff --git a/src/SMAPI/Framework/Content/AssetDataForImage.cs b/src/SMAPI/Framework/Content/AssetDataForImage.cs
index 1eef2afb..5c7b87de 100644
--- a/src/SMAPI/Framework/Content/AssetDataForImage.cs
+++ b/src/SMAPI/Framework/Content/AssetDataForImage.cs
@@ -4,7 +4,7 @@ using Microsoft.Xna.Framework.Graphics;
namespace StardewModdingAPI.Framework.Content
{
- /// <summary>Encapsulates access and changes to dictionary content being read from a data file.</summary>
+ /// <summary>Encapsulates access and changes to image content being read from a data file.</summary>
internal class AssetDataForImage : AssetData<Texture2D>, IAssetDataForImage
{
/*********
@@ -29,6 +29,8 @@ namespace StardewModdingAPI.Framework.Content
public void PatchImage(Texture2D source, Rectangle? sourceArea = null, Rectangle? targetArea = null, PatchMode patchMode = PatchMode.Replace)
{
// get texture
+ if (source == null)
+ throw new ArgumentNullException(nameof(source), "Can't patch from a null source texture.");
Texture2D target = this.Data;
// get areas
@@ -36,8 +38,6 @@ namespace StardewModdingAPI.Framework.Content
targetArea = targetArea ?? new Rectangle(0, 0, Math.Min(sourceArea.Value.Width, target.Width), Math.Min(sourceArea.Value.Height, target.Height));
// validate
- if (source == null)
- throw new ArgumentNullException(nameof(source), "Can't patch from a null source texture.");
if (sourceArea.Value.X < 0 || sourceArea.Value.Y < 0 || sourceArea.Value.Right > source.Width || sourceArea.Value.Bottom > source.Height)
throw new ArgumentOutOfRangeException(nameof(sourceArea), "The source area is outside the bounds of the source texture.");
if (targetArea.Value.X < 0 || targetArea.Value.Y < 0 || targetArea.Value.Right > target.Width || targetArea.Value.Bottom > target.Height)
diff --git a/src/SMAPI/Framework/Input/SInputState.cs b/src/SMAPI/Framework/Input/SInputState.cs
index 5e8efa62..27e40ab4 100644
--- a/src/SMAPI/Framework/Input/SInputState.cs
+++ b/src/SMAPI/Framework/Input/SInputState.cs
@@ -160,7 +160,7 @@ namespace StardewModdingAPI.Framework.Input
/// <summary>Whether input should be suppressed in the current context.</summary>
private bool ShouldSuppressNow()
{
- return Game1.chatBox != null && !Game1.chatBox.isActive();
+ return Game1.chatBox == null || !Game1.chatBox.isActive();
}
/// <summary>Apply input suppression to the given input states.</summary>
diff --git a/src/SMAPI/Framework/Models/SConfig.cs b/src/SMAPI/Framework/Models/SConfig.cs
index e201e966..98614933 100644
--- a/src/SMAPI/Framework/Models/SConfig.cs
+++ b/src/SMAPI/Framework/Models/SConfig.cs
@@ -28,5 +28,8 @@ namespace StardewModdingAPI.Framework.Models
/// <summary>The console color scheme to use.</summary>
public MonitorColorScheme ColorScheme { get; set; }
+
+ /// <summary>The mod IDs SMAPI should ignore when performing update checks or validating update keys.</summary>
+ public string[] SuppressUpdateChecks { get; set; }
}
}