/// <summary> /// Backup method to ensure the mouse gets released as needed. /// </summary> public void FixMouse() { if (InvShown() || !Window.Focused || UIConsole.Open || IsChatVisible() || IsMainMenu || CScreen != TheGameScreen) // TODO: CScreen.ShouldCaptureMouse? { MouseHandler.ReleaseMouse(); } else { MouseHandler.CaptureMouse(); } }
public override void Execute(CommandEntry entry) { if (MouseHandler.MouseCaptured) { entry.Good("Mouse released."); MouseHandler.ReleaseMouse(); } else { entry.Good("Mouse captured."); MouseHandler.CaptureMouse(); } }
public override void SwitchTo() { MouseHandler.CaptureMouse(); }