Beispiel #1
0
        private GNetwork() : base(Engine.ScreenWidth - 200, 0, 200, 400)
        {
            m_pcBytesIn  = 0;
            m_pcBytesOut = 0;
            this.m_Start = Environment.TickCount;
            IFont  uniFont = Engine.GetUniFont(1);
            IHue   bright  = Hues.Bright;
            GLabel toAdd   = new GLabel("Network Statistics", uniFont, bright, 0, 0);

            base.m_Children.Add(toAdd);
            toAdd.Center();
            toAdd.Y = 3;
            int y = (toAdd.Y + toAdd.Height) + 3;

            m_Ping = new GLabel("<-> Ping:", uniFont, bright, 3, y);
            base.m_Children.Add(m_Ping);
            y         += m_Ping.Height + 3;
            m_OutSpeed = new GLabel("--> Kbps:", uniFont, bright, 3, y);
            base.m_Children.Add(m_OutSpeed);
            base.m_Children.Add(m_OutTotal = new GLabel("", uniFont, bright, 3, y));
            y        += m_OutSpeed.Height + 3;
            m_InSpeed = new GLabel("<-- Kbps:", uniFont, bright, 3, y);
            base.m_Children.Add(m_InSpeed);
            base.m_Children.Add(m_InTotal = new GLabel("", uniFont, bright, 3, y));
            y += m_InSpeed.Height + 3;
            GPacketStats stats = new GPacketStats {
                Y = y
            };

            base.m_Children.Add(stats);
            y            += stats.Height + 3;
            base.m_Height = y;
        }
Beispiel #2
0
        public override void UpdateGump(Gump g)
        {
            GHtmlLabel label = (GHtmlLabel)g;

            label.Children.Clear();
            label.Update(this.GetText(), Engine.GetUniFont(1), GumpColors.WindowText);
        }
Beispiel #3
0
        private GTextBox AddTextBox(string name, int index, string initialText, char pc)
        {
            GLabel label;
            int    y = 30 + (index * 0x19);

            label = new GLabel(name, Engine.GetUniFont(2), GumpHues.ControlText, 0, 0)
            {
                X = 10 - label.Image.xMin,
                Y = (y + ((0x16 - ((label.Image.yMax - label.Image.yMin) + 1)) / 2)) - label.Image.yMin
            };
            base.m_Children.Add(label);
            GAlphaBackground toAdd = new GAlphaBackground(60, y, 200, 0x16)
            {
                ShouldHitTest = false,
                FillColor     = GumpColors.Window,
                FillAlpha     = 1f
            };

            base.m_Children.Add(toAdd);
            IHue     windowText = GumpHues.WindowText;
            GTextBox box        = new GTextBox(0, false, 60, y, 200, 0x16, initialText, Engine.GetUniFont(2), windowText, windowText, windowText, pc);

            base.Client.Children.Add(box);
            return(box);
        }
Beispiel #4
0
        public GSkillGump(Skill skill, int y, int width, bool showReal) : base(4, y)
        {
            this.m_yBase = y;
            this.m_Skill = skill;
            if (skill.Action)
            {
                this.m_Name = new GUsableSkillName(skill);
            }
            else
            {
                this.m_Name = new GLabel(skill.Name, Engine.GetUniFont(1), Hues.Bright, 20, 0);
            }
            this.m_Name.X -= this.m_Name.Image.xMin;
            this.m_Name.Y -= this.m_Name.Image.yMin;
            this.m_Width   = width;
            this.m_Height  = this.m_Name.Image.yMax - this.m_Name.Image.yMin;
            base.m_Children.Add(this.m_Name);
            float num = showReal ? this.m_Skill.Real : this.m_Skill.Value;

            this.m_Value    = new GLabel(num.ToString("F1"), Engine.GetUniFont(1), Hues.Bright, 0, 0);
            this.m_Value.X  = (this.m_Width - 0x18) - this.m_Value.Image.xMax;
            this.m_Value.Y -= this.m_Value.Image.yMin;
            if ((this.m_Value.Image.yMax - this.m_Value.Image.yMin) > this.m_Height)
            {
                this.m_Height = this.m_Value.Image.yMax - this.m_Value.Image.yMin;
            }
            base.m_Children.Add(this.m_Value);
            this.m_Lock = new GThreeToggle(Engine.m_SkillUp, Engine.m_SkillDown, Engine.m_SkillLocked, (int)this.m_Skill.Lock, this.m_Width - 4, 0);
            this.m_Lock.OnStateChange = new OnStateChange(this.Lock_OnStateChange);
            this.UpdateLock();
            base.m_Children.Add(this.m_Lock);
        }
Beispiel #5
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 #6
0
 public GSkillIconName(Skill skill) : base(skill.Name, Engine.GetUniFont(0), Hues.Bright, Hues.Load(0x35), 4, 4, null)
 {
     this.m_Skill     = skill;
     base.m_CanDrag   = true;
     base.m_QuickDrag = false;
     this.X          -= base.Image.xMin;
     this.Y          -= base.Image.yMin;
     base.m_Tooltip   = new SkillTooltip(skill);
 }
Beispiel #7
0
 public GWindowsButton(string text, int x, int y, int width, int height) : base(x, y)
 {
     this.m_ImageColor   = -1;
     this.m_Width        = width;
     this.m_Height       = height;
     this.m_Enabled      = true;
     this.m_CaptionLabel = new GLabel(text, Engine.GetUniFont(2), GumpHues.ControlText, 5, 5);
     base.m_Children.Add(this.m_CaptionLabel);
     this.m_CaptionLabel.Center();
 }
Beispiel #8
0
        public GFlatButton(int X, int Y, int Width, int Height, string Text, OnClick OnClick) : base(X, Y, Width, Height)
        {
            this.m_OnClick = OnClick;
            base.m_CanDrag = false;
            GTextButton toAdd = new GTextButton(Text, Engine.GetUniFont(0), Hues.Default, Hues.Load(0x35), 0, 0, new OnClick(this.Route_OnClick));

            base.m_Children.Add(toAdd);
            toAdd.Center();
            base.m_Children.Add(new GHotspot(0, 0, Width, Height, toAdd));
        }
Beispiel #9
0
 public GPartyHealthBar(Mobile m, int x, int y) : base(x, y)
 {
     base.m_CanDrag   = true;
     base.m_QuickDrag = true;
     base.m_CanDrop   = true;
     this.m_Mobile    = m;
     this.m_Name      = new GLabel("", Engine.GetUniFont(0), m.Visible ? Hues.GetNotoriety(m.Notoriety) : Hues.Grayscale, 4, 4);
     this.SetName(m.Name);
     base.m_Children.Add(this.m_Name);
 }
Beispiel #10
0
        public GBuyGump_OfferedItem(GBuyGump owner, BuyInfo bi) : base(0x20, 0x43, 0xc4, 0)
        {
            this.m_OfferMenu = owner.OfferMenu;
            IFont uniFont = Engine.GetUniFont(3);
            IHue  hue     = Hues.Load(0x288);

            this.m_xAmount     = bi.ToBuy;
            this.m_Amount      = new GLabel(bi.ToBuy.ToString(), uniFont, hue, 0, 0);
            this.m_Description = new GWrappedLabel(string.Format("{0} at {1} gp", bi.Name, bi.Price), uniFont, hue, 0x29, 0, 0x69);
            this.m_More        = new GBuyGump_AmountButton(owner, bi, 5, 0x37, 0x9b);
            this.m_Less        = new GBuyGump_AmountButton(owner, bi, -5, 0x38, 0xad);
            int height = (this.m_Amount.Image.yMax - this.m_Amount.Image.yMin) + 1;

            base.m_Height = height;
            height        = (this.m_Description.Image.yMax - this.m_Description.Image.yMin) + 1;
            if (height > base.m_Height)
            {
                base.m_Height = height;
            }
            height = this.m_More.Height;
            if (height > base.m_Height)
            {
                base.m_Height = height;
            }
            height = this.m_Less.Height;
            if (height > base.m_Height)
            {
                base.m_Height = height;
            }
            this.m_Amount.X      -= this.m_Amount.Image.xMin;
            this.m_Amount.Y       = (base.m_Height - ((this.m_Amount.Image.yMax - this.m_Amount.Image.yMin) + 1)) / 2;
            this.m_Description.X -= this.m_Description.Image.xMin;
            this.m_Description.Y  = (base.m_Height - ((this.m_Description.Image.yMax - this.m_Description.Image.yMin) + 1)) / 2;
            if (this.m_Amount.Y > this.m_Description.Y)
            {
                this.m_Amount.Y = this.m_Description.Y;
            }
            this.m_Amount.Y      -= this.m_Amount.Image.yMin;
            this.m_Description.Y -= this.m_Description.Image.yMin;
            this.m_More.Y         = (base.m_Height - this.m_More.Height) / 2;
            this.m_Less.Y         = (base.m_Height - this.m_Less.Height) / 2;
            base.m_Children.Add(this.m_Amount);
            base.m_Children.Add(this.m_Description);
            base.m_Children.Add(this.m_More);
            base.m_Children.Add(this.m_Less);
            this.Clipper = this.m_OfferMenu.ContentClipper;
            if (Engine.Features.AOS)
            {
                base.Tooltip = new ItemTooltip(bi.Item);
            }
        }
Beispiel #11
0
        private GTextBox AddTextBox(string name, int index, char pc)
        {
            GLabel label;
            int    y = (30 + (index * 0x19)) - 0x16;

            label = new GLabel(name, Engine.GetUniFont(2), GumpHues.ControlText, 0, 0)
            {
                X = (10 - label.Image.xMin) - 4,
                Y = (y + ((0x16 - ((label.Image.yMax - label.Image.yMin) + 1)) / 2)) - label.Image.yMin
            };
            base.Client.Children.Add(label);
            IHue            windowText = GumpHues.WindowText;
            GWindowsTextBox toAdd      = new GWindowsTextBox(0x38, y, 200, 0x16, "", Engine.GetUniFont(2), windowText, windowText, windowText, pc);

            base.Client.Children.Add(toAdd);
            return(toAdd.TextBox);
        }
Beispiel #12
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;
        }
Beispiel #13
0
 public GWindowsForm(int x, int y, int width, int height) : base(x, y)
 {
     base.m_CanDrag      = true;
     base.m_QuickDrag    = true;
     this.m_Width        = width;
     this.m_Height       = height;
     this.m_CaptionLabel = new GLabel("Form", Engine.GetUniFont(1), Hues.Default, 7, 3);
     base.m_Children.Add(this.m_CaptionLabel);
     this.m_Client = new GEmpty(0, 0, 0, 0);
     base.m_Children.Add(this.m_Client);
     this.m_CloseButton            = new GWindowsButton("", 0, 0, 0x10, 14);
     this.m_CloseButton.ImageColor = 0;
     this.m_CloseButton.Image      = Engine.m_FormX;
     this.m_CloseButton.Clicked   += new EventHandler(this.CloseButton_Clicked);
     base.m_Children.Add(this.m_CloseButton);
     this.ResizeClient();
 }
Beispiel #14
0
        public GCombatGump() : base(0x2b02, 50, 50)
        {
            AbilityInfo[] abilities = AbilityInfo.Abilities;
            AbilityInfo   active    = AbilityInfo.Active;
            AbilityInfo   primary   = AbilityInfo.Primary;
            AbilityInfo   secondary = AbilityInfo.Secondary;
            IFont         uniFont   = Engine.GetUniFont(1);
            OnClick       onClick   = new OnClick(this.Name_OnClick);
            GLabel        toAdd     = new GLabel("INDEX", Engine.GetFont(6), Hues.Default, 100, 4);

            base.m_Children.Add(toAdd);
            toAdd = new GLabel("INDEX", Engine.GetFont(6), Hues.Default, 0x106, 4);
            base.m_Children.Add(toAdd);
            for (int i = 0; i < abilities.Length; i++)
            {
                AbilityInfo a      = abilities[i];
                IHue        hueFor = GetHueFor(a);
                toAdd       = new GTextButton(Localization.GetString(a.Name), uniFont, hueFor, hueFor, 0x38 + ((i / 9) * 0xa2), 0x26 + ((i % 9) * 15), onClick);
                a.NameLabel = (GTextButton)toAdd;
                toAdd.SetTag("Ability", a);
                toAdd.Tooltip       = new Tooltip(Localization.GetString(a.Tooltip), true, 240);
                toAdd.Tooltip.Delay = 0.25f;
                base.m_Children.Add(toAdd);
            }
            this.m_PrimaryIcon               = new GAbilityIcon(true, true, primary.Icon, 0xda, 0x69);
            this.m_PrimaryIcon.Tooltip       = new Tooltip(Localization.GetString(primary.Name), true);
            this.m_PrimaryIcon.Tooltip.Delay = 0.25f;
            this.m_PrimaryIcon.Hue           = (primary == AbilityInfo.Active) ? Hues.Load(0x8026) : Hues.Default;
            base.m_Children.Add(this.m_PrimaryIcon);
            toAdd = new GLabel("Primary", Engine.GetFont(6), Hues.Default, 0x10c, 0x69);
            base.m_Children.Add(toAdd);
            toAdd = new GLabel("Ability Icon", Engine.GetFont(6), Hues.Default, 0x10c, 0x77);
            base.m_Children.Add(toAdd);
            this.m_SecondaryIcon               = new GAbilityIcon(true, false, secondary.Icon, 0xda, 150);
            this.m_SecondaryIcon.Tooltip       = new Tooltip(Localization.GetString(secondary.Name), true);
            this.m_SecondaryIcon.Tooltip.Delay = 0.25f;
            this.m_SecondaryIcon.Hue           = (secondary == AbilityInfo.Active) ? Hues.Load(0x8026) : Hues.Default;
            base.m_Children.Add(this.m_SecondaryIcon);
            toAdd = new GLabel("Secondary", Engine.GetFont(6), Hues.Default, 0x10c, 150);
            base.m_Children.Add(toAdd);
            toAdd = new GLabel("Ability Icon", Engine.GetFont(6), Hues.Default, 0x10c, 0xa4);
            base.m_Children.Add(toAdd);
        }
Beispiel #15
0
        protected internal override void Draw(int X, int Y)
        {
            base.Draw(X, Y);
            int x     = X + 2;
            int num2  = base.m_Height - 2;
            int count = Engine.m_Journal.Count;
            int num4  = (int)this.m_Scroller.GetValue();

            if (num4 >= count)
            {
                num4 = count - 1;
            }
            UnicodeFont uniFont = Engine.GetUniFont(3);

            for (int i = num4; (i >= 0) && (i < count); i--)
            {
                Texture      image;
                JournalEntry entry = (JournalEntry)Engine.m_Journal[i];
                if (entry.Width != this.m_CropWidth)
                {
                    string str = Engine.WrapText(entry.Text, this.m_CropWidth, uniFont);
                    image       = uniFont.GetString(str, entry.Hue);
                    entry.Width = this.m_CropWidth;
                    entry.Image = image;
                }
                else
                {
                    image = entry.Image;
                }
                if ((image != null) && !image.IsEmpty())
                {
                    num2 -= image.Height;
                    if (num2 < 3)
                    {
                        image.DrawClipped(x, Y + num2, Clipper.TemporaryInstance(X, Y + 1, this.Width, this.Height));
                        break;
                    }
                    m_vCache.Draw(image, x, Y + num2);
                    num2 -= 4;
                }
            }
        }
Beispiel #16
0
 public virtual Gump GetGump()
 {
     if (this.m_Gump == null)
     {
         GWrappedLabel label;
         if ((this.m_Text == null) || (this.m_Text.Length <= 0))
         {
             return((Gump)(this.m_Gump = null));
         }
         this.m_Gump = new GAlphaBackground(0, 0, 100, 100);
         label       = new GWrappedLabel(this.m_Text, Engine.GetUniFont(1), Hues.Load(0x481), 4, 4, this.m_WrapWidth)
         {
             X = label.X - label.Image.xMin,
             Y = label.Y - label.Image.yMin
         };
         this.m_Gump.Width  = (label.Image.xMax - label.Image.xMin) + 9;
         this.m_Gump.Height = (label.Image.yMax - label.Image.yMin) + 9;
         this.m_Gump.Children.Add(label);
     }
     return(this.m_Gump);
 }
Beispiel #17
0
 public GSkills() : base(50, 50, 250, 0x7d)
 {
     base.m_Children.Add(new GVResizer(this));
     base.m_Children.Add(new GHResizer(this));
     base.m_Children.Add(new GLResizer(this));
     base.m_Children.Add(new GTResizer(this));
     base.m_Children.Add(new GHVResizer(this));
     base.m_Children.Add(new GLTResizer(this));
     base.m_Children.Add(new GHTResizer(this));
     base.m_Children.Add(new GLVResizer(this));
     this.m_ShowReal = false;
     this.m_Total    = new GLabel(string.Format("Total: {0:F1}", this.GetTotalSkillCount()), Engine.GetUniFont(1), Hues.Bright, 0, 0);
     base.m_Children.Add(this.m_Total);
     this.m_ValueType   = new GTextButton("Used Values", Engine.GetUniFont(1), Hues.Bright, Hues.Load(0x35), 0, 0, new OnClick(this.ValueType_OnClick));
     this.m_ValueType.X = 4 - this.m_ValueType.Image.xMin;
     base.m_Children.Add(this.m_ValueType);
     this.m_SkillList = new GSkillList(this);
     base.m_Children.Add(this.m_SkillList);
     this.Width  = 250;
     this.Height = 0x7d;
 }
Beispiel #18
0
        private GContextMenu(object owner, PopupEntry[] list) : base(100, 100)
        {
            this.m_VertexPool = VertexConstructor.Create();
            this.m_Owner      = owner;
            base.m_GUID       = "MobilePopup";
            int     num      = 0;
            int     num2     = 0;
            int     length   = list.Length;
            IFont   uniFont  = Engine.GetUniFont(3);
            IHue    bright   = Hues.Bright;
            IHue    focusHue = Hues.Load(0x35);
            IHue    hue      = Hues.Default;
            OnClick onClick  = new OnClick(this.Entry_OnClick);

            for (int i = 0; i < length; i++)
            {
                PopupEntry entry = list[i];
                GLabel     toAdd = null;
                if (entry.Flags == 1)
                {
                    toAdd = new GLabel(entry.Text, uniFont, hue, 7, 7 + num2);
                }
                else
                {
                    toAdd = new GTextButton(entry.Text, uniFont, bright, focusHue, 7, 7 + num2, onClick);
                    toAdd.SetTag("EntryID", entry.EntryID);
                }
                toAdd.X -= toAdd.Image.xMin;
                toAdd.Y -= toAdd.Image.yMin;
                num2    += (toAdd.Image.yMax - toAdd.Image.yMin) + 4;
                if (((toAdd.Image.xMax - toAdd.Image.xMin) + 1) > num)
                {
                    num = (toAdd.Image.xMax - toAdd.Image.xMin) + 1;
                }
                base.m_Children.Add(toAdd);
            }
            num2         -= 3;
            this.m_Width  = num + 14;
            this.m_Height = num2 + 14;
        }
Beispiel #19
0
        public GBuyGump(int serial, BuyInfo[] info) : base(0x870, 15, 15)
        {
            base.m_GUID   = string.Format("GBuyGump-{0}", serial);
            this.m_Serial = serial;
            this.m_Info   = info;
            UnicodeFont uniFont = Engine.GetUniFont(3);
            IHue        hue     = Hues.Load(0x288);

            Array.Sort(info);
            int y = 0x42;

            for (int i = 0; i < info.Length; i++)
            {
                bool    seperate             = i != (info.Length - 1);
                BuyInfo si                   = info[i];
                GBuyGump_InventoryItem toAdd = new GBuyGump_InventoryItem(this, si, y, seperate);
                base.m_Children.Add(toAdd);
                si.InventoryGump = toAdd;
                y += toAdd.Height;
                if (seperate)
                {
                    y += 0x10;
                }
            }
            if (y > 230)
            {
                GVSlider slider = new GVSlider(0x828, 0xed, 0x51, 0x22, 0x5c, 0.0, 0.0, (double)(y - 230), 1.0)
                {
                    OnValueChange = new OnValueChange(this.Slider_OnValueChange)
                };
                base.m_Children.Add(slider);
                base.m_Children.Add(new GHotspot(0xed, 0x42, 0x22, 0x7a, slider));
            }
            base.m_NonRestrictivePicking = true;
            this.m_OfferMenu             = new GBuyGump_OfferMenu(this);
            base.m_Children.Add(this.m_OfferMenu);
            base.m_X = (Engine.ScreenWidth - (this.m_OfferMenu.X + this.m_OfferMenu.Width)) / 2;
            base.m_Y = (Engine.ScreenHeight - (this.m_OfferMenu.Y + this.m_OfferMenu.Height)) / 2;
        }
Beispiel #20
0
        public GSkillList(GSkills owner) : base(4, 4, 250, 50)
        {
            this.m_Owner   = owner;
            base.m_CanDrag = false;
            Skills skills = Engine.Skills;

            this.m_SkillGumps = new GSkillGump[0x100];
            int y = 4;

            for (int i = 0; i < skills.Groups.Length; i++)
            {
                GLabel     label;
                SkillGroup group = skills.Groups[i];
                label = new GLabel(group.Name, Engine.GetUniFont(1), Hues.Bright, 4, y)
                {
                    X = label.X - label.Image.xMin,
                    Y = label.Y - label.Image.yMin
                };
                label.SetTag("yBase", label.Y);
                base.m_Children.Add(label);
                y += 4 + (label.Image.yMax - label.Image.yMin);
                for (int j = 0; j < group.Skills.Count; j++)
                {
                    Skill      skill = (Skill)group.Skills[j];
                    GSkillGump toAdd = new GSkillGump(skill, y, base.m_Width - 20, this.m_Owner.ShowReal);
                    this.m_SkillGumps[skill.ID] = toAdd;
                    base.m_Children.Add(toAdd);
                    y += 4 + toAdd.Height;
                }
            }
            this.m_SliderBorder = new GSingleBorder(0, 0, 0x10, 100);
            base.m_Children.Add(this.m_SliderBorder);
            this.m_Slider = new GAlphaVSlider(0, 6, 0x10, 100, 0.0, 0.0, (double)(y + 1), 1.0);
            this.m_Slider.SetTag("Max", y + 1);
            this.m_Slider.OnValueChange = (OnValueChange)Delegate.Combine(this.m_Slider.OnValueChange, new OnValueChange(this.Slider_OnValueChange));
            base.m_Children.Add(this.m_Slider);
            this.m_Hotspot = new GHotspot(0, 0, 0x10, 100, this.m_Slider);
            base.m_Children.Add(this.m_Hotspot);
        }
Beispiel #21
0
        public GPacketStats() : base(3, 3, 0xc2, 0xc2)
        {
            this.m_xLast = -12345;
            this.m_yLast = -12345;
            m_Labels     = new GLabel[0x100];
            m_Values     = new GLabel[0x100];
            IFont uniFont = Engine.GetUniFont(1);
            IHue  bright  = Hues.Bright;
            int   y       = 3;

            for (int i = 0; i < 0x100; i++)
            {
                if (PacketHandlers.m_Handlers[i] != null)
                {
                    PacketHandler handler = PacketHandlers.m_Handlers[i];
                    m_Labels[i] = new GLabel(handler.Name, uniFont, bright, 3, y);
                    m_Labels[i].SetTag("BaseY", y);
                    base.m_Children.Add(m_Labels[i]);
                    m_Values[i] = new GLabel(handler.Count.ToString(), uniFont, bright, 3, y);
                    m_Values[i].SetTag("BaseY", y);
                    m_Values[i].X = 0xaf - m_Values[i].Width;
                    base.m_Children.Add(m_Values[i]);
                    y += m_Labels[i].Height + 3;
                }
            }
            this.m_Slider = new GAlphaVSlider(0xb3, 6, 0x10, 0xb7, 0.0, 0.0, (double)(y - 0xc0), 1.0);
            this.m_Slider.OnValueChange = (OnValueChange)Delegate.Combine(this.m_Slider.OnValueChange, new OnValueChange(this.Slider_OnValueChange));
            this.m_Slider.ScrollOffset  = 15.0;
            base.m_Children.Add(this.m_Slider);
            GHotspot toAdd = new GHotspot(0xb2, 1, 0x10, 0xc0, this.m_Slider)
            {
                NormalHit = false
            };

            base.m_Children.Add(toAdd);
            this.m_Event           = new OnPacketHandle(this.OnRecv);
            Network.OnPacketHandle = (OnPacketHandle)Delegate.Combine(Network.OnPacketHandle, this.m_Event);
        }
Beispiel #22
0
        public void SetValue(object val)
        {
            IFont uniFont;

            this.m_Entry.Property.SetValue(this.m_Object, val, null);
            if ((val is ValueType) ? val.Equals(this.m_Entry.Optionable.Default) : object.ReferenceEquals(val, this.m_Entry.Optionable.Default))
            {
                uniFont = Engine.GetUniFont(2);
            }
            else
            {
                uniFont = Engine.GetUniFont(1);
            }
            if (this.m_Hue == null)
            {
                this.m_Value.Text = this.GetValString(val);
            }
            else
            {
                this.m_Hue.FillColor = Engine.C16232(Hues.Load((int)val).Pixel(0xffff));
            }
            this.m_Value.Font = uniFont;
        }
Beispiel #23
0
        private void Place(int x, int y, string text, IHue hue)
        {
            int num;
            int num2;
            int num3;
            int num4;

            this.GetCellDetails(x, y, out num, out num2, out num3, out num4);
            GLabel toAdd = new GLabel(text, Engine.GetUniFont(((x > 0) && (y > 0)) ? 2 : 1), hue, num + (num3 / 2), num2 + (num4 / 2));

            if ((x == 0) || (this.m_ColWidth == 8))
            {
                toAdd.X -= ((toAdd.Image.xMax - toAdd.Image.xMin) + 1) / 2;
            }
            else
            {
                toAdd.X -= (num3 / 2) - 5;
            }
            toAdd.X -= toAdd.Image.xMin;
            toAdd.Y -= (toAdd.Image.yMax - toAdd.Image.yMin) / 2;
            toAdd.Y -= toAdd.Image.yMin;
            base.m_Children.Add(toAdd);
        }
Beispiel #24
0
        public GCategoryPanel(object obj, string category, ArrayList entries) : base(0, 0, 0x117, 0x16)
        {
            base.FillColor               = GumpColors.Control;
            base.BorderColor             = GumpColors.ControlDarkDark;
            base.FillAlpha               = 1f;
            base.ShouldHitTest           = false;
            base.m_NonRestrictivePicking = true;
            this.m_Label   = new GLabel(category, Engine.GetUniFont(1), GumpHues.ControlText, 0, 0);
            this.m_Label.X = 5 - this.m_Label.Image.xMin;
            this.m_Label.Y = ((0x16 - ((this.m_Label.Image.yMax - this.m_Label.Image.yMin) + 1)) / 2) - this.m_Label.Image.yMin;
            base.m_Children.Add(this.m_Label);
            entries.Sort();
            this.m_Entries = new GPropertyEntry[entries.Count];
            int num = 0x15;

            for (int i = 0; i < entries.Count; i++)
            {
                this.m_Entries[i]   = new GPropertyEntry(obj, (ObjectEditorEntry)entries[i]);
                this.m_Entries[i].Y = num;
                num += 0x15;
                base.m_Children.Add(this.m_Entries[i]);
            }
            this.Height = num + 1;
        }
Beispiel #25
0
        public override Gump CreateGump()
        {
            GEmpty empty = new GEmpty(0, 0, 140, 0x18);
            GLabel toAdd = new GLabel(base.Name + ":", Engine.GetUniFont(2), GumpHues.ControlText, 0, 0);

            empty.Children.Add(toAdd);
            toAdd.Center();
            toAdd.X = 0x41 - toAdd.Image.xMax;
            GAlphaBackground background = new GAlphaBackground(70, 0, 60, 0x18)
            {
                FillAlpha     = 1f,
                FillColor     = GumpColors.Window,
                ShouldHitTest = false
            };

            empty.Children.Add(background);
            GTextBox box = new GTextBox(0, false, 70, 0, 60, 0x18, "0", Engine.GetUniFont(2), GumpHues.WindowText, GumpHues.WindowText, GumpHues.WindowText)
            {
                OnTextChange = new Client.OnTextChange(this.OnTextChange)
            };

            empty.Children.Add(box);
            return(empty);
        }
Beispiel #26
0
 public GUsableSkillName(Skill skill) : base(skill.Name, Engine.GetUniFont(1), Hues.Bright, Hues.Load(0x35), 20, 0, null)
 {
     this.m_Skill     = skill;
     base.m_CanDrag   = true;
     base.m_QuickDrag = false;
 }
Beispiel #27
0
        public GQuickLogin() : base(0, 0, 200, 20)
        {
            this.m_CompactHeight  = 20;
            this.m_ExpandedHeight = Engine.GameHeight / 2;
            base.m_CanDrag        = false;
            this.m_Timer          = new Timer(new OnTick(this.Roll_OnTick), 0);
            GLabel toAdd = new GLabel("Quick Login", Engine.GetUniFont(0), Hues.Default, 2, 2);

            this.Height          = toAdd.Height + 4;
            this.m_CompactHeight = base.m_Height;
            base.m_Children.Add(toAdd);
            toAdd.Center();
            QuickLogin.Load();
            int count = QuickLogin.Entries.Count;

            if (count == 0)
            {
                base.Visible = false;
            }
            else
            {
                if (count > 12)
                {
                    count = 12;
                }
                int num2 = (2 + toAdd.Height) + 4;
                if (count == 0)
                {
                    num2 -= 2;
                }
                OnClick onClick = new OnClick(Engine.QuickLogin_OnClick);
                Clipper clipper = new Clipper(base.m_X + 1, base.m_Y + 1, base.m_Width - 2, base.m_Height - 2);
                for (int i = 0; i < count; i++)
                {
                    Entry       entry  = (Entry)QuickLogin.Entries[i];
                    GTextButton button = new GTextButton(entry.CharName, Engine.GetUniFont(0), Hues.Load(0x58), Hues.Load(0x35), 2, 2, onClick);
                    base.m_Children.Add(button);
                    button.Center();
                    button.Y = num2;
                    button.Scissor(clipper);
                    button.SetTag("Index", i);
                    num2 += button.Height;
                    int  num4 = 0;
                    bool flag = false;
                    for (int j = 0; j < count; j++)
                    {
                        Entry entry2 = (Entry)QuickLogin.Entries[j];
                        if (entry2.CharName == entry.CharName)
                        {
                            if (j <= i)
                            {
                                num4++;
                            }
                            if (j != i)
                            {
                                flag = true;
                            }
                        }
                    }
                    if (flag)
                    {
                        button.Tooltip = new Tooltip(string.Format("{0}\n{1}", num4, entry.ServerName));
                    }
                    else
                    {
                        button.Tooltip = new Tooltip(entry.ServerName);
                    }
                }
                if (count != 0)
                {
                    num2 += 2;
                }
                if (num2 > 480)
                {
                    num2 = 480;
                }
                this.m_ExpandedHeight = num2;
            }
        }
Beispiel #28
0
        public GSellGump_InventoryItem(GSellGump owner, SellInfo si, int y, bool seperate) : base(0x20, y, 0xc3, 0)
        {
            this.m_Owner = owner;
            this.m_yBase = y;
            this.m_Info  = si;
            IFont uniFont = Engine.GetUniFont(3);
            IHue  hue     = Hues.Load(0x288);

            this.m_Image       = new GItemArt(0, 0, si.ItemID, si.Hue);
            this.m_Description = new GWrappedLabel(string.Format("{0} at {1} gp", si.Name, si.Price), uniFont, hue, 0x3a, 0, 0x69);
            this.m_Available   = new GLabel(si.Amount.ToString(), uniFont, hue, 0xc3, 0);
            int num = (this.m_Image.Image.yMax - this.m_Image.Image.yMin) + 1;

            base.m_Height = num;
            num           = (this.m_Description.Image.yMax - this.m_Description.Image.yMin) + 1;
            if (num > base.m_Height)
            {
                base.m_Height = num;
            }
            num = (this.m_Available.Image.yMax - this.m_Available.Image.yMin) + 1;
            if (num > base.m_Height)
            {
                base.m_Height = num;
            }
            this.m_Image.X       += (0x38 - ((this.m_Image.Image.xMax - this.m_Image.Image.xMin) + 1)) / 2;
            this.m_Image.Y       += (base.m_Height - ((this.m_Image.Image.yMax - this.m_Image.Image.yMin) + 1)) / 2;
            this.m_Image.X       -= this.m_Image.Image.xMin;
            this.m_Image.Y       -= this.m_Image.Image.yMin;
            this.m_Description.X -= this.m_Description.Image.xMin;
            this.m_Description.Y += (base.m_Height - ((this.m_Description.Image.yMax - this.m_Description.Image.yMin) + 1)) / 2;
            this.m_Description.Y -= this.m_Description.Image.yMin;
            this.m_Available.X   -= this.m_Available.Image.xMax + 1;
            this.m_Available.Y   += (base.m_Height - ((this.m_Available.Image.yMax - this.m_Available.Image.yMin) + 1)) / 2;
            this.m_Available.Y   -= this.m_Available.Image.yMin;
            base.m_Children.Add(this.m_Image);
            base.m_Children.Add(this.m_Description);
            base.m_Children.Add(this.m_Available);
            this.m_xAvailable = si.Amount;
            if (seperate)
            {
                GImage image;
                this.m_Separator    = new GImage[11];
                this.m_Separator[0] = image = new GImage(0x39, 0, base.m_Height);
                base.m_Children.Add(image);
                for (int i = 0; i < 9; i++)
                {
                    this.m_Separator[i + 1] = image = new GImage(0x3a, 30 + (i * 0x10), base.m_Height);
                    base.m_Children.Add(image);
                }
                this.m_Separator[10] = image = new GImage(0x3b, 0xa5, base.m_Height);
                base.m_Children.Add(image);
            }
            else
            {
                this.m_Separator = new GImage[0];
            }
            if (Engine.Features.AOS)
            {
                base.Tooltip = new ItemTooltip(si.Item);
            }
        }
Beispiel #29
0
        private void ProcessHtmlGump(int thisPage, int x, int y, int width, int height, string text, bool hasBack, bool hasScroll, int color)
        {
            UnicodeFont uniFont = Engine.GetUniFont(1);

            if (!hasScroll)
            {
                if (hasBack)
                {
                    GServerBackground toAdd = new GServerBackground(this, x, y, width, height, 0xbbc, true);
                    GHtmlLabel        label = new GHtmlLabel(text, uniFont, color, toAdd.OffsetX - 2, toAdd.OffsetY - 1, toAdd.UseWidth);
                    label.Scissor(0, 0, label.Width, toAdd.UseHeight);
                    toAdd.Children.Add(label);
                    this.Pages(thisPage).Add(toAdd);
                }
                else
                {
                    GHtmlLabel label2 = new GHtmlLabel(text, uniFont, color, x - 2, y - 1, width);
                    label2.Scissor(0, 0, label2.Width, height);
                    this.Pages(thisPage).Add(label2);
                }
            }
            else
            {
                GHtmlLabel label3;
                int        num;
                width -= 15;
                if (hasBack)
                {
                    GServerBackground background2 = new GServerBackground(this, x, y, width, height, 0xbbc, true);
                    label3 = new GHtmlLabel(text, uniFont, color, background2.OffsetX - 2, background2.OffsetY - 1, background2.UseWidth);
                    label3.Scissor(0, 0, label3.Width, num = background2.UseHeight);
                    background2.Children.Add(label3);
                    this.Pages(thisPage).Add(background2);
                }
                else
                {
                    label3 = new GHtmlLabel(text, uniFont, color, x - 2, y - 1, width);
                    label3.Scissor(0, 0, label3.Width, num = height);
                    this.Pages(thisPage).Add(label3);
                }
                if ((height >= 0x1b) && (label3.Height > num))
                {
                    this.Pages(thisPage).Add(new GImage(0x101, x + width, y));
                    this.Pages(thisPage).Add(new GImage(0xff, x + width, (y + height) - 0x20));
                    for (int i = y + 30; (i + 0x20) < (y + height); i += 30)
                    {
                        this.Pages(thisPage).Add(new GImage(0x100, x + width, i));
                    }
                    GVSlider slider = new GVSlider(0xfe, (x + width) + 1, (y + 1) + 12, 13, (height - 2) - 0x18, 0.0, 0.0, (double)(label3.Height - num), 1.0);
                    slider.SetTag("yBase", label3.Y);
                    slider.SetTag("toScroll", label3);
                    slider.SetTag("viewHeight", num);
                    slider.OnValueChange = new OnValueChange(this.OnScroll);
                    this.Pages(thisPage).Add(slider);
                    this.Pages(thisPage).Add(new GHotspot(x + width, y, 15, height, slider));
                }
                else
                {
                    this.Pages(thisPage).Add(new GImage(0x101, x + width, y));
                    this.Pages(thisPage).Add(new GImage(0xff, x + width, (y + height) - 0x20));
                    for (int j = y + 30; (j + 0x20) < (y + height); j += 30)
                    {
                        this.Pages(thisPage).Add(new GImage(0x100, x + width, j));
                    }
                    this.Pages(thisPage).Add(new GImage(0xfe, Hues.Grayscale, (x + width) + 1, y + 1));
                }
            }
        }
Beispiel #30
0
 public override Gump CreateGump()
 {
     return(new GHtmlLabel(this.GetText(), Engine.GetUniFont(1), GumpColors.WindowText, 0, 0, 380));
 }