示例#1
0
 public void LoadFleetAndSystem(Fleet fleet)
 {
     _colonizingFleet = fleet;
     _starSystem      = fleet.AdjacentSystem;
     _colonyShips     = new List <Ship>();
     foreach (var ship in _colonizingFleet.OrderedShips)
     {
         foreach (var special in ship.Specials)
         {
             if (special == null)
             {
                 continue;
             }
             if (special.Technology.Colony >= _starSystem.Planets[0].ColonyRequirement)
             {
                 _colonyShips.Add(ship);
                 break;
             }
         }
     }
     //TODO: Add scrollbar to support more than 4 different colony ship designs
     _maxShips = _colonyShips.Count > 4 ? 4 : _colonyShips.Count;
     for (int i = 0; i < _maxShips; i++)
     {
         _shipButtons[i].SetText(_colonyShips[i].Name + (_colonizingFleet.Ships[_colonyShips[i]] > 1 ? " (" + _colonizingFleet.Ships[_colonyShips[i]] + ")" : string.Empty));
     }
     _shipButtons[0].Selected = true;
     _systemNameLabel.SetText(_starSystem.Name);
     _systemNameLabel.MoveTo(_xPos + 300 - (int)(_systemNameLabel.GetWidth() / 2), _yPos + 130 - (int)(_systemNameLabel.GetHeight() / 2));
 }
示例#2
0
        public override void MoveWindow()
        {
            base.MoveWindow();

            _empireBackground.MoveTo(_xPos + 10, _yPos + 10);
            _empireNameLabel.MoveTo(_xPos + 150 - (int)(_empireNameLabel.GetWidth() / 2), _yPos + 30 - (int)(_empireNameLabel.GetHeight() / 2));
            _previousFleet.MoveTo(_xPos + 18, _yPos + 22);
            _nextFleet.MoveTo(_xPos + 266, _yPos + 22);

            for (int i = 0; i < _shipBackground.Length; i++)
            {
                _shipBackground[i].MoveTo(_xPos + 10, _yPos + 55 + (i * 55));
                _shipLabels[i].MoveTo(_xPos + 15, _yPos + 65 + (i * 55));
                _shipSliders[i].MoveTo(_xPos + 15, _yPos + 85 + (i * 55));
            }
        }
示例#3
0
        public bool Initialize(GameMain gameMain, out string reason)
        {
            int x = (gameMain.ScreenWidth / 2) - 533;
            int y = (gameMain.ScreenHeight / 2) - 300;

            if (!Initialize(x, y, 1066, 600, StretchableImageType.MediumBorder, gameMain, false, gameMain.Random, out reason))
            {
                return false;
            }

            x += 20;
            y += 20;

            _columnHeaders = new BBStretchButton[8];
            for (int i = 0; i < _columnHeaders.Length; i++)
            {
                _columnHeaders[i] = new BBStretchButton();
            }
            _columnCells = new BBStretchButton[8][];
            for (int i = 0; i < _columnCells.Length; i++)
            {
                _columnCells[i] = new BBStretchButton[13];
                for (int j = 0; j < _columnCells[i].Length; j++)
                {
                    _columnCells[i][j] = new BBStretchButton();
                }
            }

            if (!_columnHeaders[0].Initialize("Planet", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonBG, x, y, 280, 30, _gameMain.Random, out reason))
            {
                return false;
            }
            for (int i = 0; i < 13; i++)
            {
                if (!_columnCells[0][i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x, y + 30 + (i * 30), 280, 30, _gameMain.Random, out reason))
                {
                    return false;
                }
            }

            x += 280;
            if (!_columnHeaders[1].Initialize("Population", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonBG, x, y, 90, 30, _gameMain.Random, out reason))
            {
                return false;
            }
            for (int i = 0; i < 13; i++)
            {
                if (!_columnCells[1][i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x, y + 30 + (i * 30), 90, 30, _gameMain.Random, out reason))
                {
                    return false;
                }
            }

            x += 90;
            if (!_columnHeaders[2].Initialize("Buildings", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonBG, x, y, 90, 30, _gameMain.Random, out reason))
            {
                return false;
            }
            for (int i = 0; i < 13; i++)
            {
                if (!_columnCells[2][i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x, y + 30 + (i * 30), 90, 30, _gameMain.Random, out reason))
                {
                    return false;
                }
            }

            x += 90;
            if (!_columnHeaders[3].Initialize("Bases", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonBG, x, y, 80, 30, _gameMain.Random, out reason))
            {
                return false;
            }
            for (int i = 0; i < 13; i++)
            {
                if (!_columnCells[3][i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x, y + 30 + (i * 30), 80, 30, _gameMain.Random, out reason))
                {
                    return false;
                }
            }

            x += 80;
            if (!_columnHeaders[4].Initialize("Waste", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonBG, x, y, 80, 30, _gameMain.Random, out reason))
            {
                return false;
            }
            for (int i = 0; i < 13; i++)
            {
                if (!_columnCells[4][i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x, y + 30 + (i * 30), 80, 30, _gameMain.Random, out reason))
                {
                    return false;
                }
            }

            x += 80;
            if (!_columnHeaders[5].Initialize("Industry", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonBG, x, y, 80, 30, _gameMain.Random, out reason))
            {
                return false;
            }
            for (int i = 0; i < 13; i++)
            {
                if (!_columnCells[5][i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x, y + 30 + (i * 30), 80, 30, _gameMain.Random, out reason))
                {
                    return false;
                }
            }

            x += 80;
            if (!_columnHeaders[6].Initialize("Constructing", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonBG, x, y, 250, 30, _gameMain.Random, out reason))
            {
                return false;
            }
            for (int i = 0; i < 13; i++)
            {
                if (!_columnCells[6][i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x, y + 30 + (i * 30), 250, 30, _gameMain.Random, out reason))
                {
                    return false;
                }
            }

            x += 250;
            if (!_columnHeaders[7].Initialize("Notes", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonBG, x, y, 60, 30, _gameMain.Random, out reason))
            {
                return false;
            }
            for (int i = 0; i < 13; i++)
            {
                if (!_columnCells[7][i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x, y + 30 + (i * 30), 60, 30, _gameMain.Random, out reason))
                {
                    return false;
                }
            }
            x += 60;
            _scrollBar = new BBScrollBar();
            if (!_scrollBar.Initialize(x, y + 30, 390, 13, 13, false, false, _gameMain.Random, out reason))
            {
                return false;
            }

            _expensesBackground = new BBStretchableImage();
            _incomeBackground = new BBStretchableImage();
            _reserves = new BBStretchableImage();

            _expenseTitle = new BBLabel();
            _incomeTitle = new BBLabel();

            _expenses = new BBStretchButton[4];
            _expenseLabels = new BBLabel[4];
            _incomes = new BBStretchButton[2];
            _incomeLabels = new BBLabel[2];
            for (int i = 0; i < 4; i++)
            {
                _expenses[i] = new BBStretchButton();
                _expenseLabels[i] = new BBLabel();
            }
            for (int i = 0; i < 2; i++)
            {
                _incomes[i] = new BBStretchButton();
                _incomeLabels[i] = new BBLabel();
            }

            x = (gameMain.ScreenWidth / 2) - 513;
            y = (gameMain.ScreenHeight / 2) + 143;

            if (!_expensesBackground.Initialize(x, y, 476, 140, StretchableImageType.ThinBorderBG, _gameMain.Random, out reason))
            {
                return false;
            }
            if (!_expenseTitle.Initialize(0, 0, "Expenses", Color.Gold, "LargeComputerFont", out reason))
            {
                return false;
            }
            _expenseTitle.MoveTo((int)(x + 238 - _expenseTitle.GetWidth() / 2), y + 5);
            if (!_expenses[0].Initialize("Ships", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x + 10, y + 50,  228, 40, _gameMain.Random, out reason))
            {
                return false;
            }
            _expenses[0].SetTextColor(Color.Orange, Color.Empty);
            if (!_expenseLabels[0].Initialize(x + 228, y + 65, string.Empty, Color.White, out reason))
            {
                return false;
            }
            _expenseLabels[0].SetAlignment(true);
            if (!_expenses[1].Initialize("Bases", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x + 10, y + 90, 228, 40, _gameMain.Random, out reason))
            {
                return false;
            }
            _expenses[1].SetTextColor(Color.Orange, Color.Empty);
            if (!_expenseLabels[1].Initialize(x + 228, y + 105, string.Empty, Color.White, out reason))
            {
                return false;
            }
            _expenseLabels[1].SetAlignment(true);
            if (!_expenses[2].Initialize("Spying", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x + 238, y + 50, 228, 40, _gameMain.Random, out reason))
            {
                return false;
            }
            _expenses[2].SetTextColor(Color.Orange, Color.Empty);
            if (!_expenseLabels[2].Initialize(x + 456, y + 65, string.Empty, Color.White, out reason))
            {
                return false;
            }
            _expenseLabels[2].SetAlignment(true);
            if (!_expenses[3].Initialize("Security", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x + 238, y + 90, 228, 40, _gameMain.Random, out reason))
            {
                return false;
            }
            _expenses[3].SetTextColor(Color.Orange, Color.Empty);
            if (!_expenseLabels[3].Initialize(x + 456, y + 105, string.Empty, Color.White, out reason))
            {
                return false;
            }
            _expenseLabels[3].SetAlignment(true);
            x += 476;

            if (!_incomeBackground.Initialize(x, y, 250, 140, StretchableImageType.ThinBorderBG, _gameMain.Random, out reason))
            {
                return false;
            }
            if (!_incomeTitle.Initialize(0, 0, "Incomes", Color.Gold, "LargeComputerFont", out reason))
            {
                return false;
            }
            if (!_incomes[0].Initialize("Planets", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x + 10, y + 50, 230, 40, _gameMain.Random, out reason))
            {
                return false;
            }
            _incomes[0].SetTextColor(Color.Orange, Color.Empty);
            if (!_incomeLabels[0].Initialize(x + 230, y + 65, string.Empty, Color.White, out reason))
            {
                return false;
            }
            _incomeLabels[0].SetAlignment(true);
            if (!_incomes[1].Initialize("Trade", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x + 10, y + 90, 230, 40, _gameMain.Random, out reason))
            {
                return false;
            }
            _incomes[1].SetTextColor(Color.Orange, Color.Empty);
            if (!_incomeLabels[1].Initialize(x + 230, y + 105, string.Empty, Color.White, out reason))
            {
                return false;
            }
            _incomeLabels[1].SetAlignment(true);
            _incomeTitle.MoveTo((int)(x + 125 - _incomeTitle.GetWidth() / 2), y + 5);
            x += 250;

            if (!_reserves.Initialize(x, y, 300, 140, StretchableImageType.ThinBorderBG, _gameMain.Random, out reason))
            {
                return false;
            }
            _reserveSlider = new BBScrollBar();
            _reservesLabel = new BBLabel();
            _reservesAmount = new BBLabel();

            _transferSlider = new BBScrollBar();
            _transferLabel = new BBLabel();
            _transferAmount = new BBLabel();
            _transferReserves = new BBStretchButton();

            if (!_reservesLabel.Initialize(x + 10, y + 10, "Reserve:", Color.Orange, out reason))
            {
                return false;
            }
            if (!_reservesAmount.Initialize(x + 280, y + 10, string.Empty, Color.White, out reason))
            {
                return false;
            }
            if (!_reserveSlider.Initialize(x + 10, y + 33, 280, 0, 20, true, true, _gameMain.Random, out reason))
            {
                return false;
            }
            if (!_transferLabel.Initialize(x + 10, y + 51, "Amount to transfer:", Color.Orange, out reason))
            {
                return false;
            }
            if (!_transferAmount.Initialize(x + 280, y + 51, string.Empty, Color.White, out reason))
            {
                return false;
            }
            if (!_transferSlider.Initialize(x + 10, y + 72, 280, 0, 200, true, true, _gameMain.Random, out reason))
            {
                return false;
            }
            if (!_transferReserves.Initialize("Transfer reserves to selected planet", ButtonTextAlignment.CENTER, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x + 10, y + 95, 280, 35, _gameMain.Random, out reason))
            {
                return false;
            }
            _reservesAmount.SetAlignment(true);
            _transferAmount.SetAlignment(true);

            return true;
        }
示例#4
0
 public void MouseUp(int x, int y, int whichButton)
 {
     if (whichButton != 1)
     {
         return;
     }
     if (_generatingGalaxy)
     {
         return;
     }
     if (_showingSelection)
     {
         _raceSelection.MouseUp(x, y);
         return;
     }
     _playerEmperorName.MouseUp(x, y);
     _playerHomeworldName.MouseUp(x, y);
     _numericUpDownAI.MouseUp(x, y);
     _difficultyComboBox.MouseUp(x, y);
     if (_playerRaceDescription.MouseUp(x, y))
     {
         return;
     }
     if (_galaxyComboBox.MouseUp(x, y))
     {
         if (!_galaxyComboBox.Dropped)
         {
             //Update galaxy here
             _generatingGalaxy = true;
             _busyText.MoveTo((int)((_gameMain.ScreenWidth / 2) - (_busyText.GetWidth() / 2)), (int)((_gameMain.ScreenHeight / 2) - (_busyText.GetHeight() / 2)));
             _gameMain.Galaxy.OnGenerateComplete += OnGalaxyGenerated;
             string reason;
             if (!_gameMain.Galaxy.GenerateGalaxy((GALAXYTYPE)_galaxyComboBox.SelectedIndex, 1, 1, _gameMain.Random, out reason))
             {
                 _generatingGalaxy = false;
             }
         }
     }
     if (_playerRaceButton.MouseUp(x, y))
     {
         _showingSelection = true;
         _raceSelection.SetCurrentPlayerInfo(0, _playerRaces[0], _playerColors[0]);
     }
     for (int i = 0; i < _numericUpDownAI.Value; i++)
     {
         if (_AIRaceButtons[i].MouseUp(x, y))
         {
             _showingSelection = true;
             _raceSelection.SetCurrentPlayerInfo(i + 1, _playerRaces[i + 1], _playerColors[i + 1]);
         }
     }
     if (_cancelButton.MouseUp(x, y))
     {
         _gameMain.ChangeToScreen(Screen.MainMenu);
     }
     if (_okButton.MouseUp(x, y))
     {
         //See if the galaxy is generated.  If not, generate it now, then proceed to player setup
         if (_gameMain.Galaxy.GetAllStars().Count == 0)
         {
             SetUpGalaxy();
         }
         else
         {
             SetUpEmpiresAndStart();
         }
     }
 }
示例#5
0
        public bool Initialize(GameMain gameMain, out string reason)
        {
            int x = (gameMain.ScreenWidth / 2) - 533;
            int y = (gameMain.ScreenHeight / 2) - 300;

            if (!Initialize(x, y, 1066, 600, StretchableImageType.MediumBorder, gameMain, false, gameMain.Random, out reason))
            {
                return(false);
            }

            x += 20;
            y += 20;

            _columnHeaders = new BBStretchButton[8];
            for (int i = 0; i < _columnHeaders.Length; i++)
            {
                _columnHeaders[i] = new BBStretchButton();
            }
            _columnCells = new BBStretchButton[8][];
            for (int i = 0; i < _columnCells.Length; i++)
            {
                _columnCells[i] = new BBStretchButton[13];
                for (int j = 0; j < _columnCells[i].Length; j++)
                {
                    _columnCells[i][j] = new BBStretchButton();
                }
            }

            if (!_columnHeaders[0].Initialize("Planet", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonBG, x, y, 280, 30, _gameMain.Random, out reason))
            {
                return(false);
            }
            for (int i = 0; i < 13; i++)
            {
                if (!_columnCells[0][i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x, y + 30 + (i * 30), 280, 30, _gameMain.Random, out reason))
                {
                    return(false);
                }
            }

            x += 280;
            if (!_columnHeaders[1].Initialize("Population", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonBG, x, y, 90, 30, _gameMain.Random, out reason))
            {
                return(false);
            }
            for (int i = 0; i < 13; i++)
            {
                if (!_columnCells[1][i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x, y + 30 + (i * 30), 90, 30, _gameMain.Random, out reason))
                {
                    return(false);
                }
            }

            x += 90;
            if (!_columnHeaders[2].Initialize("Buildings", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonBG, x, y, 90, 30, _gameMain.Random, out reason))
            {
                return(false);
            }
            for (int i = 0; i < 13; i++)
            {
                if (!_columnCells[2][i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x, y + 30 + (i * 30), 90, 30, _gameMain.Random, out reason))
                {
                    return(false);
                }
            }

            x += 90;
            if (!_columnHeaders[3].Initialize("Bases", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonBG, x, y, 80, 30, _gameMain.Random, out reason))
            {
                return(false);
            }
            for (int i = 0; i < 13; i++)
            {
                if (!_columnCells[3][i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x, y + 30 + (i * 30), 80, 30, _gameMain.Random, out reason))
                {
                    return(false);
                }
            }

            x += 80;
            if (!_columnHeaders[4].Initialize("Waste", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonBG, x, y, 80, 30, _gameMain.Random, out reason))
            {
                return(false);
            }
            for (int i = 0; i < 13; i++)
            {
                if (!_columnCells[4][i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x, y + 30 + (i * 30), 80, 30, _gameMain.Random, out reason))
                {
                    return(false);
                }
            }

            x += 80;
            if (!_columnHeaders[5].Initialize("Industry", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonBG, x, y, 80, 30, _gameMain.Random, out reason))
            {
                return(false);
            }
            for (int i = 0; i < 13; i++)
            {
                if (!_columnCells[5][i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x, y + 30 + (i * 30), 80, 30, _gameMain.Random, out reason))
                {
                    return(false);
                }
            }

            x += 80;
            if (!_columnHeaders[6].Initialize("Constructing", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonBG, x, y, 250, 30, _gameMain.Random, out reason))
            {
                return(false);
            }
            for (int i = 0; i < 13; i++)
            {
                if (!_columnCells[6][i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x, y + 30 + (i * 30), 250, 30, _gameMain.Random, out reason))
                {
                    return(false);
                }
            }

            x += 250;
            if (!_columnHeaders[7].Initialize("Notes", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonBG, x, y, 60, 30, _gameMain.Random, out reason))
            {
                return(false);
            }
            for (int i = 0; i < 13; i++)
            {
                if (!_columnCells[7][i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x, y + 30 + (i * 30), 60, 30, _gameMain.Random, out reason))
                {
                    return(false);
                }
            }
            x         += 60;
            _scrollBar = new BBScrollBar();
            if (!_scrollBar.Initialize(x, y + 30, 390, 13, 13, false, false, _gameMain.Random, out reason))
            {
                return(false);
            }

            _expensesBackground = new BBStretchableImage();
            _incomeBackground   = new BBStretchableImage();
            _reserves           = new BBStretchableImage();

            _expenseTitle = new BBLabel();
            _incomeTitle  = new BBLabel();

            _expenses      = new BBStretchButton[4];
            _expenseLabels = new BBLabel[4];
            _incomes       = new BBStretchButton[2];
            _incomeLabels  = new BBLabel[2];
            for (int i = 0; i < 4; i++)
            {
                _expenses[i]      = new BBStretchButton();
                _expenseLabels[i] = new BBLabel();
            }
            for (int i = 0; i < 2; i++)
            {
                _incomes[i]      = new BBStretchButton();
                _incomeLabels[i] = new BBLabel();
            }

            x = (gameMain.ScreenWidth / 2) - 513;
            y = (gameMain.ScreenHeight / 2) + 143;

            if (!_expensesBackground.Initialize(x, y, 476, 140, StretchableImageType.ThinBorderBG, _gameMain.Random, out reason))
            {
                return(false);
            }
            if (!_expenseTitle.Initialize(0, 0, "Expenses", Color.Gold, "LargeComputerFont", out reason))
            {
                return(false);
            }
            _expenseTitle.MoveTo((int)(x + 238 - _expenseTitle.GetWidth() / 2), y + 5);
            if (!_expenses[0].Initialize("Ships", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x + 10, y + 50, 228, 40, _gameMain.Random, out reason))
            {
                return(false);
            }
            _expenses[0].SetTextColor(Color.Orange, Color.Empty);
            if (!_expenseLabels[0].Initialize(x + 228, y + 65, string.Empty, Color.White, out reason))
            {
                return(false);
            }
            _expenseLabels[0].SetAlignment(true);
            if (!_expenses[1].Initialize("Bases", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x + 10, y + 90, 228, 40, _gameMain.Random, out reason))
            {
                return(false);
            }
            _expenses[1].SetTextColor(Color.Orange, Color.Empty);
            if (!_expenseLabels[1].Initialize(x + 228, y + 105, string.Empty, Color.White, out reason))
            {
                return(false);
            }
            _expenseLabels[1].SetAlignment(true);
            if (!_expenses[2].Initialize("Spying", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x + 238, y + 50, 228, 40, _gameMain.Random, out reason))
            {
                return(false);
            }
            _expenses[2].SetTextColor(Color.Orange, Color.Empty);
            if (!_expenseLabels[2].Initialize(x + 456, y + 65, string.Empty, Color.White, out reason))
            {
                return(false);
            }
            _expenseLabels[2].SetAlignment(true);
            if (!_expenses[3].Initialize("Security", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x + 238, y + 90, 228, 40, _gameMain.Random, out reason))
            {
                return(false);
            }
            _expenses[3].SetTextColor(Color.Orange, Color.Empty);
            if (!_expenseLabels[3].Initialize(x + 456, y + 105, string.Empty, Color.White, out reason))
            {
                return(false);
            }
            _expenseLabels[3].SetAlignment(true);
            x += 476;

            if (!_incomeBackground.Initialize(x, y, 250, 140, StretchableImageType.ThinBorderBG, _gameMain.Random, out reason))
            {
                return(false);
            }
            if (!_incomeTitle.Initialize(0, 0, "Incomes", Color.Gold, "LargeComputerFont", out reason))
            {
                return(false);
            }
            if (!_incomes[0].Initialize("Planets", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x + 10, y + 50, 230, 40, _gameMain.Random, out reason))
            {
                return(false);
            }
            _incomes[0].SetTextColor(Color.Orange, Color.Empty);
            if (!_incomeLabels[0].Initialize(x + 230, y + 65, string.Empty, Color.White, out reason))
            {
                return(false);
            }
            _incomeLabels[0].SetAlignment(true);
            if (!_incomes[1].Initialize("Trade", ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x + 10, y + 90, 230, 40, _gameMain.Random, out reason))
            {
                return(false);
            }
            _incomes[1].SetTextColor(Color.Orange, Color.Empty);
            if (!_incomeLabels[1].Initialize(x + 230, y + 105, string.Empty, Color.White, out reason))
            {
                return(false);
            }
            _incomeLabels[1].SetAlignment(true);
            _incomeTitle.MoveTo((int)(x + 125 - _incomeTitle.GetWidth() / 2), y + 5);
            x += 250;

            if (!_reserves.Initialize(x, y, 300, 140, StretchableImageType.ThinBorderBG, _gameMain.Random, out reason))
            {
                return(false);
            }
            _reserveSlider  = new BBScrollBar();
            _reservesLabel  = new BBLabel();
            _reservesAmount = new BBLabel();

            _transferSlider   = new BBScrollBar();
            _transferLabel    = new BBLabel();
            _transferAmount   = new BBLabel();
            _transferReserves = new BBStretchButton();

            if (!_reservesLabel.Initialize(x + 10, y + 10, "Reserve:", Color.Orange, out reason))
            {
                return(false);
            }
            if (!_reservesAmount.Initialize(x + 280, y + 10, string.Empty, Color.White, out reason))
            {
                return(false);
            }
            if (!_reserveSlider.Initialize(x + 10, y + 33, 280, 0, 20, true, true, _gameMain.Random, out reason))
            {
                return(false);
            }
            if (!_transferLabel.Initialize(x + 10, y + 51, "Amount to transfer:", Color.Orange, out reason))
            {
                return(false);
            }
            if (!_transferAmount.Initialize(x + 280, y + 51, string.Empty, Color.White, out reason))
            {
                return(false);
            }
            if (!_transferSlider.Initialize(x + 10, y + 72, 280, 0, 200, true, true, _gameMain.Random, out reason))
            {
                return(false);
            }
            if (!_transferReserves.Initialize("Transfer reserves to selected planet", ButtonTextAlignment.CENTER, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, x + 10, y + 95, 280, 35, _gameMain.Random, out reason))
            {
                return(false);
            }
            _reservesAmount.SetAlignment(true);
            _transferAmount.SetAlignment(true);

            return(true);
        }
 public void LoadExploredSystem(StarSystem system)
 {
     _informationText.SetText(string.Format("{0} System has been explored", system.Name));
     _informationText.MoveTo(_xPos + 200 - (int)(_informationText.GetWidth() / 2), _yPos + 50 - (int)(_informationText.GetHeight() / 2));
 }