Esempio n. 1
0
 public void Reset()
 {
     if (this.m_Picker != null)
     {
         Gumps.Destroy((Gump)this.m_Picker);
     }
     this.m_Picker = (GPropertyHuePicker)null;
 }
Esempio n. 2
0
        protected internal override void OnMouseUp(int X, int Y, MouseButtons mb)
        {
            if (mb != MouseButtons.Left)
            {
                return;
            }
            if (this.Parent.Parent is GEditorPanel)
            {
                ((GEditorPanel)this.Parent.Parent).Reset();
            }
            if (this.m_Entry.Property.PropertyType == typeof(Volume))
            {
                return;
            }
            object obj = this.m_Entry.Property.GetValue(this.m_Object, (object[])null);

            if (obj is bool)
            {
                this.SetValue((object)!(bool)obj);
            }
            else if (obj is Item || this.m_Entry.Property.PropertyType == typeof(Item))
            {
                TargetManager.Client = (ClientTargetHandler) new SetItemPropertyTarget(this);
            }
            else if (obj is Enum)
            {
                Array values = Enum.GetValues(obj.GetType());
                for (int index = 0; index < values.Length; ++index)
                {
                    if (values.GetValue(index).Equals(obj))
                    {
                        this.SetValue(values.GetValue((index + 1) % values.Length));
                        break;
                    }
                }
            }
            else if (this.m_Entry.Hue != null)
            {
                if (this.m_Picker != null)
                {
                    return;
                }
                GPropertyHuePicker gpropertyHuePicker = this.m_Picker = new GPropertyHuePicker(this);
                gpropertyHuePicker.X = this.Width - 1;
                gpropertyHuePicker.Y = 0;
                this.m_Children.Add((Gump)gpropertyHuePicker);
            }
            else if (this.m_Entry.Property.IsDefined(typeof(MacroEditorAttribute), true))
            {
                Gumps.Destroy(this.Parent.Parent.Parent.Parent);
                GMacroEditorForm.Open();
            }
            else
            {
                if (!this.m_Entry.Property.IsDefined(typeof(RenderSettingEditor), true))
                {
                    return;
                }
                Gumps.Destroy(this.Parent.Parent.Parent.Parent);
                GRenderSettingEditorForm.Open();
            }
        }