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