public static void Patch() { NomaiVR.Pre <OWInput>("ChangeInputMode", typeof(Patches), nameof(ChangeInputMode)); NomaiVR.Post <QuantumInstrument>("Update", typeof(Patches), nameof(PostQuantumInstrumentUpdate)); NomaiVR.Empty <Signalscope>("EnterSignalscopeZoom"); NomaiVR.Empty <Signalscope>("ExitSignalscopeZoom"); }
void Start() { _instance = this; NomaiVR.Log("Started FogFix"); // Make dark bramble lights visible in the fog. var fogLightCanvas = GameObject.Find("FogLightCanvas").GetComponent <Canvas>(); fogLightCanvas.renderMode = RenderMode.ScreenSpaceCamera; fogLightCanvas.worldCamera = Locator.GetActiveCamera().mainCamera; fogLightCanvas.planeDistance = 100; // Disable underwater effect. GameObject.FindObjectOfType <UnderwaterEffectBubbleController>().gameObject.SetActive(false); // Disable water entering and exiting effect. var visorEffects = FindObjectOfType <VisorEffectController>(); visorEffects.SetValue("_waterClearLength", 0); visorEffects.SetValue("_waterFadeInLength", 0); _camera = Locator.GetPlayerCamera(); if (LoadManager.GetPreviousScene() == OWScene.TitleScreen && LoadManager.GetCurrentScene() == OWScene.SolarSystem) { CloseEyes(); } }
void Start() { NomaiVR.Log("Started ControllerInput"); _instance = this; _buttons = new Dictionary <XboxButton, float>(); _singleAxes = new Dictionary <string, float>(); _doubleAxes = new Dictionary <DoubleAxis, Vector2>(); SteamVR_Actions.default_Jump.onChange += CreateButtonHandler(XboxButton.A); SteamVR_Actions.default_Back.onChange += OnBackChange; SteamVR_Actions.default_PrimaryAction.onChange += OnPrimaryActionChange; SteamVR_Actions.default_SecondaryAction.onChange += CreateButtonHandler(XboxButton.LeftBumper); SteamVR_Actions.default_Grip.onChange += OnGripChange; SteamVR_Actions.default_Menu.onChange += CreateButtonHandler(XboxButton.Start); SteamVR_Actions.default_Map.onChange += CreateButtonHandler(XboxButton.Select); SteamVR_Actions.default_ThrottleDown.onChange += CreateSingleAxisHandler(XboxAxis.leftTrigger); SteamVR_Actions.default_ThrottleUp.onChange += CreateSingleAxisHandler(XboxAxis.rightTrigger); SteamVR_Actions.default_ThrottleUp.onChange += CreateSingleAxisHandler(XboxAxis.rightTrigger); SteamVR_Actions.default_Move.onChange += CreateDoubleAxisHandler(XboxAxis.leftStick, XboxAxis.leftStickX, XboxAxis.leftStickY); SteamVR_Actions.default_Look.onChange += CreateDoubleAxisHandler(XboxAxis.rightStick, XboxAxis.rightStickX, XboxAxis.rightStickY); GlobalMessenger.AddListener("WakeUp", OnWakeUp); }
public static void Patch() { // Fixes for fog stereo problems. NomaiVR.Pre <PlanetaryFogController>("ResetFogSettings", typeof(Patches), nameof(Patches.PatchResetFog)); NomaiVR.Pre <PlanetaryFogController>("UpdateFogSettings", typeof(Patches), nameof(Patches.PatchUpdateFog)); NomaiVR.Pre <FogOverrideVolume>("OverrideFogSettings", typeof(Patches), nameof(Patches.PatchOverrideFog)); // Improvements for the "loop reset" effect. NomaiVR.Pre <Flashback>("OnTriggerFlashback", typeof(Patches), nameof(Patches.PatchTriggerFlashback)); NomaiVR.Pre <Flashback>("Update", typeof(Patches), nameof(Patches.FlashbackUpdate)); // Fix for the reprojection stone camera position. NomaiVR.Post <NomaiRemoteCameraPlatform>("SwitchToRemoteCamera", typeof(Patches), nameof(Patches.SwitchToRemoteCamera)); // Prevent flashing on energy death. NomaiVR.Post <Flashback>("OnTriggerFlashback", typeof(Patches), nameof(PostTriggerFlashback)); NomaiVR.Post <Campfire>("StartFastForwarding", typeof(Patches), nameof(PostStartFastForwarding)); var openEyesMethod = typeof(PlayerCameraEffectController) .GetMethod("OpenEyes", new[] { typeof(float), typeof(AnimationCurve) }); NomaiVR.Helper.HarmonyHelper.AddPostfix(openEyesMethod, typeof(Patches), nameof(PostOpenEyes)); NomaiVR.Post <PlayerCameraEffectController>("CloseEyes", typeof(Patches), nameof(PostCloseEyes)); }
public override void ApplyPatches() { NomaiVR.Post <ProfileMenuManager>("PopulateProfiles", typeof(Patch), nameof(PostPopulateProfiles)); NomaiVR.Post <CanvasMarkerManager>("Start", typeof(Patch), nameof(PostMarkerManagerStart)); NomaiVR.Post <TitleScreenAnimation>("FadeInMusic", typeof(Patch), nameof(PostTitleScreenFadeInMusic)); NomaiVR.Post <PopupMenu>("SetUpPopupCommands", typeof(Patch), nameof(PostSetPopupCommands)); }
private static void UpdateActiveController() { if (OWInput.GetActivePadNumber() != 0) { NomaiVR.Log("Wrong gamepad selected. Resetting to 0"); OWInput.SetActiveGamePad(0); } }
public override void ApplyPatches() { NomaiVR.Pre <CharacterDialogueTree>("StartConversation", typeof(Patch), nameof(PreStartConversation)); NomaiVR.Post <CharacterDialogueTree>("StartConversation", typeof(Patch), nameof(PostStartConversation)); NomaiVR.Pre <CharacterDialogueTree>("EndConversation", typeof(Patch), nameof(PreEndConversation)); NomaiVR.Post <DialogueOptionUI>("Awake", typeof(Patch), nameof(PostDialogueOptionAwake)); NomaiVR.Post <DialogueOptionUI>("SetSelected", typeof(Patch), nameof(PreSetButtonPromptImage)); }
public static void Patch() { // Stop stick rotation animation. NomaiVR.Empty <RoastingStickController>("UpdateRotation"); // Hide prompts. NomaiVR.Empty <RoastingStickController>("LateInitialize"); }
public static void Patch() { NomaiVR.Pre <SingleAxisCommand>("Update", typeof(Patches), nameof(Patches.SingleAxisUpdate)); NomaiVR.Pre <OWInput>("UpdateActiveInputDevice", typeof(Patches), nameof(Patches.OWInputUpdate)); NomaiVR.Pre <OWInput>("Awake", typeof(Patches), nameof(Patches.EnableListenForAllJoysticks)); NomaiVR.Post <PadEZ.PadManager>("GetAxis", typeof(Patches), nameof(Patches.GetAxis)); NomaiVR.Post <PlayerResources>("Awake", typeof(Patches), nameof(PlayerResourcesAwake)); }
void Awake() { NomaiVR.Log("Start Ship Tools"); _referenceFrameTracker = FindObjectOfType <ReferenceFrameTracker>(); _cockpitController = FindObjectOfType <ShipCockpitController>(); _mapGridRenderer = FindObjectOfType <MapController>().GetValue <MeshRenderer>("_gridRenderer").transform; }
public static void Patch() { NomaiVR.Pre <InteractZone>("UpdateInteractVolume", typeof(Patches), nameof(Patches.PatchUpdateInteractVolume)); NomaiVR.Pre <InteractZone>("OnEntry", typeof(Patches), nameof(Patches.InteractZoneEntry)); NomaiVR.Pre <InteractZone>("OnExit", typeof(Patches), nameof(Patches.InteractZoneExit)); NomaiVR.Pre <ToolModeSwapper>("Update", typeof(Patches), nameof(Patches.ToolModeUpdate)); NomaiVR.Pre <ItemTool>("UpdateIsDroppable", typeof(Patches), nameof(Patches.PreUpdateIsDroppable)); NomaiVR.Post <ItemTool>("UpdateIsDroppable", typeof(Patches), nameof(Patches.PostUpdateIsDroppable)); }
void Start() { NomaiVR.Log("Start VRTutorial"); SetTutorialState(TutorialState.LOOK); SteamVR_Actions.default_Look.onChange += OnLookChange; SteamVR_Actions.default_Move.onChange += OnMoveChange; SteamVR_Actions.default_PrimaryAction.onChange += OnPrimaryChange; }
public ModConfig() { XRSettings.showDeviceView = showMirrorView; if (preventCursorLock) { NomaiVR.Empty <CursorManager>("Update"); Cursor.lockState = CursorLockMode.None; Cursor.visible = true; } }
public override void ApplyPatches() { NomaiVR.Post <Campfire>("StartFastForwarding", typeof(Patch), nameof(PostStartFastForwarding)); var openEyesMethod = typeof(PlayerCameraEffectController) .GetMethod("OpenEyes", new[] { typeof(float), typeof(AnimationCurve) }); NomaiVR.Helper.HarmonyHelper.AddPostfix(openEyesMethod, typeof(Patch), nameof(PostOpenEyes)); NomaiVR.Post <PlayerCameraEffectController>("CloseEyes", typeof(Patch), nameof(PostCloseEyes)); }
private void SetupPatch() { if (typeof(Patch) == typeof(NomaiVRModule.EmptyPatch)) { return; } NomaiVR.Log("Applying NomaiVR patches for", GetType().Name); var patch = new Patch(); patch.ApplyPatches(); }
public override void ApplyPatches() { NomaiVR.Pre <PlayerSpacesuit>("SuitUp", typeof(Patch), nameof(Patch.SuitUp)); NomaiVR.Pre <PlayerSpacesuit>("RemoveSuit", typeof(Patch), nameof(Patch.RemoveSuit)); NomaiVR.Post <ProbeLauncherUI>("HideProbeHUD", typeof(Patch), nameof(Patch.PostHideHUD)); // Prevent probe prompt zones from equipping / unequipping the probe launcher. NomaiVR.Pre <ProbePromptReceiver>("LoseFocus", typeof(Patch), nameof(Patch.PreLoseFocus)); NomaiVR.Post <ProbePromptReceiver>("LoseFocus", typeof(Patch), nameof(Patch.PostLoseFocus)); NomaiVR.Pre <ProbePromptReceiver>("GainFocus", typeof(Patch), nameof(Patch.PreGainFocus)); NomaiVR.Post <ProbePromptReceiver>("GainFocus", typeof(Patch), nameof(Patch.PostGainFocus)); }
public static void Patch() { NomaiVR.Post <ShipBody>("Start", typeof(Patches), nameof(ShipStart)); NomaiVR.Pre <ReferenceFrameTracker>("FindReferenceFrameInLineOfSight", typeof(Patches), nameof(PreFindFrame)); NomaiVR.Post <ReferenceFrameTracker>("FindReferenceFrameInLineOfSight", typeof(Patches), nameof(PostFindFrame)); NomaiVR.Pre <ReferenceFrameTracker>("FindReferenceFrameInMapView", typeof(Patches), nameof(PreFindFrame)); NomaiVR.Post <ReferenceFrameTracker>("FindReferenceFrameInMapView", typeof(Patches), nameof(PostFindFrame)); NomaiVR.Empty <PlayerCameraController>("OnEnterLandingView"); NomaiVR.Empty <PlayerCameraController>("OnExitLandingView"); NomaiVR.Empty <PlayerCameraController>("OnEnterShipComputer"); NomaiVR.Empty <PlayerCameraController>("OnExitShipComputer"); }
public override void ApplyPatches() { NomaiVR.Pre <Flashback>("OnTriggerFlashback", typeof(Patch), nameof(PatchTriggerFlashback)); NomaiVR.Pre <Flashback>("Update", typeof(Patch), nameof(FlashbackUpdate)); NomaiVR.Pre <Flashback>("UpdateMemoryUplink", typeof(Patch), nameof(PostUpdateMemoryLink)); NomaiVR.Post <Flashback>("OnTriggerMemoryUplink", typeof(Patch), nameof(PostTriggerMemoryUplink)); // Prevent flashing on energy death. NomaiVR.Post <Flashback>("OnTriggerFlashback", typeof(Patch), nameof(PostTriggerFlashback)); // Fix loop picture scale. NomaiVR.Post <Flashback>("Start", typeof(Patch), nameof(PostFlashbackRecorderAwake)); }
void Start() { NomaiVR.Log("Started Dialogue Fixes"); _canvasTransform = GameObject.Find("DialogueCanvas").transform; _canvasTransform.localScale *= _dialogeRenderSize; _canvasTransform.parent = Locator.GetPlayerTransform(); var canvas = _canvasTransform.gameObject.GetComponent <Canvas>(); canvas.renderMode = RenderMode.WorldSpace; }
void Start() { NomaiVR.Log("Start PlayerBodyPosition"); // This component is messing with our ability to read the VR camera's rotation. // Seems to be responsible for controlling the camera rotation with the mouse / joystick. PlayerCameraController playerCameraController = Camera.main.GetComponent <PlayerCameraController>(); if (playerCameraController) { playerCameraController.enabled = false; } SetupCamera(); }
private void SetupBehaviour() { if (typeof(Behaviour) == typeof(NomaiVRModule.EmptyBehaviour)) { return; } NomaiVR.Log("Creating NomaiVR behaviour for", GetType().Name); var gameObject = new GameObject(); gameObject.AddComponent <Behaviour>(); if (IsPersistent) { gameObject.AddComponent <PersistObject>(); } }
public override void ApplyPatches() { NomaiVR.Post <ProbePromptController>("LateInitialize", typeof(Patch), nameof(RemoveProbePrompts)); NomaiVR.Post <ProbePromptController>("Awake", typeof(Patch), nameof(ChangeProbePrompts)); NomaiVR.Post <ShipPromptController>("LateInitialize", typeof(Patch), nameof(RemoveShipPrompts)); NomaiVR.Post <ShipPromptController>("Awake", typeof(Patch), nameof(ChangeShipPrompts)); NomaiVR.Post <NomaiTranslatorProp>("LateInitialize", typeof(Patch), nameof(RemoveTranslatorPrompts)); NomaiVR.Post <NomaiTranslatorProp>("Awake", typeof(Patch), nameof(ChangeTranslatorPrompts)); NomaiVR.Post <SignalscopePromptController>("LateInitialize", typeof(Patch), nameof(RemoveSignalscopePrompts)); NomaiVR.Post <SignalscopePromptController>("Awake", typeof(Patch), nameof(ChangeSignalscopePrompts)); NomaiVR.Post <SatelliteSnapshotController>("OnPressInteract", typeof(Patch), nameof(RemoveSatellitePrompts)); NomaiVR.Post <SatelliteSnapshotController>("Awake", typeof(Patch), nameof(ChangeSatellitePrompts)); NomaiVR.Post <PlayerSpawner>("Awake", typeof(Patch), nameof(RemoveJoystickPrompts)); NomaiVR.Post <RoastingStickController>("LateInitialize", typeof(Patch), nameof(RemoveRoastingStickPrompts)); NomaiVR.Post <ToolModeUI>("LateInitialize", typeof(Patch), nameof(RemoveToolModePrompts)); NomaiVR.Post <ScreenPrompt>("SetVisibility", typeof(Patch), nameof(PostScreenPromptVisibility)); NomaiVR.Pre <LockOnReticule>("Init", typeof(Patch), nameof(InitLockOnReticule)); NomaiVR.Pre <ScreenPrompt>("Init", typeof(Patch), nameof(PrePromptInit)); NomaiVR.Pre <ScreenPrompt>("SetText", typeof(Patch), nameof(PrePromptSetText)); NomaiVR.Post <ScreenPromptElement>("BuildTwoCommandScreenPrompt", typeof(Patch), nameof(PostBuildTwoCommandPromptElement)); // Replace Icons with empty version var getButtonTextureMethod = typeof(ButtonPromptLibrary).GetMethod("GetButtonTexture", new[] { typeof(JoystickButton) }); NomaiVR.Helper.HarmonyHelper.AddPostfix(getButtonTextureMethod, typeof(Patch), nameof(ReturnEmptyTexture)); var getAxisTextureMethods = typeof(ButtonPromptLibrary).GetMethods().Where(method => method.Name == "GetAxisTexture"); foreach (var method in getAxisTextureMethods) { NomaiVR.Helper.HarmonyHelper.AddPostfix(method, typeof(Patch), nameof(ReturnEmptyTexture)); } // Prevent probe launcher from moving the prompts around. NomaiVR.Empty <PromptManager>("OnProbeSnapshot"); NomaiVR.Empty <PromptManager>("OnProbeSnapshotRemoved"); NomaiVR.Empty <PromptManager>("OnProbeLauncherEquipped"); NomaiVR.Empty <PromptManager>("OnProbeLauncherUnequipped"); NomaiVR.Empty <ScreenPromptElement>("BuildInCommandImage"); }
public override void ApplyPatches() { NomaiVR.Post <ShipBody>("Start", typeof(Patch), nameof(ShipStart)); NomaiVR.Pre <ReferenceFrameTracker>("FindReferenceFrameInLineOfSight", typeof(Patch), nameof(PreFindFrame)); NomaiVR.Post <ReferenceFrameTracker>("FindReferenceFrameInLineOfSight", typeof(Patch), nameof(PostFindFrame)); NomaiVR.Pre <ReferenceFrameTracker>("FindReferenceFrameInMapView", typeof(Patch), nameof(PreFindFrame)); NomaiVR.Post <ReferenceFrameTracker>("FindReferenceFrameInMapView", typeof(Patch), nameof(PostFindFrame)); NomaiVR.Empty <PlayerCameraController>("OnEnterLandingView"); NomaiVR.Empty <PlayerCameraController>("OnExitLandingView"); NomaiVR.Empty <PlayerCameraController>("OnEnterShipComputer"); NomaiVR.Empty <PlayerCameraController>("OnExitShipComputer"); NomaiVR.Pre <ShipCockpitController>("EnterLandingView", typeof(Patch), nameof(PreEnterLandingView)); NomaiVR.Pre <ShipCockpitController>("ExitLandingView", typeof(Patch), nameof(PreExitLandingView)); NomaiVR.Post <ShipCockpitController>("ExitFlightConsole", typeof(Patch), nameof(PostExitFlightConsole)); NomaiVR.Pre <ShipCockpitUI>("Update", typeof(Patch), nameof(PreCockpitUIUpdate)); NomaiVR.Post <ShipCockpitUI>("Update", typeof(Patch), nameof(PostCockpitUIUpdate)); }
public static void Patch() { NomaiVR.Post <ProbePromptController>("LateInitialize", typeof(Patches), nameof(RemoveProbePrompts)); NomaiVR.Post <ProbePromptController>("Awake", typeof(Patches), nameof(ChangeProbePrompts)); NomaiVR.Post <ShipPromptController>("LateInitialize", typeof(Patches), nameof(RemoveShipPrompts)); NomaiVR.Post <ShipPromptController>("Awake", typeof(Patches), nameof(ChangeShipPrompts)); NomaiVR.Post <NomaiTranslatorProp>("LateInitialize", typeof(Patches), nameof(RemoveTranslatorPrompts)); NomaiVR.Post <NomaiTranslatorProp>("Awake", typeof(Patches), nameof(ChangeTranslatorPrompts)); NomaiVR.Post <SignalscopePromptController>("LateInitialize", typeof(Patches), nameof(RemoveSignalscopePrompts)); NomaiVR.Post <SignalscopePromptController>("Awake", typeof(Patches), nameof(ChangeSignalscopePrompts)); NomaiVR.Post <SatelliteSnapshotController>("OnPressInteract", typeof(Patches), nameof(RemoveSatellitePrompts)); NomaiVR.Post <SatelliteSnapshotController>("Awake", typeof(Patches), nameof(ChangeSatellitePrompts)); NomaiVR.Post <PlayerSpawner>("Awake", typeof(Patches), nameof(RemoveJoystickPrompts)); NomaiVR.Post <ToolModeUI>("LateInitialize", typeof(Patches), nameof(RemoveToolModePrompts)); NomaiVR.Pre <LockOnReticule>("Init", typeof(Patches), nameof(InitLockOnReticule)); // Prevent probe launcher from moving the prompts around. NomaiVR.Empty <PromptManager>("OnProbeSnapshot"); NomaiVR.Empty <PromptManager>("OnProbeSnapshotRemoved"); NomaiVR.Empty <PromptManager>("OnProbeLauncherEquipped"); NomaiVR.Empty <PromptManager>("OnProbeLauncherUnequipped"); // Load new icons. var harmony = HarmonyInstance.Create("nomaivr"); var initMethod = typeof(InputTranslator).GetMethod("GetButtonTexture", new[] { typeof(XboxButton) }); var harmonyMethod = new HarmonyMethod(typeof(Patches), nameof(PostInitTranslator)); harmony.Patch(initMethod, null, harmonyMethod); var assetBundle = NomaiVR.Helper.Assets.LoadBundle("assets/input-icons"); _holdTexture = assetBundle.LoadAsset <Texture2D>("assets/hold.png"); _interactTexture = assetBundle.LoadAsset <Texture2D>("assets/interact.png"); _jumpTexture = assetBundle.LoadAsset <Texture2D>("assets/jump.png"); _backTexture = assetBundle.LoadAsset <Texture2D>("assets/back.png"); _toolUnequipPrompts = new List <ScreenPrompt>(2); }
public override void ApplyPatches() { NomaiVR.Pre <SingleAxisCommand>("UpdateInputCommand", typeof(Patch), nameof(SingleAxisUpdate)); NomaiVR.Pre <OWInput>("UpdateActiveInputDevice", typeof(Patch), nameof(OWInputUpdate)); NomaiVR.Pre <OWInput>("Awake", typeof(Patch), nameof(PostEnableListenForAllJoysticks)); NomaiVR.Post <PadEZ.PadManager_OW>("GetAxis", typeof(Patch), nameof(GetAxis)); NomaiVR.Post <PlayerResources>("Awake", typeof(Patch), nameof(PlayerResourcesAwake)); NomaiVR.Post <PadEZ.PadManager_OW>("GetKey", typeof(Patch), nameof(ResetPadManagerKeyboard)); NomaiVR.Post <PadEZ.PadManager_OW>("GetKeyDown", typeof(Patch), nameof(ResetPadManagerKeyboard)); NomaiVR.Post <PadEZ.PadManager_OW>("GetKeyUp", typeof(Patch), nameof(ResetPadManagerKeyboard)); NomaiVR.Post <OWInput>("IsGamepadEnabled", typeof(Patch), nameof(PostIsGamepadEnabled)); NomaiVR.Post <PadEZ.PadManager_OW>("IsGamepadActive", typeof(Patch), nameof(PostIsGamepadEnabled)); NomaiVR.Pre <DoubleAxisCommand>("UpdateInputCommand", typeof(Patch), nameof(PreUpdateDoubleAxisCommand)); NomaiVR.Pre <SubmitActionMenu>("Submit", typeof(Patch), nameof(PreSubmitActionMenu)); var rumbleMethod = typeof(RumbleManager).GetAnyMethod("Update"); NomaiVR.Helper.HarmonyHelper.AddPrefix(rumbleMethod, typeof(Patch), nameof(PreUpdateRumble)); }
void Start() { NomaiVR.Log("Start Menus"); // Make UI elements draw on top of everything. Canvas.GetDefaultCanvasMaterial().SetInt("unity_GUIZTestMode", (int)CompareFunction.Always); var scene = LoadManager.GetCurrentScene(); if (scene == OWScene.SolarSystem) { // Make sleep timer canvas visible while eyes closed. Locator.GetUIStyleManager().transform.Find("SleepTimerCanvas").gameObject.layer = LayerMask.NameToLayer("VisibleToPlayer"); } else if (scene == OWScene.TitleScreen) { var animatedTitle = GameObject.Find("TitleCanvasHack").GetComponent <Canvas>(); animatedTitle.renderMode = RenderMode.ScreenSpaceOverlay; } ScreenCanvasesToWorld(); if (SceneManager.GetActiveScene().name == "SolarSystem") { GlobalMessenger.AddListener("WakeUp", OnWakeUp); var animatedTitleChild = animatedTitle.transform.GetChild(0).GetComponent <RectTransform>(); animatedTitleChild.anchorMax = Vector2.one * 0.5f; animatedTitleChild.anchorMin = Vector2.one * 0.5f; var mainMenu = GameObject.Find("TitleLayoutGroup").GetComponent <RectTransform>(); mainMenu.position = Vector3.zero; // Cant't get the footer to look good, so I'm hiding it. GameObject.Find("FooterBlock").SetActive(false); // Make the camera start looking forward instead of some random direction. var cameraSocket = GameObject.Find("CameraSocket").transform; cameraSocket.rotation = Quaternion.identity; } ScreenCanvasesToWorld(); }
public override void ApplyPatches() { NomaiVR.Post <NomaiRemoteCameraPlatform>("SwitchToRemoteCamera", typeof(Patch), nameof(Patch.SwitchToRemoteCamera)); }
public override void ApplyPatches() { NomaiVR.Post <PlayerCharacterController>("UpdateTurning", typeof(Patch), nameof(Patch.PatchTurning)); }
internal void Update() { var position = transform.localPosition; if (!_angleMode) { if (Input.GetKeyDown(KeyCode.Keypad7)) { position.x += positionDelta; } if (Input.GetKeyDown(KeyCode.Keypad4)) { position.x -= positionDelta; } if (Input.GetKeyDown(KeyCode.Keypad8)) { position.y += positionDelta; } if (Input.GetKeyDown(KeyCode.Keypad5)) { position.y -= positionDelta; } if (Input.GetKeyDown(KeyCode.Keypad9)) { position.z += positionDelta; } if (Input.GetKeyDown(KeyCode.Keypad6)) { position.z -= positionDelta; } } var rotation = transform.localRotation; if (_angleMode) { if (Input.GetKeyDown(KeyCode.Keypad7)) { rotation *= Quaternion.Euler(angleDelta, 0, 0); } if (Input.GetKeyDown(KeyCode.Keypad4)) { rotation *= Quaternion.Euler(-angleDelta, 0, 0); } if (Input.GetKeyDown(KeyCode.Keypad8)) { rotation *= Quaternion.Euler(0, angleDelta, 0); } if (Input.GetKeyDown(KeyCode.Keypad5)) { rotation *= Quaternion.Euler(0, -angleDelta, 0); } if (Input.GetKeyDown(KeyCode.Keypad9)) { rotation *= Quaternion.Euler(0, 0, angleDelta); } if (Input.GetKeyDown(KeyCode.Keypad6)) { rotation *= Quaternion.Euler(0, 0, -angleDelta); } } var scale = transform.localScale; if (Input.GetKeyDown(KeyCode.Keypad1)) { scale += scaleDelta; } if (Input.GetKeyDown(KeyCode.Keypad2)) { scale -= scaleDelta; } if (Input.GetKeyDown(KeyCode.Keypad0)) { _angleMode = !_angleMode; } if (Input.anyKeyDown) { transform.localPosition = position; transform.localRotation = rotation; transform.localScale = scale; var angles = transform.localEulerAngles; NomaiVR.Log("Position: new Vector3(" + Round(position.x) + "f, " + Round(position.y) + "f, " + Round(position.z) + "f)"); NomaiVR.Log("Rotation: Quaternion.Euler(" + Round(angles.x) + "f, " + Round(angles.y) + "f, " + Round(angles.z) + "f)"); NomaiVR.Log("Scale: " + scale); } }
public static void Patch() { NomaiVR.Post <ToolModeSwapper>("IsTranslatorEquipPromptAllowed", typeof(Patches), nameof(IsPromptAllowed)); NomaiVR.Post <ToolModeSwapper>("GetAutoEquipTranslator", typeof(Patches), nameof(IsPromptAllowed)); NomaiVR.Post <ToolModeSwapper>("IsNomaiTextInFocus", typeof(Patches), nameof(IsPromptAllowed)); }