Пример #1
0
        public TipNoticeGump(byte type, string page) : base(0, 0)
        {
            Height  = 300;
            CanMove = true;
            CanCloseWithRightClick = true;
            _scrollArea            = new ScrollArea(0, 32, 272, Height - 96, false);

            _textBox = new StbTextBox(1, -1, 220)
            {
                Height     = 20,
                X          = 35,
                Y          = 0,
                Width      = 220,
                IsEditable = false
            };

            _textBox.SetText(page);
            Add(_background = new ExpandableScroll(0, 0, Height, 0x0820));
            _scrollArea.Add(_textBox);
            Add(_scrollArea);

            if (type == 0)
            {
                _pages = new OrderedDictionary <uint, string>();
                _tips  = this;
                _background.TitleGumpID = 0x9CA;
                _idx      = 0;
                Add(_prev = new Button(0, 0x9cc, 0x9cc)
                {
                    X = 35, ContainsByBounds = true
                });

                _prev.MouseUp += (o, e) =>
                {
                    if (e.Button == MouseButtonType.Left)
                    {
                        SetPage(_idx - 1);
                    }
                };

                Add(_next = new Button(0, 0x9cd, 0x9cd)
                {
                    X = 240, ContainsByBounds = true
                });

                _next.MouseUp += (o, e) =>
                {
                    if (e.Button == MouseButtonType.Left)
                    {
                        SetPage(_idx + 1);
                    }
                };
            }
            else
            {
                _background.TitleGumpID = 0x9D2;
            }
        }
Пример #2
0
        public TipNoticeGump(byte type, string page) : base(0, 0)
        {
            Height     = 300;
            CanMove    = true;
            CanBeSaved = true;

            _scrollArea = new ScrollArea(0, 32, 272, Height - 96, false);

            _textBox = new MultiLineBox(new MultiLineEntry(1, -1, 0, 220, true, hue: 0), false)
            {
                Height = 20,
                X      = 35,
                Y      = 0,
                Text   = page
            };
            Add(_background = new ExpandableScroll(0, 0, Height, 0x0820));
            _scrollArea.Add(_textBox);
            Add(_scrollArea);

            if (type == 0)
            {
                _pages = new OrderedDictionary <uint, string>();
                _tips  = this;
                _background.TitleGumpID = 0x9CA;
                _idx = 0;
                Button b;
                Add(_prev = new Button(0, 0x9cc, 0x9cc)
                {
                    X = 35, ContainsByBounds = true
                });

                _prev.MouseUp += (o, e) =>
                {
                    if (e.Button == MouseButton.Left)
                    {
                        SetPage(_idx - 1);
                    }
                };
                Add(_next = new Button(0, 0x9cd, 0x9cd)
                {
                    X = 240, ContainsByBounds = true
                });

                _next.MouseUp += (o, e) =>
                {
                    if (e.Button == MouseButton.Left)
                    {
                        SetPage(_idx + 1);
                    }
                };
            }
            else
            {
                _background.TitleGumpID = 0x9D2;
            }
        }
Пример #3
0
 public override void Dispose()
 {
     _tips = null;
     base.Dispose();
 }