コード例 #1
0
        public ColorPickerGump(Serial serial, ushort graphic, int x, int y, Action <ushort> okClicked) : base(serial, 0)
        {
            _graphic         = graphic;
            CanMove          = true;
            AcceptMouseInput = false;
            X = x;
            Y = y;
            Add(new GumpPic(0, 0, 0x0906, 0));

            Add(new Button(0, 0x0907, 0x0908, 0x909)
            {
                X = 208, Y = 138, ButtonAction = ButtonAction.Activate
            });
            HSliderBar slider;

            Add(slider               = new HSliderBar(39, 142, 145, SLIDER_MIN, SLIDER_MAX, 1, HSliderBarStyle.BlueWidgetNoBar));
            slider.ValueChanged     += (sender, e) => { _box.Graduation = slider.Value; };
            Add(_box                 = new ColorPickerBox(34, 34));
            _box.ColorSelectedIndex += (sender, e) => { _dyeTybeImage.Hue = (ushort)(_box.SelectedHue + 1); };

            Add(_dyeTybeImage = new StaticPic(0x0FAB, 0)
            {
                X = 200, Y = 58
            });
            _okClicked = okClicked;
        }
コード例 #2
0
ファイル: MenuGump.cs プロジェクト: oroechimaru/ClassicUO
        public void AddItem(Graphic graphic, Hue hue, string name, int x, int y, int index)
        {
            StaticPic pic = new StaticPic(graphic, hue)
            {
                X = x,
                Y = y,
                //LocalSerial = (uint) index,
                AcceptMouseInput = true,
            };

            pic.MouseDoubleClick += (sender, e) =>
            {
                NetClient.Socket.Send(new PMenuResponse(LocalSerial, (Graphic)ServerSerial.Value, index, graphic, hue));
                Dispose();
            };
            pic.SetTooltip(name);


            _container.Add(pic);
        }
コード例 #3
0
ファイル: MenuGump.cs プロジェクト: shuixzhy/ClassicUO
        public void AddItem(ushort graphic, ushort hue, string name, int x, int y, int index)
        {
            StaticPic pic = new StaticPic(graphic, hue)
            {
                X = x,
                Y = y,
                //LocalSerial = (uint) index,
                AcceptMouseInput = true
            };

            pic.MouseDoubleClick += (sender, e) =>
            {
                NetClient.Socket.Send(new PMenuResponse(LocalSerial, (ushort)ServerSerial, index, graphic, hue));
                Dispose();
                e.Result = true;
            };
            pic.SetTooltip(name);


            _container.Add(pic);

            _container.CalculateWidth();
            _slider.MaxValue = _container.MaxValue;
        }