Update game libs to latest version, use strongly typed names in patches where possible (#493)

This commit is contained in:
artum 2021-12-23 16:05:00 +01:00 committed by GitHub
parent 0b3536bdd5
commit dbbc95e32c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 53 additions and 53 deletions

View File

@ -103,7 +103,7 @@ namespace NomaiVR.EffectFixes
var openEyesMethod = var openEyesMethod =
typeof(PlayerCameraEffectController) typeof(PlayerCameraEffectController)
.GetMethod("OpenEyes", new[] { typeof(float), typeof(AnimationCurve) }); .GetMethod(nameof(PlayerCameraEffectController.OpenEyes), new[] { typeof(float), typeof(AnimationCurve) });
Postfix(openEyesMethod, nameof(PostOpenEyes)); Postfix(openEyesMethod, nameof(PostOpenEyes));
Postfix<PlayerCameraEffectController>(nameof(PlayerCameraEffectController.CloseEyes), nameof(PostCloseEyes)); Postfix<PlayerCameraEffectController>(nameof(PlayerCameraEffectController.CloseEyes), nameof(PostCloseEyes));

View File

@ -9,7 +9,7 @@
{ {
public override void ApplyPatches() public override void ApplyPatches()
{ {
Prefix<PlayerCharacterController>("OnPlayerDeath", nameof(PrePlayerDeath)); Prefix<PlayerCharacterController>(nameof(PlayerCharacterController.OnPlayerDeath), nameof(PrePlayerDeath));
} }
private static bool PrePlayerDeath(DeathType deathType) private static bool PrePlayerDeath(DeathType deathType)

View File

@ -22,8 +22,8 @@ namespace NomaiVR.EffectFixes
//Mind Projectors //Mind Projectors
Prefix<MindProjectorImageEffect>(nameof(MindProjectorImageEffect.Awake), nameof(AddVRProjector)); Prefix<MindProjectorImageEffect>(nameof(MindProjectorImageEffect.Awake), nameof(AddVRProjector));
Prefix<MindProjectorImageEffect>(nameof(MindProjectorImageEffect.OnRenderImage), nameof(BlitImageEffect)); Prefix<MindProjectorImageEffect>(nameof(MindProjectorImageEffect.OnRenderImage), nameof(BlitImageEffect));
Prefix<MindProjectorImageEffect>("set_eyeOpenness", nameof(SetEyeOpennes)); Prefix<MindProjectorImageEffect>("set_" + nameof(MindProjectorImageEffect.eyeOpenness), nameof(SetEyeOpennes));
Prefix<MindProjectorImageEffect>("set_slideTexture", nameof(SetSlideTexture)); Prefix<MindProjectorImageEffect>("set_" + nameof(MindProjectorImageEffect.slideTexture), nameof(SetSlideTexture));
//Zoom Points //Zoom Points
Prefix<LanternZoomPoint>(nameof(LanternZoomPoint.UpdateRetroZoom), nameof(UpdateRetrozoomFOVScale)); Prefix<LanternZoomPoint>(nameof(LanternZoomPoint.UpdateRetroZoom), nameof(UpdateRetrozoomFOVScale));

View File

@ -14,16 +14,16 @@ namespace NomaiVR.EffectFixes
public override void ApplyPatches() public override void ApplyPatches()
{ {
Prefix<Flashback>("OnTriggerFlashback", nameof(PatchTriggerFlashback)); Prefix<Flashback>(nameof(Flashback.OnTriggerFlashback), nameof(PatchTriggerFlashback));
Prefix<Flashback>("Update", nameof(FlashbackUpdate)); Prefix<Flashback>(nameof(Flashback.Update), nameof(FlashbackUpdate));
Prefix<Flashback>("UpdateMemoryUplink", nameof(PostUpdateMemoryLink)); Prefix<Flashback>(nameof(Flashback.UpdateMemoryUplink), nameof(PostUpdateMemoryLink));
Postfix<Flashback>("OnTriggerMemoryUplink", nameof(PostTriggerMemoryUplink)); Postfix<Flashback>(nameof(Flashback.OnTriggerMemoryUplink), nameof(PostTriggerMemoryUplink));
// Prevent flashing on energy death. // Prevent flashing on energy death.
Postfix<Flashback>("OnTriggerFlashback", nameof(PostTriggerFlashback)); Postfix<Flashback>(nameof(Flashback.OnTriggerFlashback), nameof(PostTriggerFlashback));
// Fix loop picture scale. // Fix loop picture scale.
Postfix<Flashback>("Start", nameof(PostFlashbackRecorderAwake)); Postfix<Flashback>(nameof(Flashback.Start), nameof(PostFlashbackRecorderAwake));
} }
private static void PostFlashbackRecorderAwake(Transform ____screenTransform, ref Vector3 ____origScreenScale) private static void PostFlashbackRecorderAwake(Transform ____screenTransform, ref Vector3 ____origScreenScale)

View File

@ -11,7 +11,7 @@ namespace NomaiVR.EffectFixes
{ {
public override void ApplyPatches() public override void ApplyPatches()
{ {
Postfix<NomaiRemoteCameraPlatform>("SwitchToRemoteCamera", nameof(SwitchToRemoteCamera)); Postfix<NomaiRemoteCameraPlatform>(nameof(NomaiRemoteCameraPlatform.SwitchToRemoteCamera), nameof(SwitchToRemoteCamera));
} }
private static void SwitchToRemoteCamera(NomaiRemoteCameraPlatform ____slavePlatform, Transform ____playerHologram) private static void SwitchToRemoteCamera(NomaiRemoteCameraPlatform ____slavePlatform, Transform ____playerHologram)

View File

@ -120,7 +120,7 @@
<EmbeddedResource Remove="Input\Bindings\**" /> <EmbeddedResource Remove="Input\Bindings\**" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="OuterWildsGameLibs" Version="1.1.11.72" /> <PackageReference Include="OuterWildsGameLibs" Version="1.1.12.125" />
<PackageReference Include="OWML" Version="2.1.0"> <PackageReference Include="OWML" Version="2.1.0">
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>

View File

@ -101,10 +101,10 @@ namespace NomaiVR.Player
{ {
public override void ApplyPatches() public override void ApplyPatches()
{ {
Postfix<PlayerCharacterController>("UpdateTurning", nameof(PostCharacterTurning)); Postfix<PlayerCharacterController>(nameof(PlayerCharacterController.UpdateTurning), nameof(PostCharacterTurning));
Postfix<JetpackThrusterController>("FixedUpdate", nameof(PostThrusterUpdate)); Postfix<JetpackThrusterController>(nameof(JetpackThrusterController.FixedUpdate), nameof(PostThrusterUpdate));
Prefix<OWCamera>("set_fieldOfView", nameof(PatchOwCameraFOV)); Prefix<OWCamera>("set_" + nameof(OWCamera.fieldOfView), nameof(PatchOwCameraFOV));
Prefix<OWCamera>("get_fieldOfView", nameof(GetOwCameraFOVScaled)); Prefix<OWCamera>("get_" + nameof(OWCamera.fieldOfView), nameof(GetOwCameraFOVScaled));
} }
private static void PostThrusterUpdate(Vector3 ____rotationalInput) private static void PostThrusterUpdate(Vector3 ____rotationalInput)

View File

@ -22,21 +22,21 @@ namespace NomaiVR.Ship
{ {
public override void ApplyPatches() public override void ApplyPatches()
{ {
Postfix<ShipBody>("Start", nameof(ShipStart)); Postfix<ShipBody>(nameof(ShipBody.Start), nameof(ShipStart));
Prefix<ReferenceFrameTracker>(nameof(ReferenceFrameTracker.FindReferenceFrameInLineOfSight), nameof(PreFindFrame)); Prefix<ReferenceFrameTracker>(nameof(ReferenceFrameTracker.FindReferenceFrameInLineOfSight), nameof(PreFindFrame));
Postfix<ReferenceFrameTracker>(nameof(ReferenceFrameTracker.FindReferenceFrameInLineOfSight), nameof(PostFindFrame)); Postfix<ReferenceFrameTracker>(nameof(ReferenceFrameTracker.FindReferenceFrameInLineOfSight), nameof(PostFindFrame));
Prefix<ReferenceFrameTracker>(nameof(ReferenceFrameTracker.FindReferenceFrameInMapView), nameof(PreFindFrame)); Prefix<ReferenceFrameTracker>(nameof(ReferenceFrameTracker.FindReferenceFrameInMapView), nameof(PreFindFrame));
Postfix<ReferenceFrameTracker>(nameof(ReferenceFrameTracker.FindReferenceFrameInMapView), nameof(PostFindFrame)); Postfix<ReferenceFrameTracker>(nameof(ReferenceFrameTracker.FindReferenceFrameInMapView), nameof(PostFindFrame));
Empty<PlayerCameraController>("OnEnterLandingView"); Empty<PlayerCameraController>(nameof(PlayerCameraController.OnEnterLandingView));
Empty<PlayerCameraController>("OnExitLandingView"); Empty<PlayerCameraController>(nameof(PlayerCameraController.OnExitLandingView));
Empty<PlayerCameraController>("OnEnterShipComputer"); Empty<PlayerCameraController>(nameof(PlayerCameraController.OnEnterShipComputer));
Empty<PlayerCameraController>("OnExitShipComputer"); Empty<PlayerCameraController>(nameof(PlayerCameraController.OnExitShipComputer));
Prefix<ShipCockpitController>("EnterLandingView", nameof(PreEnterLandingView)); Prefix<ShipCockpitController>(nameof(ShipCockpitController.EnterLandingView), nameof(PreEnterLandingView));
Prefix<ShipCockpitController>("ExitLandingView", nameof(PreExitLandingView)); Prefix<ShipCockpitController>(nameof(ShipCockpitController.ExitLandingView), nameof(PreExitLandingView));
Postfix<ShipCockpitController>("ExitFlightConsole", nameof(PostExitFlightConsole)); Postfix<ShipCockpitController>(nameof(ShipCockpitController.ExitFlightConsole), nameof(PostExitFlightConsole));
Prefix<ShipCockpitUI>("Update", nameof(PreCockpitUIUpdate)); Prefix<ShipCockpitUI>(nameof(ShipCockpitUI.Update), nameof(PreCockpitUIUpdate));
Postfix<ShipCockpitUI>("Update", nameof(PostCockpitUIUpdate)); Postfix<ShipCockpitUI>(nameof(ShipCockpitUI.Update), nameof(PostCockpitUIUpdate));
Prefix(typeof(ReferenceFrameTracker).GetMethod("UntargetReferenceFrame", new[] { typeof(bool) }), nameof(PreUntargetFrame)); Prefix(typeof(ReferenceFrameTracker).GetMethod(nameof(ReferenceFrameTracker.UntargetReferenceFrame), new[] { typeof(bool) }), nameof(PreUntargetFrame));
} }
private static void PreCockpitUIUpdate(ShipCockpitUI __instance) private static void PreCockpitUIUpdate(ShipCockpitUI __instance)

View File

@ -119,10 +119,10 @@ namespace NomaiVR.Tools
public override void ApplyPatches() public override void ApplyPatches()
{ {
// Stop stick rotation animation. // Stop stick rotation animation.
Empty<RoastingStickController>("UpdateRotation"); Empty<RoastingStickController>(nameof(RoastingStickController.UpdateRotation));
// Prevent stick from moving on colliding with stuff. // Prevent stick from moving on colliding with stuff.
Postfix<RoastingStickController>("CalculateMaxStickExtension", nameof(PostCalculateMaxStickExtension)); Postfix<RoastingStickController>(nameof(RoastingStickController.CalculateMaxStickExtension), nameof(PostCalculateMaxStickExtension));
} }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Result required for return passthrough")] [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Result required for return passthrough")]

View File

@ -153,15 +153,15 @@ namespace NomaiVR.Tools
public override void ApplyPatches() public override void ApplyPatches()
{ {
Prefix<PlayerSpacesuit>("SuitUp", nameof(SuitUp)); Prefix<PlayerSpacesuit>(nameof(PlayerSpacesuit.SuitUp), nameof(SuitUp));
Prefix<PlayerSpacesuit>("RemoveSuit", nameof(RemoveSuit)); Prefix<PlayerSpacesuit>(nameof(PlayerSpacesuit.RemoveSuit), nameof(RemoveSuit));
Postfix<ProbeLauncherUI>("HideProbeHUD", nameof(PostHideHUD)); Postfix<ProbeLauncherUI>(nameof(ProbeLauncherUI.HideProbeHUD), nameof(PostHideHUD));
// Prevent probe prompt zones from equipping / unequipping the probe launcher. // Prevent probe prompt zones from equipping / unequipping the probe launcher.
Prefix<ProbePromptReceiver>("LoseFocus", nameof(PreLoseFocus)); Prefix<ProbePromptReceiver>(nameof(ProbePromptReceiver.LoseFocus), nameof(PreLoseFocus));
Postfix<ProbePromptReceiver>("LoseFocus", nameof(PostLoseFocus)); Postfix<ProbePromptReceiver>(nameof(ProbePromptReceiver.LoseFocus), nameof(PostLoseFocus));
Prefix<ProbePromptReceiver>("GainFocus", nameof(PreGainFocus)); Prefix<ProbePromptReceiver>(nameof(ProbePromptReceiver.GainFocus), nameof(PreGainFocus));
Postfix<ProbePromptReceiver>("GainFocus", nameof(PostGainFocus)); Postfix<ProbePromptReceiver>(nameof(ProbePromptReceiver.GainFocus), nameof(PostGainFocus));
} }
private static void PreLoseFocus() private static void PreLoseFocus()

View File

@ -175,9 +175,9 @@ namespace NomaiVR.Tools
{ {
public override void ApplyPatches() public override void ApplyPatches()
{ {
Postfix<ToolModeSwapper>("IsTranslatorEquipPromptAllowed", nameof(IsPromptAllowed)); Postfix<ToolModeSwapper>(nameof(ToolModeSwapper.IsTranslatorEquipPromptAllowed), nameof(IsPromptAllowed));
Postfix<ToolModeSwapper>("GetAutoEquipTranslator", nameof(IsPromptAllowed)); Postfix<ToolModeSwapper>(nameof(ToolModeSwapper.GetAutoEquipTranslator), nameof(IsPromptAllowed));
Postfix<ToolModeSwapper>("IsNomaiTextInFocus", nameof(IsPromptAllowed)); Postfix<ToolModeSwapper>(nameof(ToolModeSwapper.IsNomaiTextInFocus), nameof(IsPromptAllowed));
} }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Unusued parameter is needed for return value passthrough.")] [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Unusued parameter is needed for return value passthrough.")]

View File

@ -70,8 +70,8 @@ namespace NomaiVR.Tools
{ {
public override void ApplyPatches() public override void ApplyPatches()
{ {
Prefix<ToolModeSwapper>("EquipToolMode", nameof(PreEquipTool)); Prefix<ToolModeSwapper>(nameof(ToolModeSwapper.EquipToolMode), nameof(PreEquipTool));
Prefix<ShipCockpitController>("OnPressInteract", nameof(PreShipCockpitController)); Prefix<ShipCockpitController>(nameof(ShipCockpitController.OnPressInteract), nameof(PreShipCockpitController));
} }
private static void PreShipCockpitController() private static void PreShipCockpitController()

View File

@ -49,11 +49,11 @@ namespace NomaiVR.UI
{ {
public override void ApplyPatches() public override void ApplyPatches()
{ {
Prefix<CharacterDialogueTree>("StartConversation", nameof(PreStartConversation)); Prefix<CharacterDialogueTree>(nameof(CharacterDialogueTree.StartConversation), nameof(PreStartConversation));
Postfix<CharacterDialogueTree>("StartConversation", nameof(PostStartConversation)); Postfix<CharacterDialogueTree>(nameof(CharacterDialogueTree.StartConversation), nameof(PostStartConversation));
Prefix<CharacterDialogueTree>("EndConversation", nameof(PreEndConversation)); Prefix<CharacterDialogueTree>(nameof(CharacterDialogueTree.EndConversation), nameof(PreEndConversation));
Postfix<DialogueOptionUI>("Awake", nameof(PostDialogueOptionAwake)); Postfix<DialogueOptionUI>(nameof(DialogueOptionUI.Awake), nameof(PostDialogueOptionAwake));
Postfix<DialogueOptionUI>("SetSelected", nameof(PreSetButtonPromptImage)); Postfix<DialogueOptionUI>(nameof(DialogueOptionUI.SetSelected), nameof(PreSetButtonPromptImage));
} }
private static void PreSetButtonPromptImage(Image ____buttonPromptImage) private static void PreSetButtonPromptImage(Image ____buttonPromptImage)

View File

@ -253,7 +253,7 @@ namespace NomaiVR.UI
{ {
public override void ApplyPatches() public override void ApplyPatches()
{ {
Postfix<ToolModeUI>("Update", nameof(PostToolModeUiUpdate)); Postfix<ToolModeUI>(nameof(ToolModeUI.Update), nameof(PostToolModeUiUpdate));
} }
private static void PostToolModeUiUpdate( private static void PostToolModeUiUpdate(

View File

@ -146,9 +146,9 @@ namespace NomaiVR.UI
{ {
public override void ApplyPatches() public override void ApplyPatches()
{ {
Postfix<ThrustAndAttitudeIndicator>("LateUpdate", nameof(FixThrusterHudRotation)); Postfix<ThrustAndAttitudeIndicator>(nameof(ThrustAndAttitudeIndicator.LateUpdate), nameof(FixThrusterHudRotation));
Postfix<HUDCamera>("Awake", nameof(FixHudDistortion)); Postfix<HUDCamera>(nameof(HUDCamera.Awake), nameof(FixHudDistortion));
Postfix<HUDCamera>("OnGraphicSettingsUpdated", nameof(FixHudDistortion)); Postfix<HUDCamera>(nameof(HUDCamera.OnGraphicSettingsUpdated), nameof(FixHudDistortion));
} }
private static void FixHudDistortion(Camera ____camera) private static void FixHudDistortion(Camera ____camera)

View File

@ -106,17 +106,17 @@ namespace NomaiVR.UI
{ {
public override void ApplyPatches() public override void ApplyPatches()
{ {
var lockOnMethods = typeof(PlayerLockOnTargeting).GetMethods().Where(method => method.Name == "LockOn"); var lockOnMethods = typeof(PlayerLockOnTargeting).GetMethods().Where(method => method.Name == nameof(PlayerLockOnTargeting.LockOn));
foreach (var method in lockOnMethods) foreach (var method in lockOnMethods)
{ {
Prefix(method, nameof(PreLockOn)); Prefix(method, nameof(PreLockOn));
} }
var breakLockMethods = typeof(PlayerLockOnTargeting).GetMethods().Where(method => method.Name == "BreakLock"); var breakLockMethods = typeof(PlayerLockOnTargeting).GetMethods().Where(method => method.Name == nameof(PlayerLockOnTargeting.BreakLock));
foreach (var method in breakLockMethods) foreach (var method in breakLockMethods)
{ {
Prefix(method, nameof(PreBreakLock)); Prefix(method, nameof(PreBreakLock));
} }
Postfix(typeof(OWTime).GetMethod("Pause"), nameof(PostPause)); Postfix(typeof(OWTime).GetMethod(nameof(OWTime.Pause)), nameof(PostPause));
} }
public static void PostPause(OWTime.PauseType pauseType) public static void PostPause(OWTime.PauseType pauseType)