Skip to content

Commit

Permalink
etc
Browse files Browse the repository at this point in the history
  • Loading branch information
aedenthorn committed Jan 19, 2021
1 parent c389f24 commit bd7a2e8
Show file tree
Hide file tree
Showing 40 changed files with 605 additions and 27 deletions.
4 changes: 3 additions & 1 deletion CustomSpousePatio/ModEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,9 @@ private static void ShowSpouseAreas() {
TileSheet defaultTilesheet = farm.Map.GetTileSheet("zzz_custom_spouse_default_patio");
int sheetIdx = farm.Map.TileSheets.IndexOf(defaultTilesheet);

switch (spouse.Key)
string which = area.useTilesOf != null ? area.useTilesOf : spouse.Key;

switch (which)
{
case "Sam":
farm.setMapTileIndex(x, y + 2, 1173, "Buildings", sheetIdx);
Expand Down
2 changes: 2 additions & 0 deletions CustomSpousePatio/OutdoorAreaData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public class OutdoorArea
public List<SpecialTile> specialTiles = new List<SpecialTile>();
public Point npcOffset = new Point(-1,-1);
public string npcAnimation = null;
public string useTilesOf = null;

public Point GetLocation()
{
if (location.X != -1)
Expand Down
2 changes: 1 addition & 1 deletion CustomSpousePatio/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Name": "Custom Spouse Patio",
"Author": "aedenthorn",
"Version": "0.4.5",
"Version": "0.5.0",
"Description": "Lets you create a custom spouse patio.",
"UniqueID": "aedenthorn.CustomSpousePatio",
"EntryDll": "CustomSpousePatio.dll",
Expand Down
68 changes: 68 additions & 0 deletions FarmAnywhere/FarmAnywhere.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A37057B5-2BB9-4567-9691-70DC9A2E3B94}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FarmAnywhere</RootNamespace>
<AssemblyName>FarmAnywhere</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<EnableHarmony>true</EnableHarmony>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Build" />
<Reference Include="Microsoft.Build.Framework" />
<Reference Include="Microsoft.Build.Utilities.v4.0" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Web.Extensions" />
<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>
<Compile Include="ModConfig.cs" />
<Compile Include="ModEntry.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="manifest.json" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Pathoschild.Stardew.ModBuildConfig.3.2.2\build\Pathoschild.Stardew.ModBuildConfig.targets" Condition="Exists('..\packages\Pathoschild.Stardew.ModBuildConfig.3.2.2\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.3.2.2\build\Pathoschild.Stardew.ModBuildConfig.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Pathoschild.Stardew.ModBuildConfig.3.2.2\build\Pathoschild.Stardew.ModBuildConfig.targets'))" />
</Target>
</Project>
10 changes: 10 additions & 0 deletions FarmAnywhere/ModConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using Microsoft.Xna.Framework;

namespace FarmAnywhere
{
public class ModConfig
{
public bool EnableMod { get; set; } = true;
public bool AllowIndoorFarming { get; set; } = true;
}
}
69 changes: 69 additions & 0 deletions FarmAnywhere/ModEntry.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
using Harmony;
using Microsoft.Xna.Framework;
using StardewModdingAPI;
using StardewModdingAPI.Events;
using StardewValley;
using StardewValley.TerrainFeatures;

namespace FarmAnywhere
{
/// <summary>The mod entry point.</summary>
public class ModEntry : Mod
{
public static ModConfig Config;
private static IMonitor SMonitor;
private static IModHelper SHelper;
public override void Entry(IModHelper helper)
{
Config = Helper.ReadConfig<ModConfig>();
if (!Config.EnableMod)
return;
SMonitor = Monitor;
SHelper = Helper;

Helper.Events.Player.Warped += Player_Warped;
Helper.Events.GameLoop.DayStarted += GameLoop_DayStarted;

var harmony = HarmonyInstance.Create(this.ModManifest.UniqueID);

harmony.Patch(
original: AccessTools.Method(typeof(GameLocation), nameof(GameLocation.CanPlantSeedsHere)),
prefix: new HarmonyMethod(typeof(ModEntry), nameof(ModEntry.CanPlantSeedsHere_Prefix))
);
}

private void Player_Warped(object sender, WarpedEventArgs e)
{
if(Config.AllowIndoorFarming || e.NewLocation.IsOutdoors)
{
GameLocation l = e.NewLocation;

Monitor.Log($"Setting diggable in {l.name}");
for (int x = 0; x < l.map.Layers[0].LayerWidth; x++)
{
for (int y = 0; y < l.map.Layers[0].LayerHeight; y++)
{
bool water = false;
try { water = l.waterTiles[x, y]; } catch { }
if (!l.isTileOccupiedForPlacement(new Vector2(x, y)) && !water)
l.setTileProperty(x, y, "Back", "Diggable", "T");
if (l.isCropAtTile(x,y))
(l.terrainFeatures[new Vector2(x, y)] as HoeDirt).crop.growCompletely();
}
}
}
}

public static void GameLoop_DayStarted(object sender, DayStartedEventArgs e)
{
}



private static bool CanPlantSeedsHere_Prefix(GameLocation __instance, ref bool __result)
{
__result = Config.AllowIndoorFarming || __instance.IsOutdoors;
return false;
}
}
}
36 changes: 36 additions & 0 deletions FarmAnywhere/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("FarmAnywhere")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FarmAnywhere")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("a37057b5-2bb9-4567-9691-70dc9a2e3b94")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
22 changes: 22 additions & 0 deletions FarmAnywhere/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"Name": "Farm Anywhere",
"Author": "aedenthorn",
"Version": "0.1.0",
"Description": "Lets you plant and grow seeds anywhere.",
"UniqueID": "aedenthorn.FarmAnywhere",
"EntryDll": "FarmAnywhere.dll",
"MinimumApiVersion": "3.8.0",
"UpdateKeys": ["Nexus:7726"],
"ModUpdater": {
"Repository": "StardewValleyMods",
"User": "aedenthorn",
"Directory": "_releases",
"ModFolder": "FarmAnywhere"
},
"Dependencies": [
{
"UniqueID": "Platonymous.ModUpdater",
"IsRequired": false
},
]
}
4 changes: 4 additions & 0 deletions FarmAnywhere/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Pathoschild.Stardew.ModBuildConfig" version="3.2.2" targetFramework="net452" />
</packages>
7 changes: 7 additions & 0 deletions InstantGrowthPowder/IJsonAssetsApi.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace InstantGrowthPowder
{
public interface IJsonAssetsApi
{
void LoadAssets(string path);
}
}
75 changes: 75 additions & 0 deletions InstantGrowthPowder/InstantGrowthPowder.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{9F931EBE-941F-4F44-8E91-B676FF804217}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>InstantGrowthPowder</RootNamespace>
<AssemblyName>InstantGrowthPowder</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<EnableHarmony>true</EnableHarmony>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Build" />
<Reference Include="Microsoft.Build.Framework" />
<Reference Include="Microsoft.Build.Utilities.v4.0" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Web.Extensions" />
<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>
<Compile Include="IJsonAssetsApi.cs" />
<Compile Include="ModConfig.cs" />
<Compile Include="ModEntry.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="assets\json-assets\content-pack.json" />
<None Include="assets\json-assets\Objects\Instant Growth Powder\object.json" />
<None Include="manifest.json" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Content Include="assets\json-assets\Objects\Instant Growth Powder\object.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Pathoschild.Stardew.ModBuildConfig.3.2.2\build\Pathoschild.Stardew.ModBuildConfig.targets" Condition="Exists('..\packages\Pathoschild.Stardew.ModBuildConfig.3.2.2\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.3.2.2\build\Pathoschild.Stardew.ModBuildConfig.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Pathoschild.Stardew.ModBuildConfig.3.2.2\build\Pathoschild.Stardew.ModBuildConfig.targets'))" />
</Target>
</Project>
10 changes: 10 additions & 0 deletions InstantGrowthPowder/ModConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using Microsoft.Xna.Framework;

namespace InstantGrowthPowder
{
public class ModConfig
{
public bool EnableMod { get; set; } = true;
public bool AllowIndoorFarming { get; set; } = true;
}
}
Loading

0 comments on commit bd7a2e8

Please sign in to comment.