private void onClickClosedList(AControl control, int x, int y, MouseButton button)
        {
            if (Items.Count > 0)
            {
                m_IsListOpen                     = true;
                m_openResizePic                  = new ResizePic(Parent, X, Y, 3000, m_Width, m_Font.Height * m_visibleItems + 8);
                m_openResizePic.GumpLocalID      = GumpLocalID;
                m_openResizePic.MouseClickEvent += onClickOpenList;
                m_openResizePic.MouseOverEvent  += onMouseOverOpenList;
                m_openResizePic.MouseOutEvent   += onMouseOutOpenList;
                ((Gump)Parent).AddControl(m_openResizePic, Page);

                if (m_visibleItems > Items.Count)
                {
                    m_visibleItems = Items.Count;
                }

                // only show the scrollbar if we need to scroll
                if (m_visibleItems < Items.Count)
                {
                    m_openScrollBar = new ScrollBar(Parent, X + m_Width - 20, Y + 4, m_Font.Height * m_visibleItems, (m_CanBeNull ? -1 : 0), Items.Count - m_visibleItems, Index);
                    ((Gump)Parent).AddControl(m_openScrollBar, Page);
                }
                m_openLabels = new TextLabelAscii[m_visibleItems];
                for (int i = 0; i < m_visibleItems; i++)
                {
                    m_openLabels[i] = new TextLabelAscii(Parent, X + 4, Y + 5 + m_Font.Height * i, 1, 1106, string.Empty);
                    ((Gump)Parent).AddControl(m_openLabels[i], Page);
                }
            }
        }
Exemple #2
0
        void buildGumpling(int x, int y, int width, string[] items, int itemsVisible, int index, bool canBeNull)
        {
            Position       = new Point(x, y);
            m_items        = new List <string>(items);
            m_width        = width;
            Index          = index;
            m_visibleItems = itemsVisible;
            m_canBeNull    = canBeNull;

            m_resize = (ResizePic)AddControl(new ResizePic(this, 0, 0, 3000, m_width, m_Font.Height + 8), 0);
            m_resize.MouseClickEvent += onClickClosedList;
            m_resize.MouseOverEvent  += onMouseOverClosedList;
            m_resize.MouseOutEvent   += onMouseOutClosedList;
            m_label = (TextLabelAscii)AddControl(new TextLabelAscii(this, 4, 5, 1, hue_Text, string.Empty), 0);
            AddControl(new GumpPic(this, width - 22, 5, 2086, 0), 0);
        }
Exemple #3
0
        void buildGumpling(int x, int y, int width, string[] items, int itemsVisible, int index, bool canBeNull)
        {
            Position = new Point(x, y);
            m_items = new List<string>(items);
            m_width = width;
            Index = index;
            m_visibleItems = itemsVisible;
            m_canBeNull = canBeNull;

            m_resize = (ResizePic)AddControl(new ResizePic(this, 0, 0, 3000, m_width, m_Font.Height + 8), 0);
            m_resize.MouseClickEvent += onClickClosedList;
            m_resize.MouseOverEvent += onMouseOverClosedList;
            m_resize.MouseOutEvent += onMouseOutClosedList;
            m_label = (TextLabelAscii)AddControl(new TextLabelAscii(this, 4, 5, 1, hue_Text, string.Empty), 0);
            AddControl(new GumpPic(this, width - 22, 5, 2086, 0), 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
        }
        void buildGumpling(int x, int y, int width, int index, int itemsVisible, string[] items, bool canBeNull)
        {
            Position       = new Point(x, y);
            m_items        = new List <string>(items);
            m_width        = width;
            Index          = index;
            m_visibleItems = itemsVisible;
            m_canBeNull    = canBeNull;

            m_resize = new ResizePic(m_owner, Page, X, Y, 3000, m_width, IO.FontsOld.ASCIIText.Fonts[1].Height + 8);
            m_resize.OnMouseClick = onClickClosedList;
            m_resize.OnMouseOver  = onMouseOverClosedList;
            m_resize.OnMouseOut   = onMouseOutClosedList;
            ((Gump)m_owner).AddControl(m_resize);
            m_label = new TextLabelAscii(m_owner, Page, X + 4, Y + 5, hue_Text, 1, string.Empty);
            ((Gump)m_owner).AddControl(m_label);
            ((Gump)m_owner).AddControl(new GumpPic(m_owner, Page, X + width - 22, Y + 5, 2086, 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
        }
 void onClickClosedList(int x, int y, MouseButton button)
 {
     m_listOpen      = true;
     m_openResizePic = new ResizePic(m_owner, Page, X, Y, 3000, m_width, ASCIIText.Fonts[1].Height * m_visibleItems + 8);
     m_openResizePic.OnMouseClick = onClickOpenList;
     m_openResizePic.OnMouseOver  = onMouseOverOpenList;
     m_openResizePic.OnMouseOut   = onMouseOutOpenList;
     ((Gump)m_owner).AddControl(m_openResizePic);
     // only show the scrollbar if we need to scroll
     if (m_visibleItems < m_items.Count)
     {
         m_openScrollBar = new ScrollBar(m_owner, Page, X + m_width - 20, Y + 4, ASCIIText.Fonts[1].Height * m_visibleItems, (m_canBeNull ? -1 : 0), m_items.Count - m_visibleItems, Index);
         ((Gump)m_owner).AddControl(m_openScrollBar);
     }
     m_openLabels = new TextLabelAscii[m_visibleItems];
     for (int i = 0; i < m_visibleItems; i++)
     {
         m_openLabels[i] = new TextLabelAscii(m_owner, Page, X + 4, Y + 5 + ASCIIText.Fonts[1].Height * i, 1107, 1, string.Empty);
         ((Gump)m_owner).AddControl(m_openLabels[i]);
     }
 }
 void onClickClosedList(AControl control, int x, int y, MouseButton button)
 {
     m_listOpen = true;
     m_openResizePic = new ResizePic(Owner, X, Y, 3000, m_width, m_Font.Height * m_visibleItems + 8);
     m_openResizePic.MouseClickEvent += onClickOpenList;
     m_openResizePic.MouseOverEvent += onMouseOverOpenList;
     m_openResizePic.MouseOutEvent += onMouseOutOpenList;
     ((Gump)Owner).AddControl(m_openResizePic, this.Page);
     // only show the scrollbar if we need to scroll
     if (m_visibleItems < m_items.Count)
     {
         m_openScrollBar = new ScrollBar(Owner, X + m_width - 20, Y + 4, m_Font.Height * m_visibleItems, (m_canBeNull ? -1 : 0), m_items.Count - m_visibleItems, Index);
         ((Gump)Owner).AddControl(m_openScrollBar, this.Page);
     }
     m_openLabels = new TextLabelAscii[m_visibleItems];
     for (int i = 0; i < m_visibleItems; i++)
     {
         m_openLabels[i] = new TextLabelAscii(Owner, X + 4, Y + 5 + m_Font.Height * i, 1106, 1, string.Empty);
         ((Gump)Owner).AddControl(m_openLabels[i], this.Page);
     }
 }
        void buildGumpling(int x, int y, int width, int index, int itemsVisible, string[] items, bool canBeNull)
        {
            Position = new Point(x, y);
            m_items = new List<string>(items);
            m_width = width;
            Index = index;
            m_visibleItems = itemsVisible;
            m_canBeNull = canBeNull;

            m_resize = new ResizePic(Owner, X, Y, 3000, m_width, m_Font.Height + 8);
            m_resize.MouseClickEvent += onClickClosedList;
            m_resize.MouseOverEvent += onMouseOverClosedList;
            m_resize.MouseOutEvent += onMouseOutClosedList;
            ((Gump)Owner).AddControl(m_resize, this.Page);
            m_label = new TextLabelAscii(Owner, X + 4, Y + 5, hue_Text, 1, string.Empty);
            ((Gump)Owner).AddControl(m_label, this.Page);
            ((Gump)Owner).AddControl(new GumpPic(Owner, X + width - 22, Y + 5, 2086, 0), this.Page);
        }
Exemple #10
0
        private void onClickClosedList(AControl control, int x, int y, MouseButton button)
        {
            if (Items.Count > 0)
            {
                m_IsListOpen = true;
                m_openResizePic = new ResizePic(Parent, X, Y, 3000, m_Width, m_Font.Height * m_visibleItems + 8);
                m_openResizePic.GumpLocalID = GumpLocalID;
                m_openResizePic.MouseClickEvent += onClickOpenList;
                m_openResizePic.MouseOverEvent += onMouseOverOpenList;
                m_openResizePic.MouseOutEvent += onMouseOutOpenList;
                ((Gump)Parent).AddControl(m_openResizePic, Page);

                if (m_visibleItems > Items.Count)
                {
                    m_visibleItems = Items.Count;
                }

                // only show the scrollbar if we need to scroll
                if (m_visibleItems < Items.Count)
                {
                    m_openScrollBar = new ScrollBar(Parent, X + m_Width - 20, Y + 4, m_Font.Height * m_visibleItems, (m_CanBeNull ? -1 : 0), Items.Count - m_visibleItems, Index);
                    ((Gump)Parent).AddControl(m_openScrollBar, Page);
                }
                m_openLabels = new TextLabelAscii[m_visibleItems];
                for (int i = 0; i < m_visibleItems; i++)
                {
                    m_openLabels[i] = new TextLabelAscii(Parent, X + 4, Y + 5 + m_Font.Height * i, 1, 1106, string.Empty);
                    ((Gump)Parent).AddControl(m_openLabels[i], Page);
                }
            }
        }
        public CreateCharSkillsGump()
            : base(0, 0)
        {
            // get the resource provider
            IResourceProvider provider = ServiceRegistry.GetService<IResourceProvider>();

            // backdrop
            AddControl(new GumpPicTiled(this, 0, 0, 800, 600, 9274));
            AddControl(new GumpPic(this, 0, 0, 5500, 0));
            // center menu with fancy top
            AddControl(new ResizePic(this, 100, 80, 2600, 470, 372), 1);
            AddControl(new GumpPic(this, 291, 42, 1417, 0), 1);
            AddControl(new GumpPic(this, 214, 58, 1419, 0), 1);
            AddControl(new GumpPic(this, 300, 51, 5545, 0), 1);
            // title text
            AddControl(new TextLabelAscii(this, 148, 132, 841, 2, provider.GetString(3000326)), 1);

            // strength, dexterity, intelligence
            AddControl(new TextLabelAscii(this, 158, 170, 2430, 1, provider.GetString(3000111)), 1);
            AddControl(new TextLabelAscii(this, 158, 250, 2430, 1, provider.GetString(3000112)), 1);
            AddControl(new TextLabelAscii(this, 158, 330, 2430, 1, provider.GetString(3000113)), 1);
            // sliders for attributes
            sliderAttributes = new HSliderBar[3];
            sliderAttributes[0] = new HSliderBar(this, 164, 196, 93, 10, 60, 60, HSliderBarStyle.MetalWidgetRecessedBar);
            sliderAttributes[1] = new HSliderBar(this, 164, 276, 93, 10, 60, 10, HSliderBarStyle.MetalWidgetRecessedBar);
            sliderAttributes[2] = new HSliderBar(this, 164, 356, 93, 10, 60, 10, HSliderBarStyle.MetalWidgetRecessedBar);
            // labels for attributes
            lblAttributes = new TextLabelAscii[3];
            lblAttributes[0] = new TextLabelAscii(this, 284, 170, 2430, 1, string.Empty);
            lblAttributes[1] = new TextLabelAscii(this, 284, 250, 2430, 1, string.Empty);
            lblAttributes[2] = new TextLabelAscii(this, 284, 330, 2430, 1, string.Empty);
            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    if (i != j)
                        sliderAttributes[i].PairSlider(sliderAttributes[j]);
                }
                AddControl(sliderAttributes[i], 1);
                AddControl(lblAttributes[i], 1);
            }

            // sliders for skills
            sliderSkills = new HSliderBar[3];
            sliderSkills[0] = new HSliderBar(this, 344, 204, 93, 0, 50, 50, HSliderBarStyle.MetalWidgetRecessedBar);
            sliderSkills[1] = new HSliderBar(this, 344, 284, 93, 0, 50, 50, HSliderBarStyle.MetalWidgetRecessedBar);
            sliderSkills[2] = new HSliderBar(this, 344, 364, 93, 0, 50, 0, HSliderBarStyle.MetalWidgetRecessedBar);
            // labels for skills
            lblSkills = new TextLabelAscii[3];
            lblSkills[0] = new TextLabelAscii(this, 494, 200, 2430, 1, string.Empty);
            lblSkills[1] = new TextLabelAscii(this, 494, 280, 2430, 1, string.Empty);
            lblSkills[2] = new TextLabelAscii(this, 494, 360, 2430, 1, string.Empty);
            // drop downs for skills
            listSkills = new DropDownList[3];
            string[] skillList = SkillsData.ListNames;
            listSkills[0] = new DropDownList(this, 344, 172, 182, skillList, 8, -1, true);
            listSkills[1] = new DropDownList(this, 344, 252, 182, skillList, 8, -1, true);
            listSkills[2] = new DropDownList(this, 344, 332, 182, skillList, 8, -1, true);
            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    if (i != j)
                        sliderSkills[i].PairSlider(sliderSkills[j]);
                }
                AddControl(sliderSkills[i], 1);
                AddControl(lblSkills[i], 1);
                AddControl(listSkills[i], 1);
            }
            AddControl(new TextLabelAscii(this, 158, 170, 2430, 1, provider.GetString(3000111)), 1);
            AddControl(new TextLabelAscii(this, 158, 250, 2430, 1, provider.GetString(3000112)), 1);
            AddControl(new TextLabelAscii(this, 158, 330, 2430, 1, provider.GetString(3000113)), 1);

            // back button
            AddControl(new Button(this, 586, 435, 5537, 5539, ButtonTypes.Activate, 0, (int)Buttons.BackButton), 1);
            ((Button)LastControl).GumpOverID = 5538;
            // forward button
            AddControl(new Button(this, 610, 435, 5540, 5542, ButtonTypes.Activate, 0, (int)Buttons.ForwardButton), 1);
            ((Button)LastControl).GumpOverID = 5541;
            // quit button
            AddControl(new Button(this, 554, 2, 5513, 5515, ButtonTypes.Activate, 0, (int)Buttons.QuitButton));
            ((Button)LastControl).GumpOverID = 5514;

            IsUncloseableWithRMB = true;
        }