Beyond_Beyaan.Screens.ShipDesignScreen.KeyDown C# (CSharp) Метод

KeyDown() публичный Метод

public KeyDown ( KeyboardInputEventArgs e ) : bool
e KeyboardInputEventArgs
Результат bool
        public override bool KeyDown(KeyboardInputEventArgs e)
        {
            if (_nameField.KeyDown(e))
            {
                //Update the ship design with the text from name field
                _shipDesign.Name = _nameField.Text;
                return true;
            }
            if (e.Key == KeyboardKeys.Escape)
            {
                if (_selectionShowing)
                {
                    _selectionShowing = false;
                    return true;
                }
                if (_fleetSpecsShowing)
                {
                    _fleetSpecsShowing = false;
                    if (_gameMain.EmpireManager.CurrentEmpire.FleetManager.CurrentDesigns.Count < 6)
                    {
                        _gameMain.EmpireManager.CurrentEmpire.FleetManager.AddShipDesign(_shipDesign);
                    }
                    //In any case, close the window
                    if (CloseWindow != null)
                    {
                        CloseWindow();
                    }
                    return true;
                }
            }

            return false;
        }