summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-11-01 17:42:18 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-11-01 17:42:18 -0400
commite0b72374cd14298aacc6f71dc391fdc9814be37c (patch)
tree2e5d85937c34539c1a0df48423b5136508693ca8 /src
parent79118316065a01322d8ea12a14589ec016794c32 (diff)
parent089e6de749ae7cb109af00164d2597c6644c255e (diff)
downloadSMAPI-e0b72374cd14298aacc6f71dc391fdc9814be37c.tar.gz
SMAPI-e0b72374cd14298aacc6f71dc391fdc9814be37c.tar.bz2
SMAPI-e0b72374cd14298aacc6f71dc391fdc9814be37c.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src')
-rw-r--r--src/SMAPI.Common/SemanticVersionImpl.cs13
-rw-r--r--src/SMAPI.Installer/InteractiveInstaller.cs39
-rw-r--r--src/SMAPI.Installer/StardewModdingAPI.Installer.csproj3
-rw-r--r--src/SMAPI.Installer/readme.txt22
-rw-r--r--src/SMAPI.ModBuildConfig/Properties/AssemblyInfo.cs4
-rw-r--r--src/SMAPI.ModBuildConfig/StardewModdingAPI.ModBuildConfig.csproj2
-rw-r--r--src/SMAPI.ModBuildConfig/package.nuspec5
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/ConsoleCommandsMod.cs (renamed from src/TrainerMod/TrainerMod.cs)11
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/ArgumentParser.cs (renamed from src/TrainerMod/Framework/Commands/ArgumentParser.cs)3
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/ITrainerCommand.cs (renamed from src/TrainerMod/Framework/Commands/ITrainerCommand.cs)6
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/DebugCommand.cs (renamed from src/TrainerMod/Framework/Commands/Other/DebugCommand.cs)5
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/ShowDataFilesCommand.cs (renamed from src/TrainerMod/Framework/Commands/Other/ShowDataFilesCommand.cs)3
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/ShowGameFilesCommand.cs (renamed from src/TrainerMod/Framework/Commands/Other/ShowGameFilesCommand.cs)3
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/AddCommand.cs (renamed from src/TrainerMod/Framework/Commands/Player/AddCommand.cs)5
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/ListItemTypesCommand.cs (renamed from src/TrainerMod/Framework/Commands/Player/ListItemTypesCommand.cs)5
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/ListItemsCommand.cs (renamed from src/TrainerMod/Framework/Commands/Player/ListItemsCommand.cs)5
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/SetColorCommand.cs (renamed from src/TrainerMod/Framework/Commands/Player/SetColorCommand.cs)3
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/SetHealthCommand.cs (renamed from src/TrainerMod/Framework/Commands/Player/SetHealthCommand.cs)3
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/SetImmunityCommand.cs (renamed from src/TrainerMod/Framework/Commands/Player/SetImmunityCommand.cs)3
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/SetLevelCommand.cs (renamed from src/TrainerMod/Framework/Commands/Player/SetLevelCommand.cs)32
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/SetMaxHealthCommand.cs (renamed from src/TrainerMod/Framework/Commands/Player/SetMaxHealthCommand.cs)3
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/SetMaxStaminaCommand.cs (renamed from src/TrainerMod/Framework/Commands/Player/SetMaxStaminaCommand.cs)3
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/SetMoneyCommand.cs (renamed from src/TrainerMod/Framework/Commands/Player/SetMoneyCommand.cs)3
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/SetNameCommand.cs (renamed from src/TrainerMod/Framework/Commands/Player/SetNameCommand.cs)5
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/SetSpeedCommand.cs (renamed from src/TrainerMod/Framework/Commands/Player/SetSpeedCommand.cs)5
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/SetStaminaCommand.cs (renamed from src/TrainerMod/Framework/Commands/Player/SetStaminaCommand.cs)3
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/SetStyleCommand.cs (renamed from src/TrainerMod/Framework/Commands/Player/SetStyleCommand.cs)5
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/TrainerCommand.cs (renamed from src/TrainerMod/Framework/Commands/TrainerCommand.cs)3
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/DownMineLevelCommand.cs (renamed from src/TrainerMod/Framework/Commands/World/DownMineLevelCommand.cs)5
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/FreezeTimeCommand.cs (renamed from src/TrainerMod/Framework/Commands/World/FreezeTimeCommand.cs)3
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/SetDayCommand.cs (renamed from src/TrainerMod/Framework/Commands/World/SetDayCommand.cs)3
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/SetMineLevelCommand.cs (renamed from src/TrainerMod/Framework/Commands/World/SetMineLevelCommand.cs)3
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/SetSeasonCommand.cs (renamed from src/TrainerMod/Framework/Commands/World/SetSeasonCommand.cs)3
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/SetTimeCommand.cs (renamed from src/TrainerMod/Framework/Commands/World/SetTimeCommand.cs)3
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/SetYearCommand.cs (renamed from src/TrainerMod/Framework/Commands/World/SetYearCommand.cs)3
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/ItemData/ItemType.cs (renamed from src/TrainerMod/Framework/ItemData/ItemType.cs)2
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/ItemData/SearchableItem.cs (renamed from src/TrainerMod/Framework/ItemData/SearchableItem.cs)2
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs (renamed from src/TrainerMod/Framework/ItemRepository.cs)4
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Properties/AssemblyInfo.cs6
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/StardewModdingAPI.Mods.ConsoleCommands.csproj (renamed from src/TrainerMod/TrainerMod.csproj)11
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/manifest.json (renamed from src/TrainerMod/manifest.json)6
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/packages.config (renamed from src/TrainerMod/packages.config)0
-rw-r--r--src/SMAPI.Tests/Utilities/SemanticVersionTests.cs23
-rw-r--r--src/SMAPI.Web/Controllers/LogParserController.cs158
-rw-r--r--src/SMAPI.Web/Controllers/ModsApiController.cs (renamed from src/SMAPI.Web/Controllers/ModsController.cs)6
-rw-r--r--src/SMAPI.Web/Framework/AllowLargePostsAttribute.cs52
-rw-r--r--src/SMAPI.Web/Framework/BeanstalkEnvPropsConfigProvider.cs54
-rw-r--r--src/SMAPI.Web/Framework/ConfigModels/LogParserConfig.cs24
-rw-r--r--src/SMAPI.Web/Framework/ConfigModels/ModUpdateCheckConfig.cs2
-rw-r--r--src/SMAPI.Web/Framework/LogParser/GetPasteResponse.cs15
-rw-r--r--src/SMAPI.Web/Framework/LogParser/PastebinClient.cs117
-rw-r--r--src/SMAPI.Web/Framework/LogParser/SavePasteResponse.cs15
-rw-r--r--src/SMAPI.Web/Framework/RewriteRules/ConditionalRedirectToHttpsRule.cs62
-rw-r--r--src/SMAPI.Web/Framework/RewriteRules/ConditionalRewriteSubdomainRule.cs48
-rw-r--r--src/SMAPI.Web/Framework/RewriteRules/RedirectToUrlRule.cs61
-rw-r--r--src/SMAPI.Web/Framework/RewriteSubdomainRule.cs30
-rw-r--r--src/SMAPI.Web/Properties/launchSettings.json11
-rw-r--r--src/SMAPI.Web/Startup.cs33
-rw-r--r--src/SMAPI.Web/ViewModels/LogParserModel.cs31
-rw-r--r--src/SMAPI.Web/Views/LogParser/Index.cshtml119
-rw-r--r--src/SMAPI.Web/Views/Shared/_Layout.cshtml30
-rw-r--r--src/SMAPI.Web/Views/_ViewStart.cshtml3
-rw-r--r--src/SMAPI.Web/appsettings.Development.json20
-rw-r--r--src/SMAPI.Web/appsettings.json19
-rw-r--r--src/SMAPI.Web/wwwroot/Content/css/log-parser.css348
-rw-r--r--src/SMAPI.Web/wwwroot/Content/css/main.css107
-rw-r--r--src/SMAPI.Web/wwwroot/Content/images/sidebar-bg.gifbin0 -> 1104 bytes
-rw-r--r--src/SMAPI.Web/wwwroot/Content/js/log-parser.js278
-rw-r--r--src/SMAPI.Web/wwwroot/favicon.icobin0 -> 15086 bytes
-rw-r--r--src/SMAPI.sln6
-rw-r--r--src/SMAPI/Constants.cs2
-rw-r--r--src/SMAPI/Events/EventArgsInput.cs20
-rw-r--r--src/SMAPI/Events/InputEvents.cs15
-rw-r--r--src/SMAPI/Framework/Content/ContentCache.cs150
-rw-r--r--src/SMAPI/Framework/GameVersion.cs3
-rw-r--r--src/SMAPI/Framework/ModHelpers/ContentHelper.cs236
-rw-r--r--src/SMAPI/Framework/ModHelpers/ReflectionHelper.cs99
-rw-r--r--src/SMAPI/Framework/Reflection/PrivateProperty.cs30
-rw-r--r--src/SMAPI/Framework/Reflection/Reflector.cs16
-rw-r--r--src/SMAPI/Framework/SContentManager.cs618
-rw-r--r--src/SMAPI/Framework/SGame.cs20
-rw-r--r--src/SMAPI/Framework/Serialisation/JsonHelper.cs7
-rw-r--r--src/SMAPI/Framework/Serialisation/SelectiveStringEnumConverter.cs37
-rw-r--r--src/SMAPI/Framework/Serialisation/StringEnumConverter.cs22
-rw-r--r--src/SMAPI/IContentHelper.cs8
-rw-r--r--src/SMAPI/Program.cs31
-rw-r--r--src/SMAPI/SButton.cs12
-rw-r--r--src/SMAPI/SemanticVersion.cs6
-rw-r--r--src/SMAPI/StardewModdingAPI.csproj3
-rw-r--r--src/TrainerMod/Properties/AssemblyInfo.cs6
90 files changed, 2629 insertions, 643 deletions
diff --git a/src/SMAPI.Common/SemanticVersionImpl.cs b/src/SMAPI.Common/SemanticVersionImpl.cs
index 193d23f9..53cf5a21 100644
--- a/src/SMAPI.Common/SemanticVersionImpl.cs
+++ b/src/SMAPI.Common/SemanticVersionImpl.cs
@@ -49,6 +49,19 @@ namespace StardewModdingAPI.Common
}
/// <summary>Construct an instance.</summary>
+ /// <param name="version">The assembly version.</param>
+ /// <exception cref="ArgumentNullException">The <paramref name="version"/> is null.</exception>
+ public SemanticVersionImpl(Version version)
+ {
+ if (version == null)
+ throw new ArgumentNullException(nameof(version), "The input version can't be null.");
+
+ this.Major = version.Major;
+ this.Minor = version.Minor;
+ this.Patch = version.Build;
+ }
+
+ /// <summary>Construct an instance.</summary>
/// <param name="version">The semantic version string.</param>
/// <exception cref="ArgumentNullException">The <paramref name="version"/> is null.</exception>
/// <exception cref="FormatException">The <paramref name="version"/> is not a valid semantic version.</exception>
diff --git a/src/SMAPI.Installer/InteractiveInstaller.cs b/src/SMAPI.Installer/InteractiveInstaller.cs
index 1a132e54..b5c2735b 100644
--- a/src/SMAPI.Installer/InteractiveInstaller.cs
+++ b/src/SMAPI.Installer/InteractiveInstaller.cs
@@ -7,6 +7,7 @@ using System.Reflection;
using System.Threading;
using Microsoft.Win32;
using StardewModdingApi.Installer.Enums;
+using StardewModdingAPI.Common;
namespace StardewModdingApi.Installer
{
@@ -97,6 +98,7 @@ namespace StardewModdingApi.Installer
// obsolete
yield return GetInstallPath("Mods/.cache"); // 1.3-1.4
+ yield return GetInstallPath("Mods/TrainerMod"); // *–2.0 (renamed to ConsoleCommands)
yield return GetInstallPath("Mono.Cecil.Rocks.dll"); // 1.3–1.8
yield return GetInstallPath("StardewModdingAPI-settings.json"); // 1.0-1.4
if (modsDir.Exists)
@@ -136,6 +138,13 @@ namespace StardewModdingApi.Installer
public void Run(string[] args)
{
/****
+ ** Get platform & set window title
+ ****/
+ Platform platform = this.DetectPlatform();
+ Console.Title = $"SMAPI {new SemanticVersionImpl(this.GetType().Assembly.GetName().Version)} installer on {platform}";
+ Console.WriteLine();
+
+ /****
** read command-line arguments
****/
// get action from CLI
@@ -159,10 +168,6 @@ namespace StardewModdingApi.Installer
/****
** collect details
****/
- // get platform
- Platform platform = this.DetectPlatform();
- this.PrintDebug($"Platform: {(platform == Platform.Windows ? "Windows" : "Linux or Mac")}.");
-
// get game path
DirectoryInfo installDir = this.InteractivelyGetInstallPath(platform, gamePathArg);
if (installDir == null)
@@ -182,7 +187,9 @@ namespace StardewModdingApi.Installer
unixLauncher = Path.Combine(installDir.FullName, "StardewValley"),
unixLauncherBackup = Path.Combine(installDir.FullName, "StardewValley-original")
};
- this.PrintDebug($"Install path: {installDir}.");
+
+ // show output
+ Console.WriteLine($"Your game folder: {installDir}.");
/****
** validate assumptions
@@ -340,22 +347,26 @@ namespace StardewModdingApi.Installer
this.InteractivelyRemoveAppDataMods(platform, modsDir, packagedModsDir);
}
Console.WriteLine();
+ Console.WriteLine();
/****
- ** exit
+ ** final instructions
****/
- this.PrintColor("Done!", ConsoleColor.DarkGreen);
if (platform == Platform.Windows)
{
- this.PrintColor(
- action == ScriptAction.Install
- ? "Don't forget to launch StardewModdingAPI.exe instead of the normal game executable. See the readme.txt for details."
- : "If you manually changed shortcuts or Steam to launch SMAPI, don't forget to change those back.",
- ConsoleColor.DarkGreen
- );
+ if (action == ScriptAction.Install)
+ {
+ this.PrintColor("SMAPI is installed! If you use Steam, set your launch options to enable achievements (see smapi.io/install):", ConsoleColor.DarkGreen);
+ this.PrintColor($" \"{Path.Combine(installDir.FullName, "StardewModdingAPI.exe")}\" %command%", ConsoleColor.DarkGreen);
+ Console.WriteLine();
+ this.PrintColor("If you don't use Steam, launch StardewModdingAPI.exe in your game folder to play with mods.", ConsoleColor.DarkGreen);
+ }
+ 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("You can launch the game the same way as before to play with mods.", ConsoleColor.DarkGreen);
+ this.PrintColor("SMAPI is installed! Launch the game the same way as before to play with mods.", ConsoleColor.DarkGreen);
+
Console.ReadKey();
}
diff --git a/src/SMAPI.Installer/StardewModdingAPI.Installer.csproj b/src/SMAPI.Installer/StardewModdingAPI.Installer.csproj
index f8e368a4..d3a6aa0b 100644
--- a/src/SMAPI.Installer/StardewModdingAPI.Installer.csproj
+++ b/src/SMAPI.Installer/StardewModdingAPI.Installer.csproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
@@ -50,6 +50,7 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
+ <Import Project="..\SMAPI.Common\StardewModdingAPI.Common.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\build\common.targets" />
<Import Project="..\..\build\prepare-install-package.targets" />
diff --git a/src/SMAPI.Installer/readme.txt b/src/SMAPI.Installer/readme.txt
index eb27ac52..a03ad6a4 100644
--- a/src/SMAPI.Installer/readme.txt
+++ b/src/SMAPI.Installer/readme.txt
@@ -1,14 +1,14 @@
- ___ ___ ___ ___
- / /\ /__/\ / /\ / /\ ___
- / /:/_ | |::\ / /::\ / /::\ / /\
- / /:/ /\ | |:|:\ / /:/\:\ / /:/\:\ / /:/
- / /:/ /::\ __|__|:|\:\ / /:/~/::\ / /:/~/:/ /__/::\
- /__/:/ /:/\:\ /__/::::| \:\ /__/:/ /:/\:\ /__/:/ /:/ \__\/\:\__
- \ \:\/:/~/:/ \ \:\~~\__\/ \ \:\/:/__\/ \ \:\/:/ \ \:\/\
- \ \::/ /:/ \ \:\ \ \::/ \ \::/ \__\::/
- \__\/ /:/ \ \:\ \ \:\ \ \:\ /__/:/
- /__/:/ \ \:\ \ \:\ \ \:\ \__\/
- \__\/ \__\/ \__\/ \__\/
+ ___ ___ ___ ___ ___
+ / /\ /__/\ / /\ / /\ / /\
+ / /:/_ | |::\ / /::\ / /::\ / /:/
+ / /:/ /\ | |:|:\ / /:/\:\ / /:/\:\ / /:/
+ / /:/ /::\ __|__|:|\:\ / /:/~/::\ / /:/~/:/ / /::\ ___
+/__/:/ /:/\:\ /__/::::| \:\ /__/:/ /:/\:\ /__/:/ /:/ /__/:/\:\ /\
+\ \:\/:/~/:/ \ \:\~~\__\/ \ \:\/:/__\/ \ \:\/:/ \__\/ \:\/:/
+ \ \::/ /:/ \ \:\ \ \::/ \ \::/ \__\::/
+ \__\/ /:/ \ \:\ \ \:\ \ \:\ / /:/
+ /__/:/ \ \:\ \ \:\ \ \:\ /__/:/
+ \__\/ \__\/ \__\/ \__\/ \__\/
SMAPI lets you run Stardew Valley with mods. Don't forget to download mods separately.
diff --git a/src/SMAPI.ModBuildConfig/Properties/AssemblyInfo.cs b/src/SMAPI.ModBuildConfig/Properties/AssemblyInfo.cs
index 6ef2d568..102d4c3d 100644
--- a/src/SMAPI.ModBuildConfig/Properties/AssemblyInfo.cs
+++ b/src/SMAPI.ModBuildConfig/Properties/AssemblyInfo.cs
@@ -5,5 +5,5 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: Guid("ea4f1e80-743f-4a1d-9757-ae66904a196a")]
[assembly: ComVisible(false)]
-[assembly: AssemblyVersion("2.0.1.0")]