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;
}