コード例 #1
0
 public void KeyDown(KeyboardInputEventArgs e)
 {
     if (_generatingGalaxy)
     {
         return;
     }
     if (e.Key == KeyboardKeys.Escape)
     {
         if (_showingSelection)
         {
             //Close the race selection
             _showingSelection = false;
             return;
         }
         _gameMain.ChangeToScreen(Screen.MainMenu);
     }
     if (_playerEmperorName.KeyDown(e))
     {
         return;
     }
     if (_playerHomeworldName.KeyDown(e))
     {
         return;
     }
 }
コード例 #2
0
ファイル: InGameMenu.cs プロジェクト: Beyonders/Beyond-Beyaan
 public override bool KeyDown(KeyboardInputEventArgs e)
 {
     if (_promptShowing)
     {
         bool result = _saveGameNameField.KeyDown(e);
         if (e.Key == KeyboardKeys.Enter || e.Key == KeyboardKeys.Return)
         {
             result         = true;
             _promptShowing = false;
             _gameMain.SaveGame(_saveGameNameField.Text);
             GetSaveList();                     //Refresh the list after saving
         }
         else if (e.Key == KeyboardKeys.Escape)
         {
             _promptShowing = false;
             result         = true;
         }
         return(result);
     }
     if (e.Key == KeyboardKeys.Escape && CloseWindow != null)
     {
         CloseWindow();
         return(true);
     }
     return(false);
 }
コード例 #3
0
 public override bool KeyDown(GorgonLibrary.InputDevices.KeyboardInputEventArgs e)
 {
     if (_name.KeyDown(e))
     {
         _currentSystem.Name = _name.Text;
         return(true);
     }
     return(false);
 }
コード例 #4
0
 public override bool KeyDown(GorgonLibrary.InputDevices.KeyboardInputEventArgs e)
 {
     if (_showingText)
     {
         if ((e.Key == GorgonLibrary.InputDevices.KeyboardKeys.Enter || e.Key == GorgonLibrary.InputDevices.KeyboardKeys.Return) && !string.IsNullOrEmpty(_nameTextBox.Text))
         {
             _starSystem.Name = _nameTextBox.Text;
             _colonizing      = false;
             _showingText     = false;
             //Done
             if (Completed != null)
             {
                 Completed();
             }
         }
         _nameTextBox.KeyDown(e);
     }
     else if (e.Key == GorgonLibrary.InputDevices.KeyboardKeys.Enter || e.Key == GorgonLibrary.InputDevices.KeyboardKeys.Return)
     {
         _showingText    = true;
         _landingShipPos = _gameMain.ScreenHeight / 2 + 50;
     }
     return(true);
 }