public BuffGump() : base(0, 0) { X = 100; Y = 100; CanMove = true; CanCloseWithRightClick = true; _graphic = 0x7580; AddChildren(_background = new GumpPic(0, 0, _graphic, 0) { LocalSerial = 1 }); AddChildren(_button = new Button(0, 0x7585, 0x7589, 0x7589) { X = -2, Y = 36, ButtonAction = ButtonAction.Activate }); _direction = GumpDirection.LEFT_HORIZONTAL; foreach (KeyValuePair <Graphic, BuffIcon> k in World.Player.BuffIcons) { AddChildren(new BuffControlEntry(World.Player.BuffIcons[k.Key])); } UpdateElements(); }
public MobileHealthTrackerGump(Mobile mobile) : base(mobile.Serial, 0) { while (UserInterface.GetControl <MobileHealthTrackerGump>(mobile.Serial) != null) { UserInterface.GetControl <MobileHealthTrackerGump>(mobile.Serial).Dispose(); } IsMoveable = true; HandlesMouseInput = true; Mobile = mobile; if (Mobile.IsClientEntity) { AddControl(m_Background = new GumpPic(this, 0, 0, 0x0803, 0)); m_BarBGs = new GumpPic[3]; AddControl(m_BarBGs[0] = new GumpPic(this, 34, 10, 0x0805, 0)); AddControl(m_BarBGs[1] = new GumpPic(this, 34, 24, 0x0805, 0)); AddControl(m_BarBGs[2] = new GumpPic(this, 34, 38, 0x0805, 0)); m_Bars = new GumpPicWithWidth[3]; AddControl(m_Bars[0] = new GumpPicWithWidth(this, 34, 10, 0x0806, 0, 1f)); AddControl(m_Bars[1] = new GumpPicWithWidth(this, 34, 24, 0x0806, 0, 1f)); AddControl(m_Bars[2] = new GumpPicWithWidth(this, 34, 38, 0x0806, 0, 1f)); } else { AddControl(m_Background = new GumpPic(this, 0, 0, 0x0804, 0)); m_BarBGs = new GumpPic[1]; AddControl(m_BarBGs[0] = new GumpPic(this, 34, 38, 0x0805, 0)); m_Bars = new GumpPicWithWidth[1]; AddControl(m_Bars[0] = new GumpPicWithWidth(this, 34, 38, 0x0806, 0, 1f)); AddControl(new HtmlGumpling(this, 17, 13, 120, 20, 0, 0, String.Format("<span color='#000' style='font-family:uni0;'>{0}", mobile.Name))); } }
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 = 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); }
public override void Update(double totalMS, double frameMS) { base.Update(totalMS, frameMS); if (Keyboard.Alt && Engine.UI.AnchorManager[this] != null) { if (_lockGumpPic == null) { _lockGumpPic = new GumpPic(0, 0, 0x082C, 0); _lockGumpPic.Update(totalMS, frameMS); _lockGumpPic.AcceptMouseInput = true; _lockGumpPic.X = Width - _lockGumpPic.Width; _lockGumpPic.Y = 0; _lockGumpPic.MouseUp += _lockGumpPic_MouseClick; Add(_lockGumpPic); } if (Engine.UI.MouseOverControl != null && (Engine.UI.MouseOverControl == this || Engine.UI.MouseOverControl.RootParent == this)) { _lockGumpPic.Hue = 34; } else { _lockGumpPic.Hue = 0; } } else if ((!Keyboard.Alt || Engine.UI.AnchorManager[this] == null) && _lockGumpPic != null) { Remove(_lockGumpPic); _lockGumpPic.Dispose(); _lockGumpPic = null; } }
private void BuildGump() { WantUpdateSize = false; Add(_background = new GumpPic(0, 0, _graphic, 0) { LocalSerial = 1 }); Add(_button = new Button(0, 0x7585, 0x7589, 0x7589) { X = -2, Y = 36, ButtonAction = ButtonAction.Activate }); _direction = GumpDirection.LEFT_HORIZONTAL; foreach (KeyValuePair <BuffIconType, BuffIcon> k in World.Player.BuffIcons) { Add(new BuffControlEntry(World.Player.BuffIcons[k.Key])); } Change(); }
private void BuildGump() { CanMove = true; CanBeSaved = true; LocalSerial = _item.Serial; _isCorspeContainer = _gumpID == 0x0009; _item.Items.Added += ItemsOnAdded; _item.Items.Removed += ItemsOnRemoved; _data = ContainerManager.Get(_gumpID); Graphic g = _data.Graphic; Add(new GumpPicContainer(0, 0, g, 0, _item)); if (_isCorspeContainer) { Add(_eyeGumpPic = new GumpPic(45, 30, 0x0045, 0)); } ContainerManager.CalculateContainerPosition(g); X = ContainerManager.X; Y = ContainerManager.Y; if (_data.OpenSound != 0) { Engine.SceneManager.CurrentScene.Audio.PlaySound(_data.OpenSound); } }
private void BuildGump() { GumpPic pic = new GumpPic(0, 0, Graphic, 0); Add(pic); pic.SetTooltip(ClilocLoader.Instance.GetString(1112198 + (Graphic - 0x5DD0)), 200); }
public SplitMenuGump(Item item, Point offset) : base(item, 0) { Item = item; _offsert = offset; CanMove = true; AcceptMouseInput = false; GumpPic background = new GumpPic(0, 0, 0x085C, 0); Add(background); Add(_slider = new HSliderBar(29, 16, 105, 1, item.Amount, item.Amount, HSliderBarStyle.BlueWidgetNoBar)); _lastValue = _slider.Value; Add(_okButton = new Button(0, 0x085d, 0x085e, 0x085f) { ButtonAction = ButtonAction.Default, X = 102, Y = 37 }); _okButton.MouseClick += OkButtonOnMouseClick; Add(_textBox = new TextBox(1, isunicode: false, hue: 0x0386, width: 60, maxWidth: 1000) { X = 29, Y = 42, Width = 60, NumericOnly = true, }); _textBox.SetText(item.Amount.ToString()); }
internal GumpImage(GumpPic gp) { Location = new Point2D(gp.X, gp.Y); GraphicID = gp.Id; Color = gp.Hue; Page = gp.Page; ElementID = gp.ElemNum; }
public TargetLineGump() : base(0, 0) { CanMove = false; AcceptMouseInput = false; Add(_background = new GumpPic(0, 0, 0x1068, 0)); Add(_hp = new GumpPicWithWidth(0, 0, 0x1069, 0, 1)); }
public StandardSkillsGump() : base(Constants.SKILLSTD_LOCALSERIAL, 0) { CanBeSaved = true; AcceptMouseInput = false; CanMove = true; Height = 200 + _diffY; Add(new GumpPic(160, 0, 0x82D, 0)); _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[FileManager.Skills.SkillsCount]; foreach (KeyValuePair <string, List <int> > k in SkillsGroupManager.Groups) { AddSkillsToGroup(k.Key, k.Value.OrderBy(s => s, _instance).ToList()); } }
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(_scrollExp = new ExpandableScroll(0, _diffY, Height - _diffY, 0x0820)); _scrollArea = new ScrollArea(0, 32 + _diffY, 272, Height - (96 + _diffY), false); Control c = new Label(header, true, 0, font: 1, maxwidth: 140) { X = 85, Y = 0 }; _scrollArea.Add(c); AddHorizontalBar(_scrollArea, 92, 35, 220); _textBox = new StbTextBox(1, -1, 220) { Height = FontsLoader.Instance.GetHeightUnicode(1, body, 220, TEXT_ALIGN_TYPE.TS_LEFT, 0x0), Width = 220, X = 35, Y = 0, IsEditable = canEdit, Multiline = true }; _originalText = body; _textBox.SetText(body); if (_textBox.Height < 50) { _textBox.Height = 50; } _textBox.TextChanged += _textBox_TextChanged; _scrollArea.Add(_textBox); AddHorizontalBar(_scrollArea, 95, 35, 220); _scrollArea.Add ( new Label(footer, true, 0, font: 1, maxwidth: 220) { X = 35, Y = 0 } ); Add(_scrollArea); Add(_hitBox = new HitBox(143, 0, 23, 24)); _hitBox.MouseUp += _hitBox_MouseUp; }
public TargetLineGump(Mobile mobile) : base(mobile.Serial, 0) { CanMove = false; AcceptMouseInput = false; Add(_background = new GumpPic(0, 0, 0x1068, 0)); Add(_hp = new GumpPicWithWidth(0, 0, 0x1069, 0, 1)); Mobile = mobile; }
void BuildGump() { ClearControls(); if (m_Book.ItemID >= 0xFEF && m_Book.ItemID <= 0xFF2) { m_BookBackground = new GumpPic(this, 0, 0, 0x1FE, 0); m_PageCornerLeft = new GumpPic(this, 0, 0, 0x1FF, 0); m_PageCornerRight = new GumpPic(this, 356, 0, 0x200, 0); } AddControl(m_BookBackground); // book background gump AddControl(m_PageCornerLeft); // page turn left m_PageCornerLeft.GumpLocalID = 0; m_PageCornerLeft.MouseClickEvent += PageCorner_MouseClickEvent; m_PageCornerLeft.MouseDoubleClickEvent += PageCorner_MouseDoubleClickEvent; AddControl(m_PageCornerRight); // page turn right m_PageCornerRight.GumpLocalID = 1; m_PageCornerRight.MouseClickEvent += PageCorner_MouseClickEvent; m_PageCornerRight.MouseDoubleClickEvent += PageCorner_MouseDoubleClickEvent; // Draw the title and author page m_TitleTextEntry = new TextEntry(this, 45, 50, 155, 300, 1, 0, 0, m_Book.Title); m_TitleTextEntry.MakeThisADragger(); m_TitleTextEntry.IsEditable = m_Book.IsEditable; m_AuthorTextEntry = new TextEntry(this, 45, 110, 160, 300, 1, 0, 0, m_Book.Author); m_AuthorTextEntry.MakeThisADragger(); m_AuthorTextEntry.IsEditable = m_Book.IsEditable; AddControl(m_TitleTextEntry, 1); AddControl(new HtmlGumpling(this, 45, 90, 155, 300, 0, 0, "<font color=#444>By"), 1); AddControl(m_AuthorTextEntry, 1); // Add book pages to active pages bool isRight = true; string color = m_Book.IsEditable ? "800" : "000"; for (int i = 0; i < m_Book.PageCount; i++) { int onGumpPage = (i + 3) / 2; int x = isRight ? 235 : 45; m_Pages.Add(new TextEntryPage(this, x, 32, 155, 300, i)); m_Pages[i].SetMaxLines(8, OnPageOverflow, OnPageUnderflow); m_Pages[i].SetKeyboardPageControls(OnPreviousPage, OnNextPage); m_Pages[i].MakeThisADragger(); m_Pages[i].IsEditable = m_Book.IsEditable; m_Pages[i].LeadingHtmlTag = $"<font color=#{color}>"; m_Pages[i].Text = m_Book.Pages[i].GetAllLines(); AddControl(m_Pages[i], onGumpPage); AddControl(new HtmlGumpling(this, x, 195, 135, 20, 0, 0, $"<center><font color=#444>{i + 1}"), onGumpPage); isRight = !isRight; } AudioService service = Service.Get <AudioService>(); service.PlaySound(0x058); SetActivePage(1); UserInterface.KeyboardFocusControl = m_Pages[0]; m_Pages[0].CaratAt = m_Pages[0].Text.Length; }
private void BuildGump() { LocalSerial = _item.Serial; _isCorspeContainer = _gumpID == 0x0009; _item.Items.Added += ItemsOnAdded; _item.Items.Removed += ItemsOnRemoved; AddChildren(new GumpPicContainer(0, 0, ContainerManager.Get(_gumpID).Graphic, 0, _item)); if (_isCorspeContainer) { AddChildren(_eyeGumpPic = new GumpPic(45, 30, 0x0045, 0)); } }
public SplitMenuGump(uint serial, Point offset) : base(serial, 0) { Item item = World.Items.Get(serial); if (item == null || item.IsDestroyed) { Dispose(); return; } _offset = offset; CanMove = true; AcceptMouseInput = false; CanCloseWithRightClick = true; GumpPic background = new GumpPic(0, 0, 0x085C, 0) { ContainsByBounds = true }; Add(background); Add(_slider = new HSliderBar(29, 16, 105, 1, item.Amount, item.Amount, HSliderBarStyle.BlueWidgetNoBar)); _lastValue = _slider.Value; Add ( _okButton = new Button(0, 0x085d, 0x085e, 0x085f) { ButtonAction = ButtonAction.Default, X = 102, Y = 37 } ); _okButton.MouseUp += OkButtonOnMouseClick; Add ( _textBox = new StbTextBox(1, isunicode: false, hue: 0x0386, maxWidth: 60) { X = 29, Y = 42, Width = 60, Height = 20, NumbersOnly = true } ); _textBox.SetText(item.Amount.ToString()); _textBox.TextChanged += (sender, args) => { UpdateText(); }; _textBox.SetKeyboardFocus(); _slider.ValueChanged += (sender, args) => { UpdateText(); }; }
public PartyListEntry(int memeberIndex) { Height = 20; PartyMemeberIndex = memeberIndex; PartyMember member = World.Party.Members[memeberIndex]; if (member == null || member.Serial == 0) { Dispose(); return; } //====================================================== //Name = new Label(member.Name, true, 1153, font:3); //Name.X = 80; string name = string.IsNullOrEmpty(member.Name) ? "<Not seen>" : member.Name; Label name1 = World.Party.Leader == member.Serial ? new Label(name + "(L)", true, 1161, font: 3) { X = 80 } : new Label(name, true, 1153, font: 3) { X = 80 }; Add(name1); Mobile mobile = World.Mobiles.Get(member.Serial); //====================================================== Add(_status = new GumpPic(240, 0, 0x29F6, (Hue)(mobile != null && mobile.IsDead ? 0 : 0x43))); //====================================================== Button pmButton = new Button((int)Buttons.GetBar, 0xFAE, 0xFAF, 0xFB0) { X = 10, ButtonAction = ButtonAction.Activate }; Add(pmButton); //====================================================== Button kickButton = new Button((int)Buttons.Kick, 0xFB1, 0xFB2, 0xFB3) { X = 40, ButtonAction = ButtonAction.Activate }; Add(kickButton); }
private void AddHorizontalBar(ScrollArea area, Graphic start, int x, int width) { var startBounds = FileManager.Gumps.GetTexture(start); var middleBounds = FileManager.Gumps.GetTexture((Graphic)(start + 1)); var endBounds = FileManager.Gumps.GetTexture((Graphic)(start + 2)); int y = -startBounds.Height; Control c; c = new GumpPic(x, (y >> 1) - 6, start, 0); c.Add(new GumpPicWithWidth(startBounds.Width, (startBounds.Height - middleBounds.Height) >> 1, (Graphic)(start + 1), 0, width - startBounds.Width - endBounds.Width)); c.Add(new GumpPic(width - endBounds.Width, 0, (Graphic)(start + 2), 0)); area.Add(c); }
private void BuildGump() { LocalSerial = (uint)_spell.ID; _button = new GumpPic(0, 0, (ushort)_spell.GumpIconSmallID, 0) { AcceptMouseInput = true }; _button.MouseDoubleClick += ButtonOnMouseDoubleClick; Add(_button); WantUpdateSize = true; }
private void BuildGump() { LocalSerial = (uint)_definition.Index; _button = new GumpPic(0, 0, _definition.Icon, 0) { AcceptMouseInput = true }; _button.MouseDoubleClick += ButtonOnMouseDoubleClick; Add(_button); WantUpdateSize = true; }
public SkillListEntry(Label skillname, Label skillvaluebase, Label skillvalue, Label skillcap, Skill skill) { Height = 20; SkillName = skillname; SkillValueBase = skillvaluebase; SkillValue = skillvalue; SkillCap = skillcap; Skill = skill; SkillName.X = 10; AddChildren(SkillName); //====================== SkillValueBase.X = 200; AddChildren(SkillValueBase); //====================== SkillValue.X = 280; AddChildren(SkillValue); //====================== SkillCap.X = 360; AddChildren(SkillCap); _loc = new GumpPic(425, 4, (Graphic)(skill.Lock == Lock.Up ? 0x983 : skill.Lock == Lock.Down ? 0x985 : 0x82C), 0); AddChildren(_loc); _loc.MouseClick += (sender, e) => { switch (Skill.Lock) { case Lock.Up: Skill.Lock = Lock.Down; GameActions.ChangeSkillLockStatus((ushort)Skill.Index, (byte)Lock.Down); _loc.Graphic = 0x985; _loc.Texture = IO.Resources.Gumps.GetGumpTexture(0x985); break; case Lock.Down: Skill.Lock = Lock.Locked; GameActions.ChangeSkillLockStatus((ushort)Skill.Index, (byte)Lock.Locked); _loc.Graphic = 0x82C; _loc.Texture = IO.Resources.Gumps.GetGumpTexture(0x82C); break; case Lock.Locked: Skill.Lock = Lock.Up; GameActions.ChangeSkillLockStatus((ushort)Skill.Index, (byte)Lock.Up); _loc.Graphic = 0x983; _loc.Texture = IO.Resources.Gumps.GetGumpTexture(0x983); break; } }; }
public UseSpellButtonGump(SpellDefinition spell) : base(spell.ID, 0) { while (UserInterface.GetControl <UseSpellButtonGump>(spell.ID) != null) { UserInterface.GetControl <UseSpellButtonGump>(spell.ID).Dispose(); } _spell = spell; _world = Service.Get <WorldModel>(); IsMoveable = true; HandlesMouseInput = true; _spellButton = (GumpPic)AddControl(new GumpPic(this, 0, 0, spell.GumpIconSmallID, 0)); _spellButton.HandlesMouseInput = true; _spellButton.MouseDoubleClickEvent += EventMouseDoubleClick; }
private void BuildGump() { LocalSerial = (uint)_definition.Index; _button = new GumpPic(0, 0, _definition.Icon, 0) { AcceptMouseInput = false }; Add(_button); WantUpdateSize = true; AcceptMouseInput = true; AnchorGroupName = "spell"; GroupMatrixWidth = 44; GroupMatrixHeight = 44; }
private void AddHorizontalBar(ScrollArea area, Graphic start, int x, int width) { var startBounds = FileManager.Gumps.GetTexture(start); var middleBounds = FileManager.Gumps.GetTexture((Graphic)(start + 1)); var endBounds = FileManager.Gumps.GetTexture((Graphic)(start + 2)); PrivateContainer container = new PrivateContainer(); Control c = new GumpPic(x, 0, start, 0); container.Add(c); container.Add(new GumpPicWithWidth(x + startBounds.Width, (startBounds.Height - middleBounds.Height) >> 1, (Graphic)(start + 1), 0, width - startBounds.Width - endBounds.Width)); container.Add(new GumpPic(x + width - endBounds.Width, 0, (Graphic)(start + 2), 0)); area.Add(container); }
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 UseSpellButtonGump(SpellDefinition spell) : base((uint)spell.ID, 0) { while (UIManager.GetByLocalSerial <UseSpellButtonGump>((uint)spell.ID) != null) { UIManager.GetByLocalSerial <UseSpellButtonGump>((uint)spell.ID).Dispose(); } _spell = spell; CanMove = true; AcceptMouseInput = true; _button = new GumpPic(0, 0, (ushort)spell.GumpIconSmallID, 0) { AcceptMouseInput = true }; _button.MouseDoubleClick += ButtonOnMouseDoubleClick; AddChildren(_button); }
public PartyListEntry(PartyMember member) { Height = 20; Member = member; //====================================================== //Name = new Label(member.Name, true, 1153, font:3); //Name.X = 80; string name = string.IsNullOrEmpty(member.Name) ? "<Not seen>" : member.Name; Name = World.Party.Leader == member.Serial ? new Label(name + "(L)", true, 1161, font: 3) { X = 80 } : new Label(name, true, 1153, font: 3) { X = 80 }; Add(Name); //====================================================== if (Member.Mobile != null && Member.Mobile.IsDead) { Status = new GumpPic(240, 0, 0x29F6, 0); } else { Status = new GumpPic(240, 0, 0x29F6, 0x43); } Add(Status); //====================================================== PMButton = new Button((int)Buttons.GetBar, 0xFAE, 0xFAF, 0xFB0) { X = 10, ButtonAction = ButtonAction.Activate }; Add(PMButton); //====================================================== KickButton = new Button((int)Buttons.Kick, 0xFB1, 0xFB2, 0xFB3) { X = 40, ButtonAction = ButtonAction.Activate }; Add(KickButton); }
public MobileHealthTrackerGump(Mobile mobile) : base(mobile.Serial, 0) { while (UserInterface.GetControl <MobileHealthTrackerGump>(mobile.Serial) != null) { UserInterface.GetControl <MobileHealthTrackerGump>(mobile.Serial).Dispose(); } IsMoveable = true; Mobile = mobile; m_World = Service.Get <WorldModel>(); if (Mobile.IsClientEntity) { AddControl(m_Background = new GumpPic(this, 0, 0, 0x0803, 0)); m_Background.MouseDoubleClickEvent += Background_MouseDoubleClickEvent; m_BarBGs = new GumpPic[3]; AddControl(m_BarBGs[0] = new GumpPic(this, 34, 10, 0x0805, 0)); AddControl(m_BarBGs[1] = new GumpPic(this, 34, 24, 0x0805, 0)); AddControl(m_BarBGs[2] = new GumpPic(this, 34, 38, 0x0805, 0)); m_Bars = new GumpPicWithWidth[3]; AddControl(m_Bars[0] = new GumpPicWithWidth(this, 34, 10, 0x0806, 0, 1f)); AddControl(m_Bars[1] = new GumpPicWithWidth(this, 34, 24, 0x0806, 0, 1f)); AddControl(m_Bars[2] = new GumpPicWithWidth(this, 34, 38, 0x0806, 0, 1f)); } else { AddControl(m_Background = new GumpPic(this, 0, 0, 0x0804, 0)); m_Background.MouseDoubleClickEvent += Background_MouseDoubleClickEvent; m_BarBGs = new GumpPic[1]; AddControl(m_BarBGs[0] = new GumpPic(this, 34, 38, 0x0805, 0)); m_Bars = new GumpPicWithWidth[1]; AddControl(m_Bars[0] = new GumpPicWithWidth(this, 34, 38, 0x0806, 0, 1f)); AddControl(m_NameEntry = new TextEntry(this, 17, 16, 124, 20, 0, 0, 99, mobile.Name)); SetupMobileNameEntry(); } // bars should not handle mouse input, pass it to the background gump. for (int i = 0; i < m_BarBGs.Length; i++) { m_BarBGs[i].HandlesMouseInput = false; m_Bars[i].HandlesMouseInput = false; } }
private void BuildGump() { CanMove = true; CanBeSaved = true; LocalSerial = _item.Serial; _isCorspeContainer = _gumpID == 0x0009; _item.Items.Added += ItemsOnAdded; _item.Items.Removed += ItemsOnRemoved; _data = ContainerManager.Get(_gumpID); Graphic g = _data.Graphic; Add(new GumpPicContainer(0, 0, g, 0, _item)); if (_isCorspeContainer) { Add(_eyeGumpPic = new GumpPic(45, 30, 0x0045, 0)); } ContainerGump gg = Engine.UI.Gumps.OfType <ContainerGump>().FirstOrDefault(s => s.LocalSerial == LocalSerial); if (gg == null) { if (Engine.UI.GetGumpCachePosition(LocalSerial, out Point location) && _item.Serial == World.Player.Equipment[(int)Layer.Backpack]) { Location = location; } else { ContainerManager.CalculateContainerPosition(g); X = ContainerManager.X; Y = ContainerManager.Y; } } else { X = gg.X; Y = gg.Y; } if (_data.OpenSound != 0) { Engine.SceneManager.CurrentScene.Audio.PlaySound(_data.OpenSound); } }
public PartyListEntry(PartyMember member) { Height = 20; Member = member; //====================================================== //Name = new Label(member.Name, true, 1153, font:3); //Name.X = 80; Name = PartySystem.Leader == member.Serial ? new Label(member.Name + "(L)", true, 1161, font: 3) { X = 80 } : new Label(member.Name, true, 1153, font: 3) { X = 80 }; AddChildren(Name); //====================================================== if (Member.Mobile.IsDead) { Status = new GumpPic(240, 0, 0x29F6, 0); } else { Status = new GumpPic(240, 0, 0x29F6, 0x43); } AddChildren(Status); //====================================================== PMButton = new Button((int)Buttons.GetBar, 0xFAE, 0xFAF, 0xFB0) { X = 10, ButtonAction = ButtonAction.Activate }; AddChildren(PMButton); //====================================================== KickButton = new Button((int)Buttons.Kick, 0xFB1, 0xFB2, 0xFB3) { X = 40, ButtonAction = ButtonAction.Activate }; AddChildren(KickButton); }