From 5b675902ff561682d5a991826661edce4e20d561 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 7 Mar 2019 18:10:59 -0500 Subject: improve SMAPI 3.0 status column, show by default --- src/SMAPI.Web/wwwroot/Content/css/mods.css | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/SMAPI.Web/wwwroot/Content/css') diff --git a/src/SMAPI.Web/wwwroot/Content/css/mods.css b/src/SMAPI.Web/wwwroot/Content/css/mods.css index f42800da..75885975 100644 --- a/src/SMAPI.Web/wwwroot/Content/css/mods.css +++ b/src/SMAPI.Web/wwwroot/Content/css/mods.css @@ -135,3 +135,7 @@ table.wikitable > caption { #mod-list tr[data-status="workaround"] .mod-page-links { text-decoration: line-through; } + +#mod-list td.smapi-3-col span { + border-bottom: 1px dashed gray; +} -- cgit From 9543971d2598f4d375374f427dfc17e615d4e67a Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 7 Mar 2019 18:11:47 -0500 Subject: update for compatibility wiki page changes --- src/SMAPI.Web/Views/Mods/Index.cshtml | 6 +++--- src/SMAPI.Web/wwwroot/Content/css/mods.css | 2 +- src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs | 4 +++- .../Framework/Clients/Wiki/WikiModEntry.cs | 3 +++ 4 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src/SMAPI.Web/wwwroot/Content/css') diff --git a/src/SMAPI.Web/Views/Mods/Index.cshtml b/src/SMAPI.Web/Views/Mods/Index.cshtml index 2f325f8e..5592078c 100644 --- a/src/SMAPI.Web/Views/Mods/Index.cshtml +++ b/src/SMAPI.Web/Views/Mods/Index.cshtml @@ -1,7 +1,7 @@ @using Newtonsoft.Json @model StardewModdingAPI.Web.ViewModels.ModListModel @{ - ViewData["Title"] = "SMAPI mod compatibility"; + ViewData["Title"] = "Mod compatibility"; } @section Head { @@ -19,9 +19,9 @@ }
-

This page lists all known SMAPI mods, whether they're compatible with the latest versions of Stardew Valley and SMAPI, and how to fix broken mods if possible. The list is updated every few days. (You can help edit this list!)

+

This page shows all known SMAPI mods and (incompatible) content packs, whether they work with the latest versions of Stardew Valley and SMAPI, and how to fix them if not. If a mod doesn't work after following the instructions below, check the troubleshooting guide or ask for help.

-

If a mod doesn't work after following the instructions below, check the troubleshooting guide or ask for help.

+

The list is updated every few days (you can help update it!). It doesn't include XNB mods (see using XNB mods on the wiki instead) or compatible content packs.

@if (Model.BetaVersion != null) { diff --git a/src/SMAPI.Web/wwwroot/Content/css/mods.css b/src/SMAPI.Web/wwwroot/Content/css/mods.css index 75885975..fc5fff47 100644 --- a/src/SMAPI.Web/wwwroot/Content/css/mods.css +++ b/src/SMAPI.Web/wwwroot/Content/css/mods.css @@ -6,7 +6,7 @@ } #intro { - width: 50em; + max-width: 60em; } #beta-blurb { diff --git a/src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs b/src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs index d3a25845..ac279d88 100644 --- a/src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs +++ b/src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs @@ -39,7 +39,7 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki .WithArguments(new { action = "parse", - page = "Modding:SMAPI_compatibility", + page = "Modding:Mod_compatibility", format = "json" }) .As(); @@ -98,6 +98,7 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki string customSourceUrl = this.GetAttribute(node, "data-custom-source"); string customUrl = this.GetAttribute(node, "data-url"); string anchor = this.GetAttribute(node, "id"); + string contentPackFor = this.GetAttribute(node, "data-content-pack-for"); // parse stable compatibility WikiCompatibilityInfo compatibility = new WikiCompatibilityInfo @@ -142,6 +143,7 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki GitHubRepo = githubRepo, CustomSourceUrl = customSourceUrl, CustomUrl = customUrl, + ContentPackFor = contentPackFor, Compatibility = compatibility, BetaCompatibility = betaCompatibility, Smapi3Status = smapi3Status, diff --git a/src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiModEntry.cs b/src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiModEntry.cs index b71269fe..35d43758 100644 --- a/src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiModEntry.cs +++ b/src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiModEntry.cs @@ -33,6 +33,9 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki /// The custom mod page URL (if applicable). public string CustomUrl { get; set; } + /// The name of the mod which loads this content pack, if applicable. + public string ContentPackFor { get; set; } + /// The mod's compatibility with the latest stable version of the game. public WikiCompatibilityInfo Compatibility { get; set; } -- cgit From 6cd7e11c1020c40f223dee70a7dd7b2c66296918 Mon Sep 17 00:00:00 2001 From: danvolchek Date: Sat, 9 Mar 2019 18:20:02 -0600 Subject: add log sections implementation --- src/SMAPI.Web/Framework/LogParsing/LogParser.cs | 18 ++++++++++++++++ .../Framework/LogParsing/Models/LogMessage.cs | 6 ++++++ .../Framework/LogParsing/Models/LogSection.cs | 15 +++++++++++++ src/SMAPI.Web/Views/LogParser/Index.cshtml | 25 +++++++++++++++++++--- src/SMAPI.Web/wwwroot/Content/css/log-parser.css | 13 ++++++++++- src/SMAPI.Web/wwwroot/Content/js/log-parser.js | 11 ++++++++++ 6 files changed, 84 insertions(+), 4 deletions(-) create mode 100644 src/SMAPI.Web/Framework/LogParsing/Models/LogSection.cs (limited to 'src/SMAPI.Web/wwwroot/Content/css') diff --git a/src/SMAPI.Web/Framework/LogParsing/LogParser.cs b/src/SMAPI.Web/Framework/LogParsing/LogParser.cs index fdc19404..3f33c0c1 100644 --- a/src/SMAPI.Web/Framework/LogParsing/LogParser.cs +++ b/src/SMAPI.Web/Framework/LogParsing/LogParser.cs @@ -119,7 +119,11 @@ namespace StardewModdingAPI.Web.Framework.LogParsing // mod list if (!inModList && message.Level == LogLevel.Info && this.ModListStartPattern.IsMatch(message.Text)) + { inModList = true; + message.IsStartOfSection = true; + message.Section = LogSection.ModsList; + } else if (inModList) { Match match = this.ModListEntryPattern.Match(message.Text); @@ -128,11 +132,17 @@ namespace StardewModdingAPI.Web.Framework.LogParsing string author = match.Groups["author"].Value; string description = match.Groups["description"].Value; mods[name] = new LogModInfo { Name = name, Author = author, Version = version, Description = description, Loaded = true }; + + message.Section = LogSection.ModsList; } // content pack list else if (!inContentPackList && message.Level == LogLevel.Info && this.ContentPackListStartPattern.IsMatch(message.Text)) + { inContentPackList = true; + message.IsStartOfSection = true; + message.Section = LogSection.ContentPackList; + } else if (inContentPackList) { Match match = this.ContentPackListEntryPattern.Match(message.Text); @@ -142,11 +152,17 @@ namespace StardewModdingAPI.Web.Framework.LogParsing string description = match.Groups["description"].Value; string forMod = match.Groups["for"].Value; mods[name] = new LogModInfo { Name = name, Author = author, Version = version, Description = description, ContentPackFor = forMod, Loaded = true }; + + message.Section = LogSection.ContentPackList; } // mod update list else if (!inModUpdateList && message.Level == LogLevel.Alert && this.ModUpdateListStartPattern.IsMatch(message.Text)) + { inModUpdateList = true; + message.IsStartOfSection = true; + message.Section = LogSection.ModUpdateList; + } else if (inModUpdateList) { Match match = this.ModUpdateListEntryPattern.Match(message.Text); @@ -162,6 +178,8 @@ namespace StardewModdingAPI.Web.Framework.LogParsing { mods[name] = new LogModInfo { Name = name, UpdateVersion = version, UpdateLink = link, Loaded = false }; } + + message.Section = LogSection.ModUpdateList; } else if (message.Level == LogLevel.Alert && this.SMAPIUpdatePattern.IsMatch(message.Text)) diff --git a/src/SMAPI.Web/Framework/LogParsing/Models/LogMessage.cs b/src/SMAPI.Web/Framework/LogParsing/Models/LogMessage.cs index baeac83c..ecca0b5b 100644 --- a/src/SMAPI.Web/Framework/LogParsing/Models/LogMessage.cs +++ b/src/SMAPI.Web/Framework/LogParsing/Models/LogMessage.cs @@ -20,5 +20,11 @@ namespace StardewModdingAPI.Web.Framework.LogParsing.Models /// The number of times this message was repeated consecutively. public int Repeated { get; set; } + + /// The section that this log message belongs too. + public LogSection? Section { get; set; } + + /// Whether this message is the first one of it's section. + public bool IsStartOfSection { get; set; } } } diff --git a/src/SMAPI.Web/Framework/LogParsing/Models/LogSection.cs b/src/SMAPI.Web/Framework/LogParsing/Models/LogSection.cs new file mode 100644 index 00000000..218d546c --- /dev/null +++ b/src/SMAPI.Web/Framework/LogParsing/Models/LogSection.cs @@ -0,0 +1,15 @@ +namespace StardewModdingAPI.Web.Framework.LogParsing.Models +{ + /// The different sections of a log. + public enum LogSection + { + /// The list of mods the user has. + ModsList, + + /// The list of content packs the user has. + ContentPackList, + + /// The list of mod updates SMAPI has found. + ModUpdateList + } +} diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml index 21adf35b..aa37fef2 100644 --- a/src/SMAPI.Web/Views/LogParser/Index.cshtml +++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml @@ -27,6 +27,7 @@ logStarted: new Date(@Json.Serialize(Model.ParsedLog?.Timestamp)), showPopup: @Json.Serialize(Model.ParsedLog == null), showMods: @Json.Serialize(Model.ParsedLog?.Mods?.Select(p => Model.GetSlug(p.Name)).Distinct().ToDictionary(slug => slug, slug => true), noFormatting), + showSections: @Json.Serialize(Enum.GetNames(typeof(LogSection)).ToDictionary(section => section, section => false), noFormatting), showLevels: @Json.Serialize(defaultFilters, noFormatting), enableFilters: @Json.Serialize(!Model.ShowRaw) }, '@Model.SectionUrl'); @@ -261,16 +262,34 @@ else if (Model.ParsedLog?.IsValid == true) @foreach (var message in Model.ParsedLog.Messages) { string levelStr = message.Level.ToString().ToLower(); + string sectionStartClass = message.IsStartOfSection ? "section-start" : null; - + // filter the message by section if it has one + string sectionFilter = message.Section != null ? $"&& sectionsAllow('{message.Section}')" : null; + // always show the first message in the section regardless of section filters + string sectionsAllow = message.IsStartOfSection ? null : sectionFilter; + + v-on:click="toggleSection('@message.Section')" + } + v-show="filtersAllow('@Model.GetSlug(message.Mod)', '@levelStr') @sectionsAllow"> @message.Time @message.Level.ToString().ToUpper() @message.Mod - @message.Text + + @message.Text + @if (message.IsStartOfSection) + { + This section is hidden. Click here to show it. + This section is shown. Click here to hide it. + } + if (message.Repeated > 0) { - + repeats [@message.Repeated] times. diff --git a/src/SMAPI.Web/wwwroot/Content/css/log-parser.css b/src/SMAPI.Web/wwwroot/Content/css/log-parser.css index ea28cd7d..7610f12c 100644 --- a/src/SMAPI.Web/wwwroot/Content/css/log-parser.css +++ b/src/SMAPI.Web/wwwroot/Content/css/log-parser.css @@ -219,6 +219,18 @@ table caption { font-weight: bold; } +#log .section-start { + cursor: pointer; +} + +#log .section-toggle-message { + color: blue; +} + +#log .log-message-text { + white-space: pre-wrap; +} + #log { border-spacing: 0; } @@ -233,7 +245,6 @@ table caption { border-bottom: 1px dotted #ccc; border-top: 2px solid #fff; vertical-align: top; - white-space: pre-wrap; } #log td:not(:last-child) { diff --git a/src/SMAPI.Web/wwwroot/Content/js/log-parser.js b/src/SMAPI.Web/wwwroot/Content/js/log-parser.js index 0c654205..e87a1a5c 100644 --- a/src/SMAPI.Web/wwwroot/Content/js/log-parser.js +++ b/src/SMAPI.Web/wwwroot/Content/js/log-parser.js @@ -69,6 +69,13 @@ smapi.logParser = function (data, sectionUrl) { updateModFilters(); }, + toggleSection: function (name) { + if (!data.enableFilters) + return; + + this.showSections[name] = !this.showSections[name]; + }, + showAllMods: function () { if (!data.enableFilters) return; @@ -95,6 +102,10 @@ smapi.logParser = function (data, sectionUrl) { filtersAllow: function(modId, level) { return this.showMods[modId] !== false && this.showLevels[level] !== false; + }, + + sectionsAllow: function (section) { + return this.showSections[section] !== false; } } }); -- cgit From f91d9ce97eadd35314a5b4c46e9cbe0649387b97 Mon Sep 17 00:00:00 2001 From: danvolchek Date: Thu, 14 Mar 2019 00:48:03 -0500 Subject: remove unneeded log parser css rule --- src/SMAPI.Web/Views/LogParser/Index.cshtml | 2 +- src/SMAPI.Web/wwwroot/Content/css/log-parser.css | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'src/SMAPI.Web/wwwroot/Content/css') diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml index 36855768..babd0bd3 100644 --- a/src/SMAPI.Web/Views/LogParser/Index.cshtml +++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml @@ -17,7 +17,7 @@ { } - + diff --git a/src/SMAPI.Web/wwwroot/Content/css/log-parser.css b/src/SMAPI.Web/wwwroot/Content/css/log-parser.css index 7610f12c..d5013207 100644 --- a/src/SMAPI.Web/wwwroot/Content/css/log-parser.css +++ b/src/SMAPI.Web/wwwroot/Content/css/log-parser.css @@ -255,7 +255,6 @@ table caption { } #log td[data-title]:hover { - font-size: 1px; overflow: inherit; position: relative; } -- cgit