Esempio n. 1
0
        public GCategoryPanel(object obj, string category, ArrayList entries)
            : base(0, 0, 279, 22)
        {
            this.FillColor               = GumpColors.Control;
            this.BorderColor             = GumpColors.ControlDarkDark;
            this.FillAlpha               = 1f;
            this.ShouldHitTest           = false;
            this.m_NonRestrictivePicking = true;
            this.m_Label   = new GLabel(category, (IFont)Engine.GetUniFont(1), GumpHues.ControlText, 0, 0);
            this.m_Label.X = 5 - this.m_Label.Image.xMin;
            this.m_Label.Y = (22 - (this.m_Label.Image.yMax - this.m_Label.Image.yMin + 1)) / 2 - this.m_Label.Image.yMin;
            this.m_Children.Add((Gump)this.m_Label);
            entries.Sort();
            this.m_Entries = new GPropertyEntry[entries.Count];
            int num = 21;

            for (int index = 0; index < entries.Count; ++index)
            {
                ObjectEditorEntry entry = entries[index] as ObjectEditorEntry;
                this.m_Entries[index]   = new GPropertyEntry(entry.Object, entry);
                this.m_Entries[index].Y = num;
                num += 21;
                this.m_Children.Add((Gump)this.m_Entries[index]);
            }
            this.Height = num + 1;
        }
Esempio n. 2
0
        public GPropertyEntry(object obj, ObjectEditorEntry entry)
            : base(0, 0, 279, 22)
        {
            this.m_Object = obj;
            this.m_Entry  = entry;
            this.m_NonRestrictivePicking = true;
            bool flag = entry.Property.PropertyType == typeof(Volume);

            this.m_NameBack               = new GAlphaBackground(0, 0, 140, 22);
            this.m_NameBack.FillColor     = GumpColors.Window;
            this.m_NameBack.FillAlpha     = 1f;
            this.m_NameBack.DrawBorder    = false;
            this.m_NameBack.ShouldHitTest = false;
            this.m_Children.Add((Gump)this.m_NameBack);
            this.m_ValueBack               = new GAlphaBackground(139, 0, 140, 22);
            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;
            this.m_Children.Add((Gump)this.m_ValueBack);
            this.m_Name   = new GLabel(entry.Optionable.Name, (IFont)Engine.GetUniFont(2), GumpHues.WindowText, 0, 0);
            this.m_Name.X = 5 - this.m_Name.Image.xMin;
            this.m_Name.Y = (22 - (this.m_Name.Image.yMax - this.m_Name.Image.yMin + 1)) / 2 - this.m_Name.Image.yMin;
            this.m_NameBack.Children.Add((Gump)this.m_Name);
            object obj1      = entry.Property.GetValue(obj, (object[])null);
            string valString = this.GetValString(obj1);

            if (flag)
            {
                return;
            }
            IFont Font = (obj1 is ValueType ? (obj1.Equals(entry.Optionable.Default) ? 1 : 0) : (object.ReferenceEquals(obj1, entry.Optionable.Default) ? 1 : 0)) == 0 ? (IFont)Engine.GetUniFont(1) : (IFont)Engine.GetUniFont(2);

            this.m_Value = new GLabel(valString, Font, GumpHues.WindowText, 0, 0);
            if (entry.Hue != null)
            {
                GAlphaBackground galphaBackground = new GAlphaBackground(4, 4, 22, 14);
                galphaBackground.FillColor     = Engine.C16232((int)Hues.Load((int)obj1).Pixel(ushort.MaxValue));
                galphaBackground.FillAlpha     = 1f;
                galphaBackground.ShouldHitTest = false;
                this.m_ValueBack.Children.Add((Gump)galphaBackground);
                this.m_Value.Text = "Hue";
                this.m_Value.X    = 30 - this.m_Value.Image.xMin;
                this.m_Value.Y    = (22 - (this.m_Value.Image.yMax - this.m_Value.Image.yMin + 1)) / 2 - this.m_Value.Image.yMin;
                this.m_Hue        = galphaBackground;
            }
            else
            {
                this.m_Value.X = 5 - this.m_Value.Image.xMin;
                this.m_Value.Y = (22 - (this.m_Value.Image.yMax - this.m_Value.Image.yMin + 1)) / 2 - this.m_Value.Image.yMin;
            }
            this.m_ValueBack.Children.Add((Gump)this.m_Value);
        }