Exemple #1
0
 /// <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();
     }
 }
Exemple #2
0
 public override void Execute(CommandEntry entry)
 {
     if (MouseHandler.MouseCaptured)
     {
         entry.Good("Mouse released.");
         MouseHandler.ReleaseMouse();
     }
     else
     {
         entry.Good("Mouse captured.");
         MouseHandler.CaptureMouse();
     }
 }
Exemple #3
0
 public override void SwitchTo()
 {
     MouseHandler.CaptureMouse();
 }