diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-06-19 17:21:53 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-06-19 17:21:53 -0400 |
commit | e0ef8a20a5e7ccf1de32ff1a06f1aa62e37eb1db (patch) | |
tree | d51b5302d902f18021b72158cc95c249616ede2b /src/SMAPI.Web/Framework/LogParsing/Models/LogModInfo.cs | |
parent | 8e9237bdd7ec179975c9be5e28c811b42007e707 (diff) | |
download | SMAPI-e0ef8a20a5e7ccf1de32ff1a06f1aa62e37eb1db.tar.gz SMAPI-e0ef8a20a5e7ccf1de32ff1a06f1aa62e37eb1db.tar.bz2 SMAPI-e0ef8a20a5e7ccf1de32ff1a06f1aa62e37eb1db.zip |
fix mod count in log parser metadata
Diffstat (limited to 'src/SMAPI.Web/Framework/LogParsing/Models/LogModInfo.cs')
-rw-r--r-- | src/SMAPI.Web/Framework/LogParsing/Models/LogModInfo.cs | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/SMAPI.Web/Framework/LogParsing/Models/LogModInfo.cs b/src/SMAPI.Web/Framework/LogParsing/Models/LogModInfo.cs index a6b9165c..4b80a830 100644 --- a/src/SMAPI.Web/Framework/LogParsing/Models/LogModInfo.cs +++ b/src/SMAPI.Web/Framework/LogParsing/Models/LogModInfo.cs @@ -39,9 +39,15 @@ namespace StardewModdingAPI.Web.Framework.LogParsing.Models [MemberNotNullWhen(true, nameof(LogModInfo.UpdateVersion), nameof(LogModInfo.UpdateLink))] public bool HasUpdate => this.UpdateVersion != null && this.Version != this.UpdateVersion; - /// <summary>Whether the mod is a content pack for another mod.</summary> + /// <summary>Whether this is an actual mod (rather than a special entry for SMAPI or the game itself).</summary> + public bool IsMod { get; } + + /// <summary>Whether this is a C# code mod.</summary> + public bool IsCodeMod { get; } + + /// <summary>Whether this is a content pack for another mod.</summary> [MemberNotNullWhen(true, nameof(LogModInfo.ContentPackFor))] - public bool IsContentPack => !string.IsNullOrWhiteSpace(this.ContentPackFor); + public bool IsContentPack { get; } /********* @@ -57,7 +63,8 @@ namespace StardewModdingAPI.Web.Framework.LogParsing.Models /// <param name="contentPackFor">The name of the mod for which this is a content pack (if applicable).</param> /// <param name="errors">The number of errors logged by this mod.</param> /// <param name="loaded">Whether the mod was loaded into the game.</param> - public LogModInfo(string name, string author, string version, string description, string? updateVersion = null, string? updateLink = null, string? contentPackFor = null, int errors = 0, bool loaded = true) + /// <param name="isMod">Whether this is an actual mod (instead of a special entry for SMAPI or the game).</param> + public LogModInfo(string name, string author, string version, string description, string? updateVersion = null, string? updateLink = null, string? contentPackFor = null, int errors = 0, bool loaded = true, bool isMod = true) { this.Name = name; this.Author = author; @@ -68,6 +75,13 @@ namespace StardewModdingAPI.Web.Framework.LogParsing.Models this.ContentPackFor = contentPackFor; this.Errors = errors; this.Loaded = loaded; + + if (isMod) + { + this.IsMod = true; + this.IsContentPack = !string.IsNullOrWhiteSpace(this.ContentPackFor); + this.IsCodeMod = !this.IsContentPack; + } } /// <summary>Add an update alert for this mod.</summary> |