Exemple #1
0
        //Draw Commands
        public void Draw(GameDrawClassComponents curGameDrawClassComponents)
        {
            if (!_isNull)
            {
                menuBackground.Draw(curGameDrawClassComponents);


                //Display build time and cost.

                /////Implement later. This is temp gap solution?!?
                if (!curGameDrawClassComponents._staticDataCards._isNull)
                {
                    Vector2 vectManuTime = new Vector2(110, 250);
                    Vector2 vectManuCost = new Vector2(110, 300);

                    string strFacilityTypeName = facilityTypeDropDown.textOptions[facilityTypeDropDown.selectedIndex];

                    DataCards.Facility facilCheck = curGameDrawClassComponents._staticDataCards.getFacilityByName(strFacilityTypeName);

                    string strManuTimeDisplay = "Construction Day(s): " + facilCheck.baseManufactureCost.BaseConstructionTime.ToString();

                    string strManuCostDisplay = "Construction Cost: " + facilCheck.baseManufactureCost.ResourceCost.ToString();

                    curGameDrawClassComponents._spriteBatch.DrawString(curGameDrawClassComponents._staticFonts._courierNew, strManuTimeDisplay, vectManuTime, Color.Black);

                    curGameDrawClassComponents._spriteBatch.DrawString(curGameDrawClassComponents._staticFonts._courierNew, strManuCostDisplay, vectManuCost, Color.Black);
                }


                displayButtonsInMenu(curGameDrawClassComponents);



                destinationDropDown.Draw(curGameDrawClassComponents);

                facilityTypeDropDown.Draw(curGameDrawClassComponents);
            }
        }
        //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);
        }