From beb0b0aaf4e349cf911504a72b484d5642f6ac58 Mon Sep 17 00:00:00 2001
From: Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com>
Date: Wed, 9 Nov 2022 20:03:41 -0500
Subject: fix & improve split-screen column in log parser

---
 src/SMAPI.Web/Framework/LogParsing/LogParser.cs        | 4 ++++
 src/SMAPI.Web/Framework/LogParsing/Models/ParsedLog.cs | 3 +++
 2 files changed, 7 insertions(+)

(limited to 'src/SMAPI.Web/Framework/LogParsing')

diff --git a/src/SMAPI.Web/Framework/LogParsing/LogParser.cs b/src/SMAPI.Web/Framework/LogParsing/LogParser.cs
index 5e0dedf3..c39e612b 100644
--- a/src/SMAPI.Web/Framework/LogParsing/LogParser.cs
+++ b/src/SMAPI.Web/Framework/LogParsing/LogParser.cs
@@ -108,6 +108,10 @@ namespace StardewModdingAPI.Web.Framework.LogParsing
                         }
                     }
 
+                    // detect split-screen mode
+                    if (message.ScreenId != 0)
+                        log.IsSplitScreen = true;
+
                     // collect SMAPI metadata
                     if (message.Mod == "SMAPI")
                     {
diff --git a/src/SMAPI.Web/Framework/LogParsing/Models/ParsedLog.cs b/src/SMAPI.Web/Framework/LogParsing/Models/ParsedLog.cs
index cda0f653..2a2e5f5c 100644
--- a/src/SMAPI.Web/Framework/LogParsing/Models/ParsedLog.cs
+++ b/src/SMAPI.Web/Framework/LogParsing/Models/ParsedLog.cs
@@ -22,6 +22,9 @@ namespace StardewModdingAPI.Web.Framework.LogParsing.Models
         /// <summary>The raw log text.</summary>
         public string? RawText { get; set; }
 
+        /// <summary>Whether there are messages from multiple screens in the log.</summary>
+        public bool IsSplitScreen { get; set; }
+
         /****
         ** Log data
         ****/
-- 
cgit