Exemple #1
0
        public ConstructionMenuControl(string id, string _strControlHeader, DrawObj.Sprite _background)
        {
            ID = id;
            strControlHeader = _strControlHeader;
            menuBackground   = _background;

            menuButtons          = new List <FancyButtonControl>();
            destinationDropDown  = new FancyDropDownBoxControl();
            facilityTypeDropDown = new FancyDropDownBoxControl();
        }
        public ConstructionMenuControl(string id, string _strControlHeader, DrawObj.Sprite _background)
        {
            ID = id;
            strControlHeader = _strControlHeader;
            menuBackground = _background;

            menuButtons = new List<FancyButtonControl>();
            destinationDropDown = new FancyDropDownBoxControl();
            facilityTypeDropDown = new FancyDropDownBoxControl();
        }
Exemple #3
0
        public ConstructionMenuControl()
        {
            ID               = "";
            _isNull          = true;
            strControlHeader = "";
            menuBackground   = new DrawObj.Sprite();

            menuButtons          = new List <FancyButtonControl>();
            destinationDropDown  = new FancyDropDownBoxControl();
            facilityTypeDropDown = new FancyDropDownBoxControl();
        }
        public ConstructionMenuControl()
        {
            ID = "";
            _isNull = true;
            strControlHeader = "";
            menuBackground = new DrawObj.Sprite();

            menuButtons = new List<FancyButtonControl>();
            destinationDropDown = new FancyDropDownBoxControl();
            facilityTypeDropDown = new FancyDropDownBoxControl();
        }
        //Draw Methods

        public void Draw(GameDrawClassComponents curGameDrawClassComponents, List <DataCards.Planet> planetList)
        {
            curGameDrawClassComponents._spriteBatch.Draw(this.imgControl, this.vectorPos, Color.White);


            //Display Menu Header
            Vector2 textVector = new Vector2(this.vectorPos.X + 10, this.vectorPos.Y + 10);

            curGameDrawClassComponents._spriteBatch.DrawString(curGameDrawClassComponents._staticFonts._courierNew, this.strControlHeader, textVector, Color.Black);



            Vector2 firstPlanetVector = new Vector2(this.vectorPos.X + 10, this.vectorPos.Y + 50);

            int i = 0;

            //Display Planets
            foreach (GameEngine.PlayerInvObjs.InvUnit curInvUnit in this.menuInvUnits)
            {
                string planetImagePath = "";

                if (curInvUnit.transitObj._inTransit)
                {
                    planetImagePath = Model.DataUtilities._ShipsImagePath + "Hyper.jpg";
                }
                else
                {
                    if (System.IO.File.Exists(Model.DataUtilities._ShipsImagePath + curInvUnit.iuShip.Name + ".jpg"))
                    {
                        planetImagePath = Model.DataUtilities._ShipsImagePath + curInvUnit.iuShip.Name + ".jpg";
                    }
                    else
                    {
                        planetImagePath = Model.DataUtilities._ShipsImagePath + "UnknownShipImage.jpg";
                    }
                }


                Texture2D curPlanetImg = Texture2D.FromFile(curGameDrawClassComponents._graphicsDevice, planetImagePath);
                //Display Planet Image
                curGameDrawClassComponents._spriteBatch.Draw(curPlanetImg, firstPlanetVector, Color.White);

                Vector2 planetHeaderTextVector = new Vector2();
                planetHeaderTextVector.X = firstPlanetVector.X + 70;
                planetHeaderTextVector.Y = firstPlanetVector.Y;
                //Displat Planet Header text
                curGameDrawClassComponents._spriteBatch.DrawString(curGameDrawClassComponents._staticFonts._courierNew, curInvUnit.iuShip.HeaderText, planetHeaderTextVector, Color.Black);


                Vector2 ddlVector = new Vector2();
                ddlVector.X = firstPlanetVector.X + 170;
                ddlVector.Y = firstPlanetVector.Y;

                Controls.FancyDropDownBoxControl myfancyDDL = menuDropDownBoxControls[i];
                //myfancyDDL._isEnabled = true;

                //myfancyDDL.dropDownBoxRect = new Rectangle((int)ddlVector.X, (int)ddlVector.Y, 125, 50);

                //myfancyDDL.backColor = Color.Red;
                //myfancyDDL.borderColor = Color.White;
                //myfancyDDL.borderSize = 2;
                //myfancyDDL.dropDownBoxArrow = new DrawObj.Sprite("mdDDLSprite", ddlVector, curGameDrawClassComponents._staticTextureImages._dropDownArrowTexture);
                //myfancyDDL.dropDownCollapsed = true;
                //myfancyDDL.selectedIndex = 0;


                //menuDropDownBoxControls.Add(myfancyDDL);

                List <string> strLstPlanets = new List <string>();

                foreach (DataCards.Planet curPlanet in planetList)
                {
                    strLstPlanets.Add(curPlanet.Name);
                }

                //myfancyDDL.textOptions = strLstPlanets;



                myfancyDDL.Draw(curGameDrawClassComponents);


                //Displat Planet Header text
                //curGameDrawClassComponents._spriteBatch.DrawString(curGameDrawClassComponents._staticFonts._courierNew, curInvUnit.iuShip.HeaderText, planetHeaderTextVector, Color.Black);


                i++;

                firstPlanetVector.Y += curPlanetImg.Height + 60;
            }


            //Display Menu Buttons
            displayButtonsInMenu(curGameDrawClassComponents._spriteBatch, curGameDrawClassComponents._staticFonts, this.menuButtons);
        }
        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")
            {

            }
        }