diff options
| author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-02-24 17:54:31 -0500 |
|---|---|---|
| committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-02-24 17:54:31 -0500 |
| commit | 414cf5c197b5b59776d3dda914eb15710efb0868 (patch) | |
| tree | 0393a95194ad78cf4440c68657b0488b7db6d68b /src | |
| parent | 5da8b707385b9851ff3f6442de58519125f5c96f (diff) | |
| parent | f2e8450706d1971d774f870081deffdb0c6b92eb (diff) | |
| download | SMAPI-414cf5c197b5b59776d3dda914eb15710efb0868.tar.gz SMAPI-414cf5c197b5b59776d3dda914eb15710efb0868.tar.bz2 SMAPI-414cf5c197b5b59776d3dda914eb15710efb0868.zip | |
Merge branch 'develop' into stable
Diffstat (limited to 'src')
89 files changed, 4834 insertions, 3364 deletions
diff --git a/src/SMAPI.AssemblyRewriters/Properties/AssemblyInfo.cs b/src/SMAPI.AssemblyRewriters/Properties/AssemblyInfo.cs index 7cc6804a..f456a30d 100644 --- a/src/SMAPI.AssemblyRewriters/Properties/AssemblyInfo.cs +++ b/src/SMAPI.AssemblyRewriters/Properties/AssemblyInfo.cs @@ -1,7 +1,4 @@ using System.Reflection; -using System.Runtime.InteropServices; -[assembly: AssemblyTitle("StardewModdingAPI.AssemblyRewriters")] +[assembly: AssemblyTitle("SMAPI.AssemblyRewriters")] [assembly: AssemblyDescription("Contains internal SMAPI classes used during assembly rewriting that need to be public for technical reasons, but shouldn't be visible to modders.")] -[assembly: AssemblyProduct("StardewModdingAPI.AssemblyRewriters")] -[assembly: Guid("10db0676-9fc1-4771-a2c8-e2519f091e49")] diff --git a/src/SMAPI.Installer/InteractiveInstaller.cs b/src/SMAPI.Installer/InteractiveInstaller.cs index 43d31eea..b7e698ad 100644 --- a/src/SMAPI.Installer/InteractiveInstaller.cs +++ b/src/SMAPI.Installer/InteractiveInstaller.cs @@ -364,8 +364,13 @@ namespace StardewModdingApi.Installer else this.PrintColor("SMAPI is removed! If you configured Steam to launch SMAPI, don't forget to clear your launch options.", ConsoleColor.DarkGreen); } - else if (action == ScriptAction.Install) - this.PrintColor("SMAPI is installed! Launch the game the same way as before to play with mods.", ConsoleColor.DarkGreen); + else + { + if (action == ScriptAction.Install) + this.PrintColor("SMAPI is installed! Launch the game the same way as before to play with mods.", ConsoleColor.DarkGreen); + else + this.PrintColor("SMAPI is removed! Launch the game the same way as before to play without mods.", ConsoleColor.DarkGreen); + } Console.ReadKey(); } diff --git a/src/SMAPI.Installer/Properties/AssemblyInfo.cs b/src/SMAPI.Installer/Properties/AssemblyInfo.cs index 3a6a4648..9838e5a0 100644 --- a/src/SMAPI.Installer/Properties/AssemblyInfo.cs +++ b/src/SMAPI.Installer/Properties/AssemblyInfo.cs @@ -1,6 +1,4 @@ -using System.Reflection; -using System.Runtime.InteropServices; +using System.Reflection; -[assembly: AssemblyTitle("StardewModdingAPI.Installer")] -[assembly: AssemblyProduct("StardewModdingAPI.Installer")] -[assembly: Guid("443ddf81-6aaf-420a-a610-3459f37e5575")] +[assembly: AssemblyTitle("SMAPI.Installer")] +[assembly: AssemblyDescription("The SMAPI installer for players.")] diff --git a/src/SMAPI.Installer/StardewModdingAPI.Installer.csproj b/src/SMAPI.Installer/StardewModdingAPI.Installer.csproj index d3a6aa0b..a575e06f 100644 --- a/src/SMAPI.Installer/StardewModdingAPI.Installer.csproj +++ b/src/SMAPI.Installer/StardewModdingAPI.Installer.csproj @@ -50,6 +50,14 @@ <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> </ItemGroup> + <ItemGroup> + <None Include="unix-install.sh"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Include="unix-launcher.sh"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + </ItemGroup> <Import Project="..\SMAPI.Common\StardewModdingAPI.Common.projitems" Label="Shared" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="..\..\build\common.targets" /> diff --git a/src/SMAPI.Installer/unix-install.sh b/src/SMAPI.Installer/unix-install.sh new file mode 100644 index 00000000..a0bd9346 --- /dev/null +++ b/src/SMAPI.Installer/unix-install.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# Run the SMAPI installer through Mono on Linux or Mac. + +# Move to script's directory +cd "`dirname "$0"`" + +# get cross-distro version of POSIX command +COMMAND="" +if command -v command >/dev/null 2>&1; then + COMMAND="command -v" +elif type type >/dev/null 2>&1; then + COMMAND="type" +fi + +# validate Mono & run installer +if $COMMAND mono >/dev/null 2>&1; then + mono install.exe +else + echo "Oops! Looks like Mono isn't installed. Please install Mono from http://mono-project.com, reboot, and run this installer again." + read +fi diff --git a/src/SMAPI/unix-launcher.sh b/src/SMAPI.Installer/unix-launcher.sh index 2542a286..2542a286 100644 --- a/src/SMAPI/unix-launcher.sh +++ b/src/SMAPI.Installer/unix-launcher.sh diff --git a/src/SMAPI.ModBuildConfig/Properties/AssemblyInfo.cs b/src/SMAPI.ModBuildConfig/Properties/AssemblyInfo.cs index 102d4c3d..96bd29f4 100644 --- a/src/SMAPI.ModBuildConfig/Properties/AssemblyInfo.cs +++ b/src/SMAPI.ModBuildConfig/Properties/AssemblyInfo.cs @@ -1,9 +1,6 @@ using System.Reflection; -using System.Runtime.InteropServices; -[assembly: AssemblyTitle("StardewModdingAPI.ModBuildConfig")] +[assembly: AssemblyTitle("SMAPI.ModBuildConfig")] [assembly: AssemblyDescription("")] -[assembly: Guid("ea4f1e80-743f-4a1d-9757-ae66904a196a")] -[assembly: ComVisible(false)] [assembly: AssemblyVersion("2.0.2.0")] [assembly: AssemblyFileVersion("2.0.2.0")] diff --git a/src/SMAPI.Mods.ConsoleCommands/Properties/AssemblyInfo.cs b/src/SMAPI.Mods.ConsoleCommands/Properties/AssemblyInfo.cs index ac15ec72..86653141 100644 --- a/src/SMAPI.Mods.ConsoleCommands/Properties/AssemblyInfo.cs +++ b/src/SMAPI.Mods.ConsoleCommands/Properties/AssemblyInfo.cs @@ -1,6 +1,4 @@ using System.Reflection; -using System.Runtime.InteropServices; [assembly: AssemblyTitle("SMAPI.Mods.ConsoleCommands")] [assembly: AssemblyDescription("")] -[assembly: Guid("76791e28-b1b5-407c-82d6-50c3e5b7e037")] diff --git a/src/SMAPI.Mods.ConsoleCommands/manifest.json b/src/SMAPI.Mods.ConsoleCommands/manifest.json index fc5ce35d..b852f686 100644 --- a/src/SMAPI.Mods.ConsoleCommands/manifest.json +++ b/src/SMAPI.Mods.ConsoleCommands/manifest.json @@ -1,7 +1,7 @@ { "Name": "Console Commands", "Author": "SMAPI", - "Version": "2.4.0", + "Version": "2.5.0", "Description": "Adds SMAPI console commands that let you manipulate the game.", "UniqueID": "SMAPI.ConsoleCommands", "EntryDll": "ConsoleCommands.dll" diff --git a/src/SMAPI.Tests/Core/ModResolverTests.cs b/src/SMAPI.Tests/Core/ModResolverTests.cs index 051ffe99..d63eb1a2 100644 --- a/src/SMAPI.Tests/Core/ModResolverTests.cs +++ b/src/SMAPI.Tests/Core/ModResolverTests.cs @@ -6,6 +6,7 @@ using Moq; using Newtonsoft.Json; using NUnit.Framework; using StardewModdingAPI.Framework; +using StardewModdingAPI.Framework.ModData; using StardewModdingAPI.Framework.Models; using StardewModdingAPI.Framework.ModLoading; using StardewModdingAPI.Framework.Serialisation; @@ -30,7 +31,7 @@ namespace StardewModdingAPI.Tests.Core Directory.CreateDirectory(rootFolder); // act - IModMetadata[] mods = new ModResolver().ReadManifests(rootFolder, new JsonHelper(), new ModDataRecord[0]).ToArray(); + IModMetadata[] mods = new ModResolver().ReadManifests(rootFolder, new JsonHelper(), new ModDatabase()).ToArray(); // assert Assert.AreEqual(0, mods.Length, 0, $"Expected to find zero manifests, found {mods.Length} instead."); @@ -45,7 +46,7 @@ namespace StardewModdingAPI.Tests.Core Directory.CreateDirectory(modFolder); // act - IModMetadata[] mods = new ModResolver().ReadManifests(rootFolder, new JsonHelper(), new ModDataRecord[0]).ToArray(); + IModMetadata[] mods = new ModResolver().ReadManifests(rootFolder, new JsonHelper(), new ModDatabase()).ToArray(); IModMetadata mod = mods.FirstOrDefault(); // assert @@ -84,7 +85,7 @@ namespace StardewModdingAPI.Tests.Core File.WriteAllText(filename, JsonConvert.SerializeObject(original)); // act - IModMetadata[] mods = new ModResolver().ReadManifests(rootFolder, new JsonHelper(), new ModDataRecord[0]).ToArray(); + IModMetadata[] mods = new ModResolver().ReadManifests(rootFolder, new JsonHelper(), new ModDatabase()).ToArray(); IModMetadata mod = mods.FirstOrDefault(); // assert @@ -119,7 +120,7 @@ namespace StardewModdingAPI.Tests.Core [Test(Description = "Assert that validation doesn't fail if there are no mods installed.")] public void ValidateManifests_NoMods_DoesNothing() { - new ModResolver().ValidateManifests(new ModMetadata[0], apiVersion: new SemanticVersion("1.0"), vendorModUrls: new Dictionary<string, string>()); + new ModResolver().ValidateManifests(new ModMetadata[0], apiVersion: new SemanticVersion("1.0"), getUpdateUrl: key => null); } [Test(Description = "Assert that validation skips manifests that have already failed without calling any other properties.")] @@ -130,7 +131,7 @@ namespace StardewModdingAPI.Tests.Core mock.Setup(p => p.Status).Returns(ModMetadataStatus.Failed); // act - new ModResolver().ValidateManifests(new[] { mock.Object }, apiVersion: new SemanticVersion("1.0"), vendorModUrls: new Dictionary<string, string>()); + new ModResolver().ValidateManifests(new[] { mock.Object }, apiVersion: new SemanticVersion("1.0"), getUpdateUrl: key => null); // assert mock.VerifyGet(p => p.Status, Times.Once, "The validation did not check the manifest status."); @@ -141,14 +142,14 @@ namespace StardewModdingAPI.Tests.Core { // arrange Mock<IModMetadata> mock = this.GetMetadata("Mod A", new string[0], allowStatusChange: true); - this.SetupMetadataForValidation(mock, new ModDataRecord + this.SetupMetadataForValidation(mock, new ParsedModDataRecord { - Compatibility = new[] { new ModCompatibility("~1.0", ModStatus.AssumeBroken, null) }, + Status = ModStatus.AssumeBroken, AlternativeUrl = "http://example.org" }); // act - new ModResolver().ValidateManifests(new[] { mock.Object }, apiVersion: new SemanticVersion("1.0"), vendorModUrls: new Dictionary<string, string>()); + new ModResolver().ValidateManifests(new[] { mock.Object }, apiVersion: new SemanticVersion("1.0"), getUpdateUrl: key => null); // assert mock.Verify(p => p.SetStatus(ModMetadataStatus.Failed, It.IsAny<string>()), Times.Once, "The validation did not fail the metadata."); @@ -163,7 +164,7 @@ namespace StardewModdingAPI.Tests.Core this.SetupMetadataForValidation(mock); // act - new ModResolver().ValidateManifests(new[] { mock.Object }, apiVersion: new SemanticVersion("1.0"), vendorModUrls: new Dictionary<string, string>()); + new ModResolver().ValidateManifests(new[] { mock.Object }, apiVersion: new SemanticVersion("1.0"), getUpdateUrl: key => null); // assert mock.Verify(p => p.SetStatus(ModMetadataStatus.Failed, It.IsAny<string>()), Times.Once, "The validation did not fail the metadata."); @@ -177,7 +178,7 @@ namespace StardewModdingAPI.Tests.Core this.SetupMetadataForValidation(mock); |
