diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-02-24 16:52:38 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-02-24 16:52:38 -0500 |
commit | 691310d16e6873b83c55f62a59d5010dd8bb7e98 (patch) | |
tree | c62543dca097f7c914e27674222c34645f8498b8 /src/SMAPI.Web/Views | |
parent | d7696912e007a2b455a2fd5e1974924d2efe83b3 (diff) | |
download | SMAPI-691310d16e6873b83c55f62a59d5010dd8bb7e98.tar.gz SMAPI-691310d16e6873b83c55f62a59d5010dd8bb7e98.tar.bz2 SMAPI-691310d16e6873b83c55f62a59d5010dd8bb7e98.zip |
add content pack support to log parser
Diffstat (limited to 'src/SMAPI.Web/Views')
-rw-r--r-- | src/SMAPI.Web/Views/LogParser/Index.cshtml | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml index 8d1abbb1..20e20ee1 100644 --- a/src/SMAPI.Web/Views/LogParser/Index.cshtml +++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml @@ -1,5 +1,10 @@ @{ ViewData["Title"] = "SMAPI log parser"; + + Dictionary<string, LogModInfo[]> contentPacks = Model.ParsedLog?.Mods + ?.GroupBy(mod => mod.ContentPackFor) + .Where(group => group.Key != null) + .ToDictionary(group => group.Key, group => group.ToArray()); } @using Newtonsoft.Json @using StardewModdingAPI.Web.Framework.LogParsing.Models @@ -69,10 +74,22 @@ <span class="notice btn txt" v-on:click="showAllMods" v-if="stats.modsHidden > 0">show all</span> <span class="notice btn txt" v-on:click="hideAllMods" v-if="stats.modsShown > 0 && stats.modsHidden > 0">hide all</span> </caption> - @foreach (var mod in Model.ParsedLog.Mods) + @foreach (var mod in Model.ParsedLog.Mods.Where(p => p.ContentPackFor == null)) { <tr v-on:click="toggleMod('@mod.Name')" class="mod-entry" v-bind:class="{ hidden: !showMods['@mod.Name'] }"> <td><input type="checkbox" v-bind:checked="showMods['@mod.Name']" v-if="anyModsHidden" /></td> + <td> + @mod.Name + @if (contentPacks != null && contentPacks.TryGetValue(mod.Name, out LogModInfo[] contentPackList)) + { + <div class="content-packs"> + @foreach (var contentPack in contentPackList) + { + <text>+@contentPack.Name @contentPack.Version</text> + } + </div> + } + </td> <td>@mod.Version</td> <td>@mod.Author</td> @if (mod.Errors == 0) |