示例#1
0
 public void Reset()
 {
     if (this.m_Picker != null)
     {
         Gumps.Destroy(this.m_Picker);
     }
     this.m_Picker = null;
 }
示例#2
0
 protected internal override void OnMouseUp(int X, int Y, MouseButtons mb)
 {
     if (mb == MouseButtons.Left)
     {
         ((GEditorPanel)base.Parent.Parent).Reset();
         object obj2 = this.m_Entry.Property.GetValue(this.m_Object, null);
         if (obj2 is bool)
         {
             this.SetValue(!((bool)obj2));
         }
         else if ((obj2 is Item) || (this.m_Entry.Property.PropertyType == typeof(Item)))
         {
             Engine.TargetHandler = new SetItemPropertyTarget(this);
         }
         else if (obj2 is Enum)
         {
             Array values = Enum.GetValues(obj2.GetType());
             for (int i = 0; i < values.Length; i++)
             {
                 if (values.GetValue(i).Equals(obj2))
                 {
                     this.SetValue(values.GetValue((int)((i + 1) % values.Length)));
                     break;
                 }
             }
         }
         else if (this.m_Entry.Hue != null)
         {
             if (this.m_Picker == null)
             {
                 GPropertyHuePicker toAdd = this.m_Picker = new GPropertyHuePicker(this);
                 toAdd.X = this.Width - 1;
                 toAdd.Y = 0;
                 base.m_Children.Add(toAdd);
             }
         }
         else if (this.m_Entry.Property.IsDefined(typeof(MacroEditorAttribute), true))
         {
             Gumps.Destroy(base.Parent.Parent.Parent.Parent);
             GMacroEditorForm.Open();
         }
     }
 }
示例#3
0
 protected internal override void OnMouseUp(int X, int Y, MouseButtons mb)
 {
     if (mb == MouseButtons.Left)
     {
         ((GEditorPanel) base.Parent.Parent).Reset();
         object obj2 = this.m_Entry.Property.GetValue(this.m_Object, null);
         if (obj2 is bool)
         {
             this.SetValue(!((bool) obj2));
         }
         else if ((obj2 is Item) || (this.m_Entry.Property.PropertyType == typeof(Item)))
         {
             Engine.TargetHandler = new SetItemPropertyTarget(this);
         }
         else if (obj2 is Enum)
         {
             Array values = Enum.GetValues(obj2.GetType());
             for (int i = 0; i < values.Length; i++)
             {
                 if (values.GetValue(i).Equals(obj2))
                 {
                     this.SetValue(values.GetValue((int) ((i + 1) % values.Length)));
                     break;
                 }
             }
         }
         else if (this.m_Entry.Hue != null)
         {
             if (this.m_Picker == null)
             {
                 GPropertyHuePicker toAdd = this.m_Picker = new GPropertyHuePicker(this);
                 toAdd.X = this.Width - 1;
                 toAdd.Y = 0;
                 base.m_Children.Add(toAdd);
             }
         }
         else if (this.m_Entry.Property.IsDefined(typeof(MacroEditorAttribute), true))
         {
             Gumps.Destroy(base.Parent.Parent.Parent.Parent);
             GMacroEditorForm.Open();
         }
     }
 }
示例#4
0
 public void Reset()
 {
     if (this.m_Picker != null)
     {
         Gumps.Destroy(this.m_Picker);
     }
     this.m_Picker = null;
 }