summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/ModLoading/ModMetadata.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Framework/ModLoading/ModMetadata.cs')
-rw-r--r--src/SMAPI/Framework/ModLoading/ModMetadata.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/ModLoading/ModMetadata.cs b/src/SMAPI/Framework/ModLoading/ModMetadata.cs
index 0cb62a75..4ff021b7 100644
--- a/src/SMAPI/Framework/ModLoading/ModMetadata.cs
+++ b/src/SMAPI/Framework/ModLoading/ModMetadata.cs
@@ -179,5 +179,14 @@ namespace StardewModdingAPI.Framework.ModLoading
{
return this.GetUpdateKeys(validOnly: true).Any();
}
+
+ /// <summary>Get whether the mod has a given warning and it hasn't been suppressed in the <see cref="DataRecord"/>.</summary>
+ /// <param name="warning">The warning to check.</param>
+ public bool HasUnsuppressWarning(ModWarning warning)
+ {
+ return
+ this.Warnings.HasFlag(warning)
+ && (this.DataRecord?.DataRecord == null || !this.DataRecord.DataRecord.SuppressWarnings.HasFlag(warning));
+ }
}
}