Exemplo n.º 1
0
 private void Entry_OnClick(Gump g)
 {
     if ((g.HasTag("HueID") && g.HasTag("Buttons")) && g.HasTag("Index"))
     {
         int          tag     = (int)g.GetTag("HueID");
         MouseButtons buttons = (MouseButtons)g.GetTag("Buttons");
         int          index   = (int)g.GetTag("Index");
         if ((buttons & MouseButtons.Right) != MouseButtons.None)
         {
             QuickHues.Remove(index);
             Gumps.Destroy(this);
             GQuickHues toAdd = new GQuickHues(this.m_Picker, this.m_Brightness, this.m_Okay);
             if (this.m_Expanded)
             {
                 toAdd.m_Expanded = true;
                 toAdd.Height     = toAdd.m_ExpandedHeight;
             }
             base.m_Parent.Children.Add(toAdd);
         }
         else if ((tag >= 2) && (tag < 0x3ea))
         {
             tag -= 2;
             int num3 = tag % 5;
             tag /= 5;
             int num4 = tag % 20;
             tag /= 20;
             int num5 = tag;
             this.m_Picker.Brightness = num3;
             this.m_Picker.ShadeX     = num4;
             this.m_Picker.ShadeY     = num5;
             this.m_Brightness.Refresh();
             this.m_Okay.Click();
         }
     }
 }
Exemplo n.º 2
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;
        }
Exemplo n.º 3
0
            public void OnReturn(string message)
            {
                QuickHueEntry e = new QuickHueEntry {
                    Name = message,
                    Hue  = this.m_Hue
                };

                QuickHues.Add(e);
                Gumps.Destroy(this.m_Target);
                GQuickHues toAdd = new GQuickHues(this.m_Target.m_Picker, this.m_Target.m_Brightness, this.m_Target.m_Okay);

                if (this.m_Target.m_Expanded)
                {
                    toAdd.m_Expanded = true;
                    toAdd.Height     = toAdd.m_ExpandedHeight;
                }
                this.m_Target.m_Parent.Children.Add(toAdd);
                Engine.AddTextMessage(string.Format("Hue created under name '{0}'.", message));
            }