Beispiel #1
0
        public GPropertyEntry(object obj, ObjectEditorEntry entry) : base(0, 0, 0x117, 0x16)
        {
            IFont uniFont;

            this.m_Object = obj;
            this.m_Entry  = entry;
            base.m_NonRestrictivePicking = true;
            this.m_NameBack               = new GAlphaBackground(0, 0, 140, 0x16);
            this.m_NameBack.FillColor     = GumpColors.Window;
            this.m_NameBack.FillAlpha     = 1f;
            this.m_NameBack.DrawBorder    = false;
            this.m_NameBack.ShouldHitTest = false;
            base.m_Children.Add(this.m_NameBack);
            this.m_ValueBack               = new GAlphaBackground(0x8b, 0, 140, 0x16);
            this.m_ValueBack.FillColor     = GumpColors.Window;
            this.m_ValueBack.FillAlpha     = 1f;
            this.m_ValueBack.BorderColor   = GumpColors.Control;
            this.m_ValueBack.ShouldHitTest = false;
            this.m_ValueBack.DrawBorder    = false;
            base.m_Children.Add(this.m_ValueBack);
            this.m_Name   = new GLabel(entry.Optionable.Name, Engine.GetUniFont(2), GumpHues.WindowText, 0, 0);
            this.m_Name.X = 5 - this.m_Name.Image.xMin;
            this.m_Name.Y = ((0x16 - ((this.m_Name.Image.yMax - this.m_Name.Image.yMin) + 1)) / 2) - this.m_Name.Image.yMin;
            this.m_NameBack.Children.Add(this.m_Name);
            object val       = entry.Property.GetValue(obj, null);
            string valString = this.GetValString(val);

            if ((val is ValueType) ? val.Equals(entry.Optionable.Default) : object.ReferenceEquals(val, entry.Optionable.Default))
            {
                uniFont = Engine.GetUniFont(2);
            }
            else
            {
                uniFont = Engine.GetUniFont(1);
            }
            this.m_Value = new GLabel(valString, uniFont, GumpHues.WindowText, 0, 0);
            if (entry.Hue != null)
            {
                GAlphaBackground toAdd = new GAlphaBackground(4, 4, 0x16, 14)
                {
                    FillColor     = Engine.C16232(Hues.Load((int)val).Pixel(0xffff)),
                    FillAlpha     = 1f,
                    ShouldHitTest = false
                };
                this.m_ValueBack.Children.Add(toAdd);
                this.m_Value.Text = "Hue";
                this.m_Value.X    = 30 - this.m_Value.Image.xMin;
                this.m_Value.Y    = ((0x16 - ((this.m_Value.Image.yMax - this.m_Value.Image.yMin) + 1)) / 2) - this.m_Value.Image.yMin;
                this.m_Hue        = toAdd;
            }
            else
            {
                this.m_Value.X = 5 - this.m_Value.Image.xMin;
                this.m_Value.Y = ((0x16 - ((this.m_Value.Image.yMax - this.m_Value.Image.yMin) + 1)) / 2) - this.m_Value.Image.yMin;
            }
            this.m_ValueBack.Children.Add(this.m_Value);
        }
Beispiel #2
0
 public GPropertyEntry(object obj, ObjectEditorEntry entry)
     : base(0, 0, 0x117, 0x16)
 {
     IFont uniFont;
     this.m_Object = obj;
     this.m_Entry = entry;
     base.m_NonRestrictivePicking = true;
     this.m_NameBack = new GAlphaBackground(0, 0, 140, 0x16);
     this.m_NameBack.FillColor = GumpColors.Window;
     this.m_NameBack.FillAlpha = 1f;
     this.m_NameBack.DrawBorder = false;
     this.m_NameBack.ShouldHitTest = false;
     base.m_Children.Add(this.m_NameBack);
     this.m_ValueBack = new GAlphaBackground(0x8b, 0, 140, 0x16);
     this.m_ValueBack.FillColor = GumpColors.Window;
     this.m_ValueBack.FillAlpha = 1f;
     this.m_ValueBack.BorderColor = GumpColors.Control;
     this.m_ValueBack.ShouldHitTest = false;
     this.m_ValueBack.DrawBorder = false;
     base.m_Children.Add(this.m_ValueBack);
     this.m_Name = new GLabel(entry.Optionable.Name, Engine.GetUniFont(2), GumpHues.WindowText, 0, 0);
     this.m_Name.X = 5 - this.m_Name.Image.xMin;
     this.m_Name.Y = ((0x16 - ((this.m_Name.Image.yMax - this.m_Name.Image.yMin) + 1)) / 2) - this.m_Name.Image.yMin;
     this.m_NameBack.Children.Add(this.m_Name);
     object val = entry.Property.GetValue(obj, null);
     string valString = this.GetValString(val);
     if ((val is ValueType) ? val.Equals(entry.Optionable.Default) : object.ReferenceEquals(val, entry.Optionable.Default))
     {
         uniFont = Engine.GetUniFont(2);
     }
     else
     {
         uniFont = Engine.GetUniFont(1);
     }
     this.m_Value = new GLabel(valString, uniFont, GumpHues.WindowText, 0, 0);
     if (entry.Hue != null)
     {
         GAlphaBackground toAdd = new GAlphaBackground(4, 4, 0x16, 14) {
             FillColor = Engine.C16232(Hues.Load((int) val).Pixel(0xffff)),
             FillAlpha = 1f,
             ShouldHitTest = false
         };
         this.m_ValueBack.Children.Add(toAdd);
         this.m_Value.Text = "Hue";
         this.m_Value.X = 30 - this.m_Value.Image.xMin;
         this.m_Value.Y = ((0x16 - ((this.m_Value.Image.yMax - this.m_Value.Image.yMin) + 1)) / 2) - this.m_Value.Image.yMin;
         this.m_Hue = toAdd;
     }
     else
     {
         this.m_Value.X = 5 - this.m_Value.Image.xMin;
         this.m_Value.Y = ((0x16 - ((this.m_Value.Image.yMax - this.m_Value.Image.yMin) + 1)) / 2) - this.m_Value.Image.yMin;
     }
     this.m_ValueBack.Children.Add(this.m_Value);
 }
Beispiel #3
0
        public int CompareTo(object obj)
        {
            ObjectEditorEntry entry = (ObjectEditorEntry)obj;

            return(this.m_Optionable.Name.CompareTo(entry.m_Optionable.Name));
        }