mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-01 13:59:22 +00:00
24 lines
No EOL
769 B
C#
24 lines
No EOL
769 B
C#
using ABI_RC.Core.Player;
|
|
using ABI_RC.Core.Savior;
|
|
using HarmonyLib;
|
|
using MelonLoader;
|
|
|
|
namespace NAK.Melons.Blackout.HarmonyPatches;
|
|
|
|
[HarmonyPatch]
|
|
internal class HarmonyPatches
|
|
{
|
|
//Support for changing VRMode during runtime.
|
|
[HarmonyPostfix]
|
|
[HarmonyPatch(typeof(PlayerSetup), "CalibrateAvatar")]
|
|
private static void CheckVRModeOnSwitch()
|
|
{
|
|
if (Blackout.inVR != MetaPort.Instance.isUsingVr)
|
|
{
|
|
MelonLogger.Msg("VRMode change detected! Reinitializing Blackout Instance...");
|
|
Blackout.inVR = MetaPort.Instance.isUsingVr;
|
|
BlackoutController.Instance.SetupBlackoutInstance();
|
|
BlackoutController.Instance.ChangeBlackoutState(BlackoutController.BlackoutState.Awake);
|
|
}
|
|
}
|
|
} |