public void CreateOrbitCommandMenu(GameUpdateClassComponents curGameUpdateComponents, DataCards.Planet curPlanet) { //Create a Orbit Command Menu //Disable other controls this.disableAllControls(); Rectangle myAvgRect = new Rectangle(300, 200, 600, 400); List<GameEngine.PlayerInvObjs.InvUnit> shipInvUnits = new List<GameEngine.PlayerInvObjs.InvUnit>(); shipInvUnits = curGameUniverse.getPlanetByName(curPlanet.Name).Orbit.StarshipFleetsInOrbit; List<Controls.DataCardIconControl> dataCards = new List<GalacticConquest.Controls.DataCardIconControl>(); foreach (GameEngine.PlayerInvObjs.InvUnit curIU in shipInvUnits) { Controls.DataCardIconControl curDataCard = new GalacticConquest.Controls.DataCardIconControl(); //If Under construction@!!///// if (curIU._underConstruction) { curDataCard.imgControl = curGameUpdateComponents._staticTextureImages._underConstructionFacility; curDataCard.strControlText = curIU.iuShip.HeaderText + " (U/C " + curIU._remainingConstructionDays.ToString() + " days left)"; } else { curDataCard.imgControl = Texture2D.FromFile(curGameUpdateComponents._graphicsDevice, Model.DataUtilities._ShipsImagePath + curIU.iuShip.Name + ".jpg"); curDataCard.strControlText = curIU.iuShip.HeaderText; } Rectangle curDataCardRect = new Rectangle(myAvgRect.X + 10, myAvgRect.Y + 10, curDataCard.imgControl.Width, curDataCard.imgControl.Height); curDataCard.rectControl = curDataCardRect; curDataCard._isNull = false; dataCards.Add(curDataCard); } ///////////////////////////////// //Create Orbit Planet Menu ////////////////////////////////// Texture2D curTexture = curGameUpdateComponents._staticTextureImages._orbitCommandMenu; //Vector2 curVector = new Vector2(100, 100); //Rectangle curRect = new Rectangle(100, 100, 300, 300); Controls.PlanetOrbitControl curMenuControl = new Controls.PlanetOrbitControl(); //Start Menu Button List List<Controls.FancyButtonControl> menuButtons = new List<Controls.FancyButtonControl>(); //Get Continue Button Settings Texture2D curButtonTexture = curGameUpdateComponents._staticTextureImages._buttonTexture; Vector2 curButtonVector = new Vector2(110, 340); Rectangle curButtonRect = new Rectangle(110, 340, 130, 50); //Add the Continue Button //menuButtons.Add(new GalacticConquest.Controls.FancyButtonControl("btnSaveSettings", curButtonTexture, curButtonVector, curButtonRect, "Save")); //Add the Exit Button curButtonVector = new Vector2(365, 650); curButtonRect = new Rectangle(365, 650, 130, 50); menuButtons.Add(new Controls.FancyButtonControl("btnExitOrbitMenu", curButtonTexture, curButtonVector, curButtonRect, "Exit")); //Create the Menu Control curMenuControl = new Controls.PlanetOrbitControl("mnuOrbit", curPlanet.Name, curTexture, Model.OrientationType.Left, curPlanet.Name, "...Settings List Here...", menuButtons, curGameUniverse.getAllPlanetsList(), curGameUpdateComponents, this.curGameUniverse.getPlanetByName(curPlanet.Name).Orbit.StarshipFleetsInOrbit); this.LeftPlanetOrbitMenu = curMenuControl; //Add menu control to list //activeImgMenus.Add(curMenuControl); }
public void CreatePlanetCommandMenu(GameUpdateClassComponents curGameUpdateComponents, DataCards.Planet curPlanet) { //Create a Planet Command Menu //Disable other controls this.disableAllControls(); Rectangle myAvgRect = new Rectangle(300, 200, 600, 400); List<GameEngine.PlayerInvObjs.InvUnit> facilityInvUnits = new List<GameEngine.PlayerInvObjs.InvUnit>(); facilityInvUnits = curGameUniverse.getPlanetByName(curPlanet.Name).GroundSpaces.Facilities; List<GameEngine.PlayerInvObjs.InvUnit> troopsInvUnits = new List<GameEngine.PlayerInvObjs.InvUnit>(); troopsInvUnits = curGameUniverse.getPlanetByName(curPlanet.Name).GroundSpaces.Troops; List<Controls.DataCardIconControl> facilityDataCards = new List<GalacticConquest.Controls.DataCardIconControl>(); List<Controls.DataCardIconControl> troopsDataCards = new List<GalacticConquest.Controls.DataCardIconControl>(); foreach (GameEngine.PlayerInvObjs.InvUnit curIU in facilityInvUnits) { Controls.DataCardIconControl curDataCard = new GalacticConquest.Controls.DataCardIconControl(); //If Under construction@!!///// if (curIU._underConstruction) { curDataCard.imgControl = curGameUpdateComponents._staticTextureImages._underConstructionFacility; curDataCard.strControlText = curIU.iuFacility.HeaderText + " (U/C " + curIU._remainingConstructionDays.ToString() + " days left)"; } else { curDataCard.imgControl = Texture2D.FromFile(curGameUpdateComponents._graphicsDevice, Model.DataUtilities._FacilitiesImagePath + curIU.iuFacility.Name + ".jpg"); curDataCard.strControlText = curIU.iuFacility.HeaderText; } Rectangle curDataCardRect = new Rectangle(myAvgRect.X + 10, myAvgRect.Y + 10, curDataCard.imgControl.Width, curDataCard.imgControl.Height); curDataCard.rectControl = curDataCardRect; curDataCard._isNull = false; facilityDataCards.Add(curDataCard); } foreach (GameEngine.PlayerInvObjs.InvUnit curIU in troopsInvUnits) { Controls.DataCardIconControl curDataCard = new GalacticConquest.Controls.DataCardIconControl(); //If Under construction@!!///// if (curIU._underConstruction) { curDataCard.imgControl = curGameUpdateComponents._staticTextureImages._underConstructionFacility; // Use a troops Under Construction image when you get one... curDataCard.strControlText = curIU.iuTroops.HeaderText + " (U/C " + curIU._remainingConstructionDays.ToString() + " days left)"; } else { curDataCard.imgControl = Texture2D.FromFile(curGameUpdateComponents._graphicsDevice, Model.DataUtilities._TroopsImagePath + curIU.iuTroops.Name + ".jpg"); curDataCard.strControlText = curIU.iuTroops.HeaderText; } Rectangle curDataCardRect = new Rectangle(myAvgRect.X + 10, myAvgRect.Y + 10, curDataCard.imgControl.Width, curDataCard.imgControl.Height); curDataCard.rectControl = curDataCardRect; curDataCard._isNull = false; troopsDataCards.Add(curDataCard); } Controls.PlanetCommandControl newPlanetCmdMenu = new Controls.PlanetCommandControl(); newPlanetCmdMenu.menuImageToDisplay = curGameUpdateComponents._staticTextureImages._planetCommandMenu; newPlanetCmdMenu.menuVector = new Vector2(50, 100); newPlanetCmdMenu.HeaderText = curPlanet.HeaderText; newPlanetCmdMenu.Description = curPlanet.Description; newPlanetCmdMenu.Name = "plntCmdMenu"; newPlanetCmdMenu.tag = curPlanet; newPlanetCmdMenu.SelectedPlanetName = curPlanet.Name; newPlanetCmdMenu._isEnabled = true; newPlanetCmdMenu._isNull = false; /////////////////////////////////////////////////////////////////// //Create Tab Control Controls.TabPanel.TabPanelControl tabControl = new Controls.TabPanel.TabPanelControl(); tabControl.TabSelectedTexture = curGameUpdateComponents._staticTextureImages._tabSelected; tabControl.TabUnselectedTexture = curGameUpdateComponents._staticTextureImages._tabUnselected; tabControl.VectorPosition = new Vector2(300,157); Controls.TabPanel.TabPanel tabPanelCmd = new Controls.TabPanel.TabPanel(); Controls.PanelControl btnPanel = new Controls.PanelControl(); btnPanel._isEnabled = true; btnPanel._isNull = false; btnPanel.backColor = Color.LightSalmon; btnPanel.borderColor = Color.Black; btnPanel.borderSize = 2; btnPanel.panelRect = myAvgRect; if (curPlanet.GroundSpaces.hasFacilityMFR()) //If the planet has a manufactoring facility then let them build { Controls.FancyButtonControl btnFacilityMFR = new Controls.FancyButtonControl(); Vector2 btnFacilVector = new Vector2(350,270); Rectangle btnFacilRect = new Rectangle((int)btnFacilVector.X, (int)btnFacilVector.Y, curGameUpdateComponents._staticTextureImages._buttonTexture.Width, curGameUpdateComponents._staticTextureImages._buttonTexture.Height); btnFacilityMFR = new Controls.FancyButtonControl("btnFacilityMFR", curGameUpdateComponents._staticTextureImages._buttonTexture, btnFacilVector, btnFacilRect, "Construct Buildings"); btnPanel.menuButtons.Add(btnFacilityMFR); } if (curPlanet.GroundSpaces.hasShipMFR())//If the planet has a ship building facility then let them build { Controls.FancyButtonControl btnShipMFR = new Controls.FancyButtonControl(); Vector2 btnFacilVector = new Vector2(curGameUpdateComponents._staticTextureImages._buttonTexture.Width + 350 + 75, 270); Rectangle rectShipMFR = new Rectangle((int)btnFacilVector.X, (int)btnFacilVector.Y, curGameUpdateComponents._staticTextureImages._buttonTexture.Width, curGameUpdateComponents._staticTextureImages._buttonTexture.Height); btnShipMFR = new Controls.FancyButtonControl("btnShipMFR", curGameUpdateComponents._staticTextureImages._buttonTexture, btnFacilVector, rectShipMFR, "Construct Ships"); btnPanel.menuButtons.Add(btnShipMFR); } if (curPlanet.GroundSpaces.hasTroopsMFR())//If the planet has a troops building facility then let them build { Controls.FancyButtonControl btnTroopsMFR = new Controls.FancyButtonControl(); Vector2 btnFacilVector = new Vector2(350, curGameUpdateComponents._staticTextureImages._buttonTexture.Height + 270 + 50); Rectangle rectTroopsMFR = new Rectangle((int)btnFacilVector.X, (int)btnFacilVector.Y, curGameUpdateComponents._staticTextureImages._buttonTexture.Width, curGameUpdateComponents._staticTextureImages._buttonTexture.Height); btnTroopsMFR = new Controls.FancyButtonControl("btnTroopsMFR", curGameUpdateComponents._staticTextureImages._buttonTexture, btnFacilVector, rectTroopsMFR, "Construct Troops"); btnPanel.menuButtons.Add(btnTroopsMFR); } if (curPlanet.GroundSpaces.hasTroops() && curPlanet.Orbit.hasShipsInOrbit())//If the planet has troops and ship then let them move them { Controls.FancyButtonControl btnTroops = new Controls.FancyButtonControl(); Vector2 btnFacilVector = new Vector2(curGameUpdateComponents._staticTextureImages._buttonTexture.Width + 350 + 75, curGameUpdateComponents._staticTextureImages._buttonTexture.Height + 270 + 50); Rectangle rectTroopsMFR = new Rectangle((int)btnFacilVector.X, (int)btnFacilVector.Y, curGameUpdateComponents._staticTextureImages._buttonTexture.Width, curGameUpdateComponents._staticTextureImages._buttonTexture.Height); btnTroops = new Controls.FancyButtonControl("btnTroops", curGameUpdateComponents._staticTextureImages._buttonTexture, btnFacilVector, rectTroopsMFR, "Move Troops"); btnPanel.menuButtons.Add(btnTroops); } //btnPanel. tabPanelCmd.Name = "Command"; tabPanelCmd.TabText = "Command"; tabPanelCmd.selected = true; tabPanelCmd.panel = btnPanel; tabPanelCmd._isNull = false; Controls.TabPanel.TabPanel tabPanelFacility = new Controls.TabPanel.TabPanel(); Controls.PanelControl facilityPanel = new Controls.PanelControl(); facilityPanel._isEnabled = true; facilityPanel._isNull = false; facilityPanel.backColor = Color.LightGreen; facilityPanel.borderColor = Color.Black; facilityPanel.borderSize = 2; facilityPanel.panelRect = myAvgRect; //Add Facility DataCards //facilityPanel. facilityPanel.dataCards = facilityDataCards; tabPanelFacility.Name = "Facilities"; tabPanelFacility.TabText = "Facilities"; tabPanelFacility.panel = facilityPanel; tabPanelFacility._isNull = false; Controls.TabPanel.TabPanel tabPanelTroops = new Controls.TabPanel.TabPanel(); Controls.PanelControl troopsPanel = new Controls.PanelControl(); troopsPanel._isEnabled = true; troopsPanel._isNull = false; troopsPanel.backColor = Color.Gray; troopsPanel.borderColor = Color.Red; troopsPanel.borderSize = 2; troopsPanel.panelRect = myAvgRect; troopsPanel.dataCards = troopsDataCards; tabPanelTroops.Name = "Troops"; tabPanelTroops.TabText = "Troops"; tabPanelTroops.panel = troopsPanel; tabPanelTroops._isNull = false; //Insert all panels intoTab control tabControl.tabPanels.Add(tabPanelCmd); tabControl.tabPanels.Add(tabPanelFacility); tabControl.tabPanels.Add(tabPanelTroops); //Add the Tab Control newPlanetCmdMenu.tabControl = tabControl; //Add the Exit Button newPlanetCmdMenu.menuButtons.Add(new Controls.FancyButtonControl("btnExitPlanetCmdMenu", curGameUpdateComponents._staticTextureImages._buttonTexture, new Vector2(800, 680), new Rectangle(800, 680, 130, 50), "Exit")); this.PlanetCommandMenu = newPlanetCmdMenu; }