Esempio n. 1
0
        private void OpenList_OnClick(Gump g)
        {
            if (this.m_Dropdown != null)
            {
                Gumps.Destroy((Gump)this.m_Dropdown);
            }
            Point screen = this.PointToScreen(new Point(0, 0));

            this.m_Dropdown = new GBackground(this.m_BackID, this.Width, this.m_Count * 20 + (this.Height - this.UseHeight), screen.X, screen.Y, true);
            this.m_Dropdown.DestroyOnUnfocus = true;
            int offsetY = this.m_Dropdown.OffsetY;
            int num1    = 0;

            for (int index = 0; index < this.m_Count; ++index)
            {
                GTextButton gtextButton = new GTextButton(this.m_List[index], this.m_Font, this.m_HRegular, this.m_HOver, this.m_Dropdown.OffsetX, offsetY, new OnClick(this.SetIndex_OnClick));
                gtextButton.SetTag("Index", (object)index);
                this.m_Dropdown.Children.Add((Gump)gtextButton);
                offsetY += gtextButton.Height;
                if (gtextButton.Width + 3 > num1)
                {
                    num1 = gtextButton.Width + 3;
                }
            }
            this.m_Dropdown.Height = offsetY + (this.m_Dropdown.Height - (this.m_Dropdown.OffsetY + this.m_Dropdown.UseHeight));
            int num2 = num1 + (this.m_Dropdown.Width - this.m_Dropdown.UseWidth);

            if (num2 > this.m_Dropdown.Width)
            {
                this.m_Dropdown.Width = num2;
            }
            Gumps.Desktop.Children.Add((Gump)this.m_Dropdown);
        }
Esempio n. 2
0
        public GFlatButton(int X, int Y, int Width, int Height, string Text, OnClick OnClick)
            : base(X, Y, Width, Height)
        {
            this.m_OnClick = OnClick;
            this.m_CanDrag = false;
            GTextButton gtextButton = new GTextButton(Text, (IFont)Engine.GetUniFont(0), Hues.Default, Hues.Load(53), 0, 0, new OnClick(this.Route_OnClick));

            this.m_Children.Add((Gump)gtextButton);
            gtextButton.Center();
            this.m_Children.Add((Gump) new GHotspot(0, 0, Width, Height, (Gump)gtextButton));
        }
Esempio n. 3
0
 private void InternalUpdate()
 {
     foreach (Gump gump in this.m_Children.ToArray())
     {
         GTextButton gtextButton = gump as GTextButton;
         if (gtextButton != null)
         {
             AbilityInfo a = (AbilityInfo)gtextButton.GetTag("Ability");
             if (a != null)
             {
                 a.NameLabel.FocusHue = a.NameLabel.DefaultHue = GCombatGump.GetHueFor(a);
             }
         }
     }
 }