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