Esempio n. 1
0
        public override void Draw(CustomSpriteBatch g)
        {
            float X = Constants.Width / 2 - sprBackground.Width / 2;
            float Y = Constants.Height / 2 - sprBackground.Height / 2;

            g.Draw(sprBackground, new Vector2(X, Y), Color.White);

            float DrawX  = X + 60;
            float DrawY  = 133;
            int   Number = 1;

            foreach (WeaponSelectionItem ActiveWeapon in ListDefaultWeapon)
            {
                if (ActiveWeapon.IsSelected)
                {
                    WeaponOutlineButton.SetFrame(3);
                }
                else if (ActiveWeapon.IsDisabled)
                {
                    WeaponOutlineButton.SetFrame(1);
                }
                else if (IsMouseOverItem(DrawX, DrawY))
                {
                    WeaponOutlineButton.SetFrame(2);
                }
                else
                {
                    WeaponOutlineButton.SetFrame(0);
                }

                DrawNumber(g, (int)DrawX - 17, (int)DrawY + 1, Number);
                WeaponOutlineButton.Draw(g, new Vector2(DrawX + 64, DrawY + 23), Color.White);
                ActiveWeapon.Draw(g, DrawX + 8, DrawY);
                DrawY += 61;
                ++Number;
            }

            DrawX = X + 260;
            DrawY = 133;
            foreach (WeaponSelectionItem ActiveWeapon in ListPersonalWeapon)
            {
                if (ActiveWeapon.IsSelected)
                {
                    WeaponOutlineButton.SetFrame(3);
                }
                else if (ActiveWeapon.IsDisabled)
                {
                    WeaponOutlineButton.SetFrame(1);
                }
                else if (IsMouseOverItem(DrawX, DrawY))
                {
                    WeaponOutlineButton.SetFrame(2);
                }
                else
                {
                    WeaponOutlineButton.SetFrame(0);
                }

                DrawNumber(g, (int)DrawX - 17, (int)DrawY + 1, Number);
                WeaponOutlineButton.Draw(g, new Vector2(DrawX + 64, DrawY + 23), Color.White);
                ActiveWeapon.Draw(g, DrawX + 8, DrawY);
                DrawY += 61;
                ++Number;
            }
        }