Пример #1
0
        public MenuGump(uint serial, uint serv, string name) : base(serial, serv)
        {
            CanMove                = true;
            AcceptMouseInput       = true;
            CanCloseWithRightClick = true;
            IsFromServer           = true;

            Add(new GumpPic(0, 0, 0x0910, 0));

            Add
            (
                new ColorBox(217, 49, 0, 0xFF000001)
            {
                X = 40,
                Y = 42
            }
            );

            Label label = new Label(name, false, 0x0386, 200, 1, FontStyle.Fixed)
            {
                X = 39,
                Y = 18
            };

            Add(label);

            _container = new ContainerHorizontal
            {
                X              = 40,
                Y              = 42,
                Width          = 217,
                Height         = 49,
                WantUpdateSize = false
            };

            Add(_container);

            Add(_slider           = new HSliderBar(40, _container.Y + _container.Height + 12, 217, 0, 1, 0, HSliderBarStyle.MetalWidgetRecessedBar));
            _slider.ValueChanged += (sender, e) => { _container.Value = _slider.Value; };

            HitBox left = new HitBox(25, 60, 10, 15)
            {
                Alpha = 1
            };

            left.MouseDown += (sender, e) =>
            {
                _isDown = true;
                _isLeft = true;
            };

            left.MouseUp += (sender, e) => { _isDown = false; };
            Add(left);


            HitBox right = new HitBox(260, 60, 10, 15)
            {
                Alpha = 1
            };

            right.MouseDown += (sender, e) =>
            {
                _isDown = true;
                _isLeft = false;
            };

            right.MouseUp += (sender, e) => { _isDown = false; };
            Add(right);
        }
Пример #2
0
        public MenuGump(Serial serial, Serial serv, string name) : base(serial, serv)
        {
            CanMove                = true;
            AcceptMouseInput       = true;
            CanCloseWithRightClick = true;

            Add(new GumpPic(0, 0, 0x0910, 0));
            Add(new ColorBox(217, 49, 0, 0xFF000001)
            {
                X = 40,
                Y = 42,
            });

            Label label = new Label(name, false, 0x0386, 200, 1, FontStyle.Fixed)
            {
                X = 39,
                Y = 18
            };

            Add(label);

            _container = new ContainerHorizontal()
            {
                X              = 40,
                Y              = 42,
                Width          = 217,
                Height         = 49,
                WantUpdateSize = false
            };

            Add(_container);



            HitBox left = new HitBox(25, 60, 10, 15)
            {
                IsTransparent = true,
                Alpha         = 1,
            };

            left.MouseDown += (sender, e) =>
            {
                _isDown = true;
                _isLeft = true;
            };

            left.MouseUp += (sender, e) =>
            {
                _isDown = false;
            };
            Add(left);


            HitBox right = new HitBox(260, 60, 10, 15)
            {
                IsTransparent = true,
                Alpha         = 1,
            };

            right.MouseDown += (sender, e) =>
            {
                _isDown = true;
                _isLeft = false;
            };

            right.MouseUp += (sender, e) =>
            {
                _isDown = false;
            };
            Add(right);
        }