Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for SMAPI 2.0 #41

Merged
merged 6 commits into from Oct 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 2 additions & 8 deletions BuyRecipes/BuyRecipes.cs
@@ -1,14 +1,11 @@
using Denifia.Stardew.BuyRecipes.Domain;
using Denifia.Stardew.BuyRecipes.Framework;
using Denifia.Stardew.BuyRecipes.Services;
using StardewModdingAPI;
using StardewModdingAPI.Events;
using StardewValley;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Denifia.Stardew.BuyRecipes
{
Expand All @@ -25,7 +22,7 @@ public override void Entry(IModHelper helper)
{
SaveEvents.AfterLoad += SaveEvents_AfterLoad;
SaveEvents.AfterReturnToTitle += SaveEvents_AfterReturnToTitle;
TimeEvents.DayOfMonthChanged += TimeEvents_DayOfMonthChanged;
TimeEvents.AfterDayStarted += TimeEvents_AfterDayStarted;

RecipeAquisitionConditions = new List<IRecipeAquisitionConditions>()
{
Expand All @@ -38,9 +35,6 @@ public override void Entry(IModHelper helper)
.Add("buyrecipe", $"Buy a recipe. \n\nUsage: buyrecipe \"<name of recipe>\" \n\nNote: This is case sensitive!", HandleCommand)
.Add("showrecipes", $"Lists this weeks available recipes. \n\nUsage: showrecipes", HandleCommand);
//.Add("buyallrecipes", $"Temporary. \n\nUsage: buyallrecipes", HandleCommand);

// Instance the Version Check Service
new VersionCheckService(this);
}

private void HandleCommand(string command, string[] args)
Expand Down Expand Up @@ -136,7 +130,7 @@ private void SaveEvents_AfterLoad(object sender, EventArgs e)
GenerateWeeklyRecipes();
}

private void TimeEvents_DayOfMonthChanged(object sender, EventArgsIntChanged e)
private void TimeEvents_AfterDayStarted(object sender, EventArgs e)
{
GenerateWeeklyRecipes();
}
Expand Down
28 changes: 4 additions & 24 deletions BuyRecipes/BuyRecipes.csproj
Expand Up @@ -11,9 +11,7 @@
<AssemblyName>Denifia.Stardew.BuyRecipes</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
<DeployModFolderName>$(MSBuildProjectName)</DeployModFolderName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -35,14 +33,9 @@
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
Expand All @@ -60,10 +53,8 @@
<Compile Include="Framework\AquisitionFactory.cs" />
<Compile Include="Framework\ModConstants.cs" />
<Compile Include="Framework\ModHelper.cs" />
<Compile Include="Framework\UpdateHelper.cs" />
<Compile Include="ModConfig.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Services\VersionCheckService.cs" />
</ItemGroup>
<ItemGroup>
<None Include="config.json">
Expand All @@ -78,22 +69,11 @@
<None Include="release-notes.md" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Pathoschild.Stardew.ModBuildConfig.1.5.0\build\Pathoschild.Stardew.ModBuildConfig.targets" Condition="Exists('..\packages\Pathoschild.Stardew.ModBuildConfig.1.5.0\build\Pathoschild.Stardew.ModBuildConfig.targets')" />
<Import Project="..\packages\Pathoschild.Stardew.ModBuildConfig.1.7.1\build\Pathoschild.Stardew.ModBuildConfig.targets" Condition="Exists('..\packages\Pathoschild.Stardew.ModBuildConfig.1.7.1\build\Pathoschild.Stardew.ModBuildConfig.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Pathoschild.Stardew.ModBuildConfig.1.5.0\build\Pathoschild.Stardew.ModBuildConfig.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Pathoschild.Stardew.ModBuildConfig.1.5.0\build\Pathoschild.Stardew.ModBuildConfig.targets'))" />
</Target>
<Target Name="AfterBuild">
<PropertyGroup>
<ModPath>$(GamePath)\Mods\BuyRecipes</ModPath>
</PropertyGroup>
<Copy SourceFiles="$(TargetDir)\$(TargetName).dll" DestinationFolder="$(ModPath)" />
<Copy SourceFiles="$(TargetDir)\$(TargetName).pdb" DestinationFolder="$(ModPath)" Condition="Exists('$(TargetDir)\$(TargetName).pdb')" />
<Copy SourceFiles="$(TargetDir)\$(TargetName).dll.mdb" DestinationFolder="$(ModPath)" Condition="Exists('$(TargetDir)\$(TargetName).dll.mdb')" />
<Copy SourceFiles="$(ProjectDir)manifest.json" DestinationFolder="$(ModPath)" />
<Copy SourceFiles="$(TargetDir)\Newtonsoft.Json.dll" DestinationFolder="$(ModPath)" />
<Copy SourceFiles="$(TargetDir)\config.json" DestinationFolder="$(ModPath)" />
<Error Condition="!Exists('..\packages\Pathoschild.Stardew.ModBuildConfig.1.7.1\build\Pathoschild.Stardew.ModBuildConfig.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Pathoschild.Stardew.ModBuildConfig.1.7.1\build\Pathoschild.Stardew.ModBuildConfig.targets'))" />
</Target>
</Project>
75 changes: 0 additions & 75 deletions BuyRecipes/Framework/UpdateHelper.cs

This file was deleted.

5 changes: 1 addition & 4 deletions BuyRecipes/ModConfig.cs
@@ -1,10 +1,7 @@
using System;

namespace Denifia.Stardew.BuyRecipes
namespace Denifia.Stardew.BuyRecipes
{
public class ModConfig
{
public bool Debug { get; set; }
public bool CheckForUpdates { get; set; } = true;
}
}
63 changes: 0 additions & 63 deletions BuyRecipes/Services/VersionCheckService.cs

This file was deleted.

5 changes: 3 additions & 2 deletions BuyRecipes/manifest.json
Expand Up @@ -4,11 +4,12 @@
"Version": {
"MajorVersion": 1,
"MinorVersion": 0,
"PatchVersion": 0,
"PatchVersion": 1,
"Build": null
},
"MinimumApiVersion": "1.10",
"Description": "Buy recipes you don't know from the SMAPI console. Coming soon to a magazine rack in Pierre's shop.",
"UniqueID": "Denifia.BuyRecipes",
"EntryDll": "Denifia.Stardew.BuyRecipes.dll"
"EntryDll": "Denifia.Stardew.BuyRecipes.dll",
"UpdateKeys": [ "Nexus:1126" ]
}
2 changes: 1 addition & 1 deletion BuyRecipes/packages.config
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net45" />
<package id="Pathoschild.Stardew.ModBuildConfig" version="1.5.0" targetFramework="net452" />
<package id="Pathoschild.Stardew.ModBuildConfig" version="1.7.1" targetFramework="net45" />
</packages>
3 changes: 3 additions & 0 deletions BuyRecipes/release-notes.md
@@ -1,6 +1,9 @@
[← back to readme](readme.md)

# Release notes
## 1.0.1
* Updated for SMAPI 2.0.

## 1.0.0
* Fixed potential issue with wrapping item names in quotes

Expand Down
75 changes: 0 additions & 75 deletions SendItems/Framework/UpdateHelper.cs

This file was deleted.

1 change: 0 additions & 1 deletion SendItems/ModConfig.cs
Expand Up @@ -6,6 +6,5 @@ public class ModConfig
{
public Uri ApiUrl { get; set; }
public bool Debug { get; set; }
public bool CheckForUpdates { get; set; } = true;
}
}