Esempio n. 1
0
 public GFlatButton(int X, int Y, int Width, int Height, string Text, OnClick OnClick)
     : base(X, Y, Width, Height)
 {
     this.m_OnClick = OnClick;
     base.m_CanDrag = false;
     GTextButton toAdd = new GTextButton(Text, Engine.GetUniFont(0), Hues.Default, Hues.Load(0x35), 0, 0, new OnClick(this.Route_OnClick));
     base.m_Children.Add(toAdd);
     toAdd.Center();
     base.m_Children.Add(new GHotspot(0, 0, Width, Height, toAdd));
 }
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;
            base.m_CanDrag = false;
            GTextButton toAdd = new GTextButton(Text, Engine.GetUniFont(0), Hues.Default, Hues.Load(0x35), 0, 0, new OnClick(this.Route_OnClick));

            base.m_Children.Add(toAdd);
            toAdd.Center();
            base.m_Children.Add(new GHotspot(0, 0, Width, Height, toAdd));
        }
Esempio n. 3
0
        public GQuickHues(GHuePicker Picker, GBrightnessBar Brightness, GFlatButton Okay) : base(3, 0x57, 0x76, 20)
        {
            this.m_CompactHeight  = 20;
            this.m_ExpandedHeight = Engine.GameHeight / 2;
            this.m_Picker         = Picker;
            this.m_Brightness     = Brightness;
            this.m_Okay           = Okay;
            base.m_CanDrag        = false;
            this.m_Timer          = new Timer(new OnTick(this.Roll_OnTick), 0);
            GLabel toAdd = new GLabel("Quick Hues", Engine.GetUniFont(0), Hues.Default, 2, 2);

            this.Height          = 20;
            this.m_CompactHeight = base.m_Height;
            base.m_Children.Add(toAdd);
            toAdd.Center();
            QuickHues.Load();
            int         count   = QuickHues.Entries.Count;
            int         num2    = 0x16;
            Clipper     clipper = new Clipper(base.m_X + 1, base.m_Y + 1, base.m_Width - 2, base.m_Height - 2);
            GTextButton button  = new GTextButton("Create new..", Engine.GetUniFont(0), Hues.Default, Hues.Load(0x35), 2, 2, new OnClick(this.Add_OnClick));

            base.m_Children.Add(button);
            button.Center();
            button.Y = num2;
            button.Scissor(clipper);
            num2 += button.Height;
            OnClick     onClick   = new OnClick(this.Entry_OnClick);
            OnHighlight highlight = new OnHighlight(this.Entry_OnHighlight);

            for (int i = 0; i < count; i++)
            {
                QuickHueEntry entry   = (QuickHueEntry)QuickHues.Entries[i];
                GTextButton   button2 = new GTextButton(entry.Name, Engine.GetUniFont(0), Hues.Load(0x58), Hues.Load(0x35), 2, 2, onClick);
                base.m_Children.Add(button2);
                button2.Center();
                button2.Y = num2;
                button2.Scissor(clipper);
                button2.SetTag("HueID", entry.Hue);
                button2.SetTag("Index", i);
                num2 += button2.Height;
                button2.OnHighlight = highlight;
                button2.Tooltip     = new Tooltip(string.Format("0x{0:X}", entry.Hue));
            }
            num2 += 2;
            this.m_ExpandedHeight = num2;
        }
Esempio n. 4
0
 public GQuickHues(GHuePicker Picker, GBrightnessBar Brightness, GFlatButton Okay)
     : base(3, 0x57, 0x76, 20)
 {
     this.m_CompactHeight = 20;
     this.m_ExpandedHeight = Engine.GameHeight / 2;
     this.m_Picker = Picker;
     this.m_Brightness = Brightness;
     this.m_Okay = Okay;
     base.m_CanDrag = false;
     this.m_Timer = new Timer(new OnTick(this.Roll_OnTick), 0);
     GLabel toAdd = new GLabel("Quick Hues", Engine.GetUniFont(0), Hues.Default, 2, 2);
     this.Height = 20;
     this.m_CompactHeight = base.m_Height;
     base.m_Children.Add(toAdd);
     toAdd.Center();
     QuickHues.Load();
     int count = QuickHues.Entries.Count;
     int num2 = 0x16;
     Clipper clipper = new Clipper(base.m_X + 1, base.m_Y + 1, base.m_Width - 2, base.m_Height - 2);
     GTextButton button = new GTextButton("Create new..", Engine.GetUniFont(0), Hues.Default, Hues.Load(0x35), 2, 2, new OnClick(this.Add_OnClick));
     base.m_Children.Add(button);
     button.Center();
     button.Y = num2;
     button.Scissor(clipper);
     num2 += button.Height;
     OnClick onClick = new OnClick(this.Entry_OnClick);
     OnHighlight highlight = new OnHighlight(this.Entry_OnHighlight);
     for (int i = 0; i < count; i++)
     {
         QuickHueEntry entry = (QuickHueEntry) QuickHues.Entries[i];
         GTextButton button2 = new GTextButton(entry.Name, Engine.GetUniFont(0), Hues.Load(0x58), Hues.Load(0x35), 2, 2, onClick);
         base.m_Children.Add(button2);
         button2.Center();
         button2.Y = num2;
         button2.Scissor(clipper);
         button2.SetTag("HueID", entry.Hue);
         button2.SetTag("Index", i);
         num2 += button2.Height;
         button2.OnHighlight = highlight;
         button2.Tooltip = new Tooltip(string.Format("0x{0:X}", entry.Hue));
     }
     num2 += 2;
     this.m_ExpandedHeight = num2;
 }
Esempio n. 5
0
        public GQuickLogin() : base(0, 0, 200, 20)
        {
            this.m_CompactHeight  = 20;
            this.m_ExpandedHeight = Engine.GameHeight / 2;
            base.m_CanDrag        = false;
            this.m_Timer          = new Timer(new OnTick(this.Roll_OnTick), 0);
            GLabel toAdd = new GLabel("Quick Login", Engine.GetUniFont(0), Hues.Default, 2, 2);

            this.Height          = toAdd.Height + 4;
            this.m_CompactHeight = base.m_Height;
            base.m_Children.Add(toAdd);
            toAdd.Center();
            QuickLogin.Load();
            int count = QuickLogin.Entries.Count;

            if (count == 0)
            {
                base.Visible = false;
            }
            else
            {
                if (count > 12)
                {
                    count = 12;
                }
                int num2 = (2 + toAdd.Height) + 4;
                if (count == 0)
                {
                    num2 -= 2;
                }
                OnClick onClick = new OnClick(Engine.QuickLogin_OnClick);
                Clipper clipper = new Clipper(base.m_X + 1, base.m_Y + 1, base.m_Width - 2, base.m_Height - 2);
                for (int i = 0; i < count; i++)
                {
                    Entry       entry  = (Entry)QuickLogin.Entries[i];
                    GTextButton button = new GTextButton(entry.CharName, Engine.GetUniFont(0), Hues.Load(0x58), Hues.Load(0x35), 2, 2, onClick);
                    base.m_Children.Add(button);
                    button.Center();
                    button.Y = num2;
                    button.Scissor(clipper);
                    button.SetTag("Index", i);
                    num2 += button.Height;
                    int  num4 = 0;
                    bool flag = false;
                    for (int j = 0; j < count; j++)
                    {
                        Entry entry2 = (Entry)QuickLogin.Entries[j];
                        if (entry2.CharName == entry.CharName)
                        {
                            if (j <= i)
                            {
                                num4++;
                            }
                            if (j != i)
                            {
                                flag = true;
                            }
                        }
                    }
                    if (flag)
                    {
                        button.Tooltip = new Tooltip(string.Format("{0}\n{1}", num4, entry.ServerName));
                    }
                    else
                    {
                        button.Tooltip = new Tooltip(entry.ServerName);
                    }
                }
                if (count != 0)
                {
                    num2 += 2;
                }
                if (num2 > 480)
                {
                    num2 = 480;
                }
                this.m_ExpandedHeight = num2;
            }
        }
Esempio n. 6
0
 public GQuickLogin()
     : base(0, 0, 200, 20)
 {
     this.m_CompactHeight = 20;
     this.m_ExpandedHeight = Engine.GameHeight / 2;
     base.m_CanDrag = false;
     this.m_Timer = new Timer(new OnTick(this.Roll_OnTick), 0);
     GLabel toAdd = new GLabel("Quick Login", Engine.GetUniFont(0), Hues.Default, 2, 2);
     this.Height = toAdd.Height + 4;
     this.m_CompactHeight = base.m_Height;
     base.m_Children.Add(toAdd);
     toAdd.Center();
     QuickLogin.Load();
     int count = QuickLogin.Entries.Count;
     if (count == 0)
     {
         base.Visible = false;
     }
     else
     {
         if (count > 12)
         {
             count = 12;
         }
         int num2 = (2 + toAdd.Height) + 4;
         if (count == 0)
         {
             num2 -= 2;
         }
         OnClick onClick = new OnClick(Engine.QuickLogin_OnClick);
         Clipper clipper = new Clipper(base.m_X + 1, base.m_Y + 1, base.m_Width - 2, base.m_Height - 2);
         for (int i = 0; i < count; i++)
         {
             Entry entry = (Entry) QuickLogin.Entries[i];
             GTextButton button = new GTextButton(entry.CharName, Engine.GetUniFont(0), Hues.Load(0x58), Hues.Load(0x35), 2, 2, onClick);
             base.m_Children.Add(button);
             button.Center();
             button.Y = num2;
             button.Scissor(clipper);
             button.SetTag("Index", i);
             num2 += button.Height;
             int num4 = 0;
             bool flag = false;
             for (int j = 0; j < count; j++)
             {
                 Entry entry2 = (Entry) QuickLogin.Entries[j];
                 if (entry2.CharName == entry.CharName)
                 {
                     if (j <= i)
                     {
                         num4++;
                     }
                     if (j != i)
                     {
                         flag = true;
                     }
                 }
             }
             if (flag)
             {
                 button.Tooltip = new Tooltip(string.Format("{0}\n{1}", num4, entry.ServerName));
             }
             else
             {
                 button.Tooltip = new Tooltip(entry.ServerName);
             }
         }
         if (count != 0)
         {
             num2 += 2;
         }
         if (num2 > 480)
         {
             num2 = 480;
         }
         this.m_ExpandedHeight = num2;
     }
 }