コード例 #1
0
        public BulletinBoardGump(Item item, int x, int y, string name) : base(item, 0)
        {
            _item                = item;
            _item.Items.Added   += ItemsOnAdded;
            _item.Items.Removed += ItemsOnRemoved;

            X       = x;
            Y       = y;
            CanMove = true;
            CanCloseWithRightClick = true;


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

            Label label = new Label(name, false, 0x0386, 170, 2, align: TEXT_ALIGN_TYPE.TS_CENTER)
            {
                X = 159, Y = 36
            };

            Add(label);

            HitBox hitbox = new HitBox(15, 170, 80, 80)
            {
                Alpha = 1
            };

            hitbox.MouseUp += (sender, e) =>
            {
                UIManager.GetGump <BulletinBoardItem>(LocalSerial)?.Dispose();

                UIManager.Add(new BulletinBoardItem(LocalSerial, 0, World.Player.Name, string.Empty, "Date/Time", string.Empty, 0));
            };
            Add(hitbox);

            _area = new ScrollArea(127, 162, 241, 155, false);
            Add(_area);
        }
コード例 #2
0
        private Checkbox CreateCheckBox(ScrollArea area, string text, bool ischecked, int x, int y)
        {
            Checkbox box = new Checkbox(0x00D2, 0x00D3, text, FONT, HUE_FONT, true)
            {
                IsChecked = ischecked
            };

            if (x != 0)
            {
                ScrollAreaItem item = new ScrollAreaItem();
                box.X = x;
                box.Y = y;

                item.Add(box);
                area.Add(item);
            }
            else
            {
                box.Y = y;

                area.Add(box);
            }
            return(box);
        }
コード例 #3
0
        public InfoGump(object obj) : base(0, 0)
        {
            X                = 200;
            Y                = 200;
            CanMove          = true;
            AcceptMouseInput = false;
            AddChildren(new GameBorder(0, 0, WIDTH, HEIGHT, 4));

            AddChildren(new GumpPicTiled(4, 4, WIDTH - 8, HEIGHT - 8, 0x0A40)
            {
                IsTransparent = true
            });

            AddChildren(new GumpPicTiled(4, 4, WIDTH - 8, HEIGHT - 8, 0x0A40)
            {
                IsTransparent = true
            });
            AddChildren(new Label("Object Information", true, 1153, font: 3)
            {
                X = 20, Y = 20
            });
            AddChildren(new Line(20, 50, 250, 1, 0xFFFFFFFF));
            _scrollArea = new ScrollArea(20, 60, WIDTH - 40, 510, true)
            {
                AcceptMouseInput = true
            };
            AddChildren(_scrollArea);

            foreach (var item in ReflectionHolder.GameObjectDictionary(obj))
            {
                if (item.Value.ToString() != "")
                {
                    _scrollArea.AddChildren(new Label(item.Key + " : " + item.Value, true, 1153, font: 3, maxwidth: WIDTH - 65));
                }
            }
        }
コード例 #4
0
        public BulletinBoardItem
        (
            uint serial,
            uint msgSerial,
            string poster,
            string subject,
            string datatime,
            string data,
            byte variant
        ) : base(serial, 0)
        {
            _msgSerial             = msgSerial;
            AcceptKeyboardInput    = true;
            CanMove                = true;
            CanCloseWithRightClick = true;
            _datatime              = datatime;

            _articleContainer = new ExpandableScroll(0, 0, 408, 0x0820)
            {
                TitleGumpID      = 0x0820,
                AcceptMouseInput = true
            };

            Add(_articleContainer);

            ScrollArea area = new ScrollArea(0, 120, 272, 224, false);

            Add(area);

            _databox = new DataBox(0, 0, 1, 1);
            area.Add(_databox);

            bool useUnicode              = Client.Version >= ClientVersion.CV_305D;
            byte unicodeFontIndex        = 1;
            int  unicodeFontHeightOffset = 0;

            ushort textColor = 0x0386;

            if (useUnicode)
            {
                unicodeFontHeightOffset = -6;
                textColor = 0;
            }

            Label text = new Label
                             (ResGumps.Author, useUnicode, textColor, font: useUnicode ? unicodeFontIndex : (byte)6)
            {
                X = 30,
                Y = 40
            };

            Add(text);

            text = new Label(poster, useUnicode, textColor, font: useUnicode ? unicodeFontIndex : (byte)9)
            {
                X = 30 + text.Width,
                Y = 46 + unicodeFontHeightOffset
            };

            Add(text);


            text = new Label(ResGumps.Date, useUnicode, textColor, font: useUnicode ? unicodeFontIndex : (byte)6)
            {
                X = 30,
                Y = 58
            };

            Add(text);

            text = new Label(datatime, useUnicode, textColor, font: useUnicode ? unicodeFontIndex : (byte)9)
            {
                X = 32 + text.Width,
                Y = 64 + unicodeFontHeightOffset
            };

            Add(text);

            text = new Label(ResGumps.Title, useUnicode, textColor, font: useUnicode ? unicodeFontIndex : (byte)6)
            {
                X = 30,
                Y = 77
            };

            Add(text);

            ushort subjectColor = textColor;

            if (variant == 0)
            {
                subjectColor = 0x0008;
            }

            Add
            (
                _subjectTextbox = new StbTextBox
                                      (useUnicode ? unicodeFontIndex : (byte)9, maxWidth: 150, isunicode: useUnicode, hue: subjectColor)
            {
                X          = 30 + text.Width,
                Y          = 83 + unicodeFontHeightOffset,
                Width      = 150,
                IsEditable = variant == 0
            }
            );

            _subjectTextbox.SetText(subject);

            Add(new GumpPicTiled(30, 106, 235, 4, 0x0835));

            _databox.Add
            (
                _textBox = new StbTextBox
                               (useUnicode ? unicodeFontIndex : (byte)9, -1, 220, hue: textColor, isunicode: useUnicode)
            {
                X          = 40,
                Y          = 0,
                Width      = 220,
                Height     = 300,
                IsEditable = variant == 0,
                Multiline  = true
            }
            );

            _textBox.SetText(data);
            _textBox.TextChanged += _textBox_TextChanged;

            switch (variant)
            {
            case 0:
                Add(new GumpPic(97, 12, 0x0883, 0));

                Add
                (
                    _buttonPost = new Button((int)ButtonType.Post, 0x0886, 0x0886)
                {
                    X                = 37,
                    Y                = Height - 50,
                    ButtonAction     = ButtonAction.Activate,
                    ContainsByBounds = true
                }
                );

                break;

            case 1:

                Add
                (
                    _buttonReply = new Button((int)ButtonType.Reply, 0x0884, 0x0884)
                {
                    X                = 37,
                    Y                = Height - 50,
                    ButtonAction     = ButtonAction.Activate,
                    ContainsByBounds = true
                }
                );

                break;

            case 2:

                Add
                (
                    _buttonRemove = new Button((int)ButtonType.Remove, 0x0885, 0x0885)      //DISABLED
                {
                    X                = 235,
                    Y                = Height - 50,
                    ButtonAction     = ButtonAction.Activate,
                    ContainsByBounds = true
                }
                );

                break;
            }

            _databox.WantUpdateSize = true;
            _databox.ReArrangeChildren();
        }
コード例 #5
0
ファイル: ShopGump.cs プロジェクト: luuutz/ClassicUO
        public ShopGump(Serial serial, bool isBuyGump, int x, int y) : base(serial, 0)
        {
            X = x;
            Y = y;
            AcceptMouseInput    = false;
            AcceptKeyboardInput = true;
            CanMove             = true;

            IsBuyGump = isBuyGump;

            _transactionItems = new Dictionary <Item, TransactionItem>();
            _shopItems        = new Dictionary <Item, ShopItem>();
            _updateTotal      = false;


            if (isBuyGump)
            {
                Add(new GumpPic(0, 0, 0x0870, 0));
            }
            else
            {
                Add(new GumpPic(0, 0, 0x0872, 0));
            }

            Add(_shopScrollArea = new ScrollArea(30, 60, 225, 180, false, 130));

            if (isBuyGump)
            {
                Add(new GumpPic(170, 214, 0x0871, 0));
            }
            else
            {
                Add(new GumpPic(170, 214, 0x0873, 0));
            }

            HitBox boxAccept = new HitBox(200, 406, 34, 30)
            {
                Alpha = 1
            };

            HitBox boxClear = new HitBox(372, 410, 24, 24)
            {
                Alpha = 1
            };

            boxAccept.MouseClick += (sender, e) => { OnButtonClick((int)Buttons.Accept); };
            boxClear.MouseClick  += (sender, e) => { OnButtonClick((int)Buttons.Clear); };
            Add(boxAccept);
            Add(boxClear);


            if (isBuyGump)
            {
                Add(_totalLabel = new Label("0", true, 0x0386, 0, 1)
                {
                    X = 238,
                    Y = 381
                });

                Add(_playerGoldLabel = new Label(World.Player.Gold.ToString(), true, 0x0386, 0, 1)
                {
                    X = 356,
                    Y = 381
                });
            }
            else
            {
                Add(_totalLabel = new Label("0", true, 0x0386, 0, 1)
                {
                    X = 356,
                    Y = 381
                });
            }

            Add(new Label(World.Player.Name, false, 0x0386, font: 5)
            {
                X = 242,
                Y = 408
            });


            Add(_transactionScrollArea = new ScrollArea(180, 280, 245, 78, false));


            HitBox upButton = new HitBox(233, 50, 18, 16)
            {
                Alpha = 1
            };

            upButton.MouseDown += (sender, e) =>
            {
                _isUpDOWN = true;
            };
            upButton.MouseUp += (sender, e) => { _isUpDOWN = false; };

            Add(upButton);

            HitBox downButton = new HitBox(233, 190, 18, 16)
            {
                Alpha = 1
            };

            downButton.MouseDown += (sender, e) =>
            {
                _isDownDOWN = true;
            };
            downButton.MouseUp += (sender, e) => { _isDownDOWN = false; };
            Add(downButton);


            HitBox upButtonT = new HitBox(403, 265, 18, 16)
            {
                Alpha = 1
            };

            upButtonT.MouseDown += (sender, e) =>
            {
                _isUpDOWN_T = true;
            };
            upButtonT.MouseUp += (sender, e) => { _isUpDOWN_T = false; };

            Add(upButtonT);

            HitBox downButtonT = new HitBox(403, 370, 18, 16)
            {
                Alpha = 1
            };

            downButtonT.MouseDown += (sender, e) =>
            {
                _isDownDOWN_T = true;
            };
            downButtonT.MouseUp += (sender, e) => { _isDownDOWN_T = false; };
            Add(downButtonT);

            Engine.Input.KeyDown += InputOnKeyDown;
            Engine.Input.KeyUp   += InputOnKeyUp;
        }
コード例 #6
0
        public BulletinBoardItem(uint serial, uint msgSerial, string poster, string subject, string datatime,
                                 string data, byte variant) : base(serial, 0)
        {
            _msgSerial             = msgSerial;
            AcceptKeyboardInput    = true;
            CanMove                = true;
            CanCloseWithRightClick = true;
            _datatime              = datatime;
            _articleContainer      = new ExpandableScroll(0, 0, 408, 0x0820)
            {
                TitleGumpID      = 0x0820,
                AcceptMouseInput = true
            };

            Add(_articleContainer);
            _scrollArea = new ScrollArea(0, 120, 272, 224, false);

            AddHorizontalBar(_scrollArea, 92, 35, 220);

            bool useUnicode              = Client.Version >= ClientVersion.CV_305D;
            byte unicodeFontIndex        = 1;
            int  unicodeFontHeightOffset = 0;

            ushort textColor = 0x0386;

            if (useUnicode)
            {
                unicodeFontHeightOffset = -6;
                textColor = 0;
            }

            Label text = new Label("Author:", useUnicode, textColor, font: useUnicode ? unicodeFontIndex : (byte)6)
            {
                X = 30,
                Y = 40
            };

            Add(text);

            text = new Label(poster, useUnicode, textColor, font: useUnicode ? unicodeFontIndex : (byte)9)
            {
                X = 30 + text.Width,
                Y = 46 + unicodeFontHeightOffset
            };
            Add(text);


            text = new Label("Date:", useUnicode, textColor, font: useUnicode ? unicodeFontIndex : (byte)6)
            {
                X = 30,
                Y = 58
            };
            Add(text);

            text = new Label(datatime, useUnicode, textColor, font: useUnicode ? unicodeFontIndex : (byte)9)
            {
                X = 32 + text.Width,
                Y = 64 + unicodeFontHeightOffset
            };
            Add(text);

            text = new Label("Title:", useUnicode, textColor, font: useUnicode ? unicodeFontIndex : (byte)6)
            {
                X = 30,
                Y = 77
            };
            Add(text);

            ushort subjectColor = textColor;

            if (variant == 0)
            {
                subjectColor = 0x0008;
            }

            Add(_subjectTextbox = new TextBox(useUnicode ? unicodeFontIndex : (byte)9, maxWidth: 150, width: 150,
                                              isunicode: useUnicode, hue: subjectColor)
            {
                X          = 30 + text.Width,
                Y          = 83 + unicodeFontHeightOffset,
                Width      = 150,
                IsEditable = variant == 0 ? true : false
            });
            _subjectTextbox.SetText(subject);

            Add(new GumpPicTiled(30, 106, 235, 4, 0x0835));

            _scrollArea.Add(_textBox =
                                new MultiLineBox(
                                    new MultiLineEntry(useUnicode ? unicodeFontIndex : (byte)9, -1, 0, 220, hue: textColor,
                                                       unicode: useUnicode), true)
            {
                X               = 40,
                Y               = 0,
                Width           = 220,
                ScissorsEnabled = true,
                Text            = data,
                IsEditable      = variant == 0 ? true : false
            });
            Add(_scrollArea);
            switch (variant)
            {
            case 0:
                Add(new GumpPic(97, 12, 0x0883, 0));

                Add(_buttonPost = new Button((int)ButtonType.Post, 0x0886, 0x0886)
                {
                    X                = 37,
                    Y                = Height - 50,
                    ButtonAction     = ButtonAction.Activate,
                    ContainsByBounds = true
                });

                break;

            case 1:

                Add(_buttonReply = new Button((int)ButtonType.Reply, 0x0884, 0x0884)
                {
                    X                = 37,
                    Y                = Height - 50,
                    ButtonAction     = ButtonAction.Activate,
                    ContainsByBounds = true
                });

                break;

            case 2:

                Add(_buttonRemove = new Button((int)ButtonType.Remove, 0x0885, 0x0885)    //DISABLED
                {
                    X                = 235,
                    Y                = Height - 50,
                    ButtonAction     = ButtonAction.Activate,
                    ContainsByBounds = true
                });

                break;
            }
        }
コード例 #7
0
        public SkillGumpAdvanced() : base(0, 0)
        {
            _totalReal       = 0;
            _totalValue      = 0;
            CanMove          = true;
            AcceptMouseInput = true;
            WantUpdateSize   = false;

            Width  = WIDTH;
            Height = HEIGHT;

            Add
            (
                new AlphaBlendControl(0.05f)
            {
                X      = 1,
                Y      = 1,
                Width  = WIDTH - 2,
                Height = HEIGHT - 2
            }
            );

            ScrollArea area = new ScrollArea
                              (
                20,
                60,
                WIDTH - 40,
                250,
                true
                              )
            {
                AcceptMouseInput = true
            };

            Add(area);

            _databox = new DataBox(0, 0, 1, 1);
            _databox.WantUpdateSize = true;

            area.Add(_databox);

            Add
            (
                new NiceButton
                (
                    10,
                    10,
                    180,
                    25,
                    ButtonAction.Activate,
                    ResGumps.Name
                )
            {
                ButtonParameter = (int)Buttons.SortName,
                IsSelected      = true,
                X = 40,
                Y = 25
            }
            );

            Add
            (
                new NiceButton
                (
                    10,
                    10,
                    80,
                    25,
                    ButtonAction.Activate,
                    ResGumps.Real
                )
            {
                ButtonParameter = (int)Buttons.SortReal,
                X = 220,
                Y = 25
            }
            );

            Add
            (
                new NiceButton
                (
                    10,
                    10,
                    80,
                    25,
                    ButtonAction.Activate,
                    ResGumps.Base
                )
            {
                ButtonParameter = (int)Buttons.SortBase,
                X = 300,
                Y = 25
            }
            );

            Add
            (
                new NiceButton
                (
                    10,
                    10,
                    80,
                    25,
                    ButtonAction.Activate,
                    ResGumps.Cap
                )
            {
                ButtonParameter = (int)Buttons.SortCap,
                X = 380,
                Y = 25
            }
            );

            Add
            (
                new Line
                (
                    20,
                    60,
                    435,
                    1,
                    0xFFFFFFFF
                )
            );

            Add
            (
                new Line
                (
                    20,
                    310,
                    435,
                    1,
                    0xFFFFFFFF
                )
            );

            Add(_sortOrderIndicator = new GumpPic(0, 0, 0x985, 0));
            OnButtonClick((int)Buttons.SortName);
        }
コード例 #8
0
        public ServerSelectionGump() : base(0, 0)
        {
            //AddChildren(new LoginBackground(true));

            Add
            (
                new Button((int)Buttons.Prev, 0x15A1, 0x15A3, 0x15A2)
            {
                X = 586, Y = 445, ButtonAction = ButtonAction.Activate
            }
            );

            Add
            (
                new Button((int)Buttons.Next, 0x15A4, 0x15A6, 0x15A5)
            {
                X = 610, Y = 445, ButtonAction = ButtonAction.Activate
            }
            );

            if (Client.Version >= ClientVersion.CV_500A)
            {
                ushort textColor = 0xFFFF;

                Add
                (
                    new Label(ClilocLoader.Instance.GetString(1044579), true, textColor, font: 1)
                {
                    X = 155, Y = 70
                }
                ); // "Select which shard to play on:"

                Add
                (
                    new Label(ClilocLoader.Instance.GetString(1044577), true, textColor, font: 1)
                {
                    X = 400, Y = 70
                }
                ); // "Latency:"

                Add
                (
                    new Label(ClilocLoader.Instance.GetString(1044578), true, textColor, font: 1)
                {
                    X = 470, Y = 70
                }
                ); // "Packet Loss:"

                Add
                (
                    new Label(ClilocLoader.Instance.GetString(1044580), true, textColor, font: 1)
                {
                    X = 153, Y = 368
                }
                ); // "Sort by:"
            }
            else
            {
                ushort textColor = 0x0481;

                Add
                (
                    new Label(ResGumps.SelectWhichShardToPlayOn, false, textColor, font: 9)
                {
                    X = 155, Y = 70
                }
                );

                Add
                (
                    new Label(ResGumps.Latency, false, textColor, font: 9)
                {
                    X = 400, Y = 70
                }
                );

                Add
                (
                    new Label(ResGumps.PacketLoss, false, textColor, font: 9)
                {
                    X = 470, Y = 70
                }
                );

                Add
                (
                    new Label(ResGumps.SortBy, false, textColor, font: 9)
                {
                    X = 153, Y = 368
                }
                );
            }

            Add
            (
                new Button((int)Buttons.SortTimeZone, 0x093B, 0x093C, 0x093D)
            {
                X = 230, Y = 366
            }
            );

            Add
            (
                new Button((int)Buttons.SortFull, 0x093E, 0x093F, 0x0940)
            {
                X = 338, Y = 366
            }
            );

            Add
            (
                new Button((int)Buttons.SortConnection, 0x0941, 0x0942, 0x0943)
            {
                X = 446, Y = 366
            }
            );

            // World Pic Bg
            Add(new GumpPic(150, 390, 0x0589, 0));

            // Earth
            Add
            (
                new Button((int)Buttons.Earth, 0x15E8, 0x15EA, 0x15E9)
            {
                X = 160, Y = 400, ButtonAction = ButtonAction.Activate
            }
            );

            // Sever Scroll Area Bg
            Add
            (
                new ResizePic(0x0DAC)
            {
                X = 150, Y = 90, Width = 393 - 14, Height = 271
            }
            );

            // Sever Scroll Area
            ScrollArea scrollArea = new ScrollArea
                                    (
                150,
                90,
                393,
                271,
                true
                                    );

            DataBox databox = new DataBox(0, 0, 1, 1);

            databox.WantUpdateSize = true;
            LoginScene loginScene = Client.Game.GetScene <LoginScene>();

            scrollArea.ScissorRectangle.Y      = 16;
            scrollArea.ScissorRectangle.Height = -32;

            foreach (ServerListEntry server in loginScene.Servers)
            {
                databox.Add(new ServerEntryGump(server, 5, NORMAL_COLOR, SELECTED_COLOR));
            }

            databox.ReArrangeChildren();

            Add(scrollArea);
            scrollArea.Add(databox);

            if (loginScene.Servers.Length != 0)
            {
                int index = Settings.GlobalSettings.LastServerNum - 1;

                if (index < 0 || index >= loginScene.Servers.Length)
                {
                    index = 0;
                }

                Add
                (
                    new Label(loginScene.Servers[index].Name, false, 0x0481, font: 9)
                {
                    X = 243,
                    Y = 420
                }
                );
            }

            AcceptKeyboardInput    = true;
            CanCloseWithRightClick = false;
        }
コード例 #9
0
 void onBtn4Clicked(object sender, ClickedEventArgs e)
 {
     ScrollArea.ScrollTo(0, false);
 }
コード例 #10
0
 void SearchBox_OnTextModified(string arg)
 {
     ScrollArea.ResetScroll();
     Filter();
     ReCreateItems();
 }
コード例 #11
0
        public StandardSkillsGump() : base(0, 0)
        {
            AcceptMouseInput       = false;
            CanMove                = true;
            CanCloseWithRightClick = true;

            Height = 200 + _diffY;

            Add(_gumpPic = new GumpPic(160, 0, 0x82D, 0));
            _gumpPic.MouseDoubleClick += _picBase_MouseDoubleClick;

            _scrollArea = new ExpandableScroll(0, _diffY, Height, 0x1F40)
            {
                TitleGumpID      = 0x0834,
                AcceptMouseInput = true
            };

            Add(_scrollArea);

            Add(new GumpPic(50, 35 + _diffY, 0x082B, 0));
            Add(_bottomLine    = new GumpPic(50, Height - 98, 0x082B, 0));
            Add(_bottomComment = new GumpPic(25, Height - 85, 0x0836, 0));

            _area = new ScrollArea
                    (
                22, 45 + _diffY + _bottomLine.Height - 10, _scrollArea.Width - 14, _scrollArea.Height - (83 + _diffY),
                false
                    )
            {
                AcceptMouseInput = true, CanMove = true
            };

            Add(_area);

            _container = new DataBox(0, 0, 1, 1);
            _container.WantUpdateSize   = true;
            _container.AcceptMouseInput = true;
            _container.CanMove          = true;

            _area.Add(_container);

            Add
            (
                _skillsLabelSum = new Label(World.Player.Skills.Sum(s => s.Value).ToString("F1"), false, 600, 0, 3)
            {
                X = _bottomComment.X + _bottomComment.Width + 5, Y = _bottomComment.Y - 5
            }
            );

            //new group
            Add
            (
                _newGroupButton = new Button(0, 0x083A, 0x083A, 0x083A)
            {
                X = 60,
                Y = Height,
                ContainsByBounds = true,
                ButtonAction     = ButtonAction.Activate
            }
            );

            Add
            (
                _checkReal = new Checkbox(0x938, 0x939, ResGumps.ShowReal, 1, 0x0386, false)
            {
                X = _newGroupButton.X + _newGroupButton.Width + 30, Y = _newGroupButton.Y - 6
            }
            );

            Add
            (
                _checkCaps = new Checkbox(0x938, 0x939, ResGumps.ShowCaps, 1, 0x0386, false)
            {
                X = _newGroupButton.X + _newGroupButton.Width + 30, Y = _newGroupButton.Y + 7
            }
            );

            _checkReal.ValueChanged += UpdateSkillsValues;
            _checkCaps.ValueChanged += UpdateSkillsValues;


            if (World.Player != null)
            {
                foreach (SkillsGroup g in SkillsGroupManager.Groups)
                {
                    SkillsGroupControl control = new SkillsGroupControl(g, 3, 3);
                    _skillsControl.Add(control);
                    _container.Add(control);

                    control.IsMinimized = true;

                    int count = g.Count;

                    for (int i = 0; i < count; i++)
                    {
                        byte index = g.GetSkill(i);

                        if (index < SkillsLoader.Instance.SkillsCount)
                        {
                            control.AddSkill(index, 0, 17 + i * 17);
                        }
                    }
                }
            }

            _hitBox = new HitBox(160, 0, 23, 24);
            Add(_hitBox);
            _hitBox.MouseUp += _hitBox_MouseUp;

            _container.ReArrangeChildren();
        }
コード例 #12
0
        private void BuildPage2()
        {
            AddChildren(new GumpPic(0, 111, 0x00DB, 0)
            {
                CanMove = false
            }, 2);

            Label label = new Label("ClassicUO configuration", true, 0, 460, align: TEXT_ALIGN_TYPE.TS_CENTER)
            {
                X = 84, Y = 22
            };

            AddChildren(label, 2);
            ScrollArea scrollArea = new ScrollArea(64, 90, 500, 300, true);

            AddChildren(scrollArea, 2);

            label = new Label("FPS:", true, 0)
            {
                X = 0, Y = 0
            };
            scrollArea.AddChildren(label);
            _sliderFPS = new HSliderBar(0, 21, 90, 15, 250, _settings.MaxFPS, HSliderBarStyle.MetalWidgetRecessedBar, true);
            scrollArea.AddChildren(_sliderFPS);

            _checkboxHighlightGameObjects = new Checkbox(0x00D2, 0x00D3, "Highlight game objects")
            {
                X = 0, Y = 41, IsChecked = _settings.HighlightGameObjects
            };
            scrollArea.AddChildren(_checkboxHighlightGameObjects);

            _checkboxSmoothMovement = new Checkbox(0x00D2, 0x00D3, "Smooth movement")
            {
                X = 0, Y = 61, IsChecked = _settings.SmoothMovement
            };
            scrollArea.AddChildren(_checkboxSmoothMovement);
            int y = 81;

            for (int i = 0; i < 400; i++)
            {
                Checkbox ck = new Checkbox(0x00D2, 0x00D3, "TRY " + i)
                {
                    Y = y
                };
                ck.ValueChanged += (sender, e) => Console.WriteLine("PRESSED: " + ck.Text);
                scrollArea.AddChildren(ck);
                y += 20;
            }

            y += 20;

            for (int i = 0; i < 40; i++)
            {
                Button ck = new Button((int)Buttons.Ok + i + 1, 0x00F9, 0x00F8, 0x00F7)
                {
                    X = 34, Y = y, ButtonAction = ButtonAction.Activate
                };
                ck.MouseClick += (sender, e) => Console.WriteLine("PRESSED: " + ck.ButtonID);
                scrollArea.AddChildren(ck);
                y += ck.Height;
            }
        }
コード例 #13
0
        public ServerSelectionGump() : base(0, 0)
        {
            //AddChildren(new LoginBackground(true));

            Add(new Button((int)Buttons.Prev, 0x15A1, 0x15A3, 0x15A2)
            {
                X = 586, Y = 445, ButtonAction = ButtonAction.Activate
            });

            Add(new Button((int)Buttons.Next, 0x15A4, 0x15A6, 0x15A5)
            {
                X = 610, Y = 445, ButtonAction = ButtonAction.Activate
            });

            if (Client.Version >= ClientVersion.CV_500A)
            {
                ushort textColor = 0xFFFF;

                Add(new Label(ClilocLoader.Instance.GetString(1044579), true, textColor, font: 1)
                {
                    X = 155, Y = 70
                }); // "Select which shard to play on:"

                Add(new Label(ClilocLoader.Instance.GetString(1044577), true, textColor, font: 1)
                {
                    X = 400, Y = 70
                }); // "Latency:"

                Add(new Label(ClilocLoader.Instance.GetString(1044578), true, textColor, font: 1)
                {
                    X = 470, Y = 70
                }); // "Packet Loss:"

                Add(new Label(ClilocLoader.Instance.GetString(1044580), true, textColor, font: 1)
                {
                    X = 153, Y = 368
                }); // "Sort by:"
            }
            else
            {
                ushort textColor = 0x0481;

                Add(new Label("Select which shard to play on:", false, textColor, font: 9)
                {
                    X = 155, Y = 70
                });

                Add(new Label("Latency:", false, textColor, font: 9)
                {
                    X = 400, Y = 70
                });

                Add(new Label("Packet Loss:", false, textColor, font: 9)
                {
                    X = 470, Y = 70
                });

                Add(new Label("Sort by:", false, textColor, font: 9)
                {
                    X = 153, Y = 368
                });
            }

            Add(new Button((int)Buttons.SortTimeZone, 0x093B, 0x093C, 0x093D)
            {
                X = 230, Y = 366
            });

            Add(new Button((int)Buttons.SortFull, 0x093E, 0x093F, 0x0940)
            {
                X = 338, Y = 366
            });

            Add(new Button((int)Buttons.SortConnection, 0x0941, 0x0942, 0x0943)
            {
                X = 446, Y = 366
            });

            // World Pic Bg
            Add(new GumpPic(150, 390, 0x0589, 0));

            // Earth
            Add(new Button((int)Buttons.Earth, 0x15E8, 0x15EA, 0x15E9)
            {
                X = 160, Y = 400, ButtonAction = ButtonAction.Activate
            });

            // Sever Scroll Area Bg
            Add(new ResizePic(0x0DAC)
            {
                X = 150, Y = 90, Width = 393 - 14, Height = 271
            });
            // Sever Scroll Area
            ScrollArea scrollArea = new ScrollArea(150, 100, 383, 271, true);
            LoginScene loginScene = Client.Game.GetScene <LoginScene>();

            foreach (ServerListEntry server in loginScene.Servers)
            {
                HoveredLabel label;
                scrollArea.Add(label = new HoveredLabel($"{server.Name}                         -           -", false, NORMAL_COLOR, SELECTED_COLOR, NORMAL_COLOR, font: 5)
                {
                    X = 74,
                    //Y = 250
                });

                label.MouseUp += (sender, e) => { OnButtonClick((int)(Buttons.Server + server.Index)); };
            }

            Add(scrollArea);

            if (loginScene.Servers.Length != 0)
            {
                int index = Settings.GlobalSettings.LastServerNum - 1;

                if (index < 0 || index >= loginScene.Servers.Length)
                {
                    index = 0;
                }

                Add(new Label(loginScene.Servers[index].Name, false, 0x0481, font: 9)
                {
                    X = 243,
                    Y = 420
                });

                //if (loginScene.Servers.Last().Index < loginScene.Servers.Count())
                //{
                //    Add(new Label(loginScene.Servers.Last().Name, false, 0x0481, font: 9)
                //    {
                //        X = 243, Y = 420
                //    });
                //}
                //else
                //{
                //    Add(new Label(loginScene.Servers.First().Name, false, 0x0481, font: 9)
                //    {
                //        X = 243, Y = 420
                //    });
                //}
            }

            AcceptKeyboardInput    = true;
            CanCloseWithRightClick = false;
        }
コード例 #14
0
        public StandardSkillsGump() : base(Constants.SKILLSTD_LOCALSERIAL, 0)
        {
            CanBeSaved       = true;
            AcceptMouseInput = false;
            CanMove          = true;
            Height           = 200 + _diffY;

            Add(_gumpPic = new GumpPic(160, 0, 0x82D, 0));
            _gumpPic.MouseDoubleClick += _picBase_MouseDoubleClick;
            _scrollArea = new ExpandableScroll(0, _diffY, Height, 0x1F40)
            {
                TitleGumpID      = 0x0834,
                AcceptMouseInput = true
            };

            Add(_scrollArea);

            Add(new GumpPic(50, 35 + _diffY, 0x082B, 0));
            Add(_bottomLine    = new GumpPic(50, Height - 98, 0x082B, 0));
            Add(_bottomComment = new GumpPic(25, Height - 85, 0x0836, 0));

            _container = new ScrollArea(22, 45 + _diffY + _bottomLine.Height - 10, _scrollArea.Width - 14,
                                        _scrollArea.Height - (83 + _diffY), false)
            {
                AcceptMouseInput = true, CanMove = true
            };
            Add(_container);
            Add(_skillsLabelSum = new Label(World.Player.Skills.Sum(s => s.Value).ToString("F1"), false, 600, 0, 3)
            {
                X = _bottomComment.X + _bottomComment.Width + 5, Y = _bottomComment.Y - 5
            });

            //new group
            Add(_newGroupButton = new Button(0, 0x083A, 0x083A, 0x083A)
            {
                X = 60,
                Y = Height,
                ContainsByBounds = true,
                ButtonAction     = ButtonAction.Activate
            });
            Add(_checkReal = new Checkbox(0x938, 0x939, " - Show Real", 1, 0x0386, false)
            {
                X = _newGroupButton.X + _newGroupButton.Width + 30, Y = _newGroupButton.Y - 6
            });
            Add(_checkCaps = new Checkbox(0x938, 0x939, " - Show Caps", 1, 0x0386, false)
            {
                X = _newGroupButton.X + _newGroupButton.Width + 30, Y = _newGroupButton.Y + 7
            });
            _checkReal.ValueChanged += UpdateGump;
            _checkCaps.ValueChanged += UpdateGump;

            _allSkillControls = new SkillControl[UOFileManager.Skills.SkillsCount];

            foreach (KeyValuePair <string, List <int> > k in SkillsGroupManager.Groups)
            {
                AddSkillsToGroup(k.Key, k.Value.OrderBy(s => s, _instance).ToList());
            }


            _hitBox = new HitBox(160, 0, 23, 24);
            Add(_hitBox);
            _hitBox.MouseUp += _hitBox_MouseUp;
        }
コード例 #15
0
ファイル: OptionsGump1.cs プロジェクト: msx752/ClassicUO
        private void BuildCombat()
        {
            const int      PAGE      = 8;
            ScrollArea     rightArea = new ScrollArea(190, 60, 390, 380, true);
            ScrollAreaItem item      = new ScrollAreaItem();

            Button buttonInnocentColor = new Button((int)Buttons.InnocentColor, 0x00D4, 0x00D4)
            {
                ButtonAction = ButtonAction.Activate
            };

            item.AddChildren(buttonInnocentColor);
            uint color = 0xFF7F7F7F;

            if (Engine.Profile.Current.InnocentHue != 0xFFFF)
            {
                color = Hues.RgbaToArgb((Hues.GetPolygoneColor(12, Engine.Profile.Current.InnocentHue) << 8) | 0xFF);
            }
            ColorPickerBox innocentColor = new ColorPickerBox(3, 3, 1, 1, 13, 14);

            innocentColor.MouseClick += (sender, e) => buttonInnocentColor.InvokeMouseClick(e.Location, e.Button);
            innocentColor.SetHue(color);

            buttonInnocentColor.MouseClick += (sender, e) =>
            {
                // TODO: fix multi opening
                ColorPickerGump pickerGump = new ColorPickerGump(100, 100, s => innocentColor.SetHue(s));
                Engine.UI.Add(pickerGump);
            };
            item.AddChildren(innocentColor);

            Label text = new Label("Innocent color", true, 1)
            {
                X = 20
            };

            item.AddChildren(text);

            Button buttonFriendColor = new Button((int)Buttons.FriendColor, 0x00D4, 0x00D4)
            {
                ButtonAction = ButtonAction.Activate, Y = buttonInnocentColor.Height
            };

            item.AddChildren(buttonFriendColor);
            color = 0xFF7F7F7F;

            if (Engine.Profile.Current.FriendHue != 0xFFFF)
            {
                color = Hues.RgbaToArgb((Hues.GetPolygoneColor(12, Engine.Profile.Current.FriendHue) << 8) | 0xFF);
            }

            ColorPickerBox friendColor = new ColorPickerBox(3, 3, 1, 1, 13, 14)
            {
                Y = buttonInnocentColor.Height + 3
            };

            friendColor.MouseClick += (sender, e) => buttonFriendColor.InvokeMouseClick(e.Location, e.Button);
            friendColor.SetHue(color);

            buttonFriendColor.MouseClick += (sender, e) =>
            {
                // TODO: fix multi opening
                ColorPickerGump pickerGump = new ColorPickerGump(100, 100, s => friendColor.SetHue(s));
                Engine.UI.Add(pickerGump);
            };
            item.AddChildren(friendColor);

            text = new Label("Friend color", true, 1)
            {
                X = 20, Y = buttonInnocentColor.Height
            };
            item.AddChildren(text);

            Button buttonCriminalColor = new Button((int)Buttons.CriminalColor, 0x00D4, 0x00D4)
            {
                ButtonAction = ButtonAction.Activate, Y = buttonFriendColor.Bounds.Bottom
            };

            item.AddChildren(buttonCriminalColor);
            color = 0xFF7F7F7F;

            if (Engine.Profile.Current.CriminalHue != 0xFFFF)
            {
                color = Hues.RgbaToArgb((Hues.GetPolygoneColor(12, Engine.Profile.Current.CriminalHue) << 8) | 0xFF);
            }

            ColorPickerBox criminalColor = new ColorPickerBox(3, 3, 1, 1, 13, 14)
            {
                Y = buttonFriendColor.Bounds.Bottom + 3
            };

            criminalColor.MouseClick += (sender, e) => buttonCriminalColor.InvokeMouseClick(e.Location, e.Button);
            criminalColor.SetHue(color);

            buttonCriminalColor.MouseClick += (sender, e) =>
            {
                // TODO: fix multi opening
                ColorPickerGump pickerGump = new ColorPickerGump(100, 100, s => criminalColor.SetHue(s));
                Engine.UI.Add(pickerGump);
            };
            item.AddChildren(criminalColor);

            text = new Label("Criminal color", true, 1)
            {
                X = 20, Y = buttonFriendColor.Bounds.Bottom
            };
            item.AddChildren(text);

            Button buttonEnemyColor = new Button((int)Buttons.EnemyColor, 0x00D4, 0x00D4)
            {
                ButtonAction = ButtonAction.Activate, X = 150
            };

            item.AddChildren(buttonEnemyColor);
            color = 0xFF7F7F7F;

            if (Engine.Profile.Current.EnemyHue != 0xFFFF)
            {
                color = Hues.RgbaToArgb((Hues.GetPolygoneColor(12, Engine.Profile.Current.EnemyHue) << 8) | 0xFF);
            }

            ColorPickerBox enemyColor = new ColorPickerBox(3, 3, 1, 1, 13, 14)
            {
                X = 150 + 3
            };

            enemyColor.MouseClick += (sender, e) => buttonEnemyColor.InvokeMouseClick(e.Location, e.Button);
            enemyColor.SetHue(color);

            buttonEnemyColor.MouseClick += (sender, e) =>
            {
                // TODO: fix multi opening
                ColorPickerGump pickerGump = new ColorPickerGump(100, 100, s => enemyColor.SetHue(s));
                Engine.UI.Add(pickerGump);
            };
            item.AddChildren(enemyColor);

            text = new Label("Enemy color", true, 1)
            {
                X = 150 + 20
            };
            item.AddChildren(text);

            Button buttonMurdererColor = new Button((int)Buttons.MurdererColor, 0x00D4, 0x00D4)
            {
                ButtonAction = ButtonAction.Activate, X = 150, Y = buttonEnemyColor.Bounds.Bottom
            };

            item.AddChildren(buttonMurdererColor);
            color = 0xFF7F7F7F;

            if (Engine.Profile.Current.MurdererHue != 0xFFFF)
            {
                color = Hues.RgbaToArgb((Hues.GetPolygoneColor(12, Engine.Profile.Current.MurdererHue) << 8) | 0xFF);
            }

            ColorPickerBox murdererColor = new ColorPickerBox(3, 3, 1, 1, 13, 14)
            {
                X = 150 + 3, Y = buttonEnemyColor.Bounds.Bottom + 3
            };

            murdererColor.MouseClick += (sender, e) => buttonMurdererColor.InvokeMouseClick(e.Location, e.Button);
            murdererColor.SetHue(color);

            buttonMurdererColor.MouseClick += (sender, e) =>
            {
                // TODO: fix multi opening
                ColorPickerGump pickerGump = new ColorPickerGump(100, 100, s => murdererColor.SetHue(s));
                Engine.UI.Add(pickerGump);
            };
            item.AddChildren(murdererColor);

            text = new Label("Murderer color", true, 1)
            {
                X = 150 + 20, Y = buttonEnemyColor.Bounds.Bottom
            };
            item.AddChildren(text);
            rightArea.AddChildren(item);
            item = new ScrollAreaItem();

            Checkbox queryBeforeAttact = new Checkbox(0x00D2, 0x00D3, "Query before attack", 1)
            {
                Y = 30, IsChecked = Engine.Profile.Current.EnabledCriminalActionQuery
            };

            item.AddChildren(queryBeforeAttact);
            rightArea.AddChildren(item);
            AddChildren(rightArea, PAGE);
        }
コード例 #16
0
        public ProfileGump(uint serial, string header, string footer, string body, bool canEdit) : base
                (serial == World.Player.Serial ? serial = Constants.PROFILE_LOCALSERIAL : serial, serial)
        {
            Height                 = 300 + _diffY;
            CanMove                = true;
            AcceptKeyboardInput    = true;
            CanCloseWithRightClick = true;

            Add(_gumpPic = new GumpPic(143, 0, 0x82D, 0));
            _gumpPic.MouseDoubleClick += _picBase_MouseDoubleClick;

            Add(new ExpandableScroll(0, _diffY, Height - _diffY, 0x0820));
            _scrollArea = new ScrollArea(22, 32 + _diffY, 272 - 22, Height - (96 + _diffY), false);

            Label topText = new Label(header, true, 0, font: 1, maxwidth: 140)
            {
                X = 53,
                Y = 6
            };

            _scrollArea.Add(topText);

            int offsetY = topText.Height - 15;

            _scrollArea.Add(new GumpPic(4, offsetY, 0x005C, 0));
            _scrollArea.Add(new GumpPicTiled(56, offsetY, 138, 0, 0x005D));
            _scrollArea.Add(new GumpPic(194, offsetY, 0x005E, 0));

            offsetY += 44;

            _textBox = new StbTextBox(1, -1, 220)
            {
                Width      = 220,
                X          = 4,
                Y          = offsetY,
                IsEditable = canEdit,
                Multiline  = true
            };

            _originalText         = body;
            _textBox.TextChanged += _textBox_TextChanged;
            _textBox.SetText(body);
            _scrollArea.Add(_textBox);


            _databox = new DataBox(4, _textBox.Height + 3, 1, 1);
            _databox.WantUpdateSize = true;

            _databox.Add(new GumpPic(4, 0, 0x005F, 0));
            _databox.Add(new GumpPicTiled(13, 0 + 9, 197, 0, 0x0060));
            _databox.Add(new GumpPic(210, 0, 0x0061, 0));

            _databox.Add
            (
                new Label(footer, true, 0, font: 1, maxwidth: 220)
            {
                X = 2,
                Y = 26
            }
            );

            Add(_scrollArea);
            _scrollArea.Add(_databox);

            Add(_hitBox      = new HitBox(143, 0, 23, 24));
            _hitBox.MouseUp += _hitBox_MouseUp;
        }
コード例 #17
0
        public InfoGump(GameObject obj) : base(0, 0)
        {
            X                = 200;
            Y                = 200;
            CanMove          = true;
            AcceptMouseInput = false;
            Add(new GameBorder(0, 0, WIDTH, HEIGHT, 4));

            Add(new GumpPicTiled(4, 4, WIDTH - 8, HEIGHT - 8, 0x0A40)
            {
                IsTransparent = true,
                Alpha         = 0.5f,
            });

            Add(new GumpPicTiled(4, 4, WIDTH - 8, HEIGHT - 8, 0x0A40)
            {
                IsTransparent = true,
                Alpha         = 0.5f,
            });
            Add(new Label("Object Information", true, 1153, font: 3)
            {
                X = 20, Y = 20
            });
            Add(new Line(20, 50, WIDTH - 50, 1, 0xFFFFFFFF));
            _scrollArea = new ScrollArea(20, 60, WIDTH - 40, 510, true)
            {
                AcceptMouseInput = true
            };
            Add(_scrollArea);

            Dictionary <string, string> dict = ReflectionHolder.GetGameObjectProperties(obj);

            if (dict != null)
            {
                foreach (KeyValuePair <string, string> item in dict.OrderBy(s => s.Key))
                {
                    ScrollAreaItem areaItem = new ScrollAreaItem();

                    Label label = new Label(item.Key + ":", true, 33, font: 1, style: FontStyle.BlackBorder)
                    {
                        X = 2
                    };
                    areaItem.Add(label);

                    int height = label.Height;

                    label = new Label(item.Value, true, 1153, font: 1, style: FontStyle.BlackBorder, maxwidth: WIDTH - 65 - 200)
                    {
                        X = 200
                    };

                    if (label.Height > 0)
                    {
                        height = label.Height;
                    }

                    areaItem.Add(label);
                    areaItem.Add(new Line(0, height + 2, WIDTH - 65, 1, Color.Gray.PackedValue));

                    _scrollArea.Add(areaItem);
                }
            }
        }
コード例 #18
0
 void onBtn5Clicked(object sender, ClickedEventArgs e)
 {
     ScrollArea.ScrollTo(0, true);
 }
コード例 #19
0
        public BulletinBoardGump(uint serial, int x, int y, string name) : base(serial, 0)
        {
            X       = x;
            Y       = y;
            CanMove = true;
            CanCloseWithRightClick = true;

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

            Label label = new Label
                          (
                name,
                true,
                1,
                170,
                1,
                align: TEXT_ALIGN_TYPE.TS_CENTER
                          )
            {
                X = 159,
                Y = 36
            };

            Add(label);

            HitBox hitbox = new HitBox(15, 170, 80, 80)
            {
                Alpha = 1
            };

            hitbox.MouseUp += (sender, e) =>
            {
                UIManager.GetGump <BulletinBoardItem>(LocalSerial)?.Dispose();

                UIManager.Add
                (
                    new BulletinBoardItem
                    (
                        LocalSerial,
                        0,
                        World.Player.Name,
                        string.Empty,
                        ResGumps.DateTime,
                        string.Empty,
                        0
                    )
                {
                    X = 400, Y = 335
                }
                );
            };

            Add(hitbox);

            ScrollArea area = new ScrollArea
                              (
                127,
                159,
                241,
                195,
                false
                              );

            Add(area);

            _databox = new DataBox(0, 0, 1, 1);
            _databox.WantUpdateSize = true;

            area.Add(_databox);


            // TODO: buuttons
        }
コード例 #20
0
ファイル: ShopGump.cs プロジェクト: dissident76/ClassicUO
        public ShopGump(uint serial, bool isBuyGump, int x, int y) : base(serial, 0) //60 is the base height, original size
        {
            int height = ProfileManager.Current.VendorGumpHeight;

            if (_shopGumpParts == null)
            {
                GenerateVirtualTextures();
            }
            X = x;
            Y = y;
            AcceptMouseInput       = false;
            AcceptKeyboardInput    = true;
            CanMove                = true;
            CanCloseWithRightClick = true;
            IsBuyGump              = isBuyGump;

            _transactionItems = new Dictionary <uint, TransactionItem>();
            _shopItems        = new Dictionary <uint, ShopItem>();
            _updateTotal      = false;

            int add = isBuyGump ? 0 : 6;

            GumpPic pic = new GumpPic(0, 0, _shopGumpParts[0 + add], 0);

            Add(pic);
            pic = new GumpPic(250, 144, _shopGumpParts[3 + add], 0);
            Add(pic);

            Add(_middleGumpLeft = new GumpPicTiled(0, 64, pic.Width, height, _shopGumpParts[1 + add]));
            Add(new GumpPic(0, _middleGumpLeft.Height + _middleGumpLeft.Y, _shopGumpParts[2 + add], 0));

            _shopScrollArea = new ScrollArea(30, 60, 225, _middleGumpLeft.Height + _middleGumpLeft.Y + 50, false, _middleGumpLeft.Height + _middleGumpLeft.Y);
            Add(_shopScrollArea);


            Add(_middleGumpRight = new GumpPicTiled(250, 144 + 64, pic.Width, _middleGumpLeft.Height >> 1, _shopGumpParts[4 + add]));
            Add(new GumpPic(250, _middleGumpRight.Height + _middleGumpRight.Y, _shopGumpParts[5 + add], 0));


            HitBox boxAccept = new HitBox(280, 306 + _middleGumpRight.Height, 34, 30)
            {
                Alpha = 1
            };

            HitBox boxClear = new HitBox(452, 310 + _middleGumpRight.Height, 24, 24)
            {
                Alpha = 1
            };

            boxAccept.MouseUp += (sender, e) => { OnButtonClick((int)Buttons.Accept); };
            boxClear.MouseUp  += (sender, e) => { OnButtonClick((int)Buttons.Clear); };
            Add(boxAccept);
            Add(boxClear);


            if (isBuyGump)
            {
                Add(_totalLabel = new Label("0", true, 0x0386, 0, 1)
                {
                    X = 318,
                    Y = 281 + _middleGumpRight.Height
                });

                Add(_playerGoldLabel = new Label(World.Player.Gold.ToString(), true, 0x0386, 0, 1)
                {
                    X = 436,
                    Y = 281 + _middleGumpRight.Height
                });
            }
            else
            {
                Add(_totalLabel = new Label("0", true, 0x0386, 0, 1)
                {
                    X = 436,
                    Y = 281 + _middleGumpRight.Height
                });
            }

            Add(new Label(World.Player.Name, false, 0x0386, font: 5)
            {
                X = 322,
                Y = 308 + _middleGumpRight.Height
            });

            Add(_transactionScrollArea = new ScrollArea(260, 215, 245, 53 + _middleGumpRight.Height, false));


            HitBox upButton = new HitBox(233, 50, 18, 16)
            {
                Alpha = 1
            };

            upButton.MouseDown += (sender, e) => { _isUpDOWN = true; };
            upButton.MouseUp   += (sender, e) => { _isUpDOWN = false; };

            Add(upButton);

            HitBox downButton = new HitBox(233, 130 + _middleGumpLeft.Height, 18, 16)
            {
                Alpha = 1
            };

            downButton.MouseDown += (sender, e) => { _isDownDOWN = true; };
            downButton.MouseUp   += (sender, e) => { _isDownDOWN = false; };
            Add(downButton);


            HitBox upButtonT = new HitBox(483, 195, 18, 16)
            {
                Alpha = 1
            };

            upButtonT.MouseDown += (sender, e) => { _isUpDOWN_T = true; };
            upButtonT.MouseUp   += (sender, e) => { _isUpDOWN_T = false; };

            Add(upButtonT);

            HitBox downButtonT = new HitBox(483, 270 + _middleGumpRight.Height, 18, 16)
            {
                Alpha = 1
            };

            downButtonT.MouseDown += (sender, e) => { _isDownDOWN_T = true; };
            downButtonT.MouseUp   += (sender, e) => { _isDownDOWN_T = false; };
            Add(downButtonT);
        }
コード例 #21
0
ファイル: ShopGump.cs プロジェクト: dust765/ClassicUO
        public ShopGump(uint serial, bool isBuyGump, int x, int y) : base
                (serial, 0) //60 is the base height, original size
        {
            int height = ProfileManager.CurrentProfile.VendorGumpHeight;

            if (_shopGumpParts == null)
            {
                GenerateVirtualTextures();
            }

            X = x;
            Y = y;
            AcceptMouseInput       = false;
            AcceptKeyboardInput    = true;
            CanMove                = true;
            CanCloseWithRightClick = true;
            IsBuyGump              = isBuyGump;

            _transactionItems = new Dictionary <uint, TransactionItem>();
            _shopItems        = new Dictionary <uint, ShopItem>();
            _updateTotal      = false;

            int add = isBuyGump ? 0 : 6;

            GumpPicTexture pic = new GumpPicTexture(0, 0, _shopGumpParts[0 + add]);

            Add(pic);

            pic = new GumpPicTexture(250, 144, _shopGumpParts[3 + add]);
            Add(pic);


            _middleGumpLeft = new GumpPicTexture(0, 64, _shopGumpParts[1 + add], true)
            {
                Width  = pic.Width,
                Height = height
            };

            Add(_middleGumpLeft);

            GumpPicTexture left_down = new GumpPicTexture
                                           (0, _middleGumpLeft.Height + _middleGumpLeft.Y, _shopGumpParts[2 + add]);

            Add(left_down);

            _shopScrollArea = new ScrollArea
                              (
                30, 60, 225, _middleGumpLeft.Height + _middleGumpLeft.Y + 50, false,
                _middleGumpLeft.Height + _middleGumpLeft.Y
                              );

            Add(_shopScrollArea);


            _middleGumpRight = new GumpPicTexture(250, 144 + 64, _shopGumpParts[4 + add], true)
            {
                Width  = pic.Width,
                Height = _middleGumpLeft.Height >> 1
            };

            Add(_middleGumpRight);


            GumpPicTexture right_down = new GumpPicTexture
                                            (250, _middleGumpRight.Height + _middleGumpRight.Y, _shopGumpParts[5 + add]);

            Add(right_down);


            HitBox boxAccept = new HitBox(280, 306 + _middleGumpRight.Height, 34, 30)
            {
                Alpha = 1
            };

            HitBox boxClear = new HitBox(452, 310 + _middleGumpRight.Height, 24, 24)
            {
                Alpha = 1
            };

            boxAccept.MouseUp += (sender, e) => { OnButtonClick((int)Buttons.Accept); };
            boxClear.MouseUp  += (sender, e) => { OnButtonClick((int)Buttons.Clear); };
            Add(boxAccept);
            Add(boxClear);


            if (isBuyGump)
            {
                Add
                (
                    _totalLabel = new Label("0", true, 0x0386, 0, 1)
                {
                    X = 318,
                    Y = 281 + _middleGumpRight.Height
                }
                );

                Add
                (
                    _playerGoldLabel = new Label(World.Player.Gold.ToString(), true, 0x0386, 0, 1)
                {
                    X = 436,
                    Y = 281 + _middleGumpRight.Height
                }
                );
            }
            else
            {
                Add
                (
                    _totalLabel = new Label("0", true, 0x0386, 0, 1)
                {
                    X = 436,
                    Y = 281 + _middleGumpRight.Height
                }
                );
            }

            Label name = new Label(World.Player.Name, false, 0x0386, font: 5)
            {
                X = 322,
                Y = 308 + _middleGumpRight.Height
            };

            Add(name);

            Add(_transactionScrollArea = new ScrollArea(260, 215, 245, 53 + _middleGumpRight.Height, false));

            _transactionDataBox = new DataBox(0, 0, 1, 1);
            _transactionDataBox.WantUpdateSize = true;

            _transactionScrollArea.Add(_transactionDataBox);

            HitBox upButton = new HitBox(233, 50, 18, 16)
            {
                Alpha = 1
            };

            upButton.MouseDown += (sender, e) => { _isUpDOWN = true; };
            upButton.MouseUp   += (sender, e) => { _isUpDOWN = false; };

            Add(upButton);

            HitBox downButton = new HitBox(233, 130 + _middleGumpLeft.Height, 18, 16)
            {
                Alpha = 1
            };

            downButton.MouseDown += (sender, e) => { _isDownDOWN = true; };
            downButton.MouseUp   += (sender, e) => { _isDownDOWN = false; };
            Add(downButton);


            HitBox upButtonT = new HitBox(483, 195, 18, 16)
            {
                Alpha = 1
            };

            upButtonT.MouseDown += (sender, e) => { _isUpDOWN_T = true; };
            upButtonT.MouseUp   += (sender, e) => { _isUpDOWN_T = false; };

            Add(upButtonT);

            HitBox downButtonT = new HitBox(483, 270 + _middleGumpRight.Height, 18, 16)
            {
                Alpha = 1
            };

            downButtonT.MouseDown += (sender, e) => { _isDownDOWN_T = true; };
            downButtonT.MouseUp   += (sender, e) => { _isDownDOWN_T = false; };
            Add(downButtonT);


            Add
            (
                _button_expander = new Button(2, 0x082E, 0x82F)
            {
                ButtonAction = ButtonAction.Activate,
                X            = _shopGumpParts[0 + add].Width / 2 - 10,
                Y            = left_down.Y + left_down.Height
            }
            );

            bool is_pressing    = false;
            int  initial_Y      = 0;
            int  initial_height = 0;

            _button_expander.MouseDown += (sender, args) =>
            {
                is_pressing    = true;
                initial_Y      = Mouse.Position.Y;
                initial_height = _middleGumpLeft.Height;
            };

            _button_expander.MouseUp += (sender, args) => { is_pressing = false; };

            _button_expander.MouseOver += (sender, args) =>
            {
                if (is_pressing && Mouse.Position.Y != initial_Y)
                {
                    _middleGumpLeft.Height = initial_height + (Mouse.Position.Y - initial_Y);

                    if (_middleGumpLeft.Height < 60)
                    {
                        _middleGumpLeft.Height = 60;
                    }
                    else if (_middleGumpLeft.Height > 450)
                    {
                        _middleGumpLeft.Height = 450;
                    }

                    ProfileManager.CurrentProfile.VendorGumpHeight = _middleGumpLeft.Height;

                    _middleGumpRight.Height = _middleGumpLeft.Height >> 1;

                    left_down.Y  = _middleGumpLeft.Y + _middleGumpLeft.Height;
                    right_down.Y = _middleGumpRight.Y + _middleGumpRight.Height;
                    boxAccept.Y  = 306 + _middleGumpRight.Height;
                    boxClear.Y   = 310 + _middleGumpRight.Height;
                    _transactionDataBox.Height      = _transactionScrollArea.Height = _middleGumpRight.Height + 53;
                    _shopScrollArea.Height          = left_down.Y + 50;
                    _shopScrollArea.ScrollMaxHeight = left_down.Y;
                    _button_expander.Y = left_down.Y + left_down.Height;
                    downButton.Y       = 130 + _middleGumpLeft.Height;
                    downButtonT.Y      = 270 + _middleGumpRight.Height;
                    name.Y             = 308 + _middleGumpRight.Height;
                    _totalLabel.Y      = 281 + _middleGumpRight.Height;

                    if (_playerGoldLabel != null)
                    {
                        _playerGoldLabel.Y = 281 + _middleGumpRight.Height;
                    }

                    WantUpdateSize = true;
                }
            };
        }
コード例 #22
0
        public ServerSelectionGump() : base(0, 0)
        {
            AddChildren(new Button((int)Buttons.Prev, 0x15A1, 0x15A3, 0x15A2)
            {
                X = 586, Y = 445, ButtonAction = ButtonAction.Activate
            });
            AddChildren(new Button((int)Buttons.Next, 0x15A4, 0x15A6, 0x15A5)
            {
                X = 610, Y = 445, ButtonAction = ButtonAction.Activate
            });

            if (FileManager.ClientVersion >= ClientVersions.CV_500A)
            {
                ushort textColor = 0xFFFF;
                AddChildren(new Label(Cliloc.GetString(1044579), true, textColor, font: 1)
                {
                    X = 155, Y = 70
                });                                                                                            // "Select which shard to play on:"
                AddChildren(new Label(Cliloc.GetString(1044577), true, textColor, font: 1)
                {
                    X = 400, Y = 70
                });                                                                                            // "Latency:"
                AddChildren(new Label(Cliloc.GetString(1044578), true, textColor, font: 1)
                {
                    X = 470, Y = 70
                });                                                                                            // "Packet Loss:"
                AddChildren(new Label(Cliloc.GetString(1044580), true, textColor, font: 1)
                {
                    X = 153, Y = 368
                });                                                                                             // "Sort by:"
            }
            else
            {
                ushort textColor = 0x0481;
                AddChildren(new Label("Select which shard to play on:", true, textColor, font: 9)
                {
                    X = 155, Y = 70
                });
                AddChildren(new Label("Latency:", true, textColor, font: 9)
                {
                    X = 400, Y = 70
                });
                AddChildren(new Label("Packet Loss:", true, textColor, font: 9)
                {
                    X = 470, Y = 70
                });
                AddChildren(new Label("Sort by:", true, textColor, font: 9)
                {
                    X = 153, Y = 368
                });
            }

            AddChildren(new Button((int)Buttons.SortTimeZone, 0x093B, 0x093C, 0x093D)
            {
                X = 230, Y = 366
            });
            AddChildren(new Button((int)Buttons.SortFull, 0x093E, 0x093F, 0x0940)
            {
                X = 338, Y = 366
            });
            AddChildren(new Button((int)Buttons.SortConnection, 0x0941, 0x0942, 0x0943)
            {
                X = 446, Y = 366
            });

            // World Pic Bg
            AddChildren(new GumpPic(150, 390, 0x0589, 0));
            // Earth
            AddChildren(new Button((int)Buttons.Earth, 0x15E8, 0x15EA, 0x15E9)
            {
                X = 160, Y = 400
            });

            // Sever Scroll Area Bg
            AddChildren(new ResizePic(0x0DAC)
            {
                X = 150, Y = 90, Width = 393 - 14, Height = 271
            });
            // Sever Scroll Area
            ScrollArea scrollArea = new ScrollArea(150, 90, 393, 271, true);
            LoginScene loginScene = Service.Get <LoginScene>();

            foreach (ServerListEntry server in loginScene.Servers)
            {
                scrollArea.AddChildren(new ServerEntryGump(server));
            }
            AddChildren(scrollArea);

            if (loginScene.Servers.Count() > 0)
            {
                if (loginScene.Servers.Last().Index < loginScene.Servers.Count())
                {
                    AddChildren(new Label(loginScene.Servers.Last().Name, false, 0x0481, font: 9)
                    {
                        X = 243, Y = 420
                    });
                }
                else
                {
                    AddChildren(new Label(loginScene.Servers.First().Name, false, 0x0481, font: 9)
                    {
                        X = 243, Y = 420
                    });
                }
            }
        }
コード例 #23
0
        public SkillGumpAdvanced() : base(0, 0)
        {
            _skillListEntries = new List <SkillListEntry>();
            _totalReal        = 0;
            _totalValue       = 0;
            X                = 100;
            Y                = 100;
            CanMove          = true;
            AcceptMouseInput = false;
            AddChildren(new GameBorder(0, 0, WIDTH, HEIGHT, 4));

            AddChildren(new GumpPicTiled(4, 4, WIDTH - 8, HEIGHT - 8, 0x0A40)
            {
                IsTransparent = true
            });

            AddChildren(new GumpPicTiled(4, 4, WIDTH - 8, HEIGHT - 8, 0x0A40)
            {
                IsTransparent = true
            });

            _scrollArea = new ScrollArea(20, 60, WIDTH - 40, 250, true)
            {
                AcceptMouseInput = true
            };
            AddChildren(_scrollArea);

            AddChildren(new Label("Skill", true, 1153)
            {
                X = 20, Y = 25
            });

            AddChildren(new Label("Real", true, 1153)
            {
                X = 220, Y = 25
            });

            AddChildren(new Label("Base", true, 1153)
            {
                X = 300, Y = 25
            });

            AddChildren(new Label("Cap", true, 1153)
            {
                X = 380, Y = 25
            });

            //======================================================================================
            AddChildren(new Line(20, 60, 435, 1, 0xFFFFFFFF));
            AddChildren(new Line(20, 310, 435, 1, 0xFFFFFFFF));

            AddChildren(new Label("Total Skill(Real): ", true, 1153)
            {
                X = 30, Y = 320
            });

            AddChildren(new Label("Total Skill(Base): ", true, 1153)
            {
                X = 30, Y = 345
            });
            World.Player.SkillsChanged += OnSkillChanged;
        }
コード例 #24
0
ファイル: PartyGumpAdvanced.cs プロジェクト: G0PLY/ClassicUO
        public PartyGumpAdvanced() : base(0, 0)
        {
            _partyListEntries = new List <PartyListEntry>();
            _line             = new Texture2D(Engine.Batcher.GraphicsDevice, 1, 1);

            _line.SetData(new[]
            {
                Color.White
            });
            X                = 100;
            Y                = 100;
            CanMove          = true;
            AcceptMouseInput = false;
            Add(_gameBorder  = new GameBorder(0, 0, 320, 400, 4));

            Add(_gumpPicTiled = new GumpPicTiled(4, 4, 320 - 8, 400 - 8, 0x0A40)
            {
                IsTransparent = true
            });
            Add(_gumpPicTiled);

            _scrollArea = new ScrollArea(20, 60, 295, 190, true)
            {
                AcceptMouseInput = true
            };
            Add(_scrollArea);

            Add(new Label("Bar", true, 1153)
            {
                X = 30, Y = 25
            });

            Add(new Label("Kick", true, 1153)
            {
                X = 60, Y = 25
            });

            Add(new Label("Player", true, 1153)
            {
                X = 100, Y = 25
            });

            Add(new Label("Status", true, 1153)
            {
                X = 250, Y = 25
            });

            //======================================================
            Add(_messagePartyButton = new Button((int)Buttons.Message, 0xFAB, 0xFAC, 0xFAD)
            {
                X = 30, Y = 275, ButtonAction = ButtonAction.Activate, IsVisible = false
            });

            Add(_messagePartyLabel = new Label("Message party", true, 1153)
            {
                X = 70, Y = 275, IsVisible = false
            });

            //======================================================
            Add(_lootMeButton = new Button((int)Buttons.Loot, 0xFA2, 0xFA3, 0xFA4)
            {
                X = 30, Y = 300, ButtonAction = ButtonAction.Activate, IsVisible = false
            });

            Add(_lootMeLabel = new Label("Party CANNOT loot me", true, 1153)
            {
                X = 70, Y = 300, IsVisible = false
            });

            //======================================================
            Add(_leaveButton = new Button((int)Buttons.Leave, 0xFAE, 0xFAF, 0xFB0)
            {
                X = 30, Y = 325, ButtonAction = ButtonAction.Activate, IsVisible = false
            });

            Add(_leaveLabel = new Label("Leave party", true, 1153)
            {
                X = 70, Y = 325, IsVisible = false
            });

            //======================================================
            Add(_createAddButton = new Button((int)Buttons.Add, 0xFA8, 0xFA9, 0xFAA)
            {
                X = 30, Y = 350, ButtonAction = ButtonAction.Activate
            });

            Add(_createAddLabel = new Label("Add party member", true, 1153)
            {
                X = 70, Y = 350
            });
            //======================================================
            World.Party.PartyMemberChanged += OnPartyMemberChanged;
        }
コード例 #25
0
        private void AddHorizontalBar(ScrollArea area, ushort start, int x, int width)
        {
            PrivateContainer container = new PrivateContainer();

            area.Add(container);
        }
コード例 #26
0
        public SkillGumpAdvanced() : base(0, 0)
        {
            _totalReal       = 0;
            _totalValue      = 0;
            CanBeSaved       = true;
            CanMove          = true;
            AcceptMouseInput = true;
            WantUpdateSize   = false;

            Width  = WIDTH;
            Height = HEIGHT;

            Add(new AlphaBlendControl(0.05f)
            {
                X      = 1,
                Y      = 1,
                Width  = WIDTH - 2,
                Height = HEIGHT - 2
            });

            _scrollArea = new ScrollArea(20, 60, WIDTH - 40, 250, true)
            {
                AcceptMouseInput = true
            };
            Add(_scrollArea);

            Add(new NiceButton(10, 10, 180, 25, ButtonAction.Activate, "Name")
            {
                ButtonParameter = (int)Buttons.SortName,
                IsSelected      = true,
                X = 40,
                Y = 25,
            });

            Add(new NiceButton(10, 10, 80, 25, ButtonAction.Activate, "Real")
            {
                ButtonParameter = (int)Buttons.SortReal,
                X = 220,
                Y = 25,
            });

            Add(new NiceButton(10, 10, 80, 25, ButtonAction.Activate, "Base")
            {
                ButtonParameter = (int)Buttons.SortBase,
                X = 300,
                Y = 25,
            });

            Add(new NiceButton(10, 10, 80, 25, ButtonAction.Activate, "Cap")
            {
                ButtonParameter = (int)Buttons.SortCap,
                X = 380,
                Y = 25,
            });

            Add(new Line(20, 60, 435, 1, 0xFFFFFFFF));
            Add(new Line(20, 310, 435, 1, 0xFFFFFFFF));

            Add(_sortOrderIndicator = new GumpPic(0, 0, 0x985, 0));
            OnButtonClick((int)Buttons.SortName);

            World.Player.SkillsChanged += OnSkillChanged;
        }
コード例 #27
0
ファイル: ChatGump.cs プロジェクト: travis-watson1/ClassicUO
        public ChatGump() : base(0, 0)
        {
            CanMove                = true;
            AcceptMouseInput       = true;
            CanCloseWithRightClick = true;
            WantUpdateSize         = false;
            Width  = 345;
            Height = 390;

            Add
            (
                new ResizePic(0x0A28)
            {
                Width  = Width,
                Height = Height
            }
            );

            int startY = 25;

            Label text = new Label
                         (
                ResGumps.Channels,
                false,
                0x0386,
                345,
                2,
                FontStyle.None,
                TEXT_ALIGN_TYPE.TS_CENTER
                         )
            {
                Y = startY
            };

            Add(text);

            startY += 40;

            Add
            (
                new BorderControl
                (
                    61,
                    startY - 3,
                    220 + 8,
                    200 + 6,
                    3
                )
            );

            Add(new AlphaBlendControl(0)
            {
                X = 64, Y = startY, Width = 220, Height = 200
            });

            ScrollArea area = new ScrollArea
                              (
                64,
                startY,
                220,
                200,
                true
                              )
            {
                ScrollbarBehaviour = ScrollbarBehaviour.ShowAlways
            };

            Add(area);

            _databox = new DataBox(0, 0, 1, 1);
            _databox.WantUpdateSize = true;
            area.Add(_databox);

            foreach (KeyValuePair <string, ChatChannel> k in ChatManager.Channels)
            {
                ChannelListItemControl chan = new ChannelListItemControl(k.Key, 195);
                _databox.Add(chan);
                _channelList.Add(chan);
            }

            _databox.ReArrangeChildren();

            startY = 275;

            text = new Label
                   (
                ResGumps.YourCurrentChannel,
                false,
                0x0386,
                345,
                2,
                FontStyle.None,
                TEXT_ALIGN_TYPE.TS_CENTER
                   )
            {
                Y = startY
            };

            Add(text);

            startY += 25;

            _currentChannelLabel = new Label
                                   (
                ChatManager.CurrentChannelName,
                false,
                0x0386,
                345,
                2,
                FontStyle.None,
                TEXT_ALIGN_TYPE.TS_CENTER
                                   )
            {
                Y = startY
            };

            Add(_currentChannelLabel);


            startY = 337;

            Button button = new Button(0, 0x0845, 0x0846, 0x0845)
            {
                X            = 48,
                Y            = startY + 5,
                ButtonAction = ButtonAction.Activate
            };

            Add(button);

            button = new Button(1, 0x0845, 0x0846, 0x0845)
            {
                X            = 123,
                Y            = startY + 5,
                ButtonAction = ButtonAction.Activate
            };

            Add(button);

            button = new Button(2, 0x0845, 0x0846, 0x0845)
            {
                X            = 216,
                Y            = startY + 5,
                ButtonAction = ButtonAction.Activate
            };

            Add(button);

            text = new Label
                   (
                ResGumps.Join,
                false,
                0x0386,
                0,
                2
                   )
            {
                X = 65,
                Y = startY
            };

            Add(text);

            text = new Label
                   (
                ResGumps.Leave,
                false,
                0x0386,
                0,
                2
                   )
            {
                X = 140,
                Y = startY
            };

            Add(text);

            text = new Label
                   (
                ResGumps.Create,
                false,
                0x0386,
                0,
                2
                   )
            {
                X = 233,
                Y = startY
            };

            Add(text);
        }
コード例 #28
0
        public ProfileGump(uint serial, string header, string footer, string body, bool canEdit) : base(serial, 0)
        {
            Height                 = 600;
            CanMove                = true;
            AcceptKeyboardInput    = true;
            CanCloseWithRightClick = true;

            Add(_profile_background = new ExpandableScroll(0, _diffY - 65, Height - _diffY, 0x09E6));
            Add(_gumpPic            = new GumpPic(365, 0, 0x2C94, 0));

            _scrollArea = new ScrollArea
                          (
                22,
                32 + _diffY,
                _profile_background.Width - 14,
                _profile_background.Height - (83 + _diffY),
                false
                          );

            Label topText = new Label
                            (
                "Name: " + header,
                true,
                0x04EC,
                font: 0,
                maxwidth: 140
                            )
            {
                X = 140,
                Y = 6
            };

            _scrollArea.Add(topText);

            int offsetY = topText.Height - 15;

            /* _scrollArea.Add(new GumpPic(4, offsetY, 0x005C, 0));
             *
             * _scrollArea.Add
             * (
             *  new GumpPicTiled
             *  (
             *      56,
             *      offsetY,
             *      138,
             *      0,
             *      0x005D
             *  )
             * );
             *
             * _scrollArea.Add(new GumpPic(194, offsetY, 0x005E, 0)); */

            offsetY += 44;

            _textBox = new StbTextBox(0, -1, 370, hue: 0x0704)
            {
                Width      = 370,
                X          = 22,
                Y          = offsetY,
                IsEditable = canEdit,
                Multiline  = true
            };

            _originalText         = body;
            _textBox.TextChanged += _textBox_TextChanged;
            _textBox.SetText(body);
            _scrollArea.Add(_textBox);

            _databox = new DataBox(12, _textBox.Height + 3, 1, 1);
            _databox.WantUpdateSize = true;

            _databox.Add(new GumpPic(4, 0, 0x005F, 0));

            _databox.Add
            (
                new GumpPicTiled
                (
                    13,
                    0 + 9,
                    370,
                    0,
                    0x0060
                )
            );

            _databox.Add(new GumpPic(375, 0, 0x0061, 0));

            _databox.Add
            (
                new Label
                (
                    footer,
                    true,
                    0x0704,
                    font: 0,
                    maxwidth: 220
                )
            {
                X = 8,
                Y = 26
            }
            );

            Add(_scrollArea);
            _scrollArea.Add(_databox);

            Add(_hitBox                = new HitBox(364, 0, 15, 20));
            _hitBox.MouseUp           += _hitBox_MouseUp;
            _gumpPic.MouseDoubleClick += _gumpPic_MouseDoubleClick;
        }
コード例 #29
0
        public PartyGumpAdvanced() : base(0, 0)
        {
            _partyListEntries = new List <PartyListEntry>();
            X                = 100;
            Y                = 100;
            CanMove          = true;
            AcceptMouseInput = true;
            WantUpdateSize   = false;

            Add(_alphaBlendControl = new AlphaBlendControl(0.05f)
            {
                X      = 1,
                Y      = 1,
                Width  = WIDTH - 2,
                Height = HEIGHT - 2
            });

            _scrollArea = new ScrollArea(20, 60, 295, 190, true)
            {
                AcceptMouseInput = true
            };
            Add(_scrollArea);

            Add(new Label("Bar", true, 1153)
            {
                X = 30, Y = 25
            });

            Add(new Label("Kick", true, 1153)
            {
                X = 60, Y = 25
            });

            Add(new Label("Player", true, 1153)
            {
                X = 100, Y = 25
            });

            Add(new Label("Status", true, 1153)
            {
                X = 250, Y = 25
            });

            //======================================================
            Add(_messagePartyButton = new Button((int)Buttons.Message, 0xFAB, 0xFAC, 0xFAD)
            {
                X = 30, Y = 275, ButtonAction = ButtonAction.Activate, IsVisible = false
            });

            Add(_messagePartyLabel = new Label("Message party", true, 1153)
            {
                X = 70, Y = 275, IsVisible = false
            });

            //======================================================
            Add(_lootMeButton = new Button((int)Buttons.Loot, 0xFA2, 0xFA3, 0xFA4)
            {
                X = 30, Y = 300, ButtonAction = ButtonAction.Activate, IsVisible = false
            });

            Add(_lootMeLabel = new Label("Party CANNOT loot me", true, 1153)
            {
                X = 70, Y = 300, IsVisible = false
            });

            //======================================================
            Add(_leaveButton = new Button((int)Buttons.Leave, 0xFAE, 0xFAF, 0xFB0)
            {
                X = 30, Y = 325, ButtonAction = ButtonAction.Activate, IsVisible = false
            });

            Add(_leaveLabel = new Label("Leave party", true, 1153)
            {
                X = 70, Y = 325, IsVisible = false
            });

            //======================================================
            Add(_createAddButton = new Button((int)Buttons.Add, 0xFA8, 0xFA9, 0xFAA)
            {
                X = 30, Y = 350, ButtonAction = ButtonAction.Activate
            });

            Add(_createAddLabel = new Label("Add party member", true, 1153)
            {
                X = 70, Y = 350
            });
            //======================================================

            Add(new Line(30, 50, 260, 1, Color.White.PackedValue));
            Add(new Line(95, 50, 1, 200, Color.White.PackedValue));
            Add(new Line(245, 50, 1, 200, Color.White.PackedValue));
            Add(new Line(30, 250, 260, 1, Color.White.PackedValue));

            Width  = WIDTH;
            Height = HEIGHT;

            Height = 320;
            _alphaBlendControl.Height = Height;
            //Set contents if player is NOT in party
            _createAddButton.Y            = 270;
            _createAddLabel.Y             = _createAddButton.Y;
            _createAddLabel.Text          = "Create a party";
            _leaveButton.IsVisible        = false;
            _leaveLabel.IsVisible         = false;
            _lootMeButton.IsVisible       = false;
            _lootMeLabel.IsVisible        = false;
            _messagePartyButton.IsVisible = false;
            _messagePartyLabel.IsVisible  = false;
        }
コード例 #30
0
ファイル: PartyGumpAdvanced.cs プロジェクト: roxya/ClassicUO
        public PartyGumpAdvanced() : base(0, 0)
        {
            _partyListEntries = new List <PartyListEntry>();
            _line             = new Texture2D(Engine.Batcher.GraphicsDevice, 1, 1);

            _line.SetData(new[]
            {
                Color.White
            });
            X                = 100;
            Y                = 100;
            CanMove          = true;
            AcceptMouseInput = true;
            WantUpdateSize   = false;

            Width  = WIDTH;
            Height = HEIGHT;

            Add(_alphaBlendControl = new AlphaBlendControl(0.05f)
            {
                X      = 1,
                Y      = 1,
                Width  = WIDTH - 2,
                Height = HEIGHT - 2
            });

            _scrollArea = new ScrollArea(20, 60, 295, 190, true)
            {
                AcceptMouseInput = true
            };
            Add(_scrollArea);

            Add(new Label("Bar", true, 1153)
            {
                X = 30, Y = 25
            });

            Add(new Label("Kick", true, 1153)
            {
                X = 60, Y = 25
            });

            Add(new Label("Player", true, 1153)
            {
                X = 100, Y = 25
            });

            Add(new Label("Status", true, 1153)
            {
                X = 250, Y = 25
            });

            //======================================================
            Add(_messagePartyButton = new Button((int)Buttons.Message, 0xFAB, 0xFAC, 0xFAD)
            {
                X = 30, Y = 275, ButtonAction = ButtonAction.Activate, IsVisible = false
            });

            Add(_messagePartyLabel = new Label("Message party", true, 1153)
            {
                X = 70, Y = 275, IsVisible = false
            });

            //======================================================
            Add(_lootMeButton = new Button((int)Buttons.Loot, 0xFA2, 0xFA3, 0xFA4)
            {
                X = 30, Y = 300, ButtonAction = ButtonAction.Activate, IsVisible = false
            });

            Add(_lootMeLabel = new Label("Party CANNOT loot me", true, 1153)
            {
                X = 70, Y = 300, IsVisible = false
            });

            //======================================================
            Add(_leaveButton = new Button((int)Buttons.Leave, 0xFAE, 0xFAF, 0xFB0)
            {
                X = 30, Y = 325, ButtonAction = ButtonAction.Activate, IsVisible = false
            });

            Add(_leaveLabel = new Label("Leave party", true, 1153)
            {
                X = 70, Y = 325, IsVisible = false
            });

            //======================================================
            Add(_createAddButton = new Button((int)Buttons.Add, 0xFA8, 0xFA9, 0xFAA)
            {
                X = 30, Y = 350, ButtonAction = ButtonAction.Activate
            });

            Add(_createAddLabel = new Label("Add party member", true, 1153)
            {
                X = 70, Y = 350
            });
            //======================================================
            World.Party.PartyMemberChanged += OnPartyMemberChanged;
        }