-
Notifications
You must be signed in to change notification settings - Fork 1
/
Cutefish_Patch.cs
74 lines (68 loc) · 2.25 KB
/
Cutefish_Patch.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static ErrorMessage;
namespace Tweaks_Fixes
{
internal class Cutefish_Patch
{
[HarmonyPatch(typeof(CuteFishHandTarget))]
class CuteFishHandTarget_patch
{
//[HarmonyPostfix]
//[HarmonyPatch("OnHandHover")]
public static void OnHandHoverPostfix(CuteFishHandTarget __instance)
{
if (GameInput.GetButtonDown(GameInput.Button.Deconstruct))
{
AddDebug("Deconstruct Button");
Pickupable p = __instance.GetComponent<Pickupable>();
if (p)
{
p.Pickup();
}
}
}
[HarmonyPostfix]
[HarmonyPatch("AllowedToInteract")]
public static void AllowedToInteractPostfix(CuteFishHandTarget __instance, ref bool __result)
{
if (ConfigToEdit.fixCuteFish.Value && !Player.main.IsSwimming())
__result = false;
}
}
//[HarmonyPatch(typeof(WaterParkCreature))]
class WaterParkCreature_patch
{
//[HarmonyPostfix]
//[HarmonyPatch("Start")]
public static void OnHandHoverPostfix(WaterParkCreature __instance)
{
if (__instance.isInside)
{
AddDebug("WaterParkCreature Start " + __instance.name);
}
}
//[HarmonyPostfix]
//[HarmonyPatch("AllowedToInteract")]
//public static void AllowedToInteractPostfix(CuteFishHandTarget __instance, ref bool __result)
//{
// if (!Player.main.IsSwimming())
// __result = false;
//}
}
//[HarmonyPatch(typeof(CuteFish))]
class CuteFish_patch
{
//[HarmonyPostfix]
//[HarmonyPatch("Start")]
public static void Postfix(CuteFish __instance)
{
AddDebug("CuteFish Start");
__instance.gameObject.EnsureComponent<Pickupable>();
}
}
}
}