Skip to content

Commit

Permalink
Merge branch 'develop' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
Pathoschild committed Mar 18, 2019
2 parents 10c7192 + 4a494c6 commit 013255d
Show file tree
Hide file tree
Showing 27 changed files with 261 additions and 128 deletions.
4 changes: 2 additions & 2 deletions build/GlobalAssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Reflection;

[assembly: AssemblyProduct("SMAPI")]
[assembly: AssemblyVersion("2.11.0")]
[assembly: AssemblyFileVersion("2.11.0")]
[assembly: AssemblyVersion("2.11.1")]
[assembly: AssemblyFileVersion("2.11.1")]
14 changes: 14 additions & 0 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
# Release notes
## 2.11.1
Released 17 March 2019 for Stardew Valley 1.3.36.

* For players:
* Added crops option to `world_clear` console command.
* Prepared compatibility check for Stardew Valley 1.4.
* Updated mod compatibility list.
* Fixed `world_clear` console command removing chests edited to have a debris name.

* For the web UI:
* Added support for suppressing false-positive warnings in rare cases.
* The log parser now collapses redundant sections by default.
* Fixed log parser column resize bug.

## 2.11
Released 01 March 2019 for Stardew Valley 1.3.36.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal class ClearCommand : TrainerCommand
** Fields
*********/
/// <summary>The valid types that can be cleared.</summary>
private readonly string[] ValidTypes = { "debris", "fruit-trees", "grass", "trees", "everything" };
private readonly string[] ValidTypes = { "crops", "debris", "fruit-trees", "grass", "trees", "everything" };

/// <summary>The resource clump IDs to consider debris.</summary>
private readonly int[] DebrisClumps = { ResourceClump.stumpIndex, ResourceClump.hollowLogIndex, ResourceClump.meteoriteIndex, ResourceClump.boulderIndex };
Expand All @@ -32,7 +32,7 @@ public ClearCommand()
description: "Clears in-game entities in a given location.\n\n"
+ "Usage: world_clear <location> <object type>\n"
+ "- location: the location name for which to clear objects (like Farm), or 'current' for the current location.\n"
+ " - object type: the type of object clear. You can specify 'debris' (stones/twigs/weeds and dead crops), 'grass', and 'trees' / 'fruit-trees'. You can also specify 'everything', which includes things not removed by the other types (like furniture or resource clumps)."
+ " - object type: the type of object clear. You can specify 'crops', 'debris' (stones/twigs/weeds and dead crops), 'grass', and 'trees' / 'fruit-trees'. You can also specify 'everything', which includes things not removed by the other types (like furniture or resource clumps)."
)
{ }

Expand Down Expand Up @@ -69,6 +69,15 @@ public override void Handle(IMonitor monitor, string command, ArgumentParser arg
// apply
switch (type)
{
case "crops":
{
int removed =
this.RemoveTerrainFeatures(location, p => p is HoeDirt)
+ this.RemoveResourceClumps(location, p => p is GiantCrop);
monitor.Log($"Done! Removed {removed} entities from {location.Name}.", LogLevel.Info);
break;
}

case "debris":
{
int removed = 0;
Expand All @@ -83,7 +92,14 @@ public override void Handle(IMonitor monitor, string command, ArgumentParser arg
}

removed +=
this.RemoveObjects(location, obj => obj.Name.ToLower().Contains("weed") || obj.Name == "Twig" || obj.Name == "Stone")
this.RemoveObjects(location, obj =>
!(obj is Chest)
&& (
obj.Name == "Weeds"
|| obj.Name == "Stone"
|| (obj.ParentSheetIndex == 294 || obj.ParentSheetIndex == 295)
)
)
+ this.RemoveResourceClumps(location, clump => this.DebrisClumps.Contains(clump.parentSheetIndex.Value));

monitor.Log($"Done! Removed {removed} entities from {location.Name}.", LogLevel.Info);
Expand Down
4 changes: 2 additions & 2 deletions src/SMAPI.Mods.ConsoleCommands/manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"Name": "Console Commands",
"Author": "SMAPI",
"Version": "2.11.0",
"Version": "2.11.1",
"Description": "Adds SMAPI console commands that let you manipulate the game.",
"UniqueID": "SMAPI.ConsoleCommands",
"EntryDll": "ConsoleCommands.dll",
"MinimumApiVersion": "2.11.0"
"MinimumApiVersion": "2.11.1"
}
4 changes: 2 additions & 2 deletions src/SMAPI.Mods.SaveBackup/manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"Name": "Save Backup",
"Author": "SMAPI",
"Version": "2.11.0",
"Version": "2.11.1",
"Description": "Automatically backs up all your saves once per day into its folder.",
"UniqueID": "SMAPI.SaveBackup",
"EntryDll": "SaveBackup.dll",
"MinimumApiVersion": "2.11.0"
"MinimumApiVersion": "2.11.1"
}
18 changes: 18 additions & 0 deletions src/SMAPI.Web/Framework/LogParsing/LogParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ public ParsedLog Parse(string logText)

// 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);
Expand All @@ -128,11 +132,17 @@ public ParsedLog Parse(string logText)
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);
Expand All @@ -142,11 +152,17 @@ public ParsedLog Parse(string logText)
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);
Expand All @@ -162,6 +178,8 @@ public ParsedLog Parse(string logText)
{
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))
Expand Down
6 changes: 6 additions & 0 deletions src/SMAPI.Web/Framework/LogParsing/Models/LogMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,11 @@ public class LogMessage

/// <summary>The number of times this message was repeated consecutively.</summary>
public int Repeated { get; set; }

/// <summary>The section that this log message belongs to.</summary>
public LogSection? Section { get; set; }

/// <summary>Whether this message is the first one of its section.</summary>
public bool IsStartOfSection { get; set; }
}
}
15 changes: 15 additions & 0 deletions src/SMAPI.Web/Framework/LogParsing/Models/LogSection.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace StardewModdingAPI.Web.Framework.LogParsing.Models
{
/// <summary>The different sections of a log.</summary>
public enum LogSection
{
/// <summary>The list of mods the user has.</summary>
ModsList,

/// <summary>The list of content packs the user has.</summary>
ContentPackList,

/// <summary>The list of mod updates SMAPI has found.</summary>
ModUpdateList
}
}
5 changes: 2 additions & 3 deletions src/SMAPI.Web/Views/Index/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,15 @@ else

<p>
Special thanks to
AbroadKew,
acerbicon,
<a href="https://www.nexusmods.com/stardewvalley/users/31393530">ChefRude</a>,
cheesysteak,
<a href="https://github.com/dittusch">dittusch</a>,
hawkfalcon,
<a href="https://twitter.com/iKeychain">iKeychain</a>,
jwdred,
<a href="https://www.nexusmods.com/users/12252523">Karmylla</a>,
Pucklynn,
Robby LaFarge,
Tarryn K.,
and a few anonymous users for their ongoing support; you're awesome! 🏅
</p>

Expand Down
27 changes: 22 additions & 5 deletions src/SMAPI.Web/Views/LogParser/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@
{
<meta name="robots" content="noindex" />
}
<link rel="stylesheet" href="~/Content/css/log-parser.css?r=20190221" />
<link rel="stylesheet" href="~/Content/css/log-parser.css?r=20190314" />
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js" crossorigin="anonymous"></script>
<script src="~/Content/js/log-parser.js?r=20190221"></script>
<script src="~/Content/js/log-parser.js?r=20190310"></script>
<script>
$(function() {
smapi.logParser({
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');
Expand Down Expand Up @@ -261,16 +262,32 @@ 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;
string sectionFilter = message.Section != null && !message.IsStartOfSection ? $"&& sectionsAllow('{message.Section}')" : null; // filter the message by section if applicable
<tr class="@levelStr mod" v-show="filtersAllow('@Model.GetSlug(message.Mod)', '@levelStr')">
<tr class="mod @levelStr @sectionStartClass"
@if (message.IsStartOfSection)
{
<text>v-on:click="toggleSection('@message.Section')"</text>
}
v-show="filtersAllow('@Model.GetSlug(message.Mod)', '@levelStr') @sectionFilter">
<td v-pre>@message.Time</td>
<td v-pre>@message.Level.ToString().ToUpper()</td>
<td v-pre data-title="@message.Mod">@message.Mod</td>
<td v-pre>@message.Text</td>
<td>
<span v-pre class="log-message-text">@message.Text</span>
@if (message.IsStartOfSection)
{
<span class="section-toggle-message">
<template v-if="sectionsAllow('@message.Section')">This section is shown. Click here to hide it.</template>
<template v-else>This section is hidden. Click here to show it.</template>
</span>
}
</td>
</tr>
if (message.Repeated > 0)
{
<tr class="@levelStr mod mod-repeat" v-show="filtersAllow('@Model.GetSlug(message.Mod)', '@levelStr')">
<tr class="@levelStr mod mod-repeat" v-show="filtersAllow('@Model.GetSlug(message.Mod)', '@levelStr') @sectionFilter">
<td colspan="3"></td>
<td v-pre><i>repeats [@message.Repeated] times.</i></td>
</tr>
Expand Down
20 changes: 10 additions & 10 deletions src/SMAPI.Web/Views/Mods/Index.cshtml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
@using Newtonsoft.Json
@model StardewModdingAPI.Web.ViewModels.ModListModel
@{
ViewData["Title"] = "SMAPI mod compatibility";
ViewData["Title"] = "Mod compatibility";
}
@section Head {
<link rel="stylesheet" href="~/Content/css/mods.css?r=20190125" />
<link rel="stylesheet" href="~/Content/css/mods.css?r=20190302" />
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/jquery.tablesorter.combined.min.js" crossorigin="anonymous"></script>
<script src="~/Content/js/mods.js?r=20190125"></script>
<script src="~/Content/js/mods.js?r=20190302"></script>
<script>
$(function() {
var data = @Json.Serialize(Model.Mods, new JsonSerializerSettings { Formatting = Formatting.None });
Expand All @@ -19,9 +19,9 @@
}

<div id="intro">
<p>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 <a href="https://stardewvalleywiki.com/Modding:SMAPI_compatibility">edit this list</a>!)</p>
<p>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 <a href="https://stardewvalleywiki.com/Modding:Player_Guide/Troubleshooting">the troubleshooting guide</a> or <a href="https://stardewvalleywiki.com/Modding:Player_Guide/Troubleshooting#Ask_for_help">ask for help</a>.</p>

<p>If a mod doesn't work after following the instructions below, check <a href="https://stardewvalleywiki.com/Modding:Player_Guide/Troubleshooting">the troubleshooting guide</a> or <a href="https://stardewvalleywiki.com/Modding:Player_Guide/Troubleshooting#Ask_for_help">ask for help</a>.</p>
<p>The list is updated every few days (you can help <a href="https://stardewvalleywiki.com/Modding:Mod_compatibility">update it</a>!). It doesn't include XNB mods (see <a href="https://stardewvalleywiki.com/Modding:Using_XNB_mods"><em>using XNB mods</em> on the wiki</a> instead) or compatible content packs.</p>

@if (Model.BetaVersion != null)
{
Expand Down Expand Up @@ -61,7 +61,7 @@
<th>compatibility</th>
<th v-show="showAdvanced">broke in</th>
<th v-show="showAdvanced">code</th>
<th v-show="showAdvanced"><a href="http://smapi.io/3.0">3.0</a></th>
<th><small><a href="http://smapi.io/3.0">3.0 ready</a></small></th>
<th>&nbsp;</th>
</tr>
</thead>
Expand Down Expand Up @@ -93,10 +93,10 @@
<span v-if="mod.SourceUrl"><a v-bind:href="mod.SourceUrl">source</a></span>
<span v-else class="mod-closed-source">no source</span>
</td>
<td v-show="showAdvanced">
<small v-if="mod.LatestCompatibility.Status == 'ok' || mod.LatestCompatibility.Status == 'unofficial' || mod.Smapi3Status == 'ok' || mod.Smapi3Status == 'soon' || mod.Smapi3Url">
<a v-if="mod.Smapi3Url" v-bind:href="mod.Smapi3Url">{{mod.Smapi3DisplayText}}</a>
<template v-else>{{mod.Smapi3DisplayText}}</template>
<td class="smapi-3-col">
<small v-if="mod.LatestCompatibility.Status == 'ok' || mod.LatestCompatibility.Status == 'unofficial' || mod.LatestCompatibility.Status == 'optional' || mod.Smapi3Status == 'ok' || mod.Smapi3Status == 'soon' || mod.Smapi3Url">
<a v-if="mod.Smapi3Url" v-bind:href="mod.Smapi3Url" v-bind:title="mod.Smapi3Tooltip">{{mod.Smapi3DisplayText}}</a>
<span v-else v-bind:title="mod.Smapi3Tooltip">{{mod.Smapi3DisplayText}}</span>
</small>
</td>
<td>
Expand Down
14 changes: 12 additions & 2 deletions src/SMAPI.Web/wwwroot/Content/css/log-parser.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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) {
Expand All @@ -244,7 +255,6 @@ table caption {
}

#log td[data-title]:hover {
font-size: 1px;
overflow: inherit;
position: relative;
}
Expand Down
6 changes: 5 additions & 1 deletion src/SMAPI.Web/wwwroot/Content/css/mods.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}

#intro {
width: 50em;
max-width: 60em;
}

#beta-blurb {
Expand Down Expand Up @@ -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;
}
11 changes: 11 additions & 0 deletions src/SMAPI.Web/wwwroot/Content/js/log-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
}
});
Expand Down
Loading

0 comments on commit 013255d

Please sign in to comment.