////////////////////////////////////////////////////////////////// //Constructors public GalacticGameEngine() { ID = ""; Name = ""; Player1 = new Player(); _gameIsRunning = false; curGalacticDayMang = new GalacticDayManager(); curGameUniverse = new GameUniverse(); MainMapControl = new Controls.GameEngineControls.GalacticMapControl(); TopBarControl = new Controls.GameEngineControls.GameTopBarControl(); RightBarControl = new Controls.GameEngineControls.GameRightBarControl(); LeftPlanetMenu = new Controls.PlanetsInGalaxyMenu(); RightPlanetMenu = new Controls.PlanetsInGalaxyMenu(); LeftPlanetOrbitMenu = new Controls.PlanetOrbitControl(); InfoMenu = new Controls.GameInformationMenu(); PlanetCommandMenu = new Controls.PlanetCommandControl(); ConstructionMenu = new Controls.GameEngineControls.ConstructionMenuControl(); }
public void buildConstructionMenu(GameUpdateClassComponents curGameUpdateComponents, string btnID) { //GameEngine.Manufacturing.FacilityMFR if (btnID == "btnFacilityMFR") { Controls.GameEngineControls.ConstructionMenuControl buildConstructionMenu = new Controls.GameEngineControls.ConstructionMenuControl(); DrawObj.Sprite menuBackImg = new DrawObj.Sprite(); Vector2 curVector = new Vector2(100, 100); menuBackImg = new DrawObj.Sprite("ConstructionMenuBackground", curVector, curGameUpdateComponents._staticTextureImages._constructionMenu); Controls.FancyDropDownBoxControl ddlPlanet = new Controls.FancyDropDownBoxControl(); ddlPlanet._isEnabled = true; ddlPlanet.backColor = Color.LightBlue; ddlPlanet.borderColor = Color.Black; Vector2 ddlPlanetsVector = new Vector2(370, 150); ddlPlanet.ID = "ddlPlanets"; ddlPlanet.selectedIndex = 0; ddlPlanet.borderSize = 2; ddlPlanet.dropDownBoxRect = new Rectangle((int)ddlPlanetsVector.X, (int)ddlPlanetsVector.Y, 100, 25); List<DataCards.Planet> lstPlanets = new List<DataCards.Planet>(); //lstPlanet.Add("Coruscant"); //lstPlanet.Add("Corfai"); //lstPlanet.Add("Corellia"); lstPlanets = curGameUniverse.getAllPlanetsList(); List<string> lstStrPlanetNames = new List<string>(); foreach (DataCards.Planet curPlanet in lstPlanets) lstStrPlanetNames.Add(curPlanet.Name); ddlPlanet.textOptions = lstStrPlanetNames; Vector2 ddlPlanetsArrowBoxVector = new Vector2(370, 150); ddlPlanet.dropDownBoxArrow = new DrawObj.Sprite("ddlPlanetsArrowbox", ddlPlanetsArrowBoxVector, curGameUpdateComponents._staticTextureImages._dropDownArrowTexture); buildConstructionMenu = new Controls.GameEngineControls.ConstructionMenuControl("facilContructMenu", "", menuBackImg); buildConstructionMenu.destinationDropDown = ddlPlanet; //Build facility type list Controls.FancyDropDownBoxControl ddlFacilityTypes = new Controls.FancyDropDownBoxControl(); ddlFacilityTypes._isEnabled = true; ddlFacilityTypes.backColor = Color.LightSeaGreen; ddlFacilityTypes.borderColor = Color.Black; Vector2 ddlFacilityTypesVector = new Vector2(125, 200); ddlFacilityTypes.ID = "ddlFacilityTypes"; ddlFacilityTypes.selectedIndex = 0; ddlFacilityTypes.borderSize = 2; ddlFacilityTypes.dropDownBoxRect = new Rectangle((int)ddlFacilityTypesVector.X, (int)ddlFacilityTypesVector.Y, 175, 25); List<string> lstFacilityTypes = new List<string>(); lstFacilityTypes.Add("Starport"); lstFacilityTypes.Add("Barracks"); lstFacilityTypes.Add("ConstructionYard"); ddlFacilityTypes.textOptions = lstFacilityTypes; Vector2 ddlFacilityTypesArrowBoxVector = new Vector2(125, 200); ddlFacilityTypes.dropDownBoxArrow = new DrawObj.Sprite("ddlFacilityTypesArrowbox", ddlFacilityTypesArrowBoxVector, curGameUpdateComponents._staticTextureImages._dropDownArrowTexture); //buildConstructionMenu = new Controls.GameEngineControls.ConstructionMenuControl("facilContructMenu", "", menuBackImg); buildConstructionMenu.facilityTypeDropDown = ddlFacilityTypes; //Button Time!!! //Add the Exit Button Vector2 vectExitBtn = new Vector2(300, 375); buildConstructionMenu.menuButtons.Add(new Controls.FancyButtonControl("btnExitManuFacilityMenu", curGameUpdateComponents._staticTextureImages._buttonTexture, vectExitBtn, new Rectangle((int)vectExitBtn.X, (int)vectExitBtn.Y, 130, 50), "Exit")); Vector2 vectConstructBtn = new Vector2(100, 375); buildConstructionMenu.menuButtons.Add(new Controls.FancyButtonControl("btnContructManuFacilityMenu", curGameUpdateComponents._staticTextureImages._buttonTexture, vectConstructBtn, new Rectangle((int)vectConstructBtn.X, (int)vectConstructBtn.Y, 130, 50), "Build")); ConstructionMenu = buildConstructionMenu; }//End btnFacilityMFR if (btnID == "btnShipMFR") { Controls.GameEngineControls.ConstructionMenuControl buildConstructionMenu = new Controls.GameEngineControls.ConstructionMenuControl(); DrawObj.Sprite menuBackImg = new DrawObj.Sprite(); Vector2 curVector = new Vector2(100, 100); menuBackImg = new DrawObj.Sprite("ConstructionMenuBackground", curVector, curGameUpdateComponents._staticTextureImages._constructionMenu); Controls.FancyDropDownBoxControl ddlPlanet = new Controls.FancyDropDownBoxControl(); ddlPlanet._isEnabled = true; ddlPlanet.backColor = Color.LightBlue; ddlPlanet.borderColor = Color.Black; Vector2 ddlPlanetsVector = new Vector2(370, 150); ddlPlanet.ID = "ddlPlanets"; ddlPlanet.selectedIndex = 0; ddlPlanet.borderSize = 2; ddlPlanet.dropDownBoxRect = new Rectangle((int)ddlPlanetsVector.X, (int)ddlPlanetsVector.Y, 100, 25); List<DataCards.Planet> lstPlanets = new List<DataCards.Planet>(); lstPlanets = curGameUniverse.getAllPlanetsList(); List<string> lstStrPlanetNames = new List<string>(); foreach (DataCards.Planet curPlanet in lstPlanets) lstStrPlanetNames.Add(curPlanet.Name); ddlPlanet.textOptions = lstStrPlanetNames; Vector2 ddlPlanetsArrowBoxVector = new Vector2(370, 150); ddlPlanet.dropDownBoxArrow = new DrawObj.Sprite("ddlPlanetsArrowbox", ddlPlanetsArrowBoxVector, curGameUpdateComponents._staticTextureImages._dropDownArrowTexture); buildConstructionMenu = new Controls.GameEngineControls.ConstructionMenuControl("shipContructMenu", "", menuBackImg); buildConstructionMenu.destinationDropDown = ddlPlanet; //Build facility type list Controls.FancyDropDownBoxControl ddlShipTypes = new Controls.FancyDropDownBoxControl(); ddlShipTypes._isEnabled = true; ddlShipTypes.backColor = Color.LightSeaGreen; ddlShipTypes.borderColor = Color.Black; Vector2 ddlShipTypesVector = new Vector2(125, 200); ddlShipTypes.ID = "ddlShipTypes"; ddlShipTypes.selectedIndex = 0; ddlShipTypes.borderSize = 2; ddlShipTypes.dropDownBoxRect = new Rectangle((int)ddlShipTypesVector.X, (int)ddlShipTypesVector.Y, 175, 25); List<string> lstShipTypes = new List<string>(); lstShipTypes.Add("NebulonBFrigate"); lstShipTypes.Add("ActionVITransport"); lstShipTypes.Add("AurekTacticalStrikefighter"); ddlShipTypes.textOptions = lstShipTypes; Vector2 ddlShipTypesArrowBoxVector = new Vector2(125, 200); ddlShipTypes.dropDownBoxArrow = new DrawObj.Sprite("ddlFacilityTypesArrowbox", ddlShipTypesArrowBoxVector, curGameUpdateComponents._staticTextureImages._dropDownArrowTexture); //buildConstructionMenu = new Controls.GameEngineControls.ConstructionMenuControl("facilContructMenu", "", menuBackImg); buildConstructionMenu.facilityTypeDropDown = ddlShipTypes; //Button Time!!! //Add the Exit Button Vector2 vectExitBtn = new Vector2(300, 375); buildConstructionMenu.menuButtons.Add(new Controls.FancyButtonControl("btnExitManuFacilityMenu", curGameUpdateComponents._staticTextureImages._buttonTexture, vectExitBtn, new Rectangle((int)vectExitBtn.X, (int)vectExitBtn.Y, 130, 50), "Exit")); Vector2 vectConstructBtn = new Vector2(100, 375); buildConstructionMenu.menuButtons.Add(new Controls.FancyButtonControl("btnContructManuShipMenu", curGameUpdateComponents._staticTextureImages._buttonTexture, vectConstructBtn, new Rectangle((int)vectConstructBtn.X, (int)vectConstructBtn.Y, 130, 50), "Build")); ConstructionMenu = buildConstructionMenu; }//End btnShipsMFR if (btnID == "btnTroopsMFR") { Controls.GameEngineControls.ConstructionMenuControl buildConstructionMenu = new Controls.GameEngineControls.ConstructionMenuControl(); DrawObj.Sprite menuBackImg = new DrawObj.Sprite(); Vector2 curVector = new Vector2(100, 100); menuBackImg = new DrawObj.Sprite("ConstructionMenuBackground", curVector, curGameUpdateComponents._staticTextureImages._constructionMenu); Controls.FancyDropDownBoxControl ddlPlanet = new Controls.FancyDropDownBoxControl(); ddlPlanet._isEnabled = true; ddlPlanet.backColor = Color.LightBlue; ddlPlanet.borderColor = Color.Black; Vector2 ddlPlanetsVector = new Vector2(370, 150); ddlPlanet.ID = "ddlPlanets"; ddlPlanet.selectedIndex = 0; ddlPlanet.borderSize = 2; ddlPlanet.dropDownBoxRect = new Rectangle((int)ddlPlanetsVector.X, (int)ddlPlanetsVector.Y, 100, 25); List<DataCards.Planet> lstPlanets = new List<DataCards.Planet>(); lstPlanets = curGameUniverse.getAllPlanetsList(); List<string> lstStrPlanetNames = new List<string>(); foreach (DataCards.Planet curPlanet in lstPlanets) lstStrPlanetNames.Add(curPlanet.Name); ddlPlanet.textOptions = lstStrPlanetNames; Vector2 ddlPlanetsArrowBoxVector = new Vector2(370, 150); ddlPlanet.dropDownBoxArrow = new DrawObj.Sprite("ddlPlanetsArrowbox", ddlPlanetsArrowBoxVector, curGameUpdateComponents._staticTextureImages._dropDownArrowTexture); buildConstructionMenu = new Controls.GameEngineControls.ConstructionMenuControl("troopsContructMenu", "", menuBackImg); buildConstructionMenu.destinationDropDown = ddlPlanet; //Build facility type list Controls.FancyDropDownBoxControl ddlTroopsTypes = new Controls.FancyDropDownBoxControl(); ddlTroopsTypes._isEnabled = true; ddlTroopsTypes.backColor = Color.LightSeaGreen; ddlTroopsTypes.borderColor = Color.Black; Vector2 ddlTroopsTypesVector = new Vector2(125, 200); ddlTroopsTypes.ID = "ddlTroopsTypes"; ddlTroopsTypes.selectedIndex = 0; ddlTroopsTypes.borderSize = 2; ddlTroopsTypes.dropDownBoxRect = new Rectangle((int)ddlTroopsTypesVector.X, (int)ddlTroopsTypesVector.Y, 175, 25); List<string> lstTroopsTypes = new List<string>(); lstTroopsTypes.Add("ImperialGarrison"); lstTroopsTypes.Add("StormTroopers"); ddlTroopsTypes.textOptions = lstTroopsTypes; Vector2 ddlShipTypesArrowBoxVector = new Vector2(125, 200); ddlTroopsTypes.dropDownBoxArrow = new DrawObj.Sprite("ddlFacilityTypesArrowbox", ddlShipTypesArrowBoxVector, curGameUpdateComponents._staticTextureImages._dropDownArrowTexture); //buildConstructionMenu = new Controls.GameEngineControls.ConstructionMenuControl("facilContructMenu", "", menuBackImg); buildConstructionMenu.facilityTypeDropDown = ddlTroopsTypes; //Button Time!!! //Add the Exit Button Vector2 vectExitBtn = new Vector2(300, 375); buildConstructionMenu.menuButtons.Add(new Controls.FancyButtonControl("btnExitManuFacilityMenu", curGameUpdateComponents._staticTextureImages._buttonTexture, vectExitBtn, new Rectangle((int)vectExitBtn.X, (int)vectExitBtn.Y, 130, 50), "Exit")); Vector2 vectConstructBtn = new Vector2(100, 375); buildConstructionMenu.menuButtons.Add(new Controls.FancyButtonControl("btnContructManuTroopsMenu", curGameUpdateComponents._staticTextureImages._buttonTexture, vectConstructBtn, new Rectangle((int)vectConstructBtn.X, (int)vectConstructBtn.Y, 130, 50), "Build")); ConstructionMenu = buildConstructionMenu; }//End btnTroopsMFR if (btnID == "btnTroops") { } }
//////////////////////////////////////////// //Check Mouse Clicks public void checkGameRunningMouseClick(GameUpdateClassComponents curGameUpdateComponents) { if (this._gameIsRunning) { /////////////////////////////////////// //Check Orbit Planet Menus ////////////////////////////////////// //Check Orbit Menu if (!this.LeftPlanetOrbitMenu._isNull && this.LeftPlanetOrbitMenu._isEnabled) { bool blnExit = false; //foreach(Controls.FancyDropDownBoxControl curDDB in this.LeftPlanetOrbitMenu.menuDropDownBoxControls) //{ for (int i = 0; i < this.LeftPlanetOrbitMenu.menuDropDownBoxControls.Count; i++) { if (LeftPlanetOrbitMenu.menuDropDownBoxControls[i]._isEnabled) { if (LeftPlanetOrbitMenu.menuDropDownBoxControls[i].dropDownBoxArrow.mouseClicked(curGameUpdateComponents)) { if (LeftPlanetOrbitMenu.menuDropDownBoxControls[i].dropDownCollapsed) LeftPlanetOrbitMenu.menuDropDownBoxControls[i].dropDownCollapsed = false; else LeftPlanetOrbitMenu.menuDropDownBoxControls[i].dropDownCollapsed = true; } if (!LeftPlanetOrbitMenu.menuDropDownBoxControls[i].dropDownCollapsed) { LeftPlanetOrbitMenu.menuDropDownBoxControls[i].mouseClicked(curGameUpdateComponents); } } } //} bool blnOrbitLeftClose = false; int menuInc = 0; //Run through each Button foreach (Controls.FancyButtonControl curButton in this.LeftPlanetOrbitMenu.menuButtons) { if (!curButton._isNull) { if (curButton.mouseClicked(curGameUpdateComponents)) { if (curButton.ID == "btnExitOrbitMenu") {//Clicked Exit Galaxy blnOrbitLeftClose = true; } if (curButton.ID.Length > "btnSendShip".Length) { if (curButton.ID.Substring(0, "btnSendShip".Length) == "btnSendShip") { int invUnitID = Convert.ToInt32(curButton.ID.Replace("btnSendShip", "")); string originalPlanetName = LeftPlanetOrbitMenu.strPlanetName; GameEngine.PlayerInvObjs.InvUnit myInv = curGameUniverse.getInvUnitByID(invUnitID, Model.DataCardType.Ship); string desitiantionPlanetName = LeftPlanetOrbitMenu.getDestinationPlanetNameByID(invUnitID); DataCards.Planet oriPlnt = curGameUniverse.getPlanetByName(originalPlanetName); DataCards.Planet destPlnt = curGameUniverse.getPlanetByName(desitiantionPlanetName); oriPlnt.Orbit.removeShipFromOrbitByID(myInv.id); //Takes 5 days to get anywhere! myInv.transitObj.setTravelTime(5); destPlnt.Orbit.StarshipFleetsInOrbit.Add(myInv); LeftPlanetOrbitMenu.menuButtons.RemoveAt(menuInc); blnOrbitLeftClose = true; break; //myInv. } } //if (curButton.ID == "btnExitPlanetCmdMenu") //{//Clicked Exit Planet Command // exitPlntCmdMenu = true; //} //if (curButton.ID == "btnContinue") //{//Clicked Exit Faction form // _continueClicked = true; //} } } menuInc++; } if (blnOrbitLeftClose) { this.LeftPlanetOrbitMenu = new Controls.PlanetOrbitControl(); this.LeftPlanetMenu.Enable(); this.RightPlanetMenu.Enable(); } } /////////////////////////////////////// //Check Galaxy Planet Menus ////////////////////////////////////// //Check Left Menu if (!this.LeftPlanetMenu._isNull && this.LeftPlanetMenu._isEnabled) { bool exitLeftGPMenu = false; bool exitRightGPMenu = false; //Run through each Button foreach (Controls.FancyButtonControl curButton in this.LeftPlanetMenu.menuButtons) { if (!curButton._isNull) { if (curButton.mouseClicked(curGameUpdateComponents)) { if (curButton.ID == "btnExitGalaxyMenu") {//Clicked Exit Galaxy exitLeftGPMenu = true; } //if (curButton.ID == "btnContinue") //{//Clicked Exit Faction form // _continueClicked = true; //} } } } float startingPlanetY = this.LeftPlanetMenu.vectorPos.Y + 50; float infoButtonX = Model.StaticValues.xPaddingForInfoBuutton + this.LeftPlanetMenu.vectorPos.X; float commandButtonX = Model.StaticValues.xPaddingForCommandButton + this.LeftPlanetMenu.vectorPos.X; float orbitButtonX = Model.StaticValues.xPaddingForOrbitButton + this.LeftPlanetMenu.vectorPos.X; foreach (DataCards.Planet curPlanet in this.LeftPlanetMenu.menuPlanetControls) { //Check for Info Button if (curGameUpdateComponents._curMouseState.X > infoButtonX && curGameUpdateComponents._curMouseState.X < (infoButtonX + 30)) { if (curGameUpdateComponents._curMouseState.Y > startingPlanetY && curGameUpdateComponents._curMouseState.Y < (startingPlanetY + 30)) { CreatePlanetInfoMenu(curGameUpdateComponents, curPlanet); } } //Check for Command Button if (curGameUpdateComponents._curMouseState.X > commandButtonX && curGameUpdateComponents._curMouseState.X < (commandButtonX + 30)) { if (curGameUpdateComponents._curMouseState.Y > startingPlanetY && curGameUpdateComponents._curMouseState.Y < (startingPlanetY + 30)) { CreatePlanetCommandMenu(curGameUpdateComponents, curPlanet); } } //Check for Orbit Button if (curGameUpdateComponents._curMouseState.X > orbitButtonX && curGameUpdateComponents._curMouseState.X < (orbitButtonX + 30)) { if (curGameUpdateComponents._curMouseState.Y > startingPlanetY && curGameUpdateComponents._curMouseState.Y < (startingPlanetY + 30)) { //CreatePlanetCommandMenu(curGameUpdateComponents, curPlanet); CreateOrbitCommandMenu(curGameUpdateComponents, curPlanet); } } startingPlanetY += 60; } if (exitLeftGPMenu) { this.LeftPlanetMenu = new Controls.PlanetsInGalaxyMenu(); } if (exitRightGPMenu) { this.RightPlanetMenu = new Controls.PlanetsInGalaxyMenu(); } } //Check Info Menu if (!this.InfoMenu._isNull && this.InfoMenu._isEnabled) { bool exitInfoMenu = false; //Run through each Button foreach (Controls.FancyButtonControl curButton in this.InfoMenu.menuButtons) { if (!curButton._isNull) { if (curButton.mouseClicked(curGameUpdateComponents)) { if (curButton.ID == "btnExitInfoMenu") {//Clicked Exit Galaxy exitInfoMenu = true; } //if (curButton.ID == "btnExitPlanetCmdMenu") //{//Clicked Exit Planet Command // exitPlntCmdMenu = true; //} //if (curButton.ID == "btnContinue") //{//Clicked Exit Faction form // _continueClicked = true; //} } } } if (exitInfoMenu) { this.InfoMenu = new Controls.GameInformationMenu(); this.LeftPlanetMenu.Enable(); this.RightPlanetMenu.Enable(); } //if (exitPlntCmdMenu) //{ // this.PlanetCommandMenu = new Controls.PlanetCommandControl(); // this.LeftPlanetMenu.Enable(); // this.RightPlanetMenu.Enable(); //} } //Check Planet Control Menu if (!this.PlanetCommandMenu._isNull && this.PlanetCommandMenu._isEnabled) { bool exitPlntCmdMenu = false; //Run through each Button foreach (Controls.FancyButtonControl curButton in this.PlanetCommandMenu.menuButtons) { if (!curButton._isNull) { if (curButton.mouseClicked(curGameUpdateComponents)) { // if (curButton.ID == "btnExitInfoMenu") // {//Clicked Exit Galaxy // exitInfoMenu = true; // } if (curButton.ID == "btnExitPlanetCmdMenu") {//Clicked Exit Planet Command exitPlntCmdMenu = true; } //if (curButton.ID == "btnContinue") //{//Clicked Exit Faction form // _continueClicked = true; //} } } } foreach (Controls.TabPanel.TabPanel curTP in PlanetCommandMenu.tabControl.tabPanels) { Controls.PanelControl curPnl = curTP.panel; //Prolly dont need a loop here but whatevs/// if (curTP.selected) { foreach (Controls.FancyButtonControl curBtn in curPnl.menuButtons) { if (curBtn.mouseClicked(curGameUpdateComponents)) { if (curBtn.ID == "btnFacilityMFR") { buildConstructionMenu(curGameUpdateComponents, curBtn.ID); } if (curBtn.ID == "btnShipMFR") { buildConstructionMenu(curGameUpdateComponents, curBtn.ID); //buildShipMenu(curGameUpdateComponents, curBtn.ID); } if (curBtn.ID == "btnTroopsMFR") { buildConstructionMenu(curGameUpdateComponents, curBtn.ID); //buildShipMenu(curGameUpdateComponents, curBtn.ID); } if (curBtn.ID == "btnTroops") { loadAsManyTroopsOnShipsAsPossible(PlanetCommandMenu.SelectedPlanetName); } } } } } PlanetCommandMenu.CheckMouseClick(curGameUpdateComponents); if (exitPlntCmdMenu) { this.PlanetCommandMenu = new Controls.PlanetCommandControl(); this.LeftPlanetMenu.Enable(); this.RightPlanetMenu.Enable(); } } //Check Construction Menu if (!ConstructionMenu._isNull) { if (ConstructionMenu.destinationDropDown._isEnabled) { //Collapse or close menu if arrow clicked if (ConstructionMenu.destinationDropDown.dropDownBoxArrow.mouseClicked(curGameUpdateComponents)) { if (ConstructionMenu.destinationDropDown.dropDownCollapsed) ConstructionMenu.destinationDropDown.dropDownCollapsed = false; else ConstructionMenu.destinationDropDown.dropDownCollapsed = true; } //Select a new test option as "selected" if (!ConstructionMenu.destinationDropDown.dropDownCollapsed) { ConstructionMenu.destinationDropDown.mouseClicked(curGameUpdateComponents); } } if (ConstructionMenu.facilityTypeDropDown._isEnabled) { //Collapse or close menu if arrow clicked if (ConstructionMenu.facilityTypeDropDown.dropDownBoxArrow.mouseClicked(curGameUpdateComponents)) { if (ConstructionMenu.facilityTypeDropDown.dropDownCollapsed) ConstructionMenu.facilityTypeDropDown.dropDownCollapsed = false; else ConstructionMenu.facilityTypeDropDown.dropDownCollapsed = true; } //Select a new test option as "selected" if (!ConstructionMenu.facilityTypeDropDown.dropDownCollapsed) { ConstructionMenu.facilityTypeDropDown.mouseClicked(curGameUpdateComponents); } } //Check buttons foreach (Controls.FancyButtonControl curBtn in ConstructionMenu.menuButtons) { if (curBtn.mouseClicked(curGameUpdateComponents)) { //Exit if (curBtn.ID == "btnExitManuFacilityMenu") { ConstructionMenu = new Controls.GameEngineControls.ConstructionMenuControl(); } //Build new facility if (curBtn.ID == "btnContructManuFacilityMenu") {/////////Under construction is going on Type not Entity!!! string strFacilityTypeName = ConstructionMenu.facilityTypeDropDown.textOptions[ConstructionMenu.facilityTypeDropDown.selectedIndex]; string strPlanetName = ConstructionMenu.destinationDropDown.textOptions[ConstructionMenu.destinationDropDown.selectedIndex]; DataCards.Facility facilCheck = staticDataCards.getFacilityByName(strFacilityTypeName); //InvUnit will be like... An Entity. Maybe I will rename it that later when its a pain in the ass to change it :P GameEngine.PlayerInvObjs.InvUnit newUnit = new GameEngine.PlayerInvObjs.InvUnit(); newUnit._underConstruction = true; newUnit.startEntityConstruction(facilCheck, strPlanetName); newUnit.FacilityOwner = new GameEngine.GalacticComponents.Owner(Player1); //Add the Inventory Object to the GroundSpaces->Facilites array curGameUniverse.getPlanetByName(strPlanetName).GroundSpaces.Facilities.Add(newUnit); Player1.curGameResourceMang.invRawMaterials -= facilCheck.baseManufactureCost.ResourceCost; ConstructionMenu = new Controls.GameEngineControls.ConstructionMenuControl(); } //Build new Ship if (curBtn.ID == "btnContructManuShipMenu") {/////////Under construction is going on Type not Entity!!! string strFacilityTypeShipName = ConstructionMenu.facilityTypeDropDown.textOptions[ConstructionMenu.facilityTypeDropDown.selectedIndex]; string strPlanetName = ConstructionMenu.destinationDropDown.textOptions[ConstructionMenu.destinationDropDown.selectedIndex]; DataCards.Ship shipCheck = staticDataCards.getShipByName(strFacilityTypeShipName); //InvUnit will be like... An Entity. Maybe I will rename it that later when its a pain in the ass to change it :P GameEngine.PlayerInvObjs.InvUnit newUnit = new GameEngine.PlayerInvObjs.InvUnit(); newUnit._underConstruction = true; newUnit.startEntityConstruction(shipCheck, strPlanetName); newUnit.FacilityOwner = new GameEngine.GalacticComponents.Owner(Player1); //Add ship to orbit curGameUniverse.getPlanetByName(strPlanetName).Orbit.StarshipFleetsInOrbit.Add(newUnit); Player1.curGameResourceMang.invRawMaterials -= 100;//Charging 100 by default ConstructionMenu = new Controls.GameEngineControls.ConstructionMenuControl(); } //Build new Troop if (curBtn.ID == "btnContructManuTroopsMenu") {/////////Under construction is going on Type not Entity!!! string strFacilityTypeTroopsName = ConstructionMenu.facilityTypeDropDown.textOptions[ConstructionMenu.facilityTypeDropDown.selectedIndex]; string strPlanetName = ConstructionMenu.destinationDropDown.textOptions[ConstructionMenu.destinationDropDown.selectedIndex]; DataCards.Troops TroopsCheck = staticDataCards.getTroopsByName(strFacilityTypeTroopsName); //InvUnit will be like... An Entity. Maybe I will rename it that later when its a pain in the ass to change it :P GameEngine.PlayerInvObjs.InvUnit newUnit = new GameEngine.PlayerInvObjs.InvUnit(); newUnit._underConstruction = true; newUnit.startEntityConstruction(TroopsCheck, strPlanetName); newUnit.FacilityOwner = new GameEngine.GalacticComponents.Owner(Player1); //Add troops to planet curGameUniverse.getPlanetByName(strPlanetName).GroundSpaces.Troops.Add(newUnit); Player1.curGameResourceMang.invRawMaterials -= 10;//Charging 10 by default ConstructionMenu = new Controls.GameEngineControls.ConstructionMenuControl(); } } } } //Only Check if GP menus are not displayed if (this.LeftPlanetMenu._isNull && this.RightPlanetMenu._isNull) { //Check Galaxy Clicks foreach (DataCards.Galaxy curGalaxy in this.curGameUniverse.TheUniverse) { string[] strArryXYBounds = curGalaxy.MouseImageAreaCoordinates.Split(';'); Model.XYStringToInt topLeft = new Model.XYStringToInt(strArryXYBounds[0]); Model.XYStringToInt bottomRight = new Model.XYStringToInt(strArryXYBounds[1]); if (curGameUpdateComponents._curMouseState.X > topLeft.X && curGameUpdateComponents._curMouseState.X < bottomRight.X) { if (curGameUpdateComponents._curMouseState.Y > topLeft.Y && curGameUpdateComponents._curMouseState.Y < bottomRight.Y) { ///////////////////////////////// //Create Galaxy Planets Menu ////////////////////////////////// Texture2D curTexture = curGameUpdateComponents._staticTextureImages._galacticPlanetView; //Vector2 curVector = new Vector2(100, 100); //Rectangle curRect = new Rectangle(100, 100, 300, 300); Controls.PlanetsInGalaxyMenu curMenuControl = new Controls.PlanetsInGalaxyMenu(); //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("btnExitGalaxyMenu", curButtonTexture, curButtonVector, curButtonRect, "Exit")); //Create the Menu Control curMenuControl = new Controls.PlanetsInGalaxyMenu("mnuGalaxy", curTexture, Model.OrientationType.Left, curGalaxy.Name, "...Settings List Here...", menuButtons); curMenuControl.menuPlanetControls = this.curGameUniverse.getPlanetListByGalaxyName(curGalaxy.Name); this.LeftPlanetMenu = curMenuControl; //Add menu control to list //activeImgMenus.Add(curMenuControl); } } } } checkTopBarMouseClick(curGameUpdateComponents); } }