summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Views/LogParser
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-08-20 17:01:59 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-08-20 17:01:59 -0400
commita1bc96d365dc40275f198668d3f4c09bd7a92613 (patch)
tree5a130399bf8031aa70defb71a121b740d7c6cd7a /src/SMAPI.Web/Views/LogParser
parentd51ffe58f7b7450cd4c4a7ee3d8b4da1cf55e7e4 (diff)
parentf3a79219e85c9af18f2f6d8b2aaa794afa08578d (diff)
downloadSMAPI-a1bc96d365dc40275f198668d3f4c09bd7a92613.tar.gz
SMAPI-a1bc96d365dc40275f198668d3f4c09bd7a92613.tar.bz2
SMAPI-a1bc96d365dc40275f198668d3f4c09bd7a92613.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI.Web/Views/LogParser')
-rw-r--r--src/SMAPI.Web/Views/LogParser/Index.cshtml34
1 files changed, 27 insertions, 7 deletions
diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml
index b824b768..f71c6ac1 100644
--- a/src/SMAPI.Web/Views/LogParser/Index.cshtml
+++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml
@@ -17,6 +17,7 @@
LogModInfo[] outdatedMods = log?.Mods.Where(mod => mod.HasUpdate).ToArray() ?? Array.Empty<LogModInfo>();
LogModInfo? errorHandler = log?.Mods.FirstOrDefault(p => p.IsCodeMod && p.Name == "Error Handler");
bool hasOlderErrorHandler = errorHandler?.GetParsedVersion() is not null && log?.ApiVersionParsed is not null && log.ApiVersionParsed.IsNewerThan(errorHandler.GetParsedVersion());
+ bool isPyTkCompatibilityMode = log?.ApiVersionParsed?.IsOlderThan("3.15.0") is false && log.Mods.Any(p => p.IsCodeMod && p.Name == "PyTK" && p.GetParsedVersion()?.IsOlderThan("1.23.1") is true);
// get filters
IDictionary<string, bool> defaultFilters = Enum
@@ -242,7 +243,7 @@ else if (log?.IsValid == true)
@if (log?.IsValid == true)
{
<div id="output">
- @if (outdatedMods.Any() || errorHandler is null || hasOlderErrorHandler)
+ @if (outdatedMods.Any() || errorHandler is null || hasOlderErrorHandler || isPyTkCompatibilityMode)
{
<h2>Suggested fixes</h2>
<ul id="fix-list">
@@ -254,6 +255,10 @@ else if (log?.IsValid == true)
{
<li>Your <strong>Error Handler</strong> mod is older than SMAPI. You may be missing some game/mod error fixes. You can <a href="https://stardewvalleywiki.com/Modding:Player_Guide#Install_SMAPI">reinstall SMAPI</a> to update it.</li>
}
+ @if (isPyTkCompatibilityMode)
+ {
+ <li>PyTK 1.23.0 or earlier isn't compatible with newer SMAPI performance optimizations. This may increase loading times or in-game lag.</li>
+ }
@if (outdatedMods.Any())
{
<li>
@@ -347,16 +352,31 @@ else if (log?.IsValid == true)
<span class="notice btn txt" v-on:click="toggleContentPacks">toggle content packs in list</span>
}
</caption>
- @foreach (var mod in log.Mods.Where(p => p.Loaded && !p.IsContentPack))
- {
- if (contentPacks == null || !contentPacks.TryGetValue(mod.Name, out LogModInfo[]? contentPackList))
- contentPackList = null;
+ @{
+ var modsWithContentPacks = log.Mods
+ .Where(mod => mod.Loaded && !mod.IsContentPack)
+ .Select(mod => (
+ Mod: mod,
+ ContentPacks: contentPacks?.TryGetValue(mod.Name, out LogModInfo[]? contentPackList) == true ? contentPackList : Array.Empty<LogModInfo>()
+ ))
+ .ToList();
+ if (contentPacks?.TryGetValue("", out LogModInfo[] invalidPacks) == true)
+ {
+ modsWithContentPacks.Add((
+ Mod: new LogModInfo(ModType.CodeMod, "<invalid content packs>", "", "", ""),
+ ContentPacks: invalidPacks
+ ));
+ }
+ }
+
+ @foreach ((LogModInfo mod, LogModInfo[] contentPackList) in modsWithContentPacks)
+ {
<tr v-on:click="toggleMod('@Model.GetSlug(mod.Name)')" class="mod-entry" v-bind:class="{ hidden: !showMods['@Model.GetSlug(mod.Name)'] }">
<td><input type="checkbox" v-bind:checked="showMods['@Model.GetSlug(mod.Name)']" v-bind:class="{ invisible: !anyModsHidden }" /></td>
<td>
<strong v-pre>@mod.Name</strong> @mod.Version
- @if (contentPackList != null)
+ @if (contentPackList.Any())
{
<div v-if="!hideContentPacks" class="content-packs">
@foreach (var contentPack in contentPackList)
@@ -369,7 +389,7 @@ else if (log?.IsValid == true)
</td>
<td>
@mod.Author
- @if (contentPackList != null)
+ @if (contentPackList.Any())
{
<div v-if="!hideContentPacks" class="content-packs">
@foreach (var contentPack in contentPackList)