public bool Initialize(GameMain gameMain, string name, out string reason)
{
_x = (gameMain.ScreenWidth / 2) - 430;
_y = (gameMain.ScreenHeight / 2) - 300;
if (!Initialize((gameMain.ScreenWidth / 2) - 450, (gameMain.ScreenHeight / 2) - 320, 900, 640, StretchableImageType.MediumBorder, gameMain, false, gameMain.Random, out reason))
{
return false;
}
_shipBackground = new BBStretchableImage(); //Used for sprite preview
if (!_shipBackground.Initialize(0,0, 170, 170, StretchableImageType.ThinBorderBG, gameMain.Random, out reason))
{
return false;
}
_shipBackgrounds = new BBStretchableImage[6];
_beamBackgrounds = new BBStretchableImage[6];
_missileBackgrounds = new BBStretchableImage[6];
_attackBackgrounds = new BBStretchableImage[6];
_hitPointsBackgrounds = new BBStretchableImage[6];
_shieldBackgrounds = new BBStretchableImage[6];
_galaxySpeedBackgrounds = new BBStretchableImage[6];
_combatSpeedBackgrounds = new BBStretchableImage[6];
_weaponsBackgrounds = new BBStretchableImage[6];
_specialsBackgrounds = new BBStretchableImage[6];
_scrapButtons = new BBButton[6];
_shipNameLabels = new BBLabel[6];
_beamDefLabels = new BBLabel[6];
_beamDefValueLabels = new BBLabel[6];
_missileDefLabels = new BBLabel[6];
_missileDefValueLabels = new BBLabel[6];
_attackLevelLabels = new BBLabel[6];
_attackLevelValueLabels = new BBLabel[6];
_hitPointsLabels = new BBLabel[6];
_hitPointsValueLabels = new BBLabel[6];
_shieldLabels = new BBLabel[6];
_shieldValueLabels = new BBLabel[6];
_galaxySpeedLabels = new BBLabel[6];
_galaxySpeedValueLabels = new BBLabel[6];
_combatSpeedLabels = new BBLabel[6];
_combatSpeedValueLabels = new BBLabel[6];
_costLabels = new BBLabel[6];
_costValueLabels = new BBLabel[6];
_amountLabels = new BBLabel[6];
_amountValueLabels = new BBLabel[6];
_weaponLabels = new BBLabel[6][];
_specialLabels = new BBLabel[6][];
for (int i = 0; i < 6; i++)
{
_shipBackgrounds[i] = new BBStretchableImage();
_scrapButtons[i] = new BBButton();
_shipNameLabels[i] = new BBLabel();
_beamBackgrounds[i] = new BBStretchableImage();
_missileBackgrounds[i] = new BBStretchableImage();
_attackBackgrounds[i] = new BBStretchableImage();
_hitPointsBackgrounds[i] = new BBStretchableImage();
_shieldBackgrounds[i] = new BBStretchableImage();
_galaxySpeedBackgrounds[i] = new BBStretchableImage();
_combatSpeedBackgrounds[i] = new BBStretchableImage();
_weaponsBackgrounds[i] = new BBStretchableImage();
_specialsBackgrounds[i] = new BBStretchableImage();
_beamDefLabels[i] = new BBLabel();
_beamDefValueLabels[i] = new BBLabel();
_missileDefLabels[i] = new BBLabel();
_missileDefValueLabels[i] = new BBLabel();
_attackLevelLabels[i] = new BBLabel();
_attackLevelValueLabels[i] = new BBLabel();
_hitPointsLabels[i] = new BBLabel();
_hitPointsValueLabels[i] = new BBLabel();
_shieldLabels[i] = new BBLabel();
_shieldValueLabels[i] = new BBLabel();
_galaxySpeedLabels[i] = new BBLabel();
_galaxySpeedValueLabels[i] = new BBLabel();
_combatSpeedLabels[i] = new BBLabel();
_combatSpeedValueLabels[i] = new BBLabel();
_costLabels[i] = new BBLabel();
_costValueLabels[i] = new BBLabel();
_amountLabels[i] = new BBLabel();
_amountValueLabels[i] = new BBLabel();
if (!_shipBackgrounds[i].Initialize(_x, _y + (i * 100), 860, 100, StretchableImageType.ThinBorderBG, gameMain.Random, out reason))
{
return false;
}
if (!_shipNameLabels[i].Initialize(_x + 10, _y + 10 + (i * 100), string.Empty, Color.White, out reason))
{
return false;
}
if (!_scrapButtons[i].Initialize("ScrapShipBG", "ScrapShipFG", string.Empty, ButtonTextAlignment.LEFT, _x + 250, _y + 5 + (i * 100), 75, 35, gameMain.Random, out reason))
{
return false;
}
if (!_scrapButtons[i].SetToolTip(name + "ScrapShipToolTip" + i, "Scrap Ship Design", gameMain.ScreenWidth, gameMain.ScreenHeight, gameMain.Random, out reason))
{
return false;
}
if (!_beamBackgrounds[i].Initialize(_x + 5, _y + 39 + (i * 100), 160, 28, StretchableImageType.TinyButtonBG, gameMain.Random, out reason))
{
return false;
}
if (!_beamDefLabels[i].Initialize(_x + 10, _y + 43 + (i * 100), "Beam Defense:", Color.Orange, out reason))
{
return false;
}
if (!_beamDefValueLabels[i].Initialize(_x + 155, _y + 43 + (i * 100), string.Empty, Color.White, out reason))
{
return false;
}
if (!_missileBackgrounds[i].Initialize(_x + 5, _y + 66 + (i * 100), 160, 28, StretchableImageType.TinyButtonBG, gameMain.Random, out reason))
{
return false;
}
if (!_missileDefLabels[i].Initialize(_x + 10, _y + 72 + (i * 100), "Missile Defense:", Color.Orange, out reason))
{
return false;
}
if (!_missileDefValueLabels[i].Initialize(_x + 155, _y + 72 + (i * 100), string.Empty, Color.White, out reason))
{
return false;
}
if (!_attackBackgrounds[i].Initialize(_x + 165, _y + 39 + (i * 100), 160, 28, StretchableImageType.TinyButtonBG, gameMain.Random, out reason))
{
return false;
}
if (!_attackLevelLabels[i].Initialize(_x + 170, _y + 43 + (i * 100), "Attack Level:", Color.Orange, out reason))
{
return false;
}
if (!_attackLevelValueLabels[i].Initialize(_x + 315, _y + 43 + (i * 100), string.Empty, Color.White, out reason))
{
return false;
}
if (!_hitPointsBackgrounds[i].Initialize(_x + 165, _y + 66 + (i * 100), 160, 28, StretchableImageType.TinyButtonBG, gameMain.Random, out reason))
{
return false;
}
if (!_hitPointsLabels[i].Initialize(_x + 170, _y + 72 + (i * 100), "Hit Points:", Color.Orange, out reason))
{
return false;
}
if (!_hitPointsValueLabels[i].Initialize(_x + 315, _y + 72 + (i * 100), string.Empty, Color.White, out reason))
{
return false;
}
if (!_shieldBackgrounds[i].Initialize(_x + 325, _y + 5 + (i * 100), 140, 35, StretchableImageType.TinyButtonBG, gameMain.Random, out reason))
{
return false;
}
if (!_shieldLabels[i].Initialize(_x + 330, _y + 12 + (i * 100), "Shield Level:", Color.Orange, out reason))
{
return false;
}
if (!_shieldValueLabels[i].Initialize(_x + 455, _y + 12 + (i * 100), string.Empty, Color.White, out reason))
{
return false;
}
if (!_galaxySpeedBackgrounds[i].Initialize(_x + 325, _y + 39 + (i * 100), 140, 28, StretchableImageType.TinyButtonBG, gameMain.Random, out reason))
{
return false;
}
if (!_galaxySpeedLabels[i].Initialize(_x + 330, _y + 43 + (i * 100), "Galaxy Speed:", Color.Orange, out reason))
{
return false;
}
if (!_galaxySpeedValueLabels[i].Initialize(_x + 455, _y + 43 + (i * 100), string.Empty, Color.White, out reason))
{
return false;
}
if (!_combatSpeedBackgrounds[i].Initialize(_x + 325, _y + 66 + (i * 100), 140, 28, StretchableImageType.TinyButtonBG, gameMain.Random, out reason))
{
return false;
}
if (!_combatSpeedLabels[i].Initialize(_x + 330, _y + 72 + (i * 100), "Combat Speed:", Color.Orange, out reason))
{
return false;
}
if (!_combatSpeedValueLabels[i].Initialize(_x + 455, _y + 72 + (i * 100), string.Empty, Color.White, out reason))
{
return false;
}
if (!_weaponsBackgrounds[i].Initialize(_x + 470, _y + (i * 100), 200, 100, StretchableImageType.ThinBorderBG, gameMain.Random, out reason))
{
return false;
}
if (!_specialsBackgrounds[i].Initialize(_x + 670, _y + (i * 100), 190, 100, StretchableImageType.ThinBorderBG, gameMain.Random, out reason))
{
return false;
}
if (!_amountLabels[i].Initialize(_x + 675, _y + (i * 100) + 63, "Amt:", Color.Orange, out reason))
{
return false;
}
if (!_amountValueLabels[i].Initialize(_x + 755, _y + (i * 100) + 63, string.Empty, Color.White, out reason))
{
return false;
}
if (!_costLabels[i].Initialize(_x + 760, _y + (i * 100) + 63, "Cost: ", Color.Orange, out reason))
{
return false;
}
if (!_costValueLabels[i].Initialize(_x + 855, _y + (i * 100) + 63, string.Empty, Color.White, out reason))
{
return false;
}
_beamDefValueLabels[i].SetAlignment(true);
_missileDefValueLabels[i].SetAlignment(true);
_attackLevelValueLabels[i].SetAlignment(true);
_hitPointsValueLabels[i].SetAlignment(true);
_shieldValueLabels[i].SetAlignment(true);
_galaxySpeedValueLabels[i].SetAlignment(true);
_combatSpeedValueLabels[i].SetAlignment(true);
_costValueLabels[i].SetAlignment(true);
_amountValueLabels[i].SetAlignment(true);
_weaponLabels[i] = new BBLabel[4];
for (int j = 0; j < _weaponLabels[i].Length; j++)
{
_weaponLabels[i][j] = new BBLabel();
if (!_weaponLabels[i][j].Initialize(_x + 475, _y + 7 + (i * 100 + j * 21), string.Empty, Color.White, out reason))
{
return false;
}
}
_specialLabels[i] = new BBLabel[3];
for (int j = 0; j < _specialLabels[i].Length; j++)
{
_specialLabels[i][j] = new BBLabel();
if (!_specialLabels[i][j].Initialize(_x + 675, _y + 7 + (i * 100 + j * 21), string.Empty, Color.White, out reason))
{
return false;
}
}
}
reason = null;
return true;
}