Exemplo n.º 1
0
        public PlanetOrbitControl(string id, string planetName, Texture2D curImgControl, Model.OrientationType curOrientation, string curControlHeader, string curControlText, List<Controls.FancyButtonControl> curMenuButtons, List<DataCards.Planet> planetList, GameUpdateClassComponents curGameDrawClassComponents, List<GameEngine.PlayerInvObjs.InvUnit> InvObjs)
        {
            _isNull = false;
            _isEnabled = true;
            ID = id;
            strPlanetName = planetName;
            imgControl = curImgControl;

            //rectControl = curRect;
            menuOrientation = curOrientation;

            strControlHeader = curControlHeader;
            strControlText = curControlText;

            menuInvUnits = InvObjs;

            menuButtons = curMenuButtons;
            menuDropDownBoxControls = new List<Controls.FancyDropDownBoxControl>();

            setMenuVector();

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

            int i = 1;

            foreach (GameEngine.PlayerInvObjs.InvUnit curInvUnit in this.menuInvUnits)
            {

                int myId = curInvUnit.id;

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

                Controls.FancyDropDownBoxControl myfancyDDL = new FancyDropDownBoxControl();
                myfancyDDL._isEnabled = true;

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

                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;
                myfancyDDL.ID = "ddlDestinationPlanet" + myId;

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

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

                myfancyDDL.textOptions = strLstPlanets;

                menuDropDownBoxControls.Add(myfancyDDL);
                string planetImagePath = "";

                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);

                string orbitBtnImagePath = Model.DataUtilities._ButtonsImagePath + "30x30DayAdvanceButton.bmp";

                Texture2D curOrbitBtnImg = Texture2D.FromFile(curGameDrawClassComponents._graphicsDevice, orbitBtnImagePath);

                ddlVector.X += 250;

                //urGameDrawClassComponents._spriteBatch.Draw(curOrbitBtnImg, ddlVector, Color.White);
                this.menuButtons.Add(new Controls.FancyButtonControl("btnSendShip" + myId, curGameDrawClassComponents._staticTextureImages._buttonTexture, ddlVector, new Rectangle((int)ddlVector.X, (int)ddlVector.Y, 30, 50), "Go"));

                firstPlanetVector.Y += curPlanetImg.Height + 60;
                i++;
            }
        }
        public PlanetOrbitControl(string id, string planetName, Texture2D curImgControl, Model.OrientationType curOrientation, string curControlHeader, string curControlText, List <Controls.FancyButtonControl> curMenuButtons, List <DataCards.Planet> planetList, GameUpdateClassComponents curGameDrawClassComponents, List <GameEngine.PlayerInvObjs.InvUnit> InvObjs)
        {
            _isNull       = false;
            _isEnabled    = true;
            ID            = id;
            strPlanetName = planetName;
            imgControl    = curImgControl;

            //rectControl = curRect;
            menuOrientation = curOrientation;

            strControlHeader = curControlHeader;
            strControlText   = curControlText;


            menuInvUnits = InvObjs;

            menuButtons             = curMenuButtons;
            menuDropDownBoxControls = new List <Controls.FancyDropDownBoxControl>();



            setMenuVector();



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

            int i = 1;

            foreach (GameEngine.PlayerInvObjs.InvUnit curInvUnit in this.menuInvUnits)
            {
                int myId = curInvUnit.id;

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

                Controls.FancyDropDownBoxControl myfancyDDL = new FancyDropDownBoxControl();
                myfancyDDL._isEnabled = true;

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

                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;
                myfancyDDL.ID = "ddlDestinationPlanet" + myId;

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

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

                myfancyDDL.textOptions = strLstPlanets;


                menuDropDownBoxControls.Add(myfancyDDL);
                string planetImagePath = "";


                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);



                string orbitBtnImagePath = Model.DataUtilities._ButtonsImagePath + "30x30DayAdvanceButton.bmp";

                Texture2D curOrbitBtnImg = Texture2D.FromFile(curGameDrawClassComponents._graphicsDevice, orbitBtnImagePath);

                ddlVector.X += 250;



                //urGameDrawClassComponents._spriteBatch.Draw(curOrbitBtnImg, ddlVector, Color.White);
                this.menuButtons.Add(new Controls.FancyButtonControl("btnSendShip" + myId, curGameDrawClassComponents._staticTextureImages._buttonTexture, ddlVector, new Rectangle((int)ddlVector.X, (int)ddlVector.Y, 30, 50), "Go"));



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