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

[BulkAnimalPurchase] update to 1.6 #136

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion BulkAnimalPurchase/BulkAnimalPurchase.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
10 changes: 5 additions & 5 deletions BulkAnimalPurchase/CodePatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace BulkAnimalPurchase
/// <summary>The mod entry point.</summary>
public partial class ModEntry
{
[HarmonyPatch(typeof(PurchaseAnimalsMenu), new Type[] { typeof(List<Object>) })]
[HarmonyPatch(typeof(PurchaseAnimalsMenu), new Type[] { typeof(List<Object>), typeof(GameLocation) })]
[HarmonyPatch(MethodType.Constructor)]
public class PurchaseAnimalsMenu_Patch
{
Expand Down Expand Up @@ -48,7 +48,7 @@ public static void Prefix()
}
}
private static bool skip = false;
[HarmonyPatch(typeof(Game1), nameof(Game1.drawDialogueBox), new Type[] { typeof(int), typeof(int), typeof(int), typeof(int), typeof(bool),typeof(bool), typeof(string), typeof(bool), typeof(bool), typeof(int), typeof(int), typeof(int) })]
[HarmonyPatch(typeof(Game1), nameof(Game1.drawDialogueBox), new Type[] { typeof(int), typeof(int), typeof(int), typeof(int), typeof(bool), typeof(bool), typeof(string), typeof(bool), typeof(bool), typeof(int), typeof(int), typeof(int) })]
public class Game1_drawDialogueBox_Patch
{
public static void Prefix()
Expand Down Expand Up @@ -76,7 +76,7 @@ public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructio
bool found = false;
for (int i = 0; i < codes.Count; i++)
{
if (found && codes[i].opcode == OpCodes.Callvirt && (MethodInfo)codes[i].operand == AccessTools.Method(typeof(LocalizedContentManager), nameof(LocalizedContentManager.LoadString), new Type[] { typeof(string),typeof(object),typeof(object) }))
if (found && codes[i].opcode == OpCodes.Callvirt && (MethodInfo)codes[i].operand == AccessTools.Method(typeof(LocalizedContentManager), nameof(LocalizedContentManager.LoadString), new Type[] { typeof(string), typeof(object), typeof(object) }))
{
SMonitor.Log("Adding to string result");
codes.Insert(i + 1, new CodeInstruction(OpCodes.Call, typeof(ModEntry).GetMethod(nameof(ModEntry.AddToString))));
Expand Down Expand Up @@ -121,7 +121,7 @@ public static bool Prefix(PurchaseAnimalsMenu __instance, ref FarmAnimal ___anim
Game1.addHUDMessage(new HUDMessage(___animalBeingPurchased.isMale() ? Game1.content.LoadString("Strings\\StringsFromCSFiles:PurchaseAnimalsMenu.cs.11311", ___animalBeingPurchased.displayName) : Game1.content.LoadString("Strings\\StringsFromCSFiles:PurchaseAnimalsMenu.cs.11314", ___animalBeingPurchased.displayName), 1));

string type = ___animalBeingPurchased.type.Value;
if (!SHelper.ModRegistry.IsLoaded("aedenthorn.LivestockChoices"))
if (!SHelper.ModRegistry.IsLoaded("aedenthorn.LivestockChoices"))
{
if (type.EndsWith(" Chicken") && !type.Equals("Void Chicken") && !type.Equals("Golden Chicken"))
{
Expand Down Expand Up @@ -159,7 +159,7 @@ public static bool Prefix(PurchaseAnimalsMenu __instance, int x, int y, bool ___
}
return true;
}
public static void Postfix(int __state, ref int ___priceOfAnimal)
public static void Postfix(int __state, ref int ___priceOfAnimal)
{
if (!Config.EnableMod || __state == ___priceOfAnimal)
return;
Expand Down
8 changes: 4 additions & 4 deletions BulkAnimalPurchase/manifest.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"Name": "Bulk Animal Purchase",
"Author": "aedenthorn",
"Version": "0.2.1",
"Version": "0.2.2",
"Description": "Bulk Animal Purchase.",
"UniqueID": "aedenthorn.BulkAnimalPurchase",
"EntryDll": "BulkAnimalPurchase.dll",
"MinimumApiVersion": "3.13.0",
"MinimumApiVersion": "4.0.0",
"ModUpdater": {
"Repository": "StardewValleyMods",
"User": "aedenthorn",
"Directory": "_releases",
"ModFolder": "BulkAnimalPurchase"
},
"UpdateKeys": [ "Nexus:11539" ],
"UpdateKeys": ["Nexus:11539"],
"Dependencies": [
{
"UniqueID": "Platonymous.ModUpdater",
"IsRequired": false
}
]
}
}