public VendorBuyGump(AEntity vendorBackpack, VendorBuyListPacket packet) : base(0, 0) { // sanity checking: don't show buy gumps for empty containers. if (!(vendorBackpack is Container) || ((vendorBackpack as Container).Contents.Count <= 0) || (packet.Items.Count <= 0)) { Dispose(); return; } IsMoveable = true; // note: original gumplings start at index 0x0870. AddControl(m_Background = new ExpandableScroll(this, 0, 0, 360, false)); AddControl(new HtmlGumpling(this, 0, 6, 300, 20, 0, 0, " <center><span color='#004' style='font-family:uni0;'>Shop Inventory")); m_ScrollBar = (IScrollBar)AddControl(new ScrollFlag(this)); AddControl(m_ShopContents = new RenderedTextList(this, 22, 32, 250, 260, m_ScrollBar)); BuildShopContents(vendorBackpack, packet); AddControl(m_TotalCost = new HtmlGumpling(this, 44, 334, 200, 30, 0, 0, string.Empty)); UpdateCost(); Button okButton = (Button)AddControl(new Button(this, 220, 333, 0x907, 0x908, ButtonTypes.Activate, 0, 0)); okButton.GumpOverID = 0x909; okButton.MouseClickEvent += okButton_MouseClickEvent; }
public JournalGump() : base(0, 0) { IsMoveable = true; AddControl(m_Background = new ExpandableScroll(this, 0, 0, 300)); m_Background.TitleGumpID = 0x82A; m_ScrollBar = (IScrollBar)AddControl(new ScrollFlag(this)); AddControl(m_JournalEntries = new RenderedTextList(this, 30, 36, 242, 200, m_ScrollBar)); }
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)); }
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); }
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; }
public VendorSellGump(VendorSellListPacket packet) : base(0, 0) { IsMoveable = true; // note: original gumplings start at index 0x0870. AddControl(m_Background = new ExpandableScroll(this, 0, 0, 360, false)); AddControl(new HtmlGumpling(this, 0, 6, 300, 20, 0, 0, " <center><span color='#004' style='font-family:uni0;'>My Inventory")); m_ScrollBar = (IScrollBar)AddControl(new ScrollFlag(this)); AddControl(m_ShopContents = new RenderedTextList(this, 22, 32, 250, 260, m_ScrollBar)); BuildShopContents(packet); AddControl(m_TotalCost = new HtmlGumpling(this, 44, 334, 200, 30, 0, 0, string.Empty)); UpdateEntryAndCost(); AddControl(m_OKButton = new Button(this, 220, 333, 0x907, 0x908, ButtonTypes.Activate, 0, 0)); m_OKButton.GumpOverID = 0x909; m_OKButton.MouseClickEvent += okButton_MouseClickEvent; }
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); }
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; }
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; }