public bool Initialize(GameMain gameMain, out string reason) { if (!this.Initialize(gameMain.ScreenWidth / 2 - 230, gameMain.ScreenHeight / 2 - 180, 460, 360, StretchableImageType.MediumBorder, gameMain, false, gameMain.Random, out reason)) { return(false); } _discoveredTechs = new List <Technology>(); _fieldsNeedingNewTopics = new List <TechField>(); _availableTopics = new Dictionary <TechField, List <Technology> >(); _techDescriptionBackground = new BBStretchableImage(); _availableTechsToResearchBackground = new BBStretchableImage(); _instructionLabel = new BBLabel(); _techDescription = new BBTextBox(); _scrollBar = new BBScrollBar(); _availableTechsToResearchButtons = new BBInvisibleStretchButton[4]; _researchCosts = new BBLabel[4]; if (!_techDescriptionBackground.Initialize(_xPos + 20, _yPos + 20, 420, 170, StretchableImageType.ThinBorderBG, gameMain.Random, out reason)) { return(false); } if (!_availableTechsToResearchBackground.Initialize(_xPos + 20, _yPos + 220, 420, 120, StretchableImageType.ThinBorderBG, gameMain.Random, out reason)) { return(false); } if (!_instructionLabel.Initialize(_xPos + 20, _yPos + 195, "Please select an item to research", System.Drawing.Color.White, out reason)) { return(false); } if (!_techDescription.Initialize(_xPos + 165, _yPos + 33, 265, 150, true, true, "TechDescriptionTextBox", gameMain.Random, out reason)) { return(false); } if (!_scrollBar.Initialize(_xPos + 415, _yPos + 230, 100, 4, 4, false, false, gameMain.Random, out reason)) { return(false); } for (int i = 0; i < _availableTechsToResearchButtons.Length; i++) { _availableTechsToResearchButtons[i] = new BBInvisibleStretchButton(); _researchCosts[i] = new BBLabel(); if (!_availableTechsToResearchButtons[i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, _xPos + 30, _yPos + 230 + (i * 25), 385, 25, gameMain.Random, out reason)) { return(false); } if (!_availableTechsToResearchButtons[i].SetToolTip("ItemToResearch" + i + "ToolTip", string.Empty, gameMain.ScreenWidth, gameMain.ScreenHeight, gameMain.Random, out reason)) { return(false); } if (!_researchCosts[i].Initialize(_xPos + 405, _yPos + 232 + (i * 25), string.Empty, System.Drawing.Color.White, out reason)) { return(false); } _researchCosts[i].SetAlignment(true); } return(true); }
public bool Initialize(GameMain gameMain, out string reason) { _gameMain = gameMain; if (!base.Initialize((gameMain.ScreenWidth / 2) - 320, (gameMain.ScreenHeight / 2) - 320, 640, 640, StretchableImageType.MediumBorder, gameMain, false, gameMain.Random, out reason)) { return(false); } _randomSprite = SpriteManager.GetSprite("RandomRace", gameMain.Random); if (_randomSprite == null) { reason = "RandomRace sprite does not exist."; return(false); } _raceButtons = new BBStretchButton[15]; _raceScrollBar = new BBScrollBar(); _raceBackground = new BBStretchableImage(); _raceDescription = new BBTextBox(); _okButton = new BBStretchButton(); _raceManager = gameMain.RaceManager; for (int i = 0; i < _raceButtons.Length; i++) { _raceButtons[i] = new BBStretchButton(); if (!_raceButtons[i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.ThinBorderBG, StretchableImageType.ThinBorderFG, _xPos + 10, _yPos + 10 + (i * 40), 280, 40, gameMain.Random, out reason)) { return(false); } } //Add 1 for the random race option int scrollValue = (_raceManager.Races.Count + 1) < _raceButtons.Length ? _raceButtons.Length : (_raceManager.Races.Count + 1); if (!_raceScrollBar.Initialize(_xPos + 290, _yPos + 10, 600, _raceButtons.Length, scrollValue, false, false, gameMain.Random, out reason)) { return(false); } _maxVisible = (_raceManager.Races.Count + 1) > _raceButtons.Length ? _raceButtons.Length : (_raceManager.Races.Count + 1); if (_raceManager.Races.Count < 15) { _raceScrollBar.SetEnabledState(false); } if (!_raceBackground.Initialize(_xPos + 310, _yPos + 10, 310, 550, StretchableImageType.ThinBorderBG, gameMain.Random, out reason)) { return(false); } if (!_raceDescription.Initialize(_xPos + 315, _yPos + 325, 300, 215, true, true, "RaceSelectionDescriptionTextBox", gameMain.Random, out reason)) { return(false); } if (!_okButton.Initialize("Select Race", ButtonTextAlignment.CENTER, StretchableImageType.ThinBorderBG, StretchableImageType.ThinBorderFG, _xPos + 310, _yPos + 570, 310, 40, gameMain.Random, out reason)) { return(false); } RefreshRaceLabels(); RefreshRaceDescription(); reason = null; return(true); }
public bool Initialize(GameMain gameMain, out string reason) { _middleX = gameMain.ScreenWidth / 2; _middleY = gameMain.ScreenHeight / 2; if (!base.Initialize((gameMain.ScreenWidth / 2) - 210, (gameMain.ScreenHeight / 2) - 230, 420, 460, StretchableImageType.ThinBorderBG, gameMain, false, gameMain.Random, out reason)) { return(false); } _buttons = new BBStretchButton[10]; _columnValues = new List <BBLabel[]>(); _columnNames = new List <BBLabel>(); _maxVisible = 0; for (int i = 0; i < 10; i++) { _buttons[i] = new BBStretchButton(); if (!_buttons[i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, _xPos + 10, _yPos + 50 + i * 40, 380, 40, gameMain.Random, out reason)) { return(false); } if (!_buttons[i].SetToolTip("EquipmentSelection" + i, string.Empty, gameMain.ScreenWidth, gameMain.ScreenHeight, gameMain.Random, out reason)) { return(false); } } _scrollBar = new BBScrollBar(); if (!_scrollBar.Initialize(_xPos + 390, _yPos + 50, 400, 10, 10, false, false, gameMain.Random, out reason)) { return(false); } _maxVisible = 0; _numOfColumnsVisible = 0; _scrollBarVisible = false; return(true); }
public bool Initialize(GameMain gameMain, out string reason) { this._gameMain = gameMain; _buttons = new BBButton[4]; _x = (gameMain.ScreenWidth / 2) - 130; _y = (gameMain.ScreenHeight / 2); for (int i = 0; i < _buttons.Length; i++) { _buttons[i] = new BBButton(); } if (!_buttons[0].Initialize("MainButtonBG", "MainButtonFG", "Continue", "LargeComputerFont", ButtonTextAlignment.CENTER, _x, _y, 260, 40, gameMain.Random, out reason, 20, -1)) { return false; } if (!_buttons[1].Initialize("MainButtonBG", "MainButtonFG", "New Game", "LargeComputerFont", ButtonTextAlignment.CENTER, _x, _y + 50, 260, 40, gameMain.Random, out reason, 20, -1)) { return false; } if (!_buttons[2].Initialize("MainButtonBG", "MainButtonFG", "Load Game", "LargeComputerFont", ButtonTextAlignment.CENTER, _x, _y + 100, 260, 40, gameMain.Random, out reason, 20, -1)) { return false; } if (!_buttons[3].Initialize("MainButtonBG", "MainButtonFG", "Exit", "LargeComputerFont", ButtonTextAlignment.CENTER, _x, _y + 150, 260, 40, gameMain.Random, out reason, 20, -1)) { return false; } for (int i = 0; i < _buttons.Length; i++) { _buttons[i].SetTextColor(System.Drawing.Color.Gold, System.Drawing.Color.Black); } _versionLabel = new BBLabel(); if (!_versionLabel.Initialize(10, _gameMain.ScreenHeight - 30, "Version 0.59", System.Drawing.Color.White, out reason)) { return false; } _background = SpriteManager.GetSprite("MainBackground", gameMain.Random); _planet = SpriteManager.GetSprite("MainPlanetBackground", gameMain.Random); _title = SpriteManager.GetSprite("Title", gameMain.Random); _x = (gameMain.ScreenWidth / 2) - 512; _y = (gameMain.ScreenHeight / 2) - 300; _files = Utility.GetSaveGames(gameMain.GameDataSet.FullName); if (_files.Count == 0) { _buttons[0].Active = false; //Disabled Continue and Load buttons since there's no games to load _buttons[2].Active = false; } _loadBackground = new BBStretchableImage(); if (!_loadBackground.Initialize((gameMain.ScreenWidth / 2) - 225, (gameMain.ScreenHeight / 2) - 175, 450, 350, StretchableImageType.ThinBorderBG, gameMain.Random, out reason)) { return false; } _saveGameButtons = new BBInvisibleStretchButton[10]; for (int i = 0; i < _saveGameButtons.Length; i++) { _saveGameButtons[i] = new BBInvisibleStretchButton(); if (!_saveGameButtons[i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, (gameMain.ScreenWidth / 2) - 220, (gameMain.ScreenHeight / 2) - 160 + (i * 32), 420, 32, gameMain.Random, out reason)) { return false; } } _scrollBar = new BBScrollBar(); if (!_scrollBar.Initialize((gameMain.ScreenWidth / 2) + 200, (gameMain.ScreenHeight / 2) - 160, 320, 10, 10, false, false, gameMain.Random, out reason)) { return false; } _maxVisible = _files.Count > _saveGameButtons.Length ? _saveGameButtons.Length : _files.Count; if (_maxVisible < _saveGameButtons.Length) { //Disable the scrollbar _scrollBar.SetEnabledState(false); } else { _scrollBar.SetEnabledState(true); _scrollBar.SetAmountOfItems(_files.Count); } RefreshSaves(); _showingLoadMenu = false; reason = null; return true; }
public bool Initialize(GameMain gameMain, out string reason) { if (!base.Initialize((gameMain.ScreenWidth / 2) - 250, (gameMain.ScreenHeight / 2) - 200, 500, 400, StretchableImageType.MediumBorder, gameMain, false, gameMain.Random, out reason)) { return false; } int x = (gameMain.ScreenWidth / 2) - 150; int y = (gameMain.ScreenHeight / 2) - 50; _saveGameNamePromptBackground = new BBStretchableImage(); if (!_saveGameNamePromptBackground.Initialize(x, y, 300, 100, StretchableImageType.ThinBorderBG, gameMain.Random, out reason)) { return false; } _saveGameNamePromptInstructionLabel = new BBLabel(); if (!_saveGameNamePromptInstructionLabel.Initialize(x + 20, y + 10, "Please input name for the save:", Color.White, out reason)) { return false; } _saveGameNameField = new BBSingleLineTextBox(); if (!_saveGameNameField.Initialize(string.Empty, x + 20, y + 40, 250, 40, false, gameMain.Random, out reason)) { return false; } _buttons = new BBStretchButton[4]; _buttons[0] = new BBStretchButton(); if (!_buttons[0].Initialize("New Game", ButtonTextAlignment.CENTER, StretchableImageType.ThinBorderBG, StretchableImageType.ThinBorderFG, _xPos + 30, _yPos + 350, 200, 35, gameMain.Random, out reason)) { return false; } _buttons[1] = new BBStretchButton(); if (!_buttons[1].Initialize("Save Game", ButtonTextAlignment.CENTER, StretchableImageType.ThinBorderBG, StretchableImageType.ThinBorderFG, _xPos + 270, _yPos + 300, 200, 35, gameMain.Random, out reason)) { return false; } _buttons[2] = new BBStretchButton(); if (!_buttons[2].Initialize("Load Game", ButtonTextAlignment.CENTER, StretchableImageType.ThinBorderBG, StretchableImageType.ThinBorderFG, _xPos + 30, _yPos + 300, 200, 35, gameMain.Random, out reason)) { return false; } _buttons[2].Enabled = false; _buttons[3] = new BBStretchButton(); if (!_buttons[3].Initialize("Exit Game", ButtonTextAlignment.CENTER, StretchableImageType.ThinBorderBG, StretchableImageType.ThinBorderFG, _xPos + 270, _yPos + 350, 200, 35, gameMain.Random, out reason)) { return false; } _saveGameListBackground = new BBStretchableImage(); if (!_saveGameListBackground.Initialize(_xPos + 20, _yPos + 20, 460, 325, StretchableImageType.ThinBorderBG, gameMain.Random, out reason)) { return false; } _saveGameButtons = new BBInvisibleStretchButton[8]; for (int i = 0; i < _saveGameButtons.Length; i++) { _saveGameButtons[i] = new BBInvisibleStretchButton(); if (!_saveGameButtons[i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, _xPos + 30, _yPos + 35 + (i * 32), 420, 32, gameMain.Random, out reason)) { return false; } } _scrollBar = new BBScrollBar(); if (!_scrollBar.Initialize(_xPos + 455, _yPos + 37, 256, _saveGameButtons.Length, _saveGameButtons.Length, false, false, gameMain.Random, out reason)) { return false; } _maxVisible = 0; _scrollBar.SetEnabledState(false); _selectedGame = -1; _files = new List<FileInfo>(); _promptShowing = false; return true; }
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 bool Initialize(GameMain gameMain, string identifier, out string reason) { _isExplored = false; _isOwnedSystem = false; if (!base.Initialize(gameMain.ScreenWidth - 300, gameMain.ScreenHeight / 2 - 240, 300, 480, StretchableImageType.ThinBorderBG, gameMain, true, gameMain.Random, out reason)) { return false; } _infrastructureIcon = SpriteManager.GetSprite("InfrastructureIcon", gameMain.Random); _defenseIcon = SpriteManager.GetSprite("MilitaryIcon", gameMain.Random); _researchIcon = SpriteManager.GetSprite("ResearchIcon", gameMain.Random); _environmentIcon = SpriteManager.GetSprite("EnvironmentIcon", gameMain.Random); _constructionIcon = SpriteManager.GetSprite("ConstructionIcon", gameMain.Random); if (_infrastructureIcon == null || _defenseIcon == null || _researchIcon == null || _environmentIcon == null || _constructionIcon == null) { reason = "One or more of the following sprites does not exist: InfrastructureIcon, MilitaryIcon, ResearchIcon, EnvironmentIcon, and/or ConstructionIcon"; return false; } _name = new BBSingleLineTextBox(); if (!_name.Initialize(string.Empty, _xPos + 10, _yPos + 15, 280, 35, false, gameMain.Random, out reason)) { return false; } _generalPurposeBackground = new BBStretchableImage(); _infrastructureBackground = new BBStretchableImage(); _researchBackground = new BBStretchableImage(); _environmentBackground = new BBStretchableImage(); _defenseBackground = new BBStretchableImage(); _constructionProjectButton = new BBStretchButton(); _popLabel = new BBLabel(); _terrainLabel = new BBLabel(); _productionLabel = new BBLabel(); _infrastructureLabel = new BBLabel(); _researchLabel = new BBLabel(); _environmentLabel = new BBLabel(); _defenseLabel = new BBLabel(); _constructionLabel = new BBLabel(); _generalPurposeText = new BBTextBox(); _transferLabel = new BBLabel(); _infrastructureSlider = new BBScrollBar(); _researchSlider = new BBScrollBar(); _environmentSlider = new BBScrollBar(); _defenseSlider = new BBScrollBar(); _constructionSlider = new BBScrollBar(); _popTransferSlider = new BBScrollBar(); _infrastructureLockButton = new BBButton(); _researchLockButton = new BBButton(); _environmentLockButton = new BBButton(); _defenseLockButton = new BBButton(); _constructionLockButton = new BBButton(); _relocateToButton = new BBButton(); _transferToButton = new BBButton(); if (!_generalPurposeBackground.Initialize(_xPos + 10, _yPos + 130, 280, 300, StretchableImageType.ThinBorderBG, gameMain.Random, out reason)) { return false; } if (!_generalPurposeText.Initialize(_xPos + 20, _yPos + 140, 260, 260, true, false, "PlanetUIText" + identifier, gameMain.Random, out reason)) { return false; } if (!_infrastructureBackground.Initialize(_xPos + 10, _yPos + 130, 280, 60, StretchableImageType.ThinBorderBG, gameMain.Random, out reason)) { return false; } if (!_researchBackground.Initialize(_xPos + 10, _yPos + 190, 280, 60, StretchableImageType.ThinBorderBG, gameMain.Random, out reason)) { return false; } if (!_environmentBackground.Initialize(_xPos + 10, _yPos + 250, 280, 60, StretchableImageType.ThinBorderBG, gameMain.Random, out reason)) { return false; } if (!_defenseBackground.Initialize(_xPos + 10, _yPos + 310, 280, 60, StretchableImageType.ThinBorderBG, gameMain.Random, out reason)) { return false; } if (!_constructionProjectButton.Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.ThinBorderBG, StretchableImageType.ThinBorderFG, _xPos + 10, _yPos + 370, 280, 60, gameMain.Random, out reason)) { return false; } if (!_terrainLabel.Initialize(_xPos + 55, _yPos + 60, string.Empty, System.Drawing.Color.White, out reason)) { return false; } if (!_popLabel.Initialize(_xPos + 55, _yPos + 80, string.Empty, System.Drawing.Color.White, out reason)) { return false; } if (!_productionLabel.Initialize(_xPos + 55, _yPos + 100, string.Empty, System.Drawing.Color.White, out reason)) { return false; } if (!_infrastructureLabel.Initialize(_xPos + 65, _yPos + 140, string.Empty, System.Drawing.Color.White, out reason)) { return false; } if (!_infrastructureSlider.Initialize(_xPos + 65, _yPos + 160, 200, 0, 100, true, true, gameMain.Random, out reason)) { return false; } if (!_infrastructureLockButton.Initialize("LockBG", "LockFG", string.Empty, ButtonTextAlignment.CENTER, _xPos + 267, _yPos + 160, 16, 16, gameMain.Random, out reason)) { return false; } if (!_researchLabel.Initialize(_xPos + 65, _yPos + 200, string.Empty, System.Drawing.Color.White, out reason)) { return false; } if (!_researchSlider.Initialize(_xPos + 65, _yPos + 220, 200, 0, 100, true, true, gameMain.Random, out reason)) { return false; } if (!_researchLockButton.Initialize("LockBG", "LockFG", string.Empty, ButtonTextAlignment.CENTER, _xPos + 267, _yPos + 220, 16, 16, gameMain.Random, out reason)) { return false; } if (!_environmentLabel.Initialize(_xPos + 65, _yPos + 260, string.Empty, System.Drawing.Color.White, out reason)) { return false; } if (!_environmentSlider.Initialize(_xPos + 65, _yPos + 280, 200, 0, 100, true, true, gameMain.Random, out reason)) { return false; } if (!_environmentLockButton.Initialize("LockBG", "LockFG", string.Empty, ButtonTextAlignment.CENTER, _xPos + 267, _yPos + 280, 16, 16, gameMain.Random, out reason)) { return false; } if (!_defenseLabel.Initialize(_xPos + 65, _yPos + 320, string.Empty, System.Drawing.Color.White, out reason)) { return false; } if (!_defenseSlider.Initialize(_xPos + 65, _yPos + 340, 200, 0, 100, true, true, gameMain.Random, out reason)) { return false; } if (!_defenseLockButton.Initialize("LockBG", "LockFG", string.Empty, ButtonTextAlignment.CENTER, _xPos + 267, _yPos + 340, 16, 16, gameMain.Random, out reason)) { return false; } if (!_constructionLabel.Initialize(_xPos + 65, _yPos + 380, string.Empty, System.Drawing.Color.White, out reason)) { return false; } if (!_constructionSlider.Initialize(_xPos + 65, _yPos + 400, 200, 0, 100, true, true, gameMain.Random, out reason)) { return false; } if (!_constructionLockButton.Initialize("LockBG", "LockFG", string.Empty, ButtonTextAlignment.CENTER, _xPos + 267, _yPos + 400, 16, 16, gameMain.Random, out reason)) { return false; } if (!_transferLabel.Initialize(_xPos + 20, _yPos + 370, string.Empty, System.Drawing.Color.White, out reason)) { return false; } if (!_popTransferSlider.Initialize(_xPos + 20, _yPos + 400, 260, 0, 1, true, true, gameMain.Random, out reason)) { return false; } if (!_relocateToButton.Initialize("RelocateToBG", "RelocateToFG", string.Empty, ButtonTextAlignment.CENTER, _xPos + 130, _yPos + 435, 75, 35, gameMain.Random, out reason)) { return false; } if (!_relocateToButton.SetToolTip("RelocateToolTip" + identifier, "Set a friendly system as the destination of newly built ships", gameMain.ScreenWidth, gameMain.ScreenHeight, gameMain.Random, out reason)) { return false; } if (!_transferToButton.Initialize("TransferToBG", "TransferToFG", string.Empty, ButtonTextAlignment.CENTER, _xPos + 215, _yPos + 435, 75, 35, gameMain.Random, out reason)) { return false; } if (!_transferToButton.SetToolTip("TransferToToolTip" + identifier, "Send up to half of the population to another occupied system", gameMain.ScreenWidth, gameMain.ScreenHeight, gameMain.Random, out reason)) { return false; } reason = null; return true; }
public bool Initialize(GameMain gameMain, out string reason) { if (!base.Initialize((gameMain.ScreenWidth / 2) - 250, (gameMain.ScreenHeight / 2) - 200, 500, 400, StretchableImageType.MediumBorder, gameMain, false, gameMain.Random, out reason)) { return(false); } int x = (gameMain.ScreenWidth / 2) - 150; int y = (gameMain.ScreenHeight / 2) - 50; _saveGameNamePromptBackground = new BBStretchableImage(); if (!_saveGameNamePromptBackground.Initialize(x, y, 300, 100, StretchableImageType.ThinBorderBG, gameMain.Random, out reason)) { return(false); } _saveGameNamePromptInstructionLabel = new BBLabel(); if (!_saveGameNamePromptInstructionLabel.Initialize(x + 20, y + 10, "Please input name for the save:", Color.White, out reason)) { return(false); } _saveGameNameField = new BBSingleLineTextBox(); if (!_saveGameNameField.Initialize(string.Empty, x + 20, y + 40, 250, 40, false, gameMain.Random, out reason)) { return(false); } _buttons = new BBStretchButton[4]; _buttons[0] = new BBStretchButton(); if (!_buttons[0].Initialize("New Game", ButtonTextAlignment.CENTER, StretchableImageType.ThinBorderBG, StretchableImageType.ThinBorderFG, _xPos + 30, _yPos + 350, 200, 35, gameMain.Random, out reason)) { return(false); } _buttons[1] = new BBStretchButton(); if (!_buttons[1].Initialize("Save Game", ButtonTextAlignment.CENTER, StretchableImageType.ThinBorderBG, StretchableImageType.ThinBorderFG, _xPos + 270, _yPos + 300, 200, 35, gameMain.Random, out reason)) { return(false); } _buttons[2] = new BBStretchButton(); if (!_buttons[2].Initialize("Load Game", ButtonTextAlignment.CENTER, StretchableImageType.ThinBorderBG, StretchableImageType.ThinBorderFG, _xPos + 30, _yPos + 300, 200, 35, gameMain.Random, out reason)) { return(false); } _buttons[2].Enabled = false; _buttons[3] = new BBStretchButton(); if (!_buttons[3].Initialize("Exit Game", ButtonTextAlignment.CENTER, StretchableImageType.ThinBorderBG, StretchableImageType.ThinBorderFG, _xPos + 270, _yPos + 350, 200, 35, gameMain.Random, out reason)) { return(false); } _saveGameListBackground = new BBStretchableImage(); if (!_saveGameListBackground.Initialize(_xPos + 20, _yPos + 20, 460, 325, StretchableImageType.ThinBorderBG, gameMain.Random, out reason)) { return(false); } _saveGameButtons = new BBInvisibleStretchButton[8]; for (int i = 0; i < _saveGameButtons.Length; i++) { _saveGameButtons[i] = new BBInvisibleStretchButton(); if (!_saveGameButtons[i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, _xPos + 30, _yPos + 35 + (i * 32), 420, 32, gameMain.Random, out reason)) { return(false); } } _scrollBar = new BBScrollBar(); if (!_scrollBar.Initialize(_xPos + 455, _yPos + 37, 256, _saveGameButtons.Length, _saveGameButtons.Length, false, false, gameMain.Random, out reason)) { return(false); } _maxVisible = 0; _scrollBar.SetEnabledState(false); _selectedGame = -1; _files = new List <FileInfo>(); _promptShowing = false; return(true); }
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 bool Initialize(GameMain gameMain, out string reason) { this._gameMain = gameMain; _buttons = new BBButton[4]; _x = (gameMain.ScreenWidth / 2) - 130; _y = (gameMain.ScreenHeight / 2); for (int i = 0; i < _buttons.Length; i++) { _buttons[i] = new BBButton(); } if (!_buttons[0].Initialize("MainButtonBG", "MainButtonFG", "Continue", "LargeComputerFont", ButtonTextAlignment.CENTER, _x, _y, 260, 40, gameMain.Random, out reason, 20, -1)) { return(false); } if (!_buttons[1].Initialize("MainButtonBG", "MainButtonFG", "New Game", "LargeComputerFont", ButtonTextAlignment.CENTER, _x, _y + 50, 260, 40, gameMain.Random, out reason, 20, -1)) { return(false); } if (!_buttons[2].Initialize("MainButtonBG", "MainButtonFG", "Load Game", "LargeComputerFont", ButtonTextAlignment.CENTER, _x, _y + 100, 260, 40, gameMain.Random, out reason, 20, -1)) { return(false); } if (!_buttons[3].Initialize("MainButtonBG", "MainButtonFG", "Exit", "LargeComputerFont", ButtonTextAlignment.CENTER, _x, _y + 150, 260, 40, gameMain.Random, out reason, 20, -1)) { return(false); } for (int i = 0; i < _buttons.Length; i++) { _buttons[i].SetTextColor(System.Drawing.Color.Gold, System.Drawing.Color.Black); } _versionLabel = new BBLabel(); if (!_versionLabel.Initialize(10, _gameMain.ScreenHeight - 30, "Version 0.59", System.Drawing.Color.White, out reason)) { return(false); } _background = SpriteManager.GetSprite("MainBackground", gameMain.Random); _planet = SpriteManager.GetSprite("MainPlanetBackground", gameMain.Random); _title = SpriteManager.GetSprite("Title", gameMain.Random); _x = (gameMain.ScreenWidth / 2) - 512; _y = (gameMain.ScreenHeight / 2) - 300; _files = Utility.GetSaveGames(gameMain.GameDataSet.FullName); if (_files.Count == 0) { _buttons[0].Active = false; //Disabled Continue and Load buttons since there's no games to load _buttons[2].Active = false; } _loadBackground = new BBStretchableImage(); if (!_loadBackground.Initialize((gameMain.ScreenWidth / 2) - 225, (gameMain.ScreenHeight / 2) - 175, 450, 350, StretchableImageType.ThinBorderBG, gameMain.Random, out reason)) { return(false); } _saveGameButtons = new BBInvisibleStretchButton[10]; for (int i = 0; i < _saveGameButtons.Length; i++) { _saveGameButtons[i] = new BBInvisibleStretchButton(); if (!_saveGameButtons[i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, (gameMain.ScreenWidth / 2) - 220, (gameMain.ScreenHeight / 2) - 160 + (i * 32), 420, 32, gameMain.Random, out reason)) { return(false); } } _scrollBar = new BBScrollBar(); if (!_scrollBar.Initialize((gameMain.ScreenWidth / 2) + 200, (gameMain.ScreenHeight / 2) - 160, 320, 10, 10, false, false, gameMain.Random, out reason)) { return(false); } _maxVisible = _files.Count > _saveGameButtons.Length ? _saveGameButtons.Length : _files.Count; if (_maxVisible < _saveGameButtons.Length) { //Disable the scrollbar _scrollBar.SetEnabledState(false); } else { _scrollBar.SetEnabledState(true); _scrollBar.SetAmountOfItems(_files.Count); } RefreshSaves(); _showingLoadMenu = false; reason = null; return(true); }
public bool Initialize(GameMain gameMain, out string reason) { _gameMain = gameMain; _x = (gameMain.ScreenWidth / 2) - 500; _y = (gameMain.ScreenHeight / 2) - 305; if (!Initialize((gameMain.ScreenWidth / 2) - 520, (gameMain.ScreenHeight / 2) - 320, 1040, 640, StretchableImageType.MediumBorder, gameMain, false, gameMain.Random, out reason)) { return(false); } _shipNames = new BBStretchButton[6]; for (int i = 0; i < _shipNames.Length; i++) { _shipNames[i] = new BBStretchButton(); if (!_shipNames[i].Initialize(string.Empty, ButtonTextAlignment.CENTER, StretchableImageType.ThinBorderBG, StretchableImageType.ThinBorderFG, _x + 80 + (150 * i), _y, 150, 40, _gameMain.Random, out reason)) { return(false); } } _planetBackgrounds = new BBStretchButton[10]; _planetNames = new BBLabel[10]; _statusLabels = new BBLabel[11]; _scrollBar = new BBScrollBar(); _statusLabels[0] = new BBLabel(); if (!_statusLabels[0].Initialize(_x, _y + 10, "Status", Color.White, out reason)) { return(false); } for (int i = 0; i < 10; i++) { _planetBackgrounds[i] = new BBStretchButton(); if (!_planetBackgrounds[i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.ThinBorderBG, StretchableImageType.ThinBorderFG, _x, _y + 40 + (50 * i), 980, 50, _gameMain.Random, out reason)) { return(false); } _planetNames[i] = new BBLabel(); if (!_planetNames[i].Initialize(_x + 5, _y + 65 + (50 * i), string.Empty, Color.GreenYellow, out reason)) { return(false); } _statusLabels[i + 1] = new BBLabel(); if (!_statusLabels[i + 1].Initialize(_x + 5, _y + 45 + (50 * i), string.Empty, Color.Orange, out reason)) { return(false); } } _shipAmountLabels = new BBStretchButton[10][]; for (int i = 0; i < _shipAmountLabels.Length; i++) { _shipAmountLabels[i] = new BBStretchButton[6]; for (int j = 0; j < 6; j++) { _shipAmountLabels[i][j] = new BBStretchButton(); if (!_shipAmountLabels[i][j].Initialize(string.Empty, ButtonTextAlignment.CENTER, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, _x + 80 + (150 * j), _y + 43 + (i * 50), 150, 25, _gameMain.Random, out reason)) { return(false); } } } if (!_scrollBar.Initialize(_x + 980, _y + 40, 500, 10, 10, false, false, _gameMain.Random, out reason)) { return(false); } _maintenanceCostBackground = new BBStretchableImage(); _maintenanceLabel = new BBLabel(); _maintenanceAmountLabel = new BBLabel(); _scrapButtons = new BBButton[6]; for (int i = 0; i < _scrapButtons.Length; i++) { _scrapButtons[i] = new BBButton(); if (!_scrapButtons[i].Initialize("ScrapShipBG", "ScrapShipFG", string.Empty, ButtonTextAlignment.LEFT, _x + 112 + (150 * i), _y + 540, 75, 35, gameMain.Random, out reason)) { return(false); } } if (!_maintenanceCostBackground.Initialize(_x + 220, _y + 577, 280, 35, StretchableImageType.TinyButtonBG, gameMain.Random, out reason)) { return(false); } if (!_maintenanceLabel.Initialize(_x + 225, _y + 585, "Maintenance Cost:", Color.Orange, out reason)) { return(false); } if (!_maintenanceAmountLabel.Initialize(_x + 495, _y + 585, string.Empty, Color.White, out reason)) { return(false); } _maintenanceAmountLabel.SetAlignment(true); _viewSpecsButton = new BBStretchButton(); if (!_viewSpecsButton.Initialize("View Ship Specifications", ButtonTextAlignment.CENTER, StretchableImageType.ThinBorderBG, StretchableImageType.ThinBorderFG, _x + 500, _y + 577, 280, 35, gameMain.Random, out reason)) { return(false); } _fleetSpecsWindow = new FleetSpecsWindow(); if (!_fleetSpecsWindow.Initialize(gameMain, "FleetList", out reason)) { return(false); } _fleetSpecsShowing = false; reason = null; return(true); }
public bool Initialize(GameMain gameMain, out string reason) { _gameMain = gameMain; if (!base.Initialize((gameMain.ScreenWidth / 2) - 320, (gameMain.ScreenHeight / 2) - 320, 640, 640, StretchableImageType.MediumBorder, gameMain, false, gameMain.Random, out reason)) { return false; } _randomSprite = SpriteManager.GetSprite("RandomRace", gameMain.Random); if (_randomSprite == null) { reason = "RandomRace sprite does not exist."; return false; } _raceButtons = new BBStretchButton[15]; _raceScrollBar = new BBScrollBar(); _raceBackground = new BBStretchableImage(); _raceDescription = new BBTextBox(); _okButton = new BBStretchButton(); _raceManager = gameMain.RaceManager; for (int i = 0; i < _raceButtons.Length; i++) { _raceButtons[i] = new BBStretchButton(); if (!_raceButtons[i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.ThinBorderBG, StretchableImageType.ThinBorderFG, _xPos + 10, _yPos + 10 + (i * 40), 280, 40, gameMain.Random, out reason)) { return false; } } //Add 1 for the random race option int scrollValue = (_raceManager.Races.Count + 1) < _raceButtons.Length ? _raceButtons.Length : (_raceManager.Races.Count + 1); if (!_raceScrollBar.Initialize(_xPos + 290, _yPos + 10, 600, _raceButtons.Length, scrollValue, false, false, gameMain.Random, out reason)) { return false; } _maxVisible = (_raceManager.Races.Count + 1) > _raceButtons.Length ? _raceButtons.Length : (_raceManager.Races.Count + 1); if (_raceManager.Races.Count < 15) { _raceScrollBar.SetEnabledState(false); } if (!_raceBackground.Initialize(_xPos + 310, _yPos + 10, 310, 550, StretchableImageType.ThinBorderBG, gameMain.Random, out reason)) { return false; } if (!_raceDescription.Initialize(_xPos + 315, _yPos + 325, 300, 215, true, true, "RaceSelectionDescriptionTextBox", gameMain.Random, out reason)) { return false; } if (!_okButton.Initialize("Select Race", ButtonTextAlignment.CENTER, StretchableImageType.ThinBorderBG, StretchableImageType.ThinBorderFG, _xPos + 310, _yPos + 570, 310, 40, gameMain.Random, out reason)) { return false; } RefreshRaceLabels(); RefreshRaceDescription(); reason = null; return true; }
public bool Initialize(GameMain gameMain, out string reason) { if (!this.Initialize(gameMain.ScreenWidth / 2 - 230, gameMain.ScreenHeight / 2 - 180, 460, 360, StretchableImageType.MediumBorder, gameMain, false, gameMain.Random, out reason)) { return false; } _discoveredTechs = new List<Technology>(); _fieldsNeedingNewTopics = new List<TechField>(); _availableTopics = new Dictionary<TechField, List<Technology>>(); _techDescriptionBackground = new BBStretchableImage(); _availableTechsToResearchBackground = new BBStretchableImage(); _instructionLabel = new BBLabel(); _techDescription = new BBTextBox(); _scrollBar = new BBScrollBar(); _availableTechsToResearchButtons = new BBInvisibleStretchButton[4]; _researchCosts = new BBLabel[4]; if (!_techDescriptionBackground.Initialize(_xPos + 20, _yPos + 20, 420, 170, StretchableImageType.ThinBorderBG, gameMain.Random, out reason)) { return false; } if (!_availableTechsToResearchBackground.Initialize(_xPos + 20, _yPos + 220, 420, 120, StretchableImageType.ThinBorderBG, gameMain.Random, out reason)) { return false; } if (!_instructionLabel.Initialize(_xPos + 20, _yPos + 195, "Please select an item to research", System.Drawing.Color.White, out reason)) { return false; } if (!_techDescription.Initialize(_xPos + 165, _yPos + 33, 265, 150, true, true, "TechDescriptionTextBox", gameMain.Random, out reason)) { return false; } if (!_scrollBar.Initialize(_xPos + 415, _yPos + 230, 100, 4, 4, false, false, gameMain.Random, out reason)) { return false; } for (int i = 0; i < _availableTechsToResearchButtons.Length; i++) { _availableTechsToResearchButtons[i] = new BBInvisibleStretchButton(); _researchCosts[i] = new BBLabel(); if (!_availableTechsToResearchButtons[i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, _xPos + 30, _yPos + 230 + (i * 25), 385, 25, gameMain.Random, out reason)) { return false; } if (!_availableTechsToResearchButtons[i].SetToolTip("ItemToResearch" + i + "ToolTip", string.Empty, gameMain.ScreenWidth, gameMain.ScreenHeight, gameMain.Random, out reason)) { return false; } if (!_researchCosts[i].Initialize(_xPos + 405, _yPos + 232 + (i * 25), string.Empty, System.Drawing.Color.White, out reason)) { return false; } _researchCosts[i].SetAlignment(true); } return true; }
public bool Initialize(GameMain gameMain, string identifier, out string reason) { _isExplored = false; _isOwnedSystem = false; if (!base.Initialize(gameMain.ScreenWidth - 300, gameMain.ScreenHeight / 2 - 240, 300, 480, StretchableImageType.ThinBorderBG, gameMain, true, gameMain.Random, out reason)) { return(false); } _infrastructureIcon = SpriteManager.GetSprite("InfrastructureIcon", gameMain.Random); _defenseIcon = SpriteManager.GetSprite("MilitaryIcon", gameMain.Random); _researchIcon = SpriteManager.GetSprite("ResearchIcon", gameMain.Random); _environmentIcon = SpriteManager.GetSprite("EnvironmentIcon", gameMain.Random); _constructionIcon = SpriteManager.GetSprite("ConstructionIcon", gameMain.Random); if (_infrastructureIcon == null || _defenseIcon == null || _researchIcon == null || _environmentIcon == null || _constructionIcon == null) { reason = "One or more of the following sprites does not exist: InfrastructureIcon, MilitaryIcon, ResearchIcon, EnvironmentIcon, and/or ConstructionIcon"; return(false); } _name = new BBSingleLineTextBox(); if (!_name.Initialize(string.Empty, _xPos + 10, _yPos + 15, 280, 35, false, gameMain.Random, out reason)) { return(false); } _generalPurposeBackground = new BBStretchableImage(); _infrastructureBackground = new BBStretchableImage(); _researchBackground = new BBStretchableImage(); _environmentBackground = new BBStretchableImage(); _defenseBackground = new BBStretchableImage(); _constructionProjectButton = new BBStretchButton(); _popLabel = new BBLabel(); _terrainLabel = new BBLabel(); _productionLabel = new BBLabel(); _infrastructureLabel = new BBLabel(); _researchLabel = new BBLabel(); _environmentLabel = new BBLabel(); _defenseLabel = new BBLabel(); _constructionLabel = new BBLabel(); _generalPurposeText = new BBTextBox(); _transferLabel = new BBLabel(); _infrastructureSlider = new BBScrollBar(); _researchSlider = new BBScrollBar(); _environmentSlider = new BBScrollBar(); _defenseSlider = new BBScrollBar(); _constructionSlider = new BBScrollBar(); _popTransferSlider = new BBScrollBar(); _infrastructureLockButton = new BBButton(); _researchLockButton = new BBButton(); _environmentLockButton = new BBButton(); _defenseLockButton = new BBButton(); _constructionLockButton = new BBButton(); _relocateToButton = new BBButton(); _transferToButton = new BBButton(); if (!_generalPurposeBackground.Initialize(_xPos + 10, _yPos + 130, 280, 300, StretchableImageType.ThinBorderBG, gameMain.Random, out reason)) { return(false); } if (!_generalPurposeText.Initialize(_xPos + 20, _yPos + 140, 260, 260, true, false, "PlanetUIText" + identifier, gameMain.Random, out reason)) { return(false); } if (!_infrastructureBackground.Initialize(_xPos + 10, _yPos + 130, 280, 60, StretchableImageType.ThinBorderBG, gameMain.Random, out reason)) { return(false); } if (!_researchBackground.Initialize(_xPos + 10, _yPos + 190, 280, 60, StretchableImageType.ThinBorderBG, gameMain.Random, out reason)) { return(false); } if (!_environmentBackground.Initialize(_xPos + 10, _yPos + 250, 280, 60, StretchableImageType.ThinBorderBG, gameMain.Random, out reason)) { return(false); } if (!_defenseBackground.Initialize(_xPos + 10, _yPos + 310, 280, 60, StretchableImageType.ThinBorderBG, gameMain.Random, out reason)) { return(false); } if (!_constructionProjectButton.Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.ThinBorderBG, StretchableImageType.ThinBorderFG, _xPos + 10, _yPos + 370, 280, 60, gameMain.Random, out reason)) { return(false); } if (!_terrainLabel.Initialize(_xPos + 55, _yPos + 60, string.Empty, System.Drawing.Color.White, out reason)) { return(false); } if (!_popLabel.Initialize(_xPos + 55, _yPos + 80, string.Empty, System.Drawing.Color.White, out reason)) { return(false); } if (!_productionLabel.Initialize(_xPos + 55, _yPos + 100, string.Empty, System.Drawing.Color.White, out reason)) { return(false); } if (!_infrastructureLabel.Initialize(_xPos + 65, _yPos + 140, string.Empty, System.Drawing.Color.White, out reason)) { return(false); } if (!_infrastructureSlider.Initialize(_xPos + 65, _yPos + 160, 200, 0, 100, true, true, gameMain.Random, out reason)) { return(false); } if (!_infrastructureLockButton.Initialize("LockBG", "LockFG", string.Empty, ButtonTextAlignment.CENTER, _xPos + 267, _yPos + 160, 16, 16, gameMain.Random, out reason)) { return(false); } if (!_researchLabel.Initialize(_xPos + 65, _yPos + 200, string.Empty, System.Drawing.Color.White, out reason)) { return(false); } if (!_researchSlider.Initialize(_xPos + 65, _yPos + 220, 200, 0, 100, true, true, gameMain.Random, out reason)) { return(false); } if (!_researchLockButton.Initialize("LockBG", "LockFG", string.Empty, ButtonTextAlignment.CENTER, _xPos + 267, _yPos + 220, 16, 16, gameMain.Random, out reason)) { return(false); } if (!_environmentLabel.Initialize(_xPos + 65, _yPos + 260, string.Empty, System.Drawing.Color.White, out reason)) { return(false); } if (!_environmentSlider.Initialize(_xPos + 65, _yPos + 280, 200, 0, 100, true, true, gameMain.Random, out reason)) { return(false); } if (!_environmentLockButton.Initialize("LockBG", "LockFG", string.Empty, ButtonTextAlignment.CENTER, _xPos + 267, _yPos + 280, 16, 16, gameMain.Random, out reason)) { return(false); } if (!_defenseLabel.Initialize(_xPos + 65, _yPos + 320, string.Empty, System.Drawing.Color.White, out reason)) { return(false); } if (!_defenseSlider.Initialize(_xPos + 65, _yPos + 340, 200, 0, 100, true, true, gameMain.Random, out reason)) { return(false); } if (!_defenseLockButton.Initialize("LockBG", "LockFG", string.Empty, ButtonTextAlignment.CENTER, _xPos + 267, _yPos + 340, 16, 16, gameMain.Random, out reason)) { return(false); } if (!_constructionLabel.Initialize(_xPos + 65, _yPos + 380, string.Empty, System.Drawing.Color.White, out reason)) { return(false); } if (!_constructionSlider.Initialize(_xPos + 65, _yPos + 400, 200, 0, 100, true, true, gameMain.Random, out reason)) { return(false); } if (!_constructionLockButton.Initialize("LockBG", "LockFG", string.Empty, ButtonTextAlignment.CENTER, _xPos + 267, _yPos + 400, 16, 16, gameMain.Random, out reason)) { return(false); } if (!_transferLabel.Initialize(_xPos + 20, _yPos + 370, string.Empty, System.Drawing.Color.White, out reason)) { return(false); } if (!_popTransferSlider.Initialize(_xPos + 20, _yPos + 400, 260, 0, 1, true, true, gameMain.Random, out reason)) { return(false); } if (!_relocateToButton.Initialize("RelocateToBG", "RelocateToFG", string.Empty, ButtonTextAlignment.CENTER, _xPos + 130, _yPos + 435, 75, 35, gameMain.Random, out reason)) { return(false); } if (!_relocateToButton.SetToolTip("RelocateToolTip" + identifier, "Set a friendly system as the destination of newly built ships", gameMain.ScreenWidth, gameMain.ScreenHeight, gameMain.Random, out reason)) { return(false); } if (!_transferToButton.Initialize("TransferToBG", "TransferToFG", string.Empty, ButtonTextAlignment.CENTER, _xPos + 215, _yPos + 435, 75, 35, gameMain.Random, out reason)) { return(false); } if (!_transferToButton.SetToolTip("TransferToToolTip" + identifier, "Send up to half of the population to another occupied system", gameMain.ScreenWidth, gameMain.ScreenHeight, gameMain.Random, out reason)) { return(false); } reason = null; return(true); }
public bool Initialize(GameMain gameMain, out string reason) { _middleX = gameMain.ScreenWidth / 2; _middleY = gameMain.ScreenHeight / 2; if (!base.Initialize((gameMain.ScreenWidth / 2) - 210, (gameMain.ScreenHeight / 2) - 230, 420, 460, StretchableImageType.ThinBorderBG, gameMain, false, gameMain.Random, out reason)) { return false; } _buttons = new BBStretchButton[10]; _columnValues = new List<BBLabel[]>(); _columnNames = new List<BBLabel>(); _maxVisible = 0; for (int i = 0; i < 10; i++) { _buttons[i] = new BBStretchButton(); if (!_buttons[i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, _xPos + 10, _yPos + 50 + i * 40, 380, 40, gameMain.Random, out reason)) { return false; } if (!_buttons[i].SetToolTip("EquipmentSelection" + i, string.Empty, gameMain.ScreenWidth, gameMain.ScreenHeight, gameMain.Random, out reason)) { return false; } } _scrollBar = new BBScrollBar(); if (!_scrollBar.Initialize(_xPos + 390, _yPos + 50, 400, 10, 10, false, false, gameMain.Random, out reason)) { return false; } _maxVisible = 0; _numOfColumnsVisible = 0; _scrollBarVisible = false; return true; }
public bool Initialize(GameMain gameMain, out string reason) { _gameMain = gameMain; _x = (gameMain.ScreenWidth / 2) - 500; _y = (gameMain.ScreenHeight / 2) - 305; if (!Initialize((gameMain.ScreenWidth / 2) - 520, (gameMain.ScreenHeight / 2) - 320, 1040, 640, StretchableImageType.MediumBorder, gameMain, false, gameMain.Random, out reason)) { return false; } _shipNames = new BBStretchButton[6]; for (int i = 0; i < _shipNames.Length; i++) { _shipNames[i] = new BBStretchButton(); if (!_shipNames[i].Initialize(string.Empty, ButtonTextAlignment.CENTER, StretchableImageType.ThinBorderBG, StretchableImageType.ThinBorderFG, _x + 80 + (150 * i), _y, 150, 40, _gameMain.Random, out reason)) { return false; } } _planetBackgrounds = new BBStretchButton[10]; _planetNames = new BBLabel[10]; _statusLabels = new BBLabel[11]; _scrollBar = new BBScrollBar(); _statusLabels[0] = new BBLabel(); if (!_statusLabels[0].Initialize(_x, _y + 10, "Status", Color.White, out reason)) { return false; } for (int i = 0; i < 10; i++) { _planetBackgrounds[i] = new BBStretchButton(); if (!_planetBackgrounds[i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.ThinBorderBG, StretchableImageType.ThinBorderFG, _x, _y + 40 + (50 * i), 980, 50, _gameMain.Random, out reason)) { return false; } _planetNames[i] = new BBLabel(); if (!_planetNames[i].Initialize(_x + 5, _y + 65 + (50 * i), string.Empty, Color.GreenYellow, out reason)) { return false; } _statusLabels[i + 1] = new BBLabel(); if (!_statusLabels[i + 1].Initialize(_x + 5, _y + 45 + (50 * i), string.Empty, Color.Orange, out reason)) { return false; } } _shipAmountLabels = new BBStretchButton[10][]; for (int i = 0; i < _shipAmountLabels.Length; i++) { _shipAmountLabels[i] = new BBStretchButton[6]; for (int j = 0; j < 6; j++) { _shipAmountLabels[i][j] = new BBStretchButton(); if (!_shipAmountLabels[i][j].Initialize(string.Empty, ButtonTextAlignment.CENTER, StretchableImageType.TinyButtonBG, StretchableImageType.TinyButtonFG, _x + 80 + (150 * j), _y + 43 + (i * 50), 150, 25, _gameMain.Random, out reason)) { return false; } } } if (!_scrollBar.Initialize(_x + 980, _y + 40, 500, 10, 10, false, false, _gameMain.Random, out reason)) { return false; } _maintenanceCostBackground = new BBStretchableImage(); _maintenanceLabel = new BBLabel(); _maintenanceAmountLabel = new BBLabel(); _scrapButtons = new BBButton[6]; for (int i = 0; i < _scrapButtons.Length; i++) { _scrapButtons[i] = new BBButton(); if (!_scrapButtons[i].Initialize("ScrapShipBG", "ScrapShipFG", string.Empty, ButtonTextAlignment.LEFT, _x + 112 + (150 * i), _y + 540, 75, 35, gameMain.Random, out reason)) { return false; } } if (!_maintenanceCostBackground.Initialize(_x + 220, _y + 577, 280, 35, StretchableImageType.TinyButtonBG, gameMain.Random, out reason)) { return false; } if (!_maintenanceLabel.Initialize(_x + 225, _y + 585, "Maintenance Cost:", Color.Orange, out reason)) { return false; } if (!_maintenanceAmountLabel.Initialize(_x + 495, _y + 585, string.Empty, Color.White, out reason)) { return false; } _maintenanceAmountLabel.SetAlignment(true); _viewSpecsButton = new BBStretchButton(); if (!_viewSpecsButton.Initialize("View Ship Specifications", ButtonTextAlignment.CENTER, StretchableImageType.ThinBorderBG, StretchableImageType.ThinBorderFG, _x + 500, _y + 577, 280, 35, gameMain.Random, out reason)) { return false; } _fleetSpecsWindow = new FleetSpecsWindow(); if (!_fleetSpecsWindow.Initialize(gameMain, "FleetList", out reason)) { return false; } _fleetSpecsShowing = false; reason = null; return true; }