コード例 #1
0
ファイル: ProfileGump.cs プロジェクト: plugtopus/WisQuas2
        public ProfileGump(Serial serial, string header, string footer, string body, bool canEdit) : base(serial, serial)
        {
            CanMove = true;

            AcceptKeyboardInput = true;

            Add(_background = new ExpandableScroll(0, 0, 300));
            _scrollBar = new ScrollFlag( 0, 0, Height, true);
            Add(_scrollBar);
            AddHorizontalBar(92, 40, 40, 220);
            Add(new Label(header, true, 0, font: 1, maxwidth: 140)
            {
                X = 90,
                Y = 32,
            });

            Add(_textBox = new MultiLineBox(new MultiLineEntry(1, width: 220, maxWidth: 220, hue: 0), canEdit)
            {
                X = 40,
                Y = 82,
                Width = 220,
                ScissorsEnabled = true,
                Text = body
            });

            /*
			AddHorizontalBar(95, 40, _textBox.Y + _textBox.Height, 220);
			AddChildren(new Label(footer, true, 0, font: 1, maxwidth: 220)
			{
				X = 40, Y = _textBox.Y + _textBox.Height + 20,
			});
			*/
        }
コード例 #2
0
 public JournalGump() : base(0, 0)
 {
     X                           = 100;
     Y                           = 100;
     CanMove                     = true;
     AcceptMouseInput            = true;
     AddChildren(_background     = new ExpandableScroll(0, 0, 300));
     _background.TitleGumpID     = 0x82A;
     AddChildren(_scrollBar      = new ScrollFlag(this, 0, 0, Height));
     AddChildren(_journalEntries = new RenderedTextList(30, 36, 242, 200, _scrollBar));
 }
コード例 #3
0
ファイル: JournalGump.cs プロジェクト: shiryux/ClassicUO
        public JournalGump() : base(0, 0)
        {
            Height          = 300;
            CanMove         = true;
            CanBeSaved      = true;
            Add(_background = new ExpandableScroll(0, 0, Height)
            {
                TitleGumpID = 0x82A
            });

            _scrollBar = new ScrollFlag(-25, 0, Height, true);

            Add(_journalEntries = new RenderedTextList(30, 36, 242, 200, _scrollBar));

            Add(_scrollBar);
        }
コード例 #4
0
ファイル: JournalGump.cs プロジェクト: saddamsial/MobileUO
        public JournalGump() : base(Constants.JOURNAL_LOCALSERIAL, 0)
        {
            Height  = 300;
            CanMove = true;
            CanCloseWithRightClick = true;
            Add(_gumpPic           = new GumpPic(160, 0, 0x82D, 0));
            Add(_background        = new ExpandableScroll(0, _diffY, Height - _diffY, 0x1F40)
            {
                TitleGumpID = 0x82A
            });

            const ushort DARK_MODE_JOURNAL_HUE = 903;

            string str   = "Dark mode";
            int    width = FontsLoader.Instance.GetWidthASCII(6, str);

            Checkbox darkMode;

            Add(darkMode = new Checkbox(0x00D2, 0x00D3, str, 6, 0x0288, false)
            {
                X         = _background.Width - width - 2,
                Y         = _diffY + 7,
                IsChecked = ProfileManager.Current.JournalDarkMode
            });

            Hue = (ushort)(ProfileManager.Current.JournalDarkMode ? DARK_MODE_JOURNAL_HUE : 0);
            darkMode.ValueChanged += (sender, e) =>
            {
                var ok = ProfileManager.Current.JournalDarkMode = !ProfileManager.Current.JournalDarkMode;
                Hue = (ushort)(ok ? DARK_MODE_JOURNAL_HUE : 0);
            };

            _scrollBar = new ScrollFlag(-25, _diffY + 36, Height - _diffY, true);

            Add(_journalEntries = new RenderedTextList(25, _diffY + 36, _background.Width - (_scrollBar.Width >> 1) - 5, 200, _scrollBar));

            Add(_scrollBar);

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


            InitializeJournalEntries();
            World.Journal.EntryAdded += AddJournalEntry;
        }
コード例 #5
0
ファイル: JournalGump.cs プロジェクト: sadoseja/ClassicUO
        public JournalGump() : base(Constants.JOURNAL_LOCALSERIAL, 0)
        {
            Height = 300;
            CanMove = true;
            CanBeSaved = true;

            Add(new GumpPic(160, 0, 0x82D, 0));
            Add(_background = new ExpandableScroll(0, _diffY, Height - _diffY, 0x1F40)
            {
                TitleGumpID = 0x82A
            });

            const ushort DARK_MODE_JOURNAL_HUE = 903;

            string str = "Dark mode";
            int width = FileManager.Fonts.GetWidthASCII(6, str);

            Checkbox darkMode;
            Add(darkMode = new Checkbox(0x00D2, 0x00D3, str, 6, 0x0288, false)
            {
                X = _background.Width - width -2, 
                Y = _diffY + 7,
                IsChecked = Engine.Profile.Current.JournalDarkMode
            });

            Hue = (ushort)(Engine.Profile.Current.JournalDarkMode ? DARK_MODE_JOURNAL_HUE : 0);
            darkMode.ValueChanged += (sender, e) =>
            {
                var ok = Engine.Profile.Current.JournalDarkMode = !Engine.Profile.Current.JournalDarkMode;
                Hue = (ushort) (ok ? DARK_MODE_JOURNAL_HUE : 0);
            };

            _scrollBar = new ScrollFlag(-25, _diffY + 36, Height - _diffY, true);

            Add(_journalEntries = new RenderedTextList(25, _diffY + 36, _background.Width - (_scrollBar.Width >> 1) - 5, 200, _scrollBar));

            Add(_scrollBar);
        }
コード例 #6
0
        public BulletinBoardItem(Serial serial, Serial msgSerial, string poster, string subject, string datatime, string data, byte variant) : base(serial, 0)
        {
            _msgSerial             = msgSerial;
            AcceptKeyboardInput    = true;
            CanMove                = true;
            CanCloseWithRightClick = true;

            Add(new ExpandableScroll(0, 0, 250, 0x0820)
            {
                TitleGumpID = 0x0820
            });
            _scrollBar = new ScrollFlag(0, 0, Height, true);
            Add(_scrollBar);
            bool useUnicode              = FileManager.ClientVersion >= ClientVersions.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("Time:", useUnicode, textColor, font: useUnicode ? unicodeFontIndex : (byte)6)
            {
                X = 30,
                Y = 56
            };
            Add(text);

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


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


            ushort subjectColor = textColor;

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

            //HitBox hitBox = new HitBox(30 + text.Width, 78, 160, 16)
            //{
            //    IsTransparent = true,
            //    Alpha = 1
            //};
            //AddChildren(hitBox);


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


            Add(new GumpPicTiled(30, 100, 204, 4, 0x0835));

            Add(_textBox = new MultiLineBox(new MultiLineEntry(useUnicode ? unicodeFontIndex : (byte)9, width: 220, maxWidth: 220, hue: textColor, unicode: useUnicode), true)
            {
                X               = 40,
                Y               = 120,
                Width           = 220,
                ScissorsEnabled = true,
                Text            = data
            });

            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)
                {
                    X                = 235,
                    Y                = Height - 50,
                    ButtonAction     = ButtonAction.Activate,
                    ContainsByBounds = true
                });

                break;
            }
        }
コード例 #7
0
        public JournalGump() : base(0, 0)
        {
            Height  = 300;
            CanMove = true;
            CanCloseWithRightClick = true;
            Add(_gumpPic           = new GumpPic(160, 0, 0x82D, 0));

            Add
            (
                _background = new ExpandableScroll(0, _diffY, Height - _diffY, 0x1F40)
            {
                TitleGumpID = 0x82A
            }
            );

            const ushort DARK_MODE_JOURNAL_HUE = 903;

            string str   = ResGumps.DarkMode;
            int    width = FontsLoader.Instance.GetWidthASCII(6, str);

            Checkbox darkMode;

            Add
            (
                darkMode = new Checkbox(0x00D2, 0x00D3, str, 6, 0x0288, false)
            {
                X         = _background.Width - width - 2,
                Y         = _diffY + 7,
                IsChecked = ProfileManager.CurrentProfile.JournalDarkMode
            }
            );

            Hue = (ushort)(ProfileManager.CurrentProfile.JournalDarkMode ? DARK_MODE_JOURNAL_HUE : 0);

            darkMode.ValueChanged += (sender, e) =>
            {
                bool ok = ProfileManager.CurrentProfile.JournalDarkMode = !ProfileManager.CurrentProfile.JournalDarkMode;
                Hue = (ushort)(ok ? DARK_MODE_JOURNAL_HUE : 0);
            };

            _scrollBar = new ScrollFlag(-25, _diffY + 36, Height - _diffY, true);

            Add
            (
                _journalEntries = new RenderedTextList
                                      (25, _diffY + 36, _background.Width - (_scrollBar.Width >> 1) - 5, 200, _scrollBar)
            );

            Add(_scrollBar);

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

            int  cx   = 43; // 63
            int  dist = 75; // 85
            byte font = 6;  // 1

            _filters_chekboxes[0] = new Checkbox(0x00D2, 0x00D3, "System", font, 0x0386, false)
            {
                X           = cx,
                LocalSerial = 1,
                IsChecked   = ProfileManager.CurrentProfile.ShowJournalSystem
            };

            _filters_chekboxes[1] = new Checkbox(0x00D2, 0x00D3, "Objects", font, 0x0386, false)
            {
                X           = cx + dist,
                LocalSerial = 2,
                IsChecked   = ProfileManager.CurrentProfile.ShowJournalObjects
            };

            _filters_chekboxes[2] = new Checkbox(0x00D2, 0x00D3, "Client", font, 0x0386, false)
            {
                X           = cx + dist * 2,
                LocalSerial = 0,
                IsChecked   = ProfileManager.CurrentProfile.ShowJournalClient
            };

            _filters_chekboxes[3] = new Checkbox(0x00D2, 0x00D3, "Guild", font, 0x0386, false)
            {
                X           = cx + dist * 3,
                LocalSerial = 3,
                IsChecked   = ProfileManager.CurrentProfile.ShowJournalGuildAlly
            };

            void on_check_box(object sender, EventArgs e)
            {
                Checkbox c = (Checkbox)sender;

                if (c != null)
                {
                    switch ((TextType)c.LocalSerial)
                    {
                    case TextType.CLIENT:
                        ProfileManager.CurrentProfile.ShowJournalClient = c.IsChecked;

                        break;

                    case TextType.SYSTEM:
                        ProfileManager.CurrentProfile.ShowJournalSystem = c.IsChecked;

                        break;

                    case TextType.OBJECT:
                        ProfileManager.CurrentProfile.ShowJournalObjects = c.IsChecked;

                        break;

                    case TextType.GUILD_ALLY:
                        ProfileManager.CurrentProfile.ShowJournalGuildAlly = c.IsChecked;

                        break;
                    }
                }
            }

            for (int i = 0; i < _filters_chekboxes.Length; i++)
            {
                _filters_chekboxes[i].ValueChanged += on_check_box;

                Add(_filters_chekboxes[i]);
            }

            InitializeJournalEntries();
            World.Journal.EntryAdded += AddJournalEntry;
        }
コード例 #8
0
        public JournalGump() : base(0, 0)
        {
            Height  = 600;
            CanMove = true;
            CanCloseWithRightClick = true;

            Add(_background = new ExpandableScroll(0, _diffY - 65, Height - _diffY, 0x1F40));
            Add(_gumpPic    = new GumpPic(365, 0, 0x2C94, 0));
            _scrollBar      = new ScrollFlag(-25, _diffY + 36, Height - _diffY, true);

            Add
            (
                _journalEntries = new RenderedTextList
                                  (
                    38,
                    _diffY + 10,
                    _background.Width - 10 - (_scrollBar.Width >> 1) - 15,
                    230,
                    _scrollBar
                                  )
            );

            Add(_scrollBar);

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

            int  cx   = 65; // 63
            int  dist = 90; // 85
            byte font = 1;  // 1

            _filters_checkboxes[0] = new Checkbox
                                     (
                0x00D2,
                0x00D3,
                "System",
                font,
                0x0386,
                false
                                     )
            {
                X           = cx,
                LocalSerial = 1,
                IsChecked   = ProfileManager.CurrentProfile.ShowJournalSystem
            };

            _filters_checkboxes[1] = new Checkbox
                                     (
                0x00D2,
                0x00D3,
                "Objects",
                font,
                0x0386,
                false
                                     )
            {
                X           = cx + dist,
                LocalSerial = 2,
                IsChecked   = ProfileManager.CurrentProfile.ShowJournalObjects
            };

            _filters_checkboxes[2] = new Checkbox
                                     (
                0x00D2,
                0x00D3,
                "Client",
                font,
                0x0386,
                false
                                     )
            {
                X           = cx + dist * 2,
                LocalSerial = 0,
                IsChecked   = ProfileManager.CurrentProfile.ShowJournalClient
            };

            _filters_checkboxes[3] = new Checkbox
                                     (
                0x00D2,
                0x00D3,
                "Guild",
                font,
                0x0386,
                false
                                     )
            {
                X           = cx + dist * 3,
                LocalSerial = 3,
                IsChecked   = ProfileManager.CurrentProfile.ShowJournalGuildAlly
            };

            void on_check_box(object sender, EventArgs e)
            {
                Checkbox c = (Checkbox)sender;

                if (c != null)
                {
                    switch ((TextType)c.LocalSerial)
                    {
                    case TextType.CLIENT:
                        ProfileManager.CurrentProfile.ShowJournalClient = c.IsChecked;

                        break;

                    case TextType.SYSTEM:
                        ProfileManager.CurrentProfile.ShowJournalSystem = c.IsChecked;

                        break;

                    case TextType.OBJECT:
                        ProfileManager.CurrentProfile.ShowJournalObjects = c.IsChecked;

                        break;

                    case TextType.GUILD_ALLY:
                        ProfileManager.CurrentProfile.ShowJournalGuildAlly = c.IsChecked;

                        break;
                    }
                }
            }

            for (int i = 0; i < _filters_checkboxes.Length; i++)
            {
                _filters_checkboxes[i].ValueChanged += on_check_box;

                Add(_filters_checkboxes[i]);
            }

            InitializeJournalEntries();
            World.Journal.EntryAdded += AddJournalEntry;
        }