Пример #1
0
        private void BuildGump()
        {
            WantUpdateSize = false;

            Add(_background = new GumpPic(0, 0, _graphic, 0)
            {
                LocalSerial = 1
            });

            Add(_button = new Button(0, 0x7585, 0x7589, 0x7589)
            {
                X            = -2,
                Y            = 36,
                ButtonAction = ButtonAction.Activate
            });
            _direction = GumpDirection.LEFT_HORIZONTAL;


            foreach (KeyValuePair <BuffIconType, BuffIcon> k in World.Player.BuffIcons)
            {
                Add(new BuffControlEntry(World.Player.BuffIcons[k.Key]));
            }

            Change();
        }
Пример #2
0
        public BuffGump() : base(0, 0)
        {
            X       = 100;
            Y       = 100;
            CanMove = true;
            CanCloseWithRightClick = true;
            _graphic = 0x7580;

            AddChildren(_background = new GumpPic(0, 0, _graphic, 0)
            {
                LocalSerial = 1
            });

            AddChildren(_button = new Button(0, 0x7585, 0x7589, 0x7589)
            {
                X = -2, Y = 36, ButtonAction = ButtonAction.Activate
            });
            _direction = GumpDirection.LEFT_HORIZONTAL;

            foreach (KeyValuePair <Graphic, BuffIcon> k in World.Player.BuffIcons)
            {
                AddChildren(new BuffControlEntry(World.Player.BuffIcons[k.Key]));
            }
            UpdateElements();
        }
Пример #3
0
        public override void Restore(BinaryReader reader)
        {
            base.Restore(reader);

            _graphic   = reader.ReadUInt16();
            _direction = (GumpDirection)reader.ReadByte();
            BuildGump();
        }
Пример #4
0
        public override void Restore(XmlElement xml)
        {
            base.Restore(xml);

            _graphic   = ushort.Parse(xml.GetAttribute("graphic"));
            _direction = (GumpDirection)byte.Parse(xml.GetAttribute("direction"));
            BuildGump();
        }
Пример #5
0
        public BuffGump(int x, int y) : this()
        {
            X = x;
            Y = y;

            _direction = GumpDirection.LEFT_HORIZONTAL;
            _graphic   = 0x7580;


            SetInScreen();

            BuildGump();
        }
Пример #6
0
        public override void OnButtonClick(int buttonID)
        {
            if (buttonID == 0)
            {
                _graphic++;

                if (_graphic > 0x7582)
                {
                    _graphic = 0x757F;
                }

                switch (_graphic)
                {
                case 0x7580:
                    _button.X  = -2;
                    _button.Y  = 36;
                    _direction = GumpDirection.LEFT_HORIZONTAL;

                    break;

                case 0x7581:
                    _button.X  = 34;
                    _button.Y  = 78;
                    _direction = GumpDirection.RIGHT_VERTICAL;

                    break;

                case 0x7582:
                    _button.X  = 76;
                    _button.Y  = 36;
                    _direction = GumpDirection.RIGHT_HORIZONTAL;

                    break;

                case 0x757F:
                default:
                    _button.X  = 0;
                    _button.Y  = 0;
                    _direction = GumpDirection.LEFT_VERTICAL;

                    break;
                }

                _background.Graphic = _graphic;
                _background.Texture = IO.Resources.Gumps.GetGumpTexture(_graphic);
                Width  = _background.Texture.Width;
                Height = _background.Texture.Height;

                UpdateElements();
            }
        }
Пример #7
0
        private void Change()
        {
            if (_graphic > 0x7582)
            {
                _graphic = 0x757F;
            }

            switch (_graphic)
            {
            case 0x7580:
                _button.X  = -2;
                _button.Y  = 36;
                _direction = GumpDirection.LEFT_HORIZONTAL;

                break;

            case 0x7581:
                _button.X  = 34;
                _button.Y  = 78;
                _direction = GumpDirection.RIGHT_VERTICAL;

                break;

            case 0x7582:
                _button.X  = 76;
                _button.Y  = 36;
                _direction = GumpDirection.RIGHT_HORIZONTAL;

                break;

            case 0x757F:
            default:
                _button.X  = 0;
                _button.Y  = 0;
                _direction = GumpDirection.LEFT_VERTICAL;

                break;
            }

            _background.Graphic = _graphic;
            _background.X       = 0;
            _background.Y       = 0;

            Width  = _background.Texture.Width;
            Height = _background.Texture.Height;

            UpdateElements();
        }
Пример #8
0
        private void BuildGump()
        {
            AddChildren(_background = new GumpPic(0, 0, _graphic, 0)
            {
                LocalSerial = 1
            });

            AddChildren(_button = new Button(0, 0x7585, 0x7589, 0x7589)
            {
                X            = -2,
                Y            = 36,
                ButtonAction = ButtonAction.Activate
            });
            _direction = GumpDirection.LEFT_HORIZONTAL;

            foreach (KeyValuePair <Graphic, BuffIcon> k in World.Player.BuffIcons)
            {
                AddChildren(new BuffControlEntry(World.Player.BuffIcons[k.Key]));
            }
            UpdateElements();
        }
Пример #9
0
        public override void OnButtonClick(int buttonID)
        {
            if (buttonID == 0)
            {
                _graphic++;

                if (_graphic > 0x7582)
                {
                    _graphic = 0x757F;
                }

                switch (_graphic)
                {
                case 0x7580:
                    _direction = GumpDirection.LEFT_HORIZONTAL;

                    break;

                case 0x7581:
                    _direction = GumpDirection.RIGHT_VERTICAL;

                    break;

                case 0x7582:
                    _direction = GumpDirection.RIGHT_HORIZONTAL;

                    break;

                case 0x757F:
                default:
                    _direction = GumpDirection.LEFT_VERTICAL;

                    break;
                }

                RequestUpdateContents();
            }
        }