public static void Toggle(bool death = false) { var enable = !Enabled; var isMainMenu = !DalamudApi.Condition.Any(); if (enable) { locked = false; speed = 1; position = DalamudApi.ClientState.LocalPlayer?.Position is { } pos ? new(pos.X, pos.Z, pos.Y + 1) : new(); onDeath = death; gameCamera = isMainMenu ? Game.cameraManager->MenuCamera : Game.cameraManager->WorldCamera; if (isMainMenu) { *(byte *)((IntPtr)gameCamera + 0x2A0) = 0; } gameCamera->MinVRotation = -1.559f; gameCamera->MaxVRotation = 1.559f; gameCamera->CurrentFoV = gameCamera->MinFoV = gameCamera->MaxFoV = 0.78f; gameCamera->CurrentZoom = gameCamera->MinZoom = gameCamera->MaxZoom = 0.1f; Game.zoomDelta = 0; gameCamera->LookAtHeightOffset = 0; gameCamera->Mode = 1; Game.cameraNoCollideReplacer.Enable(); if (!isMainMenu) { Game.ForceDisableMovement++; Cammy.PrintEcho("Additional Controls:" + //"\nMove Keybinds - Move," + //"\nJump / Ascend - Up," + //"\nDescend - Down," + "\nShift (Hold) - Speed up" + "\nZoom / Controller Zoom (Autorun + Look Up / Down) - Change Speed" + "\nC / Controller Dismount (Autorun + Change Hotbar Set) - Reset" + "\nCycle through Enemies (Nearest to Farthest) / Controller Select HUD - Lock" + "\nCycle through Enemies (Farthest to Nearest) / Controller Open Main Menu - Stop"); } } else { gameCamera = null; Game.cameraNoCollideReplacer.Disable(); if (!isMainMenu) { if (!locked && Game.ForceDisableMovement > 0) { Game.ForceDisableMovement--; } new CameraConfigPreset().Apply(); PresetManager.DisableCameraPresets(); } } if (!isMainMenu) { return; }
private void TerritoryChanged(object sender, ushort id) { if (!pluginReady) { return; } Game.isChangingAreas = true; Game.changingAreaDelay = 1; PresetManager.DisableCameraPresets(); }
private void Logout(object sender, EventArgs e) { if (!pluginReady) { return; } Game.cachedDefaultLookAtHeight = null; Game.isLoggedIn = false; PresetManager.DisableCameraPresets(); }