fix & improve split-screen column in log parser

This commit is contained in:
Jesse Plamondon-Willard 2022-11-09 20:03:41 -05:00
parent 9ae69245b3
commit beb0b0aaf4
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
5 changed files with 16 additions and 12 deletions

View File

@ -7,6 +7,10 @@
_If needed, you can update to SMAPI 3.16.0 first and then install the latest version._
-->
## Upcoming release
* For the web UI:
* Fixed log parser not showing screen IDs in split-screen mode, and improved screen display.
## 3.17.2
Released 21 October 2022 for Stardew Valley 1.5.6 or later.

View File

@ -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")
{

View File

@ -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
****/

View File

@ -47,7 +47,7 @@
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1" crossorigin="anonymous"></script>
<script src="~/Content/js/file-upload.js"></script>
<script src="~/Content/js/log-parser.js?r=20220409"></script>
<script src="~/Content/js/log-parser.js"></script>
<script id="serializedData" type="application/json">
@if (!Model.ShowRaw)
@ -86,7 +86,8 @@
showMods: @this.ForJson(log?.Mods.Where(p => p.Loaded && !p.IsContentPack).Select(p => Model.GetSlug(p.Name)).Distinct().ToDictionary(slug => slug, _ => true)),
showSections: @this.ForJson(Enum.GetNames(typeof(LogSection)).ToDictionary(section => section, _ => false)),
showLevels: @this.ForJson(defaultFilters),
enableFilters: @this.ForJson(!Model.ShowRaw)
enableFilters: @this.ForJson(!Model.ShowRaw),
isSplitScreen: @this.ForJson(log?.IsSplitScreen ?? false)
}
);
@ -494,7 +495,6 @@ else if (log?.IsValid == true)
<log-line
v-for="msg in visibleMessages"
v-bind:key="msg.id"
v-bind:showScreenId="showScreenId"
v-bind:message="msg"
v-bind:highlight="shouldHighlight"
/>

View File

@ -424,10 +424,6 @@ smapi.logParser = function (state) {
Vue.component("log-line", {
functional: true,
props: {
showScreenId: {
type: Boolean,
required: true
},
message: {
type: Object,
required: true
@ -456,7 +452,7 @@ smapi.logParser = function (state) {
"td",
{
attrs: {
colspan: context.props.showScreenId ? 4 : 3
colspan: state.isSplitScreen ? 4 : 3
}
},
""
@ -541,7 +537,7 @@ smapi.logParser = function (state) {
},
[
createElement("td", message.Time),
context.props.showScreenId ? createElement("td", message.ScreenId) : null,
state.isSplitScreen ? createElement("td", { attrs: { title: (message.ScreenId == 0 ? "main screen" : "screen #" + (message.ScreenId + 1)) + " in split-screen mode" } }, `🖵${message.ScreenId + 1}`) : null,
createElement("td", level.toUpperCase()),
createElement(
"td",
@ -588,9 +584,6 @@ smapi.logParser = function (state) {
anyModsShown: function () {
return stats.modsShown > 0;
},
showScreenId: function () {
return this.data.screenIds.length > 1;
},
// Maybe not strictly necessary, but the Vue template is being
// weird about accessing data entries on the app rather than