From 9a15da5a173e5e218c16e2e4ef0af0c98968e1cb Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 9 Oct 2022 16:59:05 -0400 Subject: add 'strict mode' release with deprecated APIs stripped out --- src/SMAPI.Web/Framework/LogParsing/LogParser.cs | 9 +++++++- .../Framework/LogParsing/Models/ParsedLog.cs | 3 +++ src/SMAPI.Web/Views/LogParser/Index.cshtml | 25 ++++++++++++++++++---- src/SMAPI.Web/wwwroot/Content/css/log-parser.css | 5 +++++ 4 files changed, 37 insertions(+), 5 deletions(-) (limited to 'src/SMAPI.Web') diff --git a/src/SMAPI.Web/Framework/LogParsing/LogParser.cs b/src/SMAPI.Web/Framework/LogParsing/LogParser.cs index 18ba754c..5e0dedf3 100644 --- a/src/SMAPI.Web/Framework/LogParsing/LogParser.cs +++ b/src/SMAPI.Web/Framework/LogParsing/LogParser.cs @@ -199,8 +199,15 @@ namespace StardewModdingAPI.Web.Framework.LogParsing log.ApiVersion = match.Groups["apiVersion"].Value; log.GameVersion = match.Groups["gameVersion"].Value; log.OperatingSystem = match.Groups["os"].Value; - smapiMod.OverrideVersion(log.ApiVersion); + const string strictModeSuffix = " (strict mode)"; + if (log.ApiVersion.EndsWith(strictModeSuffix)) + { + log.IsStrictMode = true; + log.ApiVersion = log.ApiVersion[..^strictModeSuffix.Length]; + } + + smapiMod.OverrideVersion(log.ApiVersion); log.ApiVersionParsed = smapiMod.GetParsedVersion(); } diff --git a/src/SMAPI.Web/Framework/LogParsing/Models/ParsedLog.cs b/src/SMAPI.Web/Framework/LogParsing/Models/ParsedLog.cs index 3f649199..cda0f653 100644 --- a/src/SMAPI.Web/Framework/LogParsing/Models/ParsedLog.cs +++ b/src/SMAPI.Web/Framework/LogParsing/Models/ParsedLog.cs @@ -25,6 +25,9 @@ namespace StardewModdingAPI.Web.Framework.LogParsing.Models /**** ** Log data ****/ + /// Whether SMAPI is running in strict mode, which disables all deprecated APIs. + public bool IsStrictMode { get; set; } + /// The SMAPI version. public string? ApiVersion { get; set; } diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml index b982bc0c..28127903 100644 --- a/src/SMAPI.Web/Views/LogParser/Index.cshtml +++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml @@ -40,7 +40,7 @@ } - + @@ -243,7 +243,7 @@ else if (log?.IsValid == true) @if (log?.IsValid == true) {
- @if (outdatedMods.Any() || errorHandler is null || hasOlderErrorHandler || isPyTkCompatibilityMode) + @if (outdatedMods.Any() || errorHandler is null || hasOlderErrorHandler || isPyTkCompatibilityMode || log.IsStrictMode) {

Suggested fixes

} @@ -329,7 +340,13 @@ else if (log?.IsValid == true) SMAPI: - @log.ApiVersion + + @log.ApiVersion + @if (log.IsStrictMode) + { + (strict mode) + } + Folder: diff --git a/src/SMAPI.Web/wwwroot/Content/css/log-parser.css b/src/SMAPI.Web/wwwroot/Content/css/log-parser.css index f136a96f..995f5aa9 100644 --- a/src/SMAPI.Web/wwwroot/Content/css/log-parser.css +++ b/src/SMAPI.Web/wwwroot/Content/css/log-parser.css @@ -73,6 +73,11 @@ table caption { margin-bottom: 0.5em; } +#fix-list li.notice { + background: #EEFFEE; + border-color: #080; +} + #fix-list li.important { background: #FCC; border-color: #800; -- cgit