public void SetupStatic()
{
if (/*menuTab == null*/ true)
{
menuTab = ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\playerMenuTab");
menuTabSource = new Rectangle[2];
menuTabSource[SELECTED] = new Rectangle(0, menuTab.Width, menuTab.Width, menuTab.Height / 2);
menuTabSource[NORMAL] = new Rectangle(0, 0, menuTab.Width, menuTab.Height / 2);
statusFont = ScreenManager.Game.Content.Load<SpriteFont>("PlayerMenu\\statusFont");
highlightIcon = ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\Icons\\icon_selector");
tabLocation = new Vector2[5][];
Vector2 tabOffset = new Vector2(15, 0);
moneyLocation = new Vector2[5];
statusHealthLocation = new Vector2[5];
computerStatusHealthLocation = new Vector2[5];
statusNumberOfUnitsLocation = new Vector2[5];
computerStatusNumberOfUnitsLocation = new Vector2[5];
iconLocations = new Vector2[5][];
highlightIconLocations = new Rectangle[5][];
Vector2 iconOffset = new Vector2(0, 36);
defenseTowerInfo = new TowerInformation[NUM_DEFENSE_TOWERS];
defenseIcons = new Texture2D[3];
defenseIcons[0] = ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\Icons\\plasma_tower");
defenseIcons[1] = ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\Icons\\electric_tower");
defenseIcons[2] = ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\Icons\\plasma360_tower");
defenseTowerInfo[0].name = "Plasma Tower";
defenseTowerInfo[0].price = "Price: $100";
defenseTowerInfo[0].description = "Shoots quick, but weak\nblasts at the enemy";
defenseTowerInfo[0].nameLocation = new Vector2[5];
defenseTowerInfo[0].descriptionLocation = new Vector2[5];
defenseTowerInfo[0].priceLocation = new Vector2[5];
defenseTowerInfo[0].type = TowerType.Plasma;
defenseTowerInfo[1].name = "Electric Tower";
defenseTowerInfo[1].price = "Price: $250";
defenseTowerInfo[1].description = "Shoots slow, but strong\nblasts at the enemy";
defenseTowerInfo[1].nameLocation = new Vector2[5];
defenseTowerInfo[1].descriptionLocation = new Vector2[5];
defenseTowerInfo[1].priceLocation = new Vector2[5];
defenseTowerInfo[1].type = TowerType.Electric;
defenseTowerInfo[2].name = "Cannon Tower";
defenseTowerInfo[2].price = "Price: $170";
defenseTowerInfo[2].description = "Shoots average speed\nwith average damage";
defenseTowerInfo[2].nameLocation = new Vector2[5];
defenseTowerInfo[2].descriptionLocation = new Vector2[5];
defenseTowerInfo[2].priceLocation = new Vector2[5];
defenseTowerInfo[2].type = TowerType.Cannon;
lastBuiltTower = TowerType.Plasma;
defenseTowerInfo[2].priceLocation = new Vector2[5];
towerTitle = ScreenManager.Game.Content.Load<SpriteFont>("PlayerMenu\\towerTitle");
towerPrice = ScreenManager.Game.Content.Load<SpriteFont>("PlayerMenu\\towerPrice");
towerDescription = ScreenManager.Game.Content.Load<SpriteFont>("PlayerMenu\\towerDescription");
offenseTowerInfo = new TowerInformation[NUM_OFFENSE_TOWERS];
offenseIcons = new Texture2D[NUM_OFFENSE_TOWERS];
offenseIcons[0] = ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\Icons\\plasma_tower");
offenseIcons[1] = ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\Icons\\electric_tower");
offenseTowerInfo[0].name = "Small Training Area";
offenseTowerInfo[0].price = "Price: $200";
offenseTowerInfo[0].description = "Trains units\nfor use";
offenseTowerInfo[0].nameLocation = new Vector2[5];
offenseTowerInfo[0].descriptionLocation = new Vector2[5];
offenseTowerInfo[0].priceLocation = new Vector2[5];
offenseTowerInfo[0].type = TowerType.SmallUnit;
offenseTowerInfo[1].name = "Large Training Area";
offenseTowerInfo[1].price = "Price: $450";
offenseTowerInfo[1].description = "Trains units\nfor use much\nmore quickly";
offenseTowerInfo[1].nameLocation = new Vector2[5];
offenseTowerInfo[1].descriptionLocation = new Vector2[5];
offenseTowerInfo[1].priceLocation = new Vector2[5];
offenseTowerInfo[1].type = TowerType.LargeUnit;
offenseTowerInfo = new TowerInformation[NUM_OFFENSE_TOWERS];
offenseIcons = new Texture2D[NUM_OFFENSE_TOWERS];
offenseIcons[0] = ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\Icons\\plasma_tower");
offenseIcons[1] = ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\Icons\\electric_tower");
offenseTowerInfo[0].name = "Small Training Area";
offenseTowerInfo[0].price = "Price: $200";
offenseTowerInfo[0].description = "Trains units\nfor use";
offenseTowerInfo[0].nameLocation = new Vector2[5];
offenseTowerInfo[0].descriptionLocation = new Vector2[5];
offenseTowerInfo[0].priceLocation = new Vector2[5];
offenseTowerInfo[0].type = TowerType.SmallUnit;
offenseTowerInfo[1].name = "Large Training Area";
offenseTowerInfo[1].price = "Price: $450";
offenseTowerInfo[1].description = "Trains units\nfor use much\nmore quickly";
offenseTowerInfo[1].nameLocation = new Vector2[5];
offenseTowerInfo[1].descriptionLocation = new Vector2[5];
offenseTowerInfo[1].priceLocation = new Vector2[5];
offenseTowerInfo[1].type = TowerType.LargeUnit;
unitIconLocation = new Vector2[5][];
unitNumberPosition = new Vector2[5][];
unitFont = ScreenManager.Game.Content.Load<SpriteFont>("PlayerMenu\\towerPrice");
highlightUnitIconLocations = new Rectangle[5][];
unitIcons = new Texture2D[MAX_UNIT_TYPES];
Vector2 unitIconOffset = new Vector2(44.0f, 0.0f);
Vector2 unitIconRowOffset = new Vector2(0.0f, 44.0f);
unitInformation = new UnitInformation[MAX_UNIT_TYPES];
unitInformation[1].type = UnitType.SpeedBoat;
unitInformation[1].icon = ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\Icons\\speedBoat");
unitInformation[6].type = UnitType.SpeederBoat;
unitInformation[6].icon = ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\Icons\\speederBoat");
unitMeterBaseTexture = ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\unit_meter_base");
unitMeterBaseLocation = new Rectangle[5];
unitMeterOverlayMaxHeight = new float[5];
//unitMeterHighlightTexture = new Texture2D[5];
unitMeterOverlayTexture = new Texture2D[5];
for (int i = 1; i < 5; i++ )
unitMeterOverlayTexture[i] = ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\unit_meter_overlay_0" + i);
unitMeterOverlaySource = new Rectangle(0, 10, 50, 100);
unitMeterOverlayDestination = new Rectangle[5];
//unitMeterHighlightTexture = ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\unit_meter_animated");
//unitMeterHightlightSource = new Rectangle(0, 0, 30, 0);
unitMeterOverlayBaseY = new float[5];
powerIconLocations = new Vector2[5][];
powerHighlightIconLocations = new Rectangle[5][];
powerNameLocation = new Vector2[5];
powerDescriptionLocation = new Vector2[5];
powerPriceLocation = new Vector2[5];
for (int player = 1; player < 5; player++)
{
Vector2 tabStartPosition = new Vector2(8, 148);
tabLocation[player] = new Vector2[NUM_TABS];
for (int t = 0; t < NUM_TABS; t++)
{
tabLocation[player][t] = globalLocations[player] + tabStartPosition;
tabStartPosition += tabOffset;
}
moneyLocation[player] = globalLocations[player] + new Vector2(110, -1);
statusHealthLocation[player] = globalLocations[player] + new Vector2(164, 38);
computerStatusHealthLocation[player] = globalLocations[player] + new Vector2(178, 62);
statusNumberOfUnitsLocation[player] = globalLocations[player] + new Vector2(164, 60);
computerStatusNumberOfUnitsLocation[player] = globalLocations[player] + new Vector2(178, 82);
statusHealthLocation[player] = globalLocations[player] + new Vector2(125, 36);
computerStatusHealthLocation[player] = globalLocations[player] + new Vector2(125, 36);
statusNumberOfUnitsLocation[player] = globalLocations[player] + new Vector2(125, 85);
computerStatusNumberOfUnitsLocation[player] = globalLocations[player] + new Vector2(125, 85);
iconLocations[player] = new Vector2[4];
highlightIconLocations[player] = new Rectangle[4];
Vector2 iconStartPosition = new Vector2(30, 36);
Vector2 iconrowOffset = new Vector2(36, 0);
for (int icon = 0; icon < 4; icon++)
{
iconLocations[player][icon] = globalLocations[player] + iconStartPosition;
highlightIconLocations[player][icon] = new Rectangle((int)(iconLocations[player][icon].X - 5.0f + (highlightIcon.Width / 2)),
(int)(iconLocations[player][icon].Y - 5.0f + (highlightIcon.Height / 2)),
highlightIcon.Width, highlightIcon.Height);
if (icon % 2 == 1)
{
iconStartPosition += iconrowOffset;
iconStartPosition.Y = iconrowOffset.X;
}
else
iconStartPosition += iconOffset;
}
for (int tower = 0; tower < NUM_DEFENSE_TOWERS; tower++)
{
defenseTowerInfo[tower].nameLocation[player] = globalLocations[player] + new Vector2(120.0f, 30);
defenseTowerInfo[tower].priceLocation[player] = globalLocations[player] + new Vector2(120.0f, 64);
defenseTowerInfo[tower].descriptionLocation[player] = globalLocations[player] + new Vector2(120.0f, 94);
}
for (int tower = 0; tower < NUM_OFFENSE_TOWERS; tower++)
{
offenseTowerInfo[tower].nameLocation[player] = globalLocations[player] + new Vector2(120.0f, 30);
offenseTowerInfo[tower].priceLocation[player] = globalLocations[player] + new Vector2(120.0f, 64);
offenseTowerInfo[tower].descriptionLocation[player] = globalLocations[player] + new Vector2(120.0f, 94);
}
unitIconLocation[player] = new Vector2[MAX_UNIT_TYPES];
unitNumberPosition[player] = new Vector2[MAX_UNIT_TYPES];
highlightUnitIconLocations[player] = new Rectangle[MAX_UNIT_TYPES];
Vector2 unitIconStartPosition = new Vector2(48, 36);
for (int unit = 0; unit < MAX_UNIT_TYPES; unit++)
{
if (unit == 4)
{
//move over invalid middle
unitIconStartPosition += unitIconOffset;
}
unitIconLocation[player][unit] = globalLocations[player] + unitIconStartPosition;
unitNumberPosition[player][unit] = unitIconLocation[player][unit] + new Vector2(44, 4);
highlightUnitIconLocations[player][unit] = new Rectangle((int)(unitIconLocation[player][unit].X - 5.0f + (highlightIcon.Width / 2)),
(int)(unitIconLocation[player][unit].Y - 5.0f + (highlightIcon.Height / 2)),
highlightIcon.Width, highlightIcon.Height);
unitIconStartPosition += unitIconOffset;
if (unit == 2 || unit == 4)
{
unitIconStartPosition += unitIconRowOffset;
unitIconStartPosition.X = 48;
}
}
unitMeterOverlayDestination[player] = new Rectangle((int)globalLocations[player].X + 8,
(int)globalLocations[player].Y + 44 + 110,
50,
0);
unitMeterOverlayBaseY[player] = unitMeterOverlayDestination[player].Y;
unitMeterBaseLocation[player] = new Rectangle((int)globalLocations[player].X + 8,
(int)globalLocations[player].Y + 44,
50,
120);
unitMeterOverlayMaxHeight[player] = unitMeterBaseLocation[player].Height - 20.0f;
//POWERS
powerIcons = new Texture2D[NUM_POWERS];
powerIconLocations[player] = new Vector2[NUM_POWERS];
powerHighlightIconLocations[player] = new Rectangle[NUM_POWERS];
powerNameLocation[player] = globalLocations[player] + new Vector2(120.0f, 30);
powerPriceLocation[player] = globalLocations[player] + new Vector2(120.0f, 64);
powerDescriptionLocation[player] = globalLocations[player] + new Vector2(120.0f, 94);
powerIconStartPosition = new Vector2(8, 34);
for (int power = 0; power < NUM_POWERS; power++)
{
switch ((PowerType)power)
{
case PowerType.FreezeEnemies:
powerIcons[power] = ScreenManager.Game.Content.Load<Texture2D>("Powers\\icon_PFrozen");
break;
case PowerType.Rezoning:
powerIcons[power] = ScreenManager.Game.Content.Load<Texture2D>("Powers\\icon_PZone");
break;
case PowerType.StrongTowers:
powerIcons[power] = ScreenManager.Game.Content.Load<Texture2D>("Powers\\icon_PStrong");
break;
case PowerType.EMP:
powerIcons[power] = ScreenManager.Game.Content.Load<Texture2D>("Powers\\icon_PEMP");
break;
case PowerType.Bombastic:
powerIcons[power] = ScreenManager.Game.Content.Load<Texture2D>("Powers\\icon_PBombastic");
break;
}
powerIconLocations[player][power] = globalLocations[player] + powerIconStartPosition;
powerHighlightIconLocations[player][power] = new Rectangle((int)(powerIconLocations[player][power].X - 5.0f + (highlightIcon.Width / 2)),
(int)(powerIconLocations[player][power].Y - 5.0f + (highlightIcon.Height / 2)),
highlightIcon.Width, highlightIcon.Height);
if (power % 3 == 1 && power != 0)
{
powerIconStartPosition.Y = powerIconOffset.Y;
powerIconStartPosition.X += powerIconOffset.Y;
}
else
powerIconStartPosition += powerIconRowOffset;
}
}
highlightIconSourceRect = new Rectangle(0, 0, highlightIcon.Width, highlightIcon.Height);
highlightOrigin = new Vector2(highlightIcon.Width / 2.0f, highlightIcon.Height / 2.0f);
defensiveTab = new Texture2D[5][];
offensiveTab = new Texture2D[5][];
statusTab = new Texture2D[5][];
powersTab = new Texture2D[5][];
backgroundTabs = new Texture2D[5][];
computerTags = new Texture2D[5];
computerTagLocations = new Vector2[5];
for (int player = 1; player < 5; player++)
{
defensiveTab[player] = new Texture2D[5];
offensiveTab[player] = new Texture2D[5];
statusTab[player] = new Texture2D[5];
powersTab[player] = new Texture2D[5];
backgroundTabs[player] = new Texture2D[5];
computerTags[player] = ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\Tabs\\computerMode" + mapTeamNumToTeamChar[player]);
computerTagLocations[player] = globalLocations[player] + new Vector2(0, 105);
for (int team = 1; team < 5; team++)
{
defensiveTab[player][team] =
ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\Tabs\\player0" + player + "DefensiveUnits" + mapTeamNumToTeamChar[team]);
ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\Tabs\\player0" + player +
"DefensiveUnits" + mapTeamNumToTeamChar[team]);
offensiveTab[player][team] =
ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\Tabs\\player0" + player + "OffensiveUnits" + mapTeamNumToTeamChar[team]);
ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\Tabs\\player0" + player +
"OffensiveUnits" + mapTeamNumToTeamChar[team]);
statusTab[player][team] =
ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\Tabs\\player0" + player + "Status" + mapTeamNumToTeamChar[team]);
ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\Tabs\\player0" + player +
"Status" + mapTeamNumToTeamChar[team]);
powersTab[player][team] =
ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\Tabs\\player0" + player + "Power" + mapTeamNumToTeamChar[team]);
ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\Tabs\\player0" + player +
"Power" + mapTeamNumToTeamChar[team]);
backgroundTabs[player][team] =
ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\Tabs\\player0" + player + "BACKGROUND_" + mapTeamNumToTeamChar[team]);
ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\Tabs\\player0" + player +
"BACKGROUND_" + mapTeamNumToTeamChar[team]);
}
}
healthicon = ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\Icons\\icon_health");
numUnitsIcon = ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\Icons\\icon_num_units");
healthIconLocations = new Vector2[5];
numUnitsIconLocations = new Vector2[5];
for (int i = 1; i < 5; i++)
{
healthIconLocations[i] = globalLocations[i] + healthIconOffset;
numUnitsIconLocations[i] = globalLocations[i] + numUnitsIconOffset;
}
statusScreenFont = ScreenManager.Game.Content.Load<SpriteFont>("PlayerMenu\\statusScreenFont");
healthicon = ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\Icons\\icon_health");
numUnitsIcon = ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\Icons\\icon_num_units");
healthIconLocations = new Vector2[5];
numUnitsIconLocations = new Vector2[5];
for (int i = 1; i < 5; i++)
{
healthIconLocations[i] = globalLocations[i] + healthIconOffset;
numUnitsIconLocations[i] = globalLocations[i] + numUnitsIconOffset;
}
statusScreenFont = ScreenManager.Game.Content.Load<SpriteFont>("PlayerMenu\\statusScreenFont");
attackingPlayer = new Texture2D[5];
attackingPlayerLocation = new Vector2[5];
for (int p = 1; p < 5; p++)
{
attackingPlayer[p] = ScreenManager.Game.Content.Load<Texture2D>("PlayerMenu\\Attacking\\" + p);
attackingPlayerLocation[p] = globalLocations[p] + new Vector2(260.0f, 126.0f);
}
}
}