protected override void OnInitialize() { _gumplingTop = (GumpPic)AddControl(new GumpPic(this, 0, 0, 0x0820, 0)); _gumplingMiddle = (GumpPicTiled)AddControl(new GumpPicTiled(this, 0, 0, 0, 0, 0x0822)); _gumplingBottom = (GumpPic)AddControl(new GumpPic(this, 0, 0, 0x0823, 0)); if (_isResizable) { _gumplingExpander = (Button)AddControl(new Button(this, 0, 0, 0x082E, 0x82F, ButtonTypes.Activate, 0, _gumplingExpander_ButtonID)); _gumplingExpander.MouseDownEvent += expander_OnMouseDown; _gumplingExpander.MouseUpEvent += expander_OnMouseUp; _gumplingExpander.MouseOverEvent += expander_OnMouseOver; } }
public void CreateVisual() { if (_resizePic != null || _label != null || ScrollButton != null) { return; } _resizePic = (ResizePic)AddControl(new ResizePic(this, 0, 0, 3000, _width, _font.Height + 8), 0); _resizePic.GumpLocalID = GumpLocalID; _resizePic.MouseClickEvent += onClickClosedList; _resizePic.MouseOverEvent += onMouseOverClosedList; _resizePic.MouseOutEvent += onMouseOutClosedList; _resizePic.IsEnabled = false; _label = (TextLabelAscii)AddControl(new TextLabelAscii(this, 4, 5, 1, hue_Text, string.Empty), 0); _label.GumpLocalID = GumpLocalID; ScrollButton = (GumpPic)AddControl(new GumpPic(this, _width - 22, 5, 2086, 0), 0); IsFirstvisible = true;//for invisible create control }
void OnEntityUpdated(AEntity entity) { ClearControls(); // Add the base gump - the semi-naked paper doll. if (true) { var bodyID = 12 + (_isElf ? 2 : 0) + (_isFemale ? 1 : 0); // ((Mobile)m_sourceEntity).BodyID; GumpPic paperdoll = (GumpPic)AddControl(new GumpPic(this, 0, 0, bodyID, ((Mobile)_sourceEntity).Hue)); paperdoll.HandlesMouseInput = true; paperdoll.IsPaperdoll = true; } // Loop through the items on the mobile and create the gump pics. for (var i = 0; i < _drawOrder.Length; i++) { var item = ((Mobile)_sourceEntity).GetItem((int)_drawOrder[i]); if (item == null) { continue; } var canPickUp = true; switch (_drawOrder[i]) { case PaperDollEquipSlots.FacialHair: case PaperDollEquipSlots.Hair: canPickUp = false; break; default: break; } AddControl(new ItemGumplingPaperdoll(this, 0, 0, item)); ((ItemGumplingPaperdoll)LastControl).SlotIndex = (int)i; ((ItemGumplingPaperdoll)LastControl).IsFemale = _isFemale; ((ItemGumplingPaperdoll)LastControl).CanPickUp = canPickUp; } // If this object has a backpack, add it last. if (((Mobile)_sourceEntity).GetItem((int)PaperDollEquipSlots.Backpack) != null) { var backpack = ((Mobile)_sourceEntity).GetItem((int)PaperDollEquipSlots.Backpack); AddControl(_backpack = new GumpPicBackpack(this, -7, 0, backpack)); _backpack.HandlesMouseInput = true; _backpack.MouseDoubleClickEvent += On_Dblclick_Backpack; } }