mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
use annotation instead of yucky manual way
This commit is contained in:
parent
7add9f8d8d
commit
b67207555f
@ -116,10 +116,7 @@ namespace NewHorizons
|
|||||||
public void Start()
|
public void Start()
|
||||||
{
|
{
|
||||||
// Patches
|
// Patches
|
||||||
Harmony harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly());
|
Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly());
|
||||||
harmony.Patch(typeof(CloakFieldController).GetMethod("get_" + nameof(CloakFieldController.isPlayerInsideCloak), BindingFlags.Public | BindingFlags.Instance), postfix: new HarmonyMethod(typeof(Patches.LocatorPatches).GetMethod(nameof(Patches.LocatorPatches.CloakFieldController_isPlayerInsideCloak), BindingFlags.Static | BindingFlags.Public)));
|
|
||||||
harmony.Patch(typeof(CloakFieldController).GetMethod("get_" + nameof(CloakFieldController.isProbeInsideCloak), BindingFlags.Public | BindingFlags.Instance), postfix: new HarmonyMethod(typeof(Patches.LocatorPatches).GetMethod(nameof(Patches.LocatorPatches.CloakFieldController_isProbeInsideCloak), BindingFlags.Static | BindingFlags.Public)));
|
|
||||||
harmony.Patch(typeof(CloakFieldController).GetMethod("get_" + nameof(CloakFieldController.isShipInsideCloak), BindingFlags.Public | BindingFlags.Instance), postfix: new HarmonyMethod(typeof(Patches.LocatorPatches).GetMethod(nameof(Patches.LocatorPatches.CloakFieldController_isShipInsideCloak), BindingFlags.Static | BindingFlags.Public)));
|
|
||||||
|
|
||||||
OnChangeStarSystem = new StarSystemEvent();
|
OnChangeStarSystem = new StarSystemEvent();
|
||||||
OnStarSystemLoaded = new StarSystemEvent();
|
OnStarSystemLoaded = new StarSystemEvent();
|
||||||
|
|||||||
@ -11,16 +11,22 @@ namespace NewHorizons.Patches
|
|||||||
return Locator._cloakFieldController == null;
|
return Locator._cloakFieldController == null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HarmonyPostfix]
|
||||||
|
[HarmonyPatch(typeof(CloakFieldController), nameof(CloakFieldController.isPlayerInsideCloak), MethodType.Getter)]
|
||||||
public static void CloakFieldController_isPlayerInsideCloak(CloakFieldController __instance, ref bool __result)
|
public static void CloakFieldController_isPlayerInsideCloak(CloakFieldController __instance, ref bool __result)
|
||||||
{
|
{
|
||||||
__result = __result || Components.CloakSectorController.isPlayerInside;
|
__result = __result || Components.CloakSectorController.isPlayerInside;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HarmonyPostfix]
|
||||||
|
[HarmonyPatch(typeof(CloakFieldController), nameof(CloakFieldController.isProbeInsideCloak), MethodType.Getter)]
|
||||||
public static void CloakFieldController_isProbeInsideCloak(CloakFieldController __instance, ref bool __result)
|
public static void CloakFieldController_isProbeInsideCloak(CloakFieldController __instance, ref bool __result)
|
||||||
{
|
{
|
||||||
__result = __result || Components.CloakSectorController.isProbeInside;
|
__result = __result || Components.CloakSectorController.isProbeInside;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HarmonyPostfix]
|
||||||
|
[HarmonyPatch(typeof(CloakFieldController), nameof(CloakFieldController.isShipInsideCloak), MethodType.Getter)]
|
||||||
public static void CloakFieldController_isShipInsideCloak(CloakFieldController __instance, ref bool __result)
|
public static void CloakFieldController_isShipInsideCloak(CloakFieldController __instance, ref bool __result)
|
||||||
{
|
{
|
||||||
__result = __result || Components.CloakSectorController.isShipInside;
|
__result = __result || Components.CloakSectorController.isShipInside;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user