Skip to content

Commit 31777f0

Browse files
committed
Merge branch 'develop' into stable
2 parents 0ce39e2 + c517b91 commit 31777f0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+750
-357
lines changed

build/common.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repo. It imports the other MSBuild files as needed.
77
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
88
<PropertyGroup>
99
<!--set general build properties -->
10-
<Version>3.18.4</Version>
10+
<Version>3.18.5</Version>
1111
<Product>SMAPI</Product>
1212
<LangVersion>latest</LangVersion>
1313
<AssemblySearchPaths>$(AssemblySearchPaths);{GAC}</AssemblySearchPaths>

docs/release-notes.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,29 @@
77
_If needed, you can update to SMAPI 3.16.0 first and then install the latest version._
88
-->
99

10+
## 3.18.5
11+
Released 26 August 2023 for Stardew Valley 1.5.6 or later.
12+
13+
* For players:
14+
* Reduced startup time when many mods are rewritten for compatibility.
15+
* Fixed app icon on Linux/macOS, and for some players on Windows (thanks to Datrio!).
16+
* Fixed error if you copy a null field into `config.user.json`.
17+
* Fixed installer creating a "null" file in its folder.
18+
* Fixed installer moving bundled mods back to their default location on update. It now correctly updates their existing folder instead.
19+
20+
* For mod authors:
21+
* Updated dependencies, including [Mono.Cecil](https://github.com/jbevain/cecil) 0.11.4 → 0.11.5 (see [changes](https://github.com/jbevain/cecil/releases/tag/0.11.5)).
22+
* Fixed NPC warp cache not updated when a map edit changes door warps (thanks to atravita!).
23+
24+
* For the web UI:
25+
* Viewing an uploaded log/JSON file within 15 days of expiry now auto-renews it, to allow for discussions that last longer than the default 30-day expiry.
26+
* Fixed log parser's summary skipping mods if some have no description.
27+
* Fixed log parser no longer ignoring Error Handler in newer SMAPI-on-Android versions (thanks to AnotherPillow!).
28+
29+
* For SMAPI developers:
30+
* Overhauled compatibility rewriters.
31+
_This allows simpler, more robust, and more flexible crossplatform rewrites (e.g. on Android) and prepares for the upcoming Stardew Valley 1.6. See remarks on the new `ReplaceReferencesRewriter` for more info._
32+
1033
## 3.18.4
1134
Released 24 June 2023 for Stardew Valley 1.5.6 or later.
1235

src/SMAPI.Installer/InteractiveInstaller.cs

Lines changed: 44 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -460,22 +460,51 @@ public void Run(string[] args)
460460
continue;
461461
}
462462

463-
// find target folder
463+
// get mod info
464+
string modId = sourceMod.Manifest.UniqueID;
465+
string modName = sourceMod.Manifest.Name;
466+
DirectoryInfo fromDir = sourceMod.Directory;
467+
468+
// get target path
464469
// ReSharper disable once ConditionalAccessQualifierIsNonNullableAccordingToAPIContract -- avoid error if the Mods folder has invalid mods, since they're not validated yet
465-
ModFolder? targetMod = targetMods.FirstOrDefault(p => p.Manifest?.UniqueID?.Equals(sourceMod.Manifest.UniqueID, StringComparison.OrdinalIgnoreCase) == true);
466-
DirectoryInfo defaultTargetFolder = new(Path.Combine(paths.ModsPath, sourceMod.Directory.Name));
467-
DirectoryInfo targetFolder = targetMod?.Directory ?? defaultTargetFolder;
468-
this.PrintDebug(targetFolder.FullName == defaultTargetFolder.FullName
469-
? $" adding {sourceMod.Manifest.Name}..."
470-
: $" adding {sourceMod.Manifest.Name} to {Path.Combine(paths.ModsDir.Name, PathUtilities.GetRelativePath(paths.ModsPath, targetFolder.FullName))}..."
471-
);
472-
473-
// remove existing folder
474-
if (targetFolder.Exists)
475-
this.InteractivelyDelete(targetFolder.FullName, allowUserInput);
476-
477-
// copy files
478-
this.RecursiveCopy(sourceMod.Directory, paths.ModsDir, filter: this.ShouldCopy);
470+
ModFolder? targetMod = targetMods.FirstOrDefault(p => p.Manifest?.UniqueID?.Equals(modId, StringComparison.OrdinalIgnoreCase) == true);
471+
DirectoryInfo targetDir = new(Path.Combine(paths.ModsPath, fromDir.Name)); // replace existing folder if possible
472+
473+
// if we found the mod in a custom location, replace that copy
474+
if (targetMod != null && targetMod.Directory.FullName != targetDir.FullName)
475+
{
476+
targetDir = targetMod.Directory;
477+
DirectoryInfo parentDir = targetDir.Parent!;
478+
479+
this.PrintDebug($" adding {modName} to {Path.Combine(paths.ModsDir.Name, PathUtilities.GetRelativePath(paths.ModsPath, targetDir.FullName))}...");
480+
481+
if (targetDir.Name != fromDir.Name)
482+
{
483+
// in case the user does weird things like swap folder names, rename the bundled
484+
// mod in a unique staging folder within the temporary package:
485+
string stagingPath = Path.Combine(fromDir.Parent!.Parent!.FullName, $"renamed-mod-{fromDir.Name}");
486+
Directory.CreateDirectory(stagingPath);
487+
fromDir.MoveTo(
488+
Path.Combine(stagingPath, targetDir.Name)
489+
);
490+
}
491+
492+
this.InteractivelyDelete(targetDir.FullName, allowUserInput);
493+
this.RecursiveCopy(fromDir, parentDir, filter: this.ShouldCopy);
494+
}
495+
496+
// else add it to default location
497+
else
498+
{
499+
DirectoryInfo parentDir = targetDir.Parent!;
500+
501+
this.PrintDebug($" adding {modName}...");
502+
503+
if (targetDir.Exists)
504+
this.InteractivelyDelete(targetDir.FullName, allowUserInput);
505+
506+
this.RecursiveCopy(fromDir, parentDir, filter: this.ShouldCopy);
507+
}
479508
}
480509
}
481510

src/SMAPI.Installer/assets/install on Windows.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SET installerDir="%~dp0"
66
REM make sure we're not running within a zip folder
77
REM The error level is usually 0 (install dir contains temp path), 1 (it doesn't), or 9009 (findstr doesn't exist due to a Windows issue).
88
REM If the command doesn't exist, just skip this check.
9-
echo %installerDir% | findstr /C:"%TEMP%" 1>nul 2>null
9+
echo %installerDir% | findstr /C:"%TEMP%" 1>nul 2>nul
1010
if %ERRORLEVEL% EQU 0 (
1111
echo Oops! It looks like you're running the installer from inside a zip file. Make sure you unzip the download first.
1212
echo.

src/SMAPI.ModBuildConfig.Analyzer.Tests/SMAPI.ModBuildConfig.Analyzer.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<ItemGroup>
88
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="3.10.0" />
9-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
9+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.1" />
1010
<PackageReference Include="NUnit" Version="3.13.3" />
1111
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
1212
</ItemGroup>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"Name": "Console Commands",
33
"Author": "SMAPI",
4-
"Version": "3.18.4",
4+
"Version": "3.18.5",
55
"Description": "Adds SMAPI console commands that let you manipulate the game.",
66
"UniqueID": "SMAPI.ConsoleCommands",
77
"EntryDll": "ConsoleCommands.dll",
8-
"MinimumApiVersion": "3.18.4"
8+
"MinimumApiVersion": "3.18.5"
99
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"Name": "Error Handler",
33
"Author": "SMAPI",
4-
"Version": "3.18.4",
4+
"Version": "3.18.5",
55
"Description": "Handles some common vanilla errors to log more useful info or avoid breaking the game.",
66
"UniqueID": "SMAPI.ErrorHandler",
77
"EntryDll": "ErrorHandler.dll",
8-
"MinimumApiVersion": "3.18.4"
8+
"MinimumApiVersion": "3.18.5"
99
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"Name": "Save Backup",
33
"Author": "SMAPI",
4-
"Version": "3.18.4",
4+
"Version": "3.18.5",
55
"Description": "Automatically backs up all your saves once per day into its folder.",
66
"UniqueID": "SMAPI.SaveBackup",
77
"EntryDll": "SaveBackup.dll",
8-
"MinimumApiVersion": "3.18.4"
8+
"MinimumApiVersion": "3.18.5"
99
}

src/SMAPI.Tests/SMAPI.Tests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
</ItemGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="FluentAssertions" Version="6.11.0" />
18-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
19-
<PackageReference Include="Moq" Version="4.18.4" />
17+
<PackageReference Include="FluentAssertions" Version="6.12.0" />
18+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.1" />
19+
<PackageReference Include="Moq" Version="4.20.69" />
2020
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
2121
<PackageReference Include="NUnit" Version="3.13.3" />
2222
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />

src/SMAPI.Toolkit/SMAPI.Toolkit.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<Import Project="..\..\build\common.targets" />
1010

1111
<ItemGroup>
12-
<PackageReference Include="HtmlAgilityPack" Version="1.11.48" />
12+
<PackageReference Include="HtmlAgilityPack" Version="1.11.52" />
1313
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
1414
<PackageReference Include="Pathoschild.Http.FluentClient" Version="4.3.0" />
1515
<PackageReference Include="System.Management" Version="5.0.0" Condition="'$(OS)' == 'Windows_NT'" />

0 commit comments

Comments
 (0)