/*public void OpenDeathMenu() * { * new DeathMenu(this.mStateMgr); * this.SwitchGUIVisibility(true); * this.mTimeSinceGUIOpen.Reset(); * }*/ public void SwitchFreeCamMode() { VanillaPlayer mainPlayer = this.mStateMgr.MainState.CharacMgr.MainPlayer; if (mainPlayer == null) { return; } this.IsFreeCamMode = !this.IsFreeCamMode; mainPlayer.SwitchFreeCamMode(); if (this.IsFreeCamMode) { Camera cam = this.mStateMgr.Camera; Vector3 position = cam.RealPosition; Quaternion orientation = cam.RealOrientation; cam.DetachFromParent(); cam.Position = position; cam.Orientation = orientation; this.mCameraMan = new CameraMan(cam); mainPlayer.SetIsAllowedToMove(false); } else { this.InitCamera(); mainPlayer.SetIsAllowedToMove(true); this.mCameraMan = null; } }
public override void Update(float frameTime) { base.Update(frameTime); this.RTSManager.Update(frameTime); this.mBulletMgr.Update(frameTime); User user = this.mStateMgr.MainState.User; VanillaPlayer mainPlayer = this.mStateMgr.MainState.CharacMgr.MainPlayer; if (user.IsFreeCamMode && mainPlayer != null && !GUI.Visible) { bool ctrlPressed = this.mStateMgr.Controller.IsKeyDown(MOIS.KeyCode.KC_LCONTROL); mainPlayer.SetIsAllowedToMove(ctrlPressed, false); user.IsAllowedToMoveCam = !ctrlPressed; } if (this.mStateMgr.Controller.WasKeyPressed(MOIS.KeyCode.KC_F1) && !GUI.Visible) { user.SwitchFreeCamMode(); } }