public bool Initialize(GameMain gameMain, out string reason)
{
if (!this.Initialize(gameMain.ScreenWidth / 2 - 200, gameMain.ScreenHeight / 2 - 300, 400, 250, StretchableImageType.MediumBorder, gameMain, false, gameMain.Random, out reason))
{
return false;
}
_shipButtons = new BBStretchButton[4];
for (int i = 0; i < _shipButtons.Length; i++)
{
_shipButtons[i] = new BBStretchButton();
if (!_shipButtons[i].Initialize(string.Empty, ButtonTextAlignment.LEFT, StretchableImageType.ThinBorderBG, StretchableImageType.ThinBorderFG, _xPos + 20, _yPos + 60, 200, 40, gameMain.Random, out reason))
{
return false;
}
}
_instructionLabel = new BBLabel();
_systemNameLabel = new BBLabel();
_cancelButton = new BBButton();
_colonizeButton = new BBButton();
_groundViewBackground = new BBStretchableImage();
_nameBackground = new BBStretchableImage();
_nameTextBox = new BBSingleLineTextBox();
if (!_instructionLabel.Initialize(_xPos + 20, _yPos + 25, "Select a ship to colonize this planet", Color.White, out reason))
{
return false;
}
if (!_systemNameLabel.Initialize(_xPos + 300, _yPos + 130, string.Empty, Color.White, out reason))
{
return false;
}
if (!_cancelButton.Initialize("CancelColonizeBG", "CancelColonizeFG", string.Empty, ButtonTextAlignment.LEFT, _xPos + 230, _yPos + 195, 75, 35, gameMain.Random, out reason))
{
return false;
}
if (!_colonizeButton.Initialize("TransferToBG", "TransferToFG", string.Empty, ButtonTextAlignment.LEFT, _xPos + 310, _yPos + 195, 75, 35, gameMain.Random, out reason))
{
return false;
}
if (!_nameBackground.Initialize(gameMain.ScreenWidth / 2 - 100, gameMain.ScreenHeight / 2 - 40, 200, 80, StretchableImageType.ThinBorderBG, gameMain.Random, out reason))
{
return false;
}
if (!_nameTextBox.Initialize(string.Empty, gameMain.ScreenWidth / 2 - 80, gameMain.ScreenHeight / 2 - 20, 160, 40, false, gameMain.Random, out reason))
{
return false;
}
if (!_groundViewBackground.Initialize(gameMain.ScreenWidth / 2 - 440, gameMain.ScreenHeight / 2 - 340, 880, 680, StretchableImageType.ThickBorder, gameMain.Random, out reason))
{
return false;
}
_colonizing = false;
return true;
}