public bool Initialize(GameMain gameMain, out string reason)
{
if (!Initialize(gameMain.ScreenWidth - 300, 0, 300, 480, StretchableImageType.ThinBorderBG, gameMain, true, gameMain.Random, out reason))
{
return false;
}
_empireBackground = new BBStretchableImage();
_empireNameLabel = new BBLabel();
_nextFleet = new BBButton();
_previousFleet = new BBButton();
_shipBackground = new BBStretchableImage[6];
_shipPreview = new BBStretchableImage();
_shipSliders = new BBScrollBar[6];
_shipLabels = new BBLabel[6];
if (!_empireBackground.Initialize(_xPos + 10, _yPos + 10, 280, 40, StretchableImageType.ThinBorderBG, gameMain.Random, out reason))
{
return false;
}
if (!_empireNameLabel.Initialize(_xPos + 10, _yPos + 10, string.Empty, Color.White, out reason))
{
return false;
}
if (!_previousFleet.Initialize("ScrollLeftBGButton", "ScrollLeftFGButton", string.Empty, ButtonTextAlignment.LEFT, _xPos + 18, _yPos + 22, 16, 16, gameMain.Random, out reason))
{
return false;
}
if (!_nextFleet.Initialize("ScrollRightBGButton", "ScrollRightFGButton", string.Empty, ButtonTextAlignment.LEFT, _xPos + 266, _yPos + 22, 16, 16, gameMain.Random, out reason))
{
return false;
}
if (!_shipPreview.Initialize(0, 0, 170, 170, StretchableImageType.ThinBorderBG, gameMain.Random, out reason))
{
return false;
}
for (int i = 0; i < _shipBackground.Length; i++)
{
_shipBackground[i] = new BBStretchableImage();
_shipLabels[i] = new BBLabel();
_shipSliders[i] = new BBScrollBar();
if (!_shipBackground[i].Initialize(_xPos + 10, _yPos + 55 + (i * 55), 280, 55, StretchableImageType.ThinBorderBG, gameMain.Random, out reason))
{
return false;
}
if (!_shipLabels[i].Initialize(_xPos + 15, _yPos + 65 + (i * 55), "Test", Color.White, out reason))
{
return false;
}
if (!_shipSliders[i].Initialize(_xPos + 15, _yPos + 85 + (i * 55), 270, 1, 1, true, true, gameMain.Random, out reason))
{
return false;
}
}
return true;
}