public bool Initialize(GameMain gameMain, out string reason)
{
int x = (gameMain.ScreenWidth / 2) - 400;
int y = (gameMain.ScreenHeight / 2) - 300;
if (!base.Initialize(x, y, 800, 600, StretchableImageType.MediumBorder, gameMain, false, gameMain.Random, out reason))
{
return false;
}
_fieldsBackground = new BBStretchableImage();
_technologyListBackground = new BBStretchableImage();
if (!_fieldsBackground.Initialize(x + 20, y + 20, 760, 230, StretchableImageType.ThinBorderBG, gameMain.Random, out reason))
{
return false;
}
if (!_technologyListBackground.Initialize(x + 20, y + 300, 760, 280, StretchableImageType.ThinBorderBG, gameMain.Random, out reason))
{
return false;
}
_techFieldLabels = new BBLabel[6];
_techNamesBeingResearchedLabels = new BBLabel[6];
_techProgressLabels = new BBLabel[6];
_techSliders = new BBScrollBar[6];
_techLockButtons = new BBButton[6];
for (int i = 0; i < 6; i++)
{
_techFieldLabels[i] = new BBLabel();
_techNamesBeingResearchedLabels[i] = new BBLabel();
_techProgressLabels[i] = new BBLabel();
_techSliders[i] = new BBScrollBar();
_techLockButtons[i] = new BBButton();
}
_totalResearchPointsLabel = new BBLabel();
if (!_techFieldLabels[0].Initialize(x + 135, y + 35, "Computers:", System.Drawing.Color.White, out reason))
{
return false;
}
if (!_techFieldLabels[1].Initialize(x + 135, y + 65, "Construction:", System.Drawing.Color.White, out reason))
{
return false;
}
if (!_techFieldLabels[2].Initialize(x + 135, y + 95, "Force Fields:", System.Drawing.Color.White, out reason))
{
return false;
}
if (!_techFieldLabels[3].Initialize(x + 135, y + 125, "Planetology:", System.Drawing.Color.White, out reason))
{
return false;
}
if (!_techFieldLabels[4].Initialize(x + 135, y + 155, "Propulsion:", System.Drawing.Color.White, out reason))
{
return false;
}
if (!_techFieldLabels[5].Initialize(x + 135, y + 185, "Weapons:", System.Drawing.Color.White, out reason))
{
return false;
}
for (int i = 0; i < 6; i++)
{
_techFieldLabels[i].SetAlignment(true);
if (!_techNamesBeingResearchedLabels[i].Initialize(x + 140, y + 35 + (i * 30), "None", System.Drawing.Color.White, out reason))
{
return false;
}
if (!_techProgressLabels[i].Initialize(x + 545, y + 35 + (i * 30), "N/A", System.Drawing.Color.White, out reason))
{
return false;
}
_techProgressLabels[i].SetAlignment(true);
if (!_techSliders[i].Initialize(x + 550, y + 35 + (i * 30), 200, 0, 100, true, true, gameMain.Random, out reason))
{
return false;
}
if (!_techLockButtons[i].Initialize("LockBG", "LockFG", string.Empty, ButtonTextAlignment.LEFT, x + 755, y + 35 + (i * 30), 16, 16, gameMain.Random, out reason))
{
return false;
}
}
if (!_totalResearchPointsLabel.Initialize(x + 765, y + 215, "Total Research Points: 0", System.Drawing.Color.White, out reason))
{
return false;
}
_totalResearchPointsLabel.SetAlignment(true);
_researchedTechnologyDescriptions = new BBTextBox();
if (!_researchedTechnologyDescriptions.Initialize(x + 30, y + 310, 740, 260, true, true, "TechnologyListDescriptions", gameMain.Random, out reason))
{
return false;
}
_techFieldButtons = new BBStretchButton[6];
for (int i = 0; i < 6; i++)
{
_techFieldButtons[i] = new BBStretchButton();
}
if (!_techFieldButtons[0].Initialize("Computers", ButtonTextAlignment.CENTER, StretchableImageType.ThinBorderBG, StretchableImageType.ThinBorderFG, x + 20, y + 255, 125, 40, gameMain.Random, out reason))
{
return false;
}
if (!_techFieldButtons[1].Initialize("Construction", ButtonTextAlignment.CENTER, StretchableImageType.ThinBorderBG, StretchableImageType.ThinBorderFG, x + 147, y + 255, 125, 40, gameMain.Random, out reason))
{
return false;
}
if (!_techFieldButtons[2].Initialize("Force Fields", ButtonTextAlignment.CENTER, StretchableImageType.ThinBorderBG, StretchableImageType.ThinBorderFG, x + 274, y + 255, 125, 40, gameMain.Random, out reason))
{
return false;
}
if (!_techFieldButtons[3].Initialize("Planetology", ButtonTextAlignment.CENTER, StretchableImageType.ThinBorderBG, StretchableImageType.ThinBorderFG, x + 401, y + 255, 125, 40, gameMain.Random, out reason))
{
return false;
}
if (!_techFieldButtons[4].Initialize("Propulsion", ButtonTextAlignment.CENTER, StretchableImageType.ThinBorderBG, StretchableImageType.ThinBorderFG, x + 528, y + 255, 125, 40, gameMain.Random, out reason))
{
return false;
}
if (!_techFieldButtons[5].Initialize("Weapons", ButtonTextAlignment.CENTER, StretchableImageType.ThinBorderBG, StretchableImageType.ThinBorderFG, x + 655, y + 255, 125, 40, gameMain.Random, out reason))
{
return false;
}
reason = null;
return true;
}