Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 0 additions & 33 deletions CropHarvestBubbles/CodePatches.cs

This file was deleted.

2 changes: 1 addition & 1 deletion CropHarvestBubbles/CropHarvestBubbles.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>1.0.0</Version>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<EnableHarmony>true</EnableHarmony>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
Expand Down
6 changes: 0 additions & 6 deletions CropHarvestBubbles/Methods.cs

This file was deleted.

70 changes: 55 additions & 15 deletions CropHarvestBubbles/ModEntry.cs
Original file line number Diff line number Diff line change
@@ -1,40 +1,44 @@
using HarmonyLib;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using StardewValley;
using System;
using Rectangle = Microsoft.Xna.Framework.Rectangle;
using StardewModdingAPI;

namespace CropHarvestBubbles
{
/// <summary>The mod entry point.</summary>
public partial class ModEntry : Mod
public class ModEntry : Mod
{

public static IMonitor SMonitor;
public static IModHelper SHelper;
public static ModConfig Config;

public static ModEntry context;
internal static IMonitor SMonitor;
internal static IModHelper SHelper;
internal static ModConfig Config;
internal static Harmony harmony;

/// <summary>The mod entry point, called after the mod is first loaded.</summary>
/// <param name="helper">Provides simplified APIs for writing mods.</param>
public override void Entry(IModHelper helper)
{
Config = Helper.ReadConfig<ModConfig>();

context = this;

SMonitor = Monitor;
SHelper = helper;

harmony = new Harmony(ModManifest.UniqueID);
Helper.Events.GameLoop.GameLaunched += GameLoop_GameLaunched;

var harmony = new Harmony(ModManifest.UniqueID);
harmony.PatchAll();
harmony.Patch(
original: AccessTools.Method(typeof(Crop), nameof(Crop.draw)),
postfix: new HarmonyMethod(typeof(ModEntry), nameof(Postfix_draw))
);
harmony.Patch(
original: AccessTools.Method(typeof(Crop), nameof(Crop.drawWithOffset)),
postfix: new HarmonyMethod(typeof(ModEntry), nameof(Postfix_drawWithOffset))
);
}



private void GameLoop_GameLaunched(object sender, StardewModdingAPI.Events.GameLaunchedEventArgs e)
{

// get Generic Mod Config Menu's API (if it's installed)
var configMenu = Helper.ModRegistry.GetApi<IGenericModConfigMenuApi>("spacechase0.GenericModConfigMenu");
if (configMenu is null)
Expand Down Expand Up @@ -91,7 +95,43 @@ private void GameLoop_GameLaunched(object sender, StardewModdingAPI.Events.GameL
min: 1,
max: 100
);
}
public static void Postfix_draw(Crop __instance, SpriteBatch b, Vector2 tileLocation)
{
drawLogic(__instance, b, tileLocation);
}
public static void Postfix_drawWithOffset(Crop __instance, SpriteBatch b, Vector2 tileLocation, Vector2 offset)
{
drawLogic(__instance, b, tileLocation, (int)offset.X);
}
public static void drawLogic(Crop __instance, SpriteBatch b, Vector2 tileLocation, int offset = 0)
{
var item = ItemRegistry.GetDataOrErrorItem(__instance.indexOfHarvest.Value);

if (!Config.ModEnabled || (Config.RequireKeyPress && !Config.PressKeys.IsDown()) || __instance.forageCrop.Value || __instance.dead.Value || __instance.currentPhase.Value < __instance.phaseDays.Count - 1 || (__instance.fullyGrown.Value && __instance.dayOfCurrentPhase.Value > 0) || !Game1.objectData.ContainsKey(__instance.indexOfHarvest.Value) || (Config.IgnoreFlowers && item.Category == StardewValley.Object.flowersCategory))
return;

float base_sort = (float)((tileLocation.Y + 1) * 64) / 10000f + tileLocation.X / 50000f;
float yOffset = 4f * (float)Math.Round(Math.Sin(Game1.currentGameTime.TotalGameTime.TotalMilliseconds / 250.0), 2);
float movePercent = (100 - Config.SizePercent) / 100f;

b.Draw(Game1.mouseCursors, Game1.GlobalToLocal(Game1.viewport, new Vector2(tileLocation.X * 64 - 8 + movePercent * 40, tileLocation.Y * 64 - 96 - 16 - offset + yOffset + movePercent * 96)), new Rectangle?(new Rectangle(141, 465, 20, 24)), Color.White * (Config.OpacityPercent / 100f), 0f, Vector2.Zero, 4f * (Config.SizePercent / 100f), SpriteEffects.None, base_sort + 1E-06f);

b.Draw(
item.GetTexture(),
Game1.GlobalToLocal(Game1.viewport, new Vector2(tileLocation.X * 64 + 32, tileLocation.Y * 64 - 64 - offset - 8 + yOffset + movePercent * 56)),
item.GetSourceRect(),
Color.White * (Config.OpacityPercent / 100f), 0f, new Vector2(8f, 8f), 4f * (Config.SizePercent / 100f), SpriteEffects.None, base_sort + 1E-05f
);
if (__instance.programColored.Value)
{
b.Draw(
item.GetTexture(),
Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(tileLocation.X * 64 + 32), (float)(tileLocation.Y * 64 - 64 - 8 - offset) + yOffset)),
item.GetSourceRect(),
__instance.tintColor.Value * (Config.OpacityPercent / 100f), 0f, new Vector2(8f, 8f), 4f * (Config.SizePercent / 100f), SpriteEffects.None, base_sort + 1.1E-05f
);
}
}
}
}
20 changes: 4 additions & 16 deletions CropHarvestBubbles/manifest.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
{
"Name": "Crop Harvest Bubbles",
"Author": "aedenthorn",
"Version": "0.3.0",
"Description": "Crop Harvest Bubbles.",
"Version": "0.3.1-unofficial.1-logophile",
"Description": "Adds hovering bubble indicators when crops are ready to harvest.",
"UniqueID": "aedenthorn.CropHarvestBubbles",
"EntryDll": "CropHarvestBubbles.dll",
"MinimumApiVersion": "3.15.0",
"ModUpdater": {
"Repository": "StardewValleyMods",
"User": "aedenthorn",
"Directory": "_releases",
"ModFolder": "CropHarvestBubbles"
},
"Dependencies": [
{
"UniqueID": "Platonymous.ModUpdater",
"IsRequired": false
}
],
"UpdateKeys": [ "Nexus:17761" ]
"MinimumApiVersion": "4.0.0-alpha",
"UpdateKeys": [ "" ]
}
2 changes: 1 addition & 1 deletion CropVariation/CropVariation.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>1.0.0</Version>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<EnableHarmony>true</EnableHarmony>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion CropVariation/Methods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private static void GetRandomColorVars(HoeDirt hoeDirt)
}
private static int ChangeQuality(Crop crop, HoeDirt hoeDirt, int quality)
{
if (!Config.EnableMod || crop.indexOfHarvest.Value == 771 || crop.indexOfHarvest.Value == 889)
if (!Config.EnableMod || crop.indexOfHarvest.Value == "771" || crop.indexOfHarvest.Value == "889")
return quality;
float factor = 0;
if(Config.ColorVariationQualityFactor > 0)
Expand Down
20 changes: 4 additions & 16 deletions CropVariation/manifest.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
{
"Name": "Crop Variation",
"Author": "aedenthorn",
"Version": "0.2.5",
"Description": "Crop Variation.",
"Version": "0.2.5.1-unofficial.1-Logophile",
"Description": "Adds visual variation to crops",
"UniqueID": "aedenthorn.CropVariation",
"EntryDll": "CropVariation.dll",
"MinimumApiVersion": "3.13.0",
"ModUpdater": {
"Repository": "StardewValleyMods",
"User": "aedenthorn",
"Directory": "_releases",
"ModFolder": "CropVariation"
},
"UpdateKeys": [ "Nexus:11467" ],
"Dependencies": [
{
"UniqueID": "Platonymous.ModUpdater",
"IsRequired": false
}
]
"MinimumApiVersion": "4.0.0-alpha",
"UpdateKeys": [""]
}
2 changes: 1 addition & 1 deletion FishSpotBait/FishSpotBait.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>1.0.0</Version>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<EnableHarmony>true</EnableHarmony>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
Expand Down
19 changes: 3 additions & 16 deletions FishSpotBait/manifest.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
{
"Name": "Fish Spot Bait",
"Author": "aedenthorn",
"Version": "0.1.1",
"Description": "Fish Spot Bait.",
"Version": "0.1.2-unofficial.1-logophile",
"Description": "Drop bait in the water to lure fish to that spot.",
"UniqueID": "aedenthorn.FishSpotBait",
"EntryDll": "FishSpotBait.dll",
"MinimumApiVersion": "3.15.0",
"ModUpdater": {
"Repository": "StardewValleyMods",
"User": "aedenthorn",
"Directory": "_releases",
"ModFolder": "FishSpotBait"
},
"Dependencies": [
{
"UniqueID": "Platonymous.ModUpdater",
"IsRequired": false
}
],
"UpdateKeys": [ "Nexus:17581" ]
"MinimumApiVersion": "4.0.0-alpha"
}
2 changes: 1 addition & 1 deletion GiftRejection/GiftRejection.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>1.0.0</Version>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<EnableHarmony>true</EnableHarmony>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
Expand Down
19 changes: 3 additions & 16 deletions GiftRejection/manifest.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
{
"Name": "Gift Rejection",
"Author": "aedenthorn",
"Version": "0.1.0",
"Description": "Gift Rejection.",
"Version": "0.1.1-unofficial.1-logophile",
"Description": "Causes NPCs to throw gifts they don't like.",
"UniqueID": "aedenthorn.GiftRejection",
"EntryDll": "GiftRejection.dll",
"MinimumApiVersion": "3.15.0",
"ModUpdater": {
"Repository": "StardewValleyMods",
"User": "aedenthorn",
"Directory": "_releases",
"ModFolder": "GiftRejection"
},
"Dependencies": [
{
"UniqueID": "Platonymous.ModUpdater",
"IsRequired": false
}
],
"UpdateKeys": [ "Nexus:" ]
"MinimumApiVersion": "4.0.0-alpha",
}