Esempio n. 1
0
        private void ShopItem_MouseDoubleClick(object sender, MouseDoubleClickEventArgs e)
        {
            ShopItem shopItem = (ShopItem)sender;

            if (shopItem.Amount <= 0)
            {
                return;
            }


            int total = _shiftPressed ? shopItem.Amount : 1;

            if (_transactionItems.TryGetValue(shopItem.LocalSerial, out TransactionItem transactionItem))
            {
                transactionItem.Amount += total;
            }
            else
            {
                transactionItem = new TransactionItem
                                  (
                    shopItem.LocalSerial, shopItem.Graphic, shopItem.Hue, total, (ushort)shopItem.Price,
                    shopItem.ShopItemName
                                  );

                transactionItem.OnIncreaseButtomClicked += TransactionItem_OnIncreaseButtomClicked;
                transactionItem.OnDecreaseButtomClicked += TransactionItem_OnDecreaseButtomClicked;
                _transactionDataBox.Add(transactionItem);
                _transactionItems.Add(shopItem.LocalSerial, transactionItem);
                _transactionDataBox.WantUpdateSize = true;
                _transactionDataBox.ReArrangeChildren();
            }

            shopItem.Amount -= total;
            _updateTotal     = true;
        }
Esempio n. 2
0
        private void BuildGump()
        {
            _totalReal  = 0;
            _totalValue = 0;
            _databox.Clear();

            foreach (SkillListEntry entry in _skillListEntries)
            {
                entry.Clear();
                entry.Dispose();
            }

            _skillListEntries.Clear();

            PropertyInfo pi         = typeof(Skill).GetProperty(_sortField);
            List <Skill> sortSkills = new List <Skill>(World.Player.Skills.OrderBy(x => pi.GetValue(x, null)));

            if (_sortAsc)
            {
                sortSkills.Reverse();
            }

            foreach (Skill skill in sortSkills)
            {
                _totalReal  += skill.Base;
                _totalValue += skill.Value;

                Label skillName      = new Label(skill.Name, true, 1153, font: 3);
                Label skillValueBase = new Label(skill.Base.ToString(), true, 1153, font: 3);
                Label skillValue     = new Label(skill.Value.ToString(), true, 1153, font: 3);
                Label skillCap       = new Label(skill.Cap.ToString(), true, 1153, font: 3);

                _skillListEntries.Add(new SkillListEntry(skillName, skillValueBase, skillValue, skillCap, skill));
            }

            foreach (SkillListEntry t in _skillListEntries)
            {
                _databox.Add(t);
            }

            _databox.WantUpdateSize = true;
            _databox.ReArrangeChildren();

            Add(new Label(ResGumps.Total, true, 1153)
            {
                X = 40, Y = 320
            });
            Add(new Label(_totalReal.ToString("F1"), true, 1153)
            {
                X = 220, Y = 320
            });
            Add(new Label(_totalValue.ToString("F1"), true, 1153)
            {
                X = 300, Y = 320
            });
        }
Esempio n. 3
0
        public void AddBulletinObject(uint serial, string msg)
        {
            foreach (Control c in _databox.Children)
            {
                if (c.LocalSerial == serial)
                {
                    c.Dispose();

                    break;
                }
            }

            BulletinBoardObject obj = new BulletinBoardObject(serial, msg);

            _databox.Add(obj);

            _databox.WantUpdateSize = true;
            _databox.ReArrangeChildren();
        }
Esempio n. 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();
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
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;
        }
Esempio n. 7
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;
        }
Esempio n. 8
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;
        }
Esempio n. 9
0
        private void BuildGump()
        {
            WantUpdateSize = false;

            _box?.Clear();
            _box?.Children.Clear();

            Clear();


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

            Add
            (
                _button = new Button(0, 0x7585, 0x7589, 0x7589)
            {
                ButtonAction = ButtonAction.Activate
            }
            );


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

                break;

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

                break;

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

                break;

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

                break;
            }

            Add(_box = new DataBox(0, 0, 0, 0)
            {
                WantUpdateSize = true
            });

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

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

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


            UpdateElements();
        }
Esempio n. 10
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();
        }
Esempio n. 11
0
        public InspectorGump(GameObject obj) : base(0, 0)
        {
            X                      = 200;
            Y                      = 100;
            _obj                   = obj;
            CanMove                = true;
            AcceptMouseInput       = false;
            CanCloseWithRightClick = true;
            Add(new BorderControl(0, 0, WIDTH, HEIGHT, 4));

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

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

            Add(new Label(ResGumps.ObjectInformation, true, 1153, font: 3)
            {
                X = 20, Y = 10
            });
            Add(new Line(20, 30, WIDTH - 50, 1, 0xFFFFFFFF));

            Add
            (
                new NiceButton(WIDTH - 115, 5, 100, 25, ButtonAction.Activate, ResGumps.Dump)
            {
                ButtonParameter = 0
            }
            );

            ScrollArea scrollArea = new ScrollArea(20, 35, WIDTH - 40, HEIGHT - 45, true)
            {
                AcceptMouseInput = true
            };

            Add(scrollArea);

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

            databox.WantUpdateSize = true;
            scrollArea.Add(databox);

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

            if (dict != null)
            {
                int startX = 5;
                int startY = 5;

                foreach (KeyValuePair <string, string> item in dict.OrderBy(s => s.Key))
                {
                    Label label = new Label(item.Key + ":", true, 33, font: 1, style: FontStyle.BlackBorder)
                    {
                        X = startX,
                        Y = startY
                    };

                    databox.Add(label);

                    int height = label.Height;

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

                    label.MouseUp += OnLabelClick;

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

                    databox.Add(label);
                    databox.Add(new Line(startX, startY + height + 2, WIDTH - 65, 1, Color.Gray.PackedValue));

                    startY += height + 4;
                }
            }

            databox.ReArrangeChildren();
        }
Esempio n. 12
0
        public StandardSkillsGump() : base(0, 0)
        {
            AcceptMouseInput       = false;
            CanMove                = true;
            CanCloseWithRightClick = true;

            Height = 600;

            Add(_background    = new ExpandableScroll(0, _diffY - 65, Height - _diffY, 0x820));
            Add(_gumpPic       = new GumpPic(245, 0, 0x2C94, 0));
            Add(_bottomComment = new GumpPic(25, Height - 85, 0x0836, 0));

            _area = new ScrollArea
                    (
                22,
                _diffY + 10,
                _background.Width - 14,
                _background.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"),
                    true,
                    0x04EC,
                    200,
                    0
                                  )
            {
                X = _bottomComment.X - 20 + _bottomComment.Width + 5, Y = _bottomComment.Y - 5
            }
            );


            _databox = new DataBox(25, _background.Height + 3, 1, 1);
            _databox.WantUpdateSize = true;

            _databox.Add(new GumpPic(2, 22, 0x005F, 0));

            _databox.Add
            (
                new GumpPicTiled
                (
                    13,
                    31,
                    245,
                    0,
                    0x0060
                )
            );

            _databox.Add(new GumpPic(250, 22, 0x0061, 0));
            _background.Add(_databox);

            //new group
            int x = 50;

            Add
            (
                _newGroupButton = new Button(0, 0x8B, 0x8D, 0x8C)
            {
                X = x,
                Y = Height,
                ContainsByBounds = true,
                ButtonAction     = ButtonAction.Activate
            }
            );

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

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

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

            LoadSkills();

            Add(_resetGroups = new NiceButton(57, _background.Height + 15, 82, 18,
                                              ButtonAction.Activate, ResGumps.ResetGroups,
                                              hue: 0x26,
                                              unicode: true,
                                              font: 1)
            {
                ButtonParameter = 1,
                IsSelectable    = false,
                //Alpha = 1f
            });

            Add(_hitBox                = new HitBox(245, 0, 15, 20));
            _hitBox.MouseUp           += _hitBox_MouseUp;
            _gumpPic.MouseDoubleClick += _gumpPic_MouseDoubleClick;

            _container.ReArrangeChildren();
        }