Example #1
0
        protected override void OnInitialize()
        {
            m_GumplingTop    = (GumpPic)AddControl(new GumpPic(this, 0, 0, 0x0820, 0));
            m_GumplingMiddle = (GumpPicTiled)AddControl(new GumpPicTiled(this, 0, 0, 0, 0, 0x0822));
            m_GumplingBottom = (GumpPic)AddControl(new GumpPic(this, 0, 0, 0x0823, 0));

            if (m_IsResizable)
            {
                m_GumplingExpander = (Button)AddControl(new Button(this, 0, 0, 0x082E, 0x82F, ButtonTypes.Activate, 0, c_GumplingExpander_ButtonID));
                m_GumplingExpander.MouseDownEvent += expander_OnMouseDown;
                m_GumplingExpander.MouseUpEvent   += expander_OnMouseUp;
                m_GumplingExpander.MouseOverEvent += expander_OnMouseOver;
            }
        }
Example #2
0
        void OnEntityUpdated(AEntity entity)
        {
            ClearControls();
            // Add the base gump - the semi-naked paper doll.
            if (true)
            {
                int     bodyID    = 12 + (m_isElf ? 2 : 0) + (m_isFemale ? 1 : 0); // ((Mobile)m_sourceEntity).BodyID;
                GumpPic paperdoll = (GumpPic)AddControl(new GumpPic(this, 0, 0, bodyID, ((Mobile)m_sourceEntity).Hue));
                paperdoll.HandlesMouseInput = true;
                paperdoll.IsPaperdoll       = true;
            }
            // Loop through the items on the mobile and create the gump pics.
            for (int i = 0; i < s_DrawOrder.Length; i++)
            {
                Item item = ((Mobile)m_sourceEntity).GetItem((int)s_DrawOrder[i]);
                if (item == null)
                {
                    continue;
                }

                bool canPickUp = true;
                switch (s_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  = m_isFemale;
                ((ItemGumplingPaperdoll)LastControl).CanPickUp = canPickUp;
            }
            // If this object has a backpack, add it last.
            if (((Mobile)m_sourceEntity).GetItem((int)PaperDollEquipSlots.Backpack) != null)
            {
                Item backpack = ((Mobile)m_sourceEntity).GetItem((int)PaperDollEquipSlots.Backpack);
                AddControl(m_Backpack             = new GumpPicBackpack(this, -7, 0, backpack));
                m_Backpack.HandlesMouseInput      = true;
                m_Backpack.MouseDoubleClickEvent += On_Dblclick_Backpack;
            }
        }
Example #3
0
        public void CreateVisual()
        {
            if (m_ResizePic != null || m_label != null || ScrollButton != null)
            {
                return;
            }

            m_ResizePic                  = (ResizePic)AddControl(new ResizePic(this, 0, 0, 3000, m_Width, m_Font.Height + 8), 0);
            m_ResizePic.GumpLocalID      = GumpLocalID;
            m_ResizePic.MouseClickEvent += onClickClosedList;
            m_ResizePic.MouseOverEvent  += onMouseOverClosedList;
            m_ResizePic.MouseOutEvent   += onMouseOutClosedList;
            m_ResizePic.IsEnabled        = false;
            m_label             = (TextLabelAscii)AddControl(new TextLabelAscii(this, 4, 5, 1, hue_Text, string.Empty), 0);
            m_label.GumpLocalID = GumpLocalID;
            ScrollButton        = (GumpPic)AddControl(new GumpPic(this, m_Width - 22, 5, 2086, 0), 0);

            IsFirstvisible = true;//for invisible create control
        }