public GSellGump_OfferMenu(GSellGump owner)
            : base(2163, 170, 214)
        {
            this.m_Owner = owner;
            Mobile player = World.Player;
            string name;
            string Text;

            if (player != null && (name = player.Name) != null && (Text = name.Trim()).Length > 0)
            {
                this.m_Signature         = new GLabel(Text, (IFont)Engine.GetFont(5), Hues.Load(1109), 72, 194);
                this.m_Signature.Visible = false;
                this.m_Children.Add((Gump)this.m_Signature);
            }
            this.m_Total  = new GLabel("0", (IFont)Engine.GetFont(6), Hues.Default, 188, 167);
            this.m_Accept = new GSellAccept(owner);
            this.m_Clear  = new GSellClear(owner);
            this.m_Children.Add((Gump)this.m_Total);
            this.m_Children.Add((Gump)this.m_Accept);
            this.m_Children.Add((Gump)this.m_Clear);
            this.m_CanDrag   = true;
            this.m_QuickDrag = true;
            GVSlider gvSlider = new GVSlider(2088, 237, 81, 34, 58, 0.0, 0.0, 50.0, 1.0);

            this.m_Slider = gvSlider;
            this.m_Children.Add((Gump)gvSlider);
            this.m_Children.Add((Gump) new GHotspot(237, 66, 34, 84, (Gump)gvSlider));
        }
示例#2
0
        private void UpdateLabel(bool forceUpdate, IHue hue)
        {
            string str = this.m_String;

            if ((int)this.m_PassChar != 0)
            {
                str = new string(this.m_PassChar, str.Length);
            }
            if (this.m_Focus && this.ShowCaret)
            {
                str += "_";
            }
            if (this.m_Text != null && !forceUpdate)
            {
                this.m_Text.Text = str;
                this.m_Text.Hue  = hue;
            }
            else
            {
                if (this.m_Text != null)
                {
                    Gumps.Destroy((Gump)this.m_Text);
                }
                if (this.m_MaxChars >= 0)
                {
                    this.m_Text = (GLabel) new GWrappedLabel(str, this.m_Font, this.m_HNormal, 0, 0, this.m_Width);
                    this.m_Text.Scissor(0, 0, this.m_Width, this.m_Height);
                }
                else
                {
                    this.m_Text = new GLabel(str, this.m_Font, this.m_HNormal, 0, 0);
                }
            }
        }
示例#3
0
        public void UpdateColors()
        {
            switch (this.m_State)
            {
            case GSystemButton.ButtonState.Inactive:
                this.FillColor = this.m_InactiveColor.ToArgb() & 16777215;
                break;

            case GSystemButton.ButtonState.Active:
                this.FillColor = this.m_ActiveColor.ToArgb() & 16777215;
                break;

            case GSystemButton.ButtonState.Pressed:
                this.FillColor = this.m_PressedColor.ToArgb() & 16777215;
                break;
            }
            GLabel glabel = (GLabel)null;

            if (this.m_Children.Count > 0)
            {
                glabel = this.m_Children[0] as GLabel;
            }
            if (glabel == null)
            {
                return;
            }
            glabel.Hue = (IHue) new Hues.ColorFillHue(this.m_ForeColor.ToArgb() & 16777215);
        }
示例#4
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;
        }
示例#5
0
        public GItemList(int serial, int menuID, string question, AnswerEntry[] answers)
            : base(2320, 25, 25)
        {
            this.m_Serial     = serial;
            this.m_MenuID     = menuID;
            this.m_EntryLabel = new GLabel("", (IFont)Engine.GetFont(1), Hues.Load(1887), 39, 106);
            this.m_Children.Add((Gump)this.m_EntryLabel);
            GLabel glabel = new GLabel(question, (IFont)Engine.GetFont(1), Hues.Load(1887), 39, 19);

            glabel.Scissor(0, 0, 218, 11);
            this.m_Children.Add((Gump)glabel);
            int x = 37;

            for (int index = 0; index < answers.Length; ++index)
            {
                GItemListEntry gitemListEntry = new GItemListEntry(x, answers[index], this);
                this.m_Children.Add((Gump)gitemListEntry);
                x += gitemListEntry.Width;
            }
            int num = x - 37;

            if (num < 222)
            {
                return;
            }
            this.m_xOffsetCap = (double)-(num - 222);
            this.m_Left       = (GHitspot) new GItemListScroller(23, this, 150);
            this.m_Right      = (GHitspot) new GItemListScroller(261, this, -150);
            this.m_Children.Add((Gump)this.m_Left);
            this.m_Children.Add((Gump)this.m_Right);
        }
示例#6
0
        public GSellGump_InventoryItem(GSellGump owner, SellInfo si, int y, bool seperate)
            : base(32, y, 195, 0)
        {
            this.m_Owner = owner;
            this.m_yBase = y;
            this.m_Info  = si;
            IFont font = (IFont)Engine.GetUniFont(3);
            IHue  hue  = Hues.Load(648);

            this.m_Image       = new GItemArt(0, 0, si.ItemID, si.Hue);
            this.m_Description = (GLabel) new GWrappedLabel(string.Format("{0} at {1} gp", (object)si.Name, (object)si.Price), font, hue, 58, 0, 105);
            this.m_Available   = new GLabel(si.Amount.ToString(), font, hue, 195, 0);
            this.m_Height      = this.m_Image.Image.yMax - this.m_Image.Image.yMin + 1;
            int num1 = this.m_Description.Image.yMax - this.m_Description.Image.yMin + 1;

            if (num1 > this.m_Height)
            {
                this.m_Height = num1;
            }
            int num2 = this.m_Available.Image.yMax - this.m_Available.Image.yMin + 1;

            if (num2 > this.m_Height)
            {
                this.m_Height = num2;
            }
            this.m_Image.X       += (56 - (this.m_Image.Image.xMax - this.m_Image.Image.xMin + 1)) / 2;
            this.m_Image.Y       += (this.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 += (this.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   += (this.m_Height - (this.m_Available.Image.yMax - this.m_Available.Image.yMin + 1)) / 2;
            this.m_Available.Y   -= this.m_Available.Image.yMin;
            this.m_Children.Add((Gump)this.m_Image);
            this.m_Children.Add((Gump)this.m_Description);
            this.m_Children.Add((Gump)this.m_Available);
            this.m_xAvailable = si.Amount;
            if (seperate)
            {
                this.m_Separator = new GImage[11];
                this.m_Children.Add((Gump)(this.m_Separator[0] = new GImage(57, 0, this.m_Height)));
                for (int index = 0; index < 9; ++index)
                {
                    this.m_Children.Add((Gump)(this.m_Separator[index + 1] = new GImage(58, 30 + index * 16, this.m_Height)));
                }
                this.m_Children.Add((Gump)(this.m_Separator[10] = new GImage(59, 165, this.m_Height)));
            }
            else
            {
                this.m_Separator = new GImage[0];
            }
            if (!Engine.ServerFeatures.AOS)
            {
                return;
            }
            this.Tooltip = (ITooltip) new ItemTooltip(si.Item);
        }
示例#7
0
 public GWindowsButton(string text, int x, int y, int width, int height)
     : base(x, y)
 {
     this.m_Width        = width;
     this.m_Height       = height;
     this.m_Enabled      = true;
     this.m_CaptionLabel = new GLabel(text, (IFont)Engine.GetUniFont(2), GumpHues.ControlText, 5, 5);
     this.m_Children.Add((Gump)this.m_CaptionLabel);
     this.m_CaptionLabel.Center();
 }
示例#8
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);
        }
示例#9
0
 public GPartyHealthBar(Mobile m, int x, int y)
     : base(x, y)
 {
     this.m_CanDrag   = true;
     this.m_QuickDrag = true;
     this.m_CanDrop   = true;
     this.m_Mobile    = m;
     this.m_Name      = new GLabel("", (IFont)Engine.GetUniFont(0), m.Visible ? Hues.GetNotoriety(m.Notoriety) : Hues.Grayscale, 4, 4);
     this.SetName(m.Name);
     this.m_Children.Add((Gump)this.m_Name);
 }
示例#10
0
        public GSkillIcon(Skill skill)
            : base(0, 0, 100, 20)
        {
            this.m_Skill = skill;
            GLabel glabel = (GLabel) new GSkillIcon.GSkillIconName(skill);

            this.m_Width  = glabel.Image.xMax - glabel.Image.xMin + 9;
            this.m_Height = glabel.Image.yMax - glabel.Image.yMin + 9;
            this.m_Children.Add((Gump)glabel);
            this.m_DragClipX = this.m_Width - 1;
            this.m_DragClipY = this.m_Height - 1;
        }
示例#11
0
 public GPaperdoll(Mobile m, int ID, int X, int Y, bool allowItemLift)
     : base(m.Player ? 2000 : 2001, X, Y)
 {
     this.m_Mobile       = m;
     this.m_CanDrop      = true;
     this._allowItemLift = allowItemLift;
     this._bodyImages    = new List <GImage>();
     this.Children.Add((Gump) new GVirtueTrigger(m));
     this.Children.Add((Gump) new GProfileScroll(m));
     this.Children.Add((Gump)(this._titleLabel = (GLabel) new GWrappedLabel("", (IFont)Engine.GetFont(1), Hues.Load(1897), 39, 264, 184)));
     this.OnAgentUpdated();
 }
示例#12
0
 public GItemCounter(ItemIDValidator v)
     : base(0, 0, 100, 20)
 {
     this.m_Validator = (IItemValidator)v;
     this.m_Image     = new GItemArt(3, 3, v.List[0]);
     this.m_Label     = new GLabel("", Engine.DefaultFont, Hues.Bright, 0, 0);
     this.m_Image.X  -= this.m_Image.Image.xMin;
     this.m_Image.Y  -= this.m_Image.Image.yMin;
     this.m_Children.Add((Gump)this.m_Image);
     this.m_Children.Add((Gump)this.m_Label);
     this.m_LastAmount = int.MinValue;
 }
示例#13
0
        public void SetHue(IHue hue)
        {
            GLabel glabel = (GLabel)null;

            if (this.m_Children.Count > 0)
            {
                glabel = this.m_Children[0] as GLabel;
            }
            if (glabel == null)
            {
                return;
            }
            glabel.Hue = hue;
        }
示例#14
0
        public GSystemButton(int x, int y, int width, int height, Color backColor, Color foreColor, string text, IFont font)
            : base(x, y, width, height)
        {
            this.m_InactiveColor = backColor;
            this.m_ActiveColor   = ControlPaint.Dark(backColor, -this.Darkness);
            this.m_PressedColor  = ControlPaint.Light(backColor);
            this.m_ForeColor     = foreColor;
            this.m_CanDrag       = false;
            GLabel glabel = new GLabel(text, font, Hues.Default, 0, 0);

            this.m_Children.Add((Gump)glabel);
            glabel.Center();
            this.FillAlpha = 1f;
            this.UpdateColors();
        }
示例#15
0
        public GMenuItem(string text)
            : base(0, 50, 120, 24)
        {
            this.m_Text          = text;
            this.m_DefaultColor  = Color.FromArgb(192, 192, 192);
            this.m_OverColor     = Color.FromArgb(32, 64, 128);
            this.m_ExpandedColor = Color.FromArgb(32, 64, 128);
            this.FillAlpha       = 0.25f;
            this.m_CanDrag       = false;
            GLabel glabel = new GLabel(text, Engine.DefaultFont, Hues.Load(1153), 0, 0);

            this.m_Children.Add((Gump)glabel);
            glabel.Center();
            glabel.X = 4 - glabel.Image.xMin;
            this.m_NonRestrictivePicking = true;
        }
示例#16
0
 public GHealthBar(Mobile m, int X, int Y)
     : base(m.Player ? (m.Flags[MobileFlag.Warmode] ? 2055 : 2051) : 2052, X, Y)
 {
     this.m_Mobile    = m;
     this.m_CanDrop   = true;
     this.m_QuickDrag = false;
     this.m_Player    = m.Player;
     if (!this.m_Player)
     {
         this.Hue = Hues.GetNotoriety(m.Notoriety);
     }
     if (Engine.ServerFeatures.AOS)
     {
         this.Tooltip = (ITooltip) new MobileTooltip(m);
     }
     if (this.m_Player)
     {
         this.m_HP   = new GImageClip(this.GetHealthGumpID(m.Flags), 34, 12, m.CurrentHitPoints, m.MaximumHitPoints);
         this.m_Mana = new GImageClip(2054, 34, 25, m.CurrentMana, m.MaximumMana);
         this.m_Stam = new GImageClip(2054, 34, 38, m.CurrentStamina, m.MaximumStamina);
         this.m_Children.Add((Gump) new GImage(2053, 34, 12));
         this.m_Children.Add((Gump) new GImage(2053, 34, 25));
         this.m_Children.Add((Gump) new GImage(2053, 34, 38));
         this.m_Children.Add((Gump)this.m_HP);
         this.m_Children.Add((Gump)this.m_Mana);
         this.m_Children.Add((Gump)this.m_Stam);
         this.m_xHPCur   = m.CurrentHitPoints;
         this.m_xHPMax   = m.MaximumHitPoints;
         this.m_xStamCur = m.CurrentStamina;
         this.m_xStamMax = m.MaximumStamina;
         this.m_xManaCur = m.CurrentMana;
         this.m_xManaMax = m.MaximumMana;
     }
     else
     {
         this.m_Name   = new GLabel(m.Name, (IFont)Engine.GetFont(1), Hues.Load(1109), 16, 0);
         this.m_Name.Y = 11 + (24 - this.m_Name.Height) / 2;
         this.m_Name.Scissor(0, 0, 122, this.m_Name.Height);
         this.m_HP = new GImageClip(this.GetHealthGumpID(m.Flags), 34, 38, m.CurrentHitPoints, m.MaximumHitPoints);
         this.m_Children.Add((Gump) new GImage(2053, 34, 38));
         this.m_Children.Add((Gump)this.m_Name);
         this.m_Children.Add((Gump)this.m_HP);
         this.m_xName  = m.Name;
         this.m_xHPCur = m.CurrentHitPoints;
         this.m_xHPMax = m.MaximumHitPoints;
     }
 }
示例#17
0
        public GVirtueItem(GServerGump owner, int x, int y, int gumpID, IHue hue)
            : base(owner, x, y, gumpID, hue)
        {
            this.m_QuickDrag = false;
            int num1   = hue.HueID() - 1;
            int num2   = -1;
            int num3   = 0;
            int index1 = 0;

            while (index1 < GVirtueItem.m_Table.Length)
            {
                if (GVirtueItem.m_Table[index1] == gumpID)
                {
                    num2 = index1 / 4;
                    for (int index2 = 1; index2 < 4; ++index2)
                    {
                        if (GVirtueItem.m_Table[index1 + index2] == num1)
                        {
                            num3 = index2;
                            goto label_9;
                        }
                    }
                }
                index1 += 4;
            }
label_9:
            if (num2 < 0)
            {
                return;
            }
            this.m_Title = new GAlphaBackground(30 - x, 40 - y, 0, 0);
            GLabel glabel = new GLabel(Localization.GetString(1051000 + num3 * 8 + num2), (IFont)Engine.GetUniFont(0), hue, 3, 3);

            this.m_Title.Children.Add((Gump)glabel);
            glabel.X           -= glabel.Image.xMin;
            glabel.Y           -= glabel.Image.yMin;
            this.m_Title.Width  = glabel.Image.xMax - glabel.Image.xMin + 7;
            this.m_Title.Height = glabel.Image.yMax - glabel.Image.yMin + 7;
            Size size = Engine.m_Gumps.Measure(104);

            this.m_Title.X      += (size.Width - this.m_Title.Width) / 2;
            this.m_Title.Y      += (size.Height - this.m_Title.Height) / 2;
            this.m_Title.Visible = false;
            this.m_Children.Add((Gump)this.m_Title);
        }
示例#18
0
 public GWindowsForm(int x, int y, int width, int height)
     : base(x, y)
 {
     this.m_CanDrag      = true;
     this.m_QuickDrag    = true;
     this.m_Width        = width;
     this.m_Height       = height;
     this.m_CaptionLabel = new GLabel("Form", (IFont)Engine.GetUniFont(1), Hues.Default, 7, 3);
     this.m_Children.Add((Gump)this.m_CaptionLabel);
     this.m_Client = (Gump) new GEmpty(0, 0, 0, 0);
     this.m_Children.Add(this.m_Client);
     this.m_CloseButton            = new GWindowsButton("", 0, 0, 16, 14);
     this.m_CloseButton.ImageColor = 0;
     this.m_CloseButton.Image      = Engine.m_FormX;
     this.m_CloseButton.Clicked   += new EventHandler(this.CloseButton_Clicked);
     this.m_Children.Add((Gump)this.m_CloseButton);
     this.ResizeClient();
 }
示例#19
0
        private GTextBox AddTextBox(string name, int index, string initialText, char pc)
        {
            int    Y      = 30 + index * 25;
            GLabel glabel = new GLabel(name, (IFont)Engine.GetUniFont(2), GumpHues.ControlText, 0, 0);

            glabel.X = 10 - glabel.Image.xMin;
            glabel.Y = Y + (22 - (glabel.Image.yMax - glabel.Image.yMin + 1)) / 2 - glabel.Image.yMin;
            this.m_Children.Add((Gump)glabel);
            this.m_Children.Add((Gump) new GAlphaBackground(60, Y, 200, 22)
            {
                ShouldHitTest = false,
                FillColor     = GumpColors.Window,
                FillAlpha     = 1f
            });
            IHue     windowText = GumpHues.WindowText;
            GTextBox gtextBox   = new GTextBox(0, false, 64, Y, 196, 22, initialText, (IFont)Engine.GetUniFont(2), windowText, windowText, windowText, pc);

            this.Client.Children.Add((Gump)gtextBox);
            return(gtextBox);
        }
示例#20
0
        private GContextMenu(object owner, PopupEntry[] list)
            : base(100, 100)
        {
            this.m_Owner = owner;
            this.m_GUID  = "MobilePopup";
            int     num1     = 0;
            int     num2     = 0;
            int     length   = list.Length;
            IFont   font     = (IFont)Engine.GetUniFont(3);
            IHue    bright   = Hues.Bright;
            IHue    focusHue = Hues.Load(53);
            IHue    @default = Hues.Default;
            OnClick onClick  = new OnClick(this.Entry_OnClick);

            for (int index = 0; index < length; ++index)
            {
                PopupEntry popupEntry = list[index];
                GLabel     glabel;
                if (popupEntry.Flags == 1)
                {
                    glabel = new GLabel(popupEntry.Text, font, @default, 7, 7 + num2);
                }
                else
                {
                    glabel = (GLabel) new GTextButton(popupEntry.Text, font, bright, focusHue, 7, 7 + num2, onClick);
                    glabel.SetTag("EntryID", (object)popupEntry.EntryID);
                }
                glabel.X -= glabel.Image.xMin;
                glabel.Y -= glabel.Image.yMin;
                num2     += glabel.Image.yMax - glabel.Image.yMin + 4;
                if (glabel.Image.xMax - glabel.Image.xMin + 1 > num1)
                {
                    num1 = glabel.Image.xMax - glabel.Image.xMin + 1;
                }
                this.m_Children.Add((Gump)glabel);
            }
            int num3 = num2 - 3;

            this.m_Width  = num1 + 14;
            this.m_Height = num3 + 14;
        }
示例#21
0
 public GSkills()
     : base(50, 50, 250, 125)
 {
     this.m_Children.Add((Gump) new GVResizer((IResizable)this));
     this.m_Children.Add((Gump) new GHResizer((IResizable)this));
     this.m_Children.Add((Gump) new GLResizer((IResizable)this));
     this.m_Children.Add((Gump) new GTResizer((IResizable)this));
     this.m_Children.Add((Gump) new GHVResizer((IResizable)this));
     this.m_Children.Add((Gump) new GLTResizer((IResizable)this));
     this.m_Children.Add((Gump) new GHTResizer((IResizable)this));
     this.m_Children.Add((Gump) new GLVResizer((IResizable)this));
     this.m_ShowReal = false;
     this.m_Total    = new GLabel(string.Format("Total: {0:F1}", (object)this.GetTotalSkillCount()), (IFont)Engine.GetUniFont(1), Hues.Bright, 0, 0);
     this.m_Children.Add((Gump)this.m_Total);
     this.m_ValueType   = new GTextButton("Used Values", (IFont)Engine.GetUniFont(1), Hues.Bright, Hues.Load(53), 0, 0, new OnClick(this.ValueType_OnClick));
     this.m_ValueType.X = 4 - this.m_ValueType.Image.xMin;
     this.m_Children.Add((Gump)this.m_ValueType);
     this.m_SkillList = new GSkillList(this);
     this.m_Children.Add((Gump)this.m_SkillList);
     this.Width  = 250;
     this.Height = 125;
 }
示例#22
0
        public GMacroEditorForm()
            : base(0, 0, 269, 283)
        {
            Gumps.Focus = (Gump)this;
            this.m_NonRestrictivePicking        = true;
            this.Client.m_NonRestrictivePicking = true;
            this.Text = "Macro Editor";
            GAlphaBackground galphaBackground = this.m_Sunken = new GAlphaBackground(1, 2, 259, 230);

            galphaBackground.ShouldHitTest = false;
            galphaBackground.FillAlpha     = 1f;
            galphaBackground.FillColor     = GumpColors.AppWorkspace;
            galphaBackground.DrawBorder    = false;
            this.Client.Children.Add((Gump)galphaBackground);
            this.m_KeyboardFlipper         = new GSystemButton(71, 236, 120, 20, SystemColors.Control, SystemColors.ControlText, "Show Keyboard", (IFont)Engine.GetUniFont(2));
            this.m_KeyboardFlipper.OnClick = new OnClick(this.KeyboardFlipper_OnClick);
            this.Client.Children.Add((Gump)this.m_KeyboardFlipper);
            GSystemButton gsystemButton1 = new GSystemButton(240, 236, 20, 20, SystemColors.Control, SystemColors.ControlText, "→", (IFont)Engine.GetUniFont(2));

            gsystemButton1.Tooltip = (ITooltip) new Tooltip("Advance to the next macro", true);
            gsystemButton1.OnClick = new OnClick(this.Next_OnClick);
            this.Client.Children.Add((Gump)gsystemButton1);
            GSystemButton gsystemButton2 = new GSystemButton(1, 236, 20, 20, SystemColors.Control, SystemColors.ControlText, "←", (IFont)Engine.GetUniFont(2));

            gsystemButton2.Tooltip = (ITooltip) new Tooltip("Go back to the previous macro", true);
            gsystemButton2.OnClick = new OnClick(this.Prev_OnClick);
            this.Client.Children.Add((Gump)gsystemButton2);
            this.Center();
            this.Y -= 92;
            if (Macros.List.Count > 0)
            {
                this.Current = Macros.List[0];
            }
            else
            {
                this.m_NoSel = new GLabel("No macro is currently selected", (IFont)Engine.GetUniFont(1), Hues.Load(1153), 16, 18);
                this.Client.Children.Add((Gump)this.m_NoSel);
            }
        }
示例#23
0
        public GSkillList(GSkills owner)
            : base(4, 4, 250, 50)
        {
            this.m_Owner   = owner;
            this.m_CanDrag = false;
            Skills skills = Engine.Skills;

            this.m_SkillGumps = new GSkillGump[256];
            int num = 4;

            for (int index1 = 0; index1 < skills.Groups.Length; ++index1)
            {
                SkillGroup skillGroup = skills.Groups[index1];
                GLabel     glabel     = new GLabel(skillGroup.Name, (IFont)Engine.GetUniFont(1), Hues.Bright, 4, num);
                glabel.X -= glabel.Image.xMin;
                glabel.Y -= glabel.Image.yMin;
                glabel.SetTag("yBase", (object)glabel.Y);
                this.m_Children.Add((Gump)glabel);
                num += 4 + (glabel.Image.yMax - glabel.Image.yMin);
                for (int index2 = 0; index2 < skillGroup.Skills.Count; ++index2)
                {
                    Skill      skill      = (Skill)skillGroup.Skills[index2];
                    GSkillGump gskillGump = new GSkillGump(skill, num, this.m_Width - 20, this.m_Owner.ShowReal);
                    this.m_SkillGumps[skill.ID] = gskillGump;
                    this.m_Children.Add((Gump)gskillGump);
                    num += 4 + gskillGump.Height;
                }
            }
            this.m_SliderBorder = new GSingleBorder(0, 0, 16, 100);
            this.m_Children.Add((Gump)this.m_SliderBorder);
            this.m_Slider = new GAlphaVSlider(0, 6, 16, 100, 0.0, 0.0, (double)(num + 1), 1.0);
            this.m_Slider.SetTag("Max", (object)(num + 1));
            this.m_Slider.OnValueChange += new OnValueChange(this.Slider_OnValueChange);
            this.m_Children.Add((Gump)this.m_Slider);
            this.m_Hotspot = new GHotspot(0, 0, 16, 100, (Gump)this.m_Slider);
            this.m_Children.Add((Gump)this.m_Hotspot);
        }
示例#24
0
 public GSkillGump(Skill skill, int y, int width, bool showReal)
     : base(4, y)
 {
     this.m_yBase   = y;
     this.m_Skill   = skill;
     this.m_Name    = !skill.Action ? new GLabel(skill.Name, (IFont)Engine.GetUniFont(1), Hues.Bright, 20, 0) : (GLabel) new GSkillGump.GUsableSkillName(skill);
     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;
     this.m_Children.Add((Gump)this.m_Name);
     this.m_Value    = new GLabel((showReal ? this.m_Skill.Real : this.m_Skill.Value).ToString("F1"), (IFont)Engine.GetUniFont(1), Hues.Bright, 0, 0);
     this.m_Value.X  = this.m_Width - 24 - 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;
     }
     this.m_Children.Add((Gump)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();
     this.m_Children.Add((Gump)this.m_Lock);
 }
示例#25
0
        public void Update(string text, UnicodeFont initialFont, int initialColor)
        {
            int      width1    = this.m_Width;
            Stack    stack1    = new Stack();
            FontInfo fontInfo1 = new FontInfo(initialFont, initialColor);
            int      num1      = 0;
            int      num2      = 0;
            Stack    stack2    = new Stack();
            Stack    stack3    = new Stack();

            text = text.Replace("\r", "");
            text = text.Replace("\n", "<br>");
            HtmlElement[] elements = HtmlElement.GetElements(text);
            int           num3     = 0;
            int           num4     = 0;

            for (int index1 = 0; index1 < elements.Length; ++index1)
            {
                HtmlElement   htmlElement   = elements[index1];
                FontInfo      fontInfo2     = stack1.Count > 0 ? (FontInfo)stack1.Peek() : fontInfo1;
                HtmlAlignment htmlAlignment = stack2.Count > 0 ? (HtmlAlignment)stack2.Peek() : HtmlAlignment.Normal;
                string        url           = stack3.Count > 0 ? (string)stack3.Peek() : (string)null;
                switch (htmlElement.Type)
                {
                case ElementType.Text:
                    string text1 = htmlElement.Name;
                    bool   flag  = false;
                    while (text1.Length > 0)
                    {
                        int num5 = num3;
                        switch (htmlAlignment & (HtmlAlignment)255)
                        {
                        case HtmlAlignment.Center:
                            int stringWidth1 = fontInfo2.Font.GetStringWidth(text1);
                            if (stringWidth1 > width1)
                            {
                                string[] strArray = Engine.WrapText(text1, width1, (IFont)fontInfo2.Font).Split('\n');
                                stringWidth1 = fontInfo2.Font.GetStringWidth(strArray[0]);
                            }
                            num5 = (width1 - (stringWidth1 - 1) + 1) / 2;
                            break;

                        case HtmlAlignment.Left:
                            num5 = (int)htmlAlignment >> 8;
                            break;

                        case HtmlAlignment.Right:
                            int stringWidth2 = fontInfo2.Font.GetStringWidth(text1);
                            if (stringWidth2 > width1)
                            {
                                string[] strArray = Engine.WrapText(text1, width1, (IFont)fontInfo2.Font).Split('\n');
                                stringWidth2 = fontInfo2.Font.GetStringWidth(strArray[0]);
                            }
                            num5 = ((int)htmlAlignment >> 8) - stringWidth2;
                            break;
                        }
                        string[] strArray1 = text1.Split(' ');
                        int      width2    = width1 - num5;
                        if (!flag && fontInfo2.Font.GetStringWidth(strArray1[0]) > width2)
                        {
                            flag  = true;
                            num3  = 0;
                            num4 += 18;
                        }
                        else
                        {
                            flag = false;
                            string[] strArray2 = Engine.WrapText(text1, width2, (IFont)fontInfo2.Font).Split('\n');
                            string   str       = strArray2[0];
                            if (strArray2.Length > 1)
                            {
                                str = str.TrimEnd();
                            }
                            GLabel glabel = url == null ? new GLabel(str, (IFont)fontInfo2.Font, fontInfo2.Hue, num5, num4) : (GLabel) new GHyperLink(url, str, (IFont)fontInfo2.Font, num5, num4);
                            if (url == null)
                            {
                                glabel.Underline = num1 > 0;
                            }
                            this.m_Children.Add((Gump)glabel);
                            if (strArray2.Length > 1)
                            {
                                text1 = text1.Remove(0, strArray2[0].Length);
                                num3  = 0;
                                num4 += 18;
                            }
                            else
                            {
                                num3 = glabel.X + glabel.Width - 1;
                                break;
                            }
                        }
                    }
                    break;

                case ElementType.Start:
                    switch (htmlElement.Name.ToLower())
                    {
                    case "br":
                        num3  = 0;
                        num4 += 18;
                        continue;

                    case "u":
                        ++num1;
                        continue;

                    case "i":
                        ++num2;
                        continue;

                    case "a":
                        string attribute1 = htmlElement.GetAttribute("href");
                        if (attribute1 != null && !attribute1.StartsWith("?"))
                        {
                            stack3.Push((object)attribute1);
                            continue;
                        }
                        continue;

                    case "basefont":
                        string attribute2 = htmlElement.GetAttribute("color");
                        if (attribute2 != null)
                        {
                            int color = 0;
                            if (attribute2.StartsWith("#"))
                            {
                                color = Convert.ToInt32(attribute2.Substring(1), 16);
                            }
                            else
                            {
                                for (int index2 = 0; index2 < GHtmlLabel.m_ColorTable.GetLength(0); ++index2)
                                {
                                    if (attribute2.ToLower() == (string)GHtmlLabel.m_ColorTable[index2, 0])
                                    {
                                        color = (int)GHtmlLabel.m_ColorTable[index2, 1];
                                        break;
                                    }
                                }
                            }
                            stack1.Push((object)new FontInfo(fontInfo2.Font, color));
                            continue;
                        }
                        continue;

                    case "center":
                        stack2.Push((object)HtmlAlignment.Center);
                        continue;

                    case "div":
                        string attribute3 = htmlElement.GetAttribute("align");
                        if (attribute3 == null)
                        {
                            string attribute4 = htmlElement.GetAttribute("alignleft");
                            if (attribute4 != null)
                            {
                                try
                                {
                                    int num5 = int.Parse(attribute4);
                                    stack2.Push((object)(HtmlAlignment)(2 | num5 << 8));
                                }
                                catch
                                {
                                }
                            }
                            string attribute5 = htmlElement.GetAttribute("alignright");
                            if (attribute5 != null)
                            {
                                try
                                {
                                    int num5 = int.Parse(attribute5);
                                    stack2.Push((object)(HtmlAlignment)(3 | num5 << 8));
                                    continue;
                                }
                                catch
                                {
                                    continue;
                                }
                            }
                            else
                            {
                                continue;
                            }
                        }
                        else
                        {
                            switch (attribute3.ToLower())
                            {
                            case "center":
                                stack2.Push((object)HtmlAlignment.Center);
                                continue;

                            case "right":
                                stack2.Push((object)(HtmlAlignment)(3 | width1 << 8));
                                continue;

                            case "left":
                                stack2.Push((object)HtmlAlignment.Left);
                                continue;

                            default:
                                continue;
                            }
                        }

                    default:
                        continue;
                    }

                case ElementType.End:
                    switch (htmlElement.Name.ToLower())
                    {
                    case "u":
                        --num1;
                        if (num1 < 0)
                        {
                            num1 = 0;
                            continue;
                        }
                        continue;

                    case "i":
                        --num2;
                        if (num2 < 0)
                        {
                            num2 = 0;
                            continue;
                        }
                        continue;

                    case "a":
                        if (stack3.Count > 0)
                        {
                            stack3.Pop();
                            continue;
                        }
                        continue;

                    case "basefont":
                        if (stack1.Count > 0)
                        {
                            stack1.Pop();
                            continue;
                        }
                        continue;

                    case "div":
                    case "center":
                        if (stack2.Count > 0)
                        {
                            stack2.Pop();
                            continue;
                        }
                        continue;

                    default:
                        continue;
                    }
                }
            }
            this.m_Height = num4 + 18;
        }
示例#26
0
        public GSecureTrade(int serial, Gump container, string myName, string theirName)
            : base(50, 50, 281, 116)
        {
            this.m_Serial    = serial;
            this.m_Container = container;
            this.m_CanDrop   = true;
            this.FillAlpha   = 0.5f;
            this.FillColor   = 6324479;
            GBorder3D gborder3D1 = new GBorder3D(false, 0, 0, this.Width, this.Height);

            gborder3D1.FillAlpha     = 0.0f;
            gborder3D1.ShouldHitTest = false;
            this.m_Children.Add((Gump)gborder3D1);
            GBorder3D gborder3D2 = new GBorder3D(true, 6, 6, 132, 104);

            gborder3D2.FillAlpha     = 0.0f;
            gborder3D2.ShouldHitTest = false;
            this.m_Children.Add((Gump)gborder3D2);
            GBorder3D gborder3D3 = new GBorder3D(false, 7, 7, 130, 20);

            gborder3D3.ShouldHitTest = false;
            GLabel glabel1 = new GLabel(this.Truncate(myName, (IFont)Engine.GetUniFont(1), gborder3D3.Width - 28), (IFont)Engine.GetUniFont(1), Hues.Load(1), 0, 0);

            gborder3D3.Children.Add((Gump)glabel1);
            glabel1.Center();
            glabel1.X = 28 - glabel1.Image.xMin;
            this.m_Children.Add((Gump)gborder3D3);
            GBorder3D gborder3D4 = new GBorder3D(true, 143, 6, 132, 104);

            gborder3D4.FillAlpha     = 0.0f;
            gborder3D4.ShouldHitTest = false;
            this.m_Children.Add((Gump)gborder3D4);
            GBorder3D gborder3D5 = new GBorder3D(false, 144, 7, 130, 20);

            gborder3D5.ShouldHitTest = false;
            GLabel glabel2 = new GLabel(this.Truncate(theirName, (IFont)Engine.GetUniFont(1), gborder3D5.Width - 28), (IFont)Engine.GetUniFont(1), Hues.Load(1), 0, 0);

            gborder3D5.Children.Add((Gump)glabel2);
            glabel2.Center();
            glabel2.X = gborder3D5.Width - 28 - glabel2.Image.xMax;
            this.m_Children.Add((Gump)gborder3D5);
            this.m_Children.Add((Gump) new GAlphaBackground(1, 1, 5, 114)
            {
                ShouldHitTest = false,
                BorderColor   = 12632256,
                FillColor     = 12632256,
                FillAlpha     = 1f
            });
            this.m_Children.Add((Gump) new GAlphaBackground(275, 1, 5, 114)
            {
                ShouldHitTest = false,
                BorderColor   = 12632256,
                FillColor     = 12632256,
                FillAlpha     = 1f
            });
            this.m_Children.Add((Gump) new GAlphaBackground(6, 1, 269, 5)
            {
                ShouldHitTest = false,
                BorderColor   = 12632256,
                FillColor     = 12632256,
                FillAlpha     = 1f
            });
            this.m_Children.Add((Gump) new GAlphaBackground(6, 110, 269, 5)
            {
                ShouldHitTest = false,
                BorderColor   = 12632256,
                FillColor     = 12632256,
                FillAlpha     = 1f
            });
            this.m_Children.Add((Gump) new GAlphaBackground(138, 6, 5, 104)
            {
                ShouldHitTest = false,
                BorderColor   = 12632256,
                FillColor     = 12632256,
                FillAlpha     = 1f
            });
        }
示例#27
0
        public void SetList(int number, ObjectPropertyList propList)
        {
            this.m_List = propList;
            this.m_Children.Clear();
            int Y    = 5;
            int num1 = 10;

            ObjectProperty[] objectPropertyArray = propList.Properties;
            if (objectPropertyArray.Length == 0 && number != -1)
            {
                objectPropertyArray = new ObjectProperty[1]
                {
                    new ObjectProperty(number, "")
                }
            }
            ;
            int num2   = 0;
            int index1 = -1;
            int num3   = 0;
            int num4   = 0;
            int num5   = 0;
            int num6   = 0;
            int num7   = 0;
            int num8   = 0;
            int num9   = 0;

            for (int index2 = 0; index2 < objectPropertyArray.Length; ++index2)
            {
                if (objectPropertyArray[index2].Number >= 1060445 && objectPropertyArray[index2].Number <= 1060449)
                {
                    int num10 = 0;
                    try
                    {
                        num10 = int.Parse(objectPropertyArray[index2].Arguments.Trim());
                    }
                    catch
                    {
                    }
                    switch (objectPropertyArray[index2].Number)
                    {
                    case 1060445:
                        num5 += num10;
                        break;

                    case 1060446:
                        num7 += num10;
                        break;

                    case 1060447:
                        num4 += num10;
                        break;

                    case 1060448:
                        num3 += num10;
                        break;

                    case 1060449:
                        num6 += num10;
                        break;
                    }
                    if (index1 == -1)
                    {
                        index1 = index2;
                    }
                    num2 += num10;
                }
                else if (objectPropertyArray[index2].Number == 1060486)
                {
                    try
                    {
                        num9 = int.Parse(objectPropertyArray[index2].Arguments.Trim());
                    }
                    catch
                    {
                    }
                }
                else if (objectPropertyArray[index2].Number == 1061167)
                {
                    try
                    {
                        num8 = int.Parse(objectPropertyArray[index2].Arguments.Trim());
                    }
                    catch
                    {
                    }
                }
            }
            if (num8 > 0)
            {
                num8 = num8 * (100 + num9) / 100;
            }
            ResistInfo resistInfo1 = (ResistInfo)null;
            ResistInfo resistInfo2 = (ResistInfo)null;

            if (index1 != -1)
            {
                ArrayList arrayList = new ArrayList((ICollection)objectPropertyArray);
                arrayList.Insert(index1, (object)new ObjectProperty(1042971, string.Format("total resist {0}%", (object)num2)));
                objectPropertyArray = (ObjectProperty[])arrayList.ToArray(typeof(ObjectProperty));
                resistInfo1         = ResistInfo.Find(objectPropertyArray[0].Text, ResistInfo.m_Armor);
                resistInfo2         = ResistInfo.Find(objectPropertyArray[0].Text, ResistInfo.m_Materials);
            }
            int num11 = -1;

            if (this.m_Object is Mobile)
            {
                Mobile mobile = (Mobile)this.m_Object;
                int    num10  = 0;
                int    num12  = 0;
                int    num13  = 0;
                int    num14  = 0;
                int    num15  = 0;
                int    num16  = 0;
                int    num17  = 0;
                foreach (Item obj in mobile.Items)
                {
                    ObjectPropertyList propertyList = obj.PropertyList;
                    if (propertyList == null)
                    {
                        obj.QueryProperties();
                    }
                    else
                    {
                        foreach (ObjectProperty property in propertyList.Properties)
                        {
                            if (property.Number >= 1060445 && property.Number <= 1060449)
                            {
                                int num18 = 0;
                                try
                                {
                                    num18 = int.Parse(property.Arguments.Trim());
                                }
                                catch
                                {
                                }
                                switch (property.Number)
                                {
                                case 1060445:
                                    num13 += num18;
                                    continue;

                                case 1060446:
                                    num15 += num18;
                                    continue;

                                case 1060447:
                                    num12 += num18;
                                    continue;

                                case 1060448:
                                    num10 += num18;
                                    continue;

                                case 1060449:
                                    num14 += num18;
                                    continue;

                                default:
                                    continue;
                                }
                            }
                            else if (property.Number == 1060413)
                            {
                                try
                                {
                                    num16 += int.Parse(property.Arguments.Trim());
                                }
                                catch
                                {
                                }
                            }
                            else if (property.Number == 1060412)
                            {
                                try
                                {
                                    num17 += int.Parse(property.Arguments.Trim());
                                }
                                catch
                                {
                                }
                            }
                        }
                    }
                }
                num11 = num10;
                if (num12 < num11)
                {
                    num11 = num12;
                }
                if (num13 < num11)
                {
                    num11 = num13;
                }
                if (num14 < num11)
                {
                    num11 = num14;
                }
                if (num15 < num11)
                {
                    num11 = num15;
                }
                if (num10 != 0 || num12 != 0 || (num13 != 0 || num14 != 0) || (num15 != 0 || num16 != 0 || num17 != 0))
                {
                    ArrayList arrayList = new ArrayList((ICollection)objectPropertyArray);
                    if (num16 != 0 || num17 != 0)
                    {
                        arrayList.Add((object)new ObjectProperty(1042971, string.Format("FC {0}, FCR {1}", (object)num16, (object)num17)));
                    }
                    arrayList.Add((object)new ObjectProperty(1060448, num10.ToString()));
                    arrayList.Add((object)new ObjectProperty(1060447, num12.ToString()));
                    arrayList.Add((object)new ObjectProperty(1060445, num13.ToString()));
                    arrayList.Add((object)new ObjectProperty(1060449, num14.ToString()));
                    arrayList.Add((object)new ObjectProperty(1060446, num15.ToString()));
                    objectPropertyArray = (ObjectProperty[])arrayList.ToArray(typeof(ObjectProperty));
                }
            }
            if (this.m_Object is Item && ((Item)this.m_Object).Container != null && ((Item)this.m_Object).Container.m_TradeContainer)
            {
                ArrayList arrayList = new ArrayList((ICollection)objectPropertyArray);
                if (arrayList.Count > 0)
                {
                    arrayList[0] = (object)new ObjectProperty(1042971, "Their Offer");
                }
                Item   obj    = (Item)this.m_Object;
                Item[] items1 = obj.FindItems((IItemValidator) new ItemIDValidator(new int[3] {
                    3821, 3820, 3822
                }));
                int num10 = 0;
                for (int index2 = 0; index2 < items1.Length; ++index2)
                {
                    num10 += items1[index2].Amount;
                }
                Item[] items2 = obj.FindItems((IItemValidator) new ItemIDValidator(new int[2] {
                    5359, 5360
                }));
                for (int index2 = 0; index2 < items2.Length; ++index2)
                {
                    ObjectPropertyList propertyList = items2[index2].PropertyList;
                    if (propertyList == null)
                    {
                        items2[index2].QueryProperties();
                    }
                    else
                    {
                        bool flag = false;
                        for (int index3 = 0; index3 < propertyList.Properties.Length; ++index3)
                        {
                            if (propertyList.Properties[index3].Number == 1041361)
                            {
                                flag = true;
                            }
                            else if (propertyList.Properties[index3].Number == 1060738)
                            {
                                if (flag)
                                {
                                    try
                                    {
                                        num10 += int.Parse(propertyList.Properties[index3].Arguments.Trim());
                                        break;
                                    }
                                    catch
                                    {
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
                arrayList.Add((object)new ObjectProperty(1042971, string.Format("Total Gold: {0:N0}", (object)num10)));
                objectPropertyArray = (ObjectProperty[])arrayList.ToArray(typeof(ObjectProperty));
            }
            for (int index2 = 0; index2 < objectPropertyArray.Length; ++index2)
            {
                ObjectProperty objectProperty = objectPropertyArray[index2];
                GLabel         glabel         = new GLabel(Engine.MakeProperCase(objectProperty.Text), Engine.DefaultFont, index2 == 0 ? this.GetDefaultHue() : Hues.Bright, 5, Y);
                if (objectProperty.Number == 1061170)
                {
                    int num10 = 0;
                    try
                    {
                        num10 = int.Parse(objectProperty.Arguments.Trim());
                    }
                    catch
                    {
                    }
                    Mobile player = World.Player;
                    if (player != null && num10 > player.Strength)
                    {
                        glabel.Hue = Hues.Load(34);
                    }
                }
                else if (objectProperty.Number == 1061682)
                {
                    glabel.Hue  = Hues.Load(89);
                    glabel.Text = "Insured";
                }
                else if (num11 >= 0 && objectProperty.Number >= 1060445 && objectProperty.Number <= 1060449)
                {
                    int num10 = 0;
                    try
                    {
                        num10 = int.Parse(objectProperty.Arguments.Trim());
                    }
                    catch
                    {
                    }
                    if (num10 == num11)
                    {
                        if (objectProperty.Number == 1060445)
                        {
                            glabel.Hue = Hues.Load(95);
                        }
                        else if (objectProperty.Number == 1060446)
                        {
                            glabel.Hue = Hues.Load(26);
                        }
                        else if (objectProperty.Number == 1060447)
                        {
                            glabel.Hue = Hues.Load(45);
                        }
                        else if (objectProperty.Number == 1060448)
                        {
                            glabel.Hue = Hues.Load(1154);
                        }
                        else if (objectProperty.Number == 1060449)
                        {
                            glabel.Hue = Hues.Load(70);
                        }
                    }
                }
                else if (resistInfo1 != null && objectProperty.Number >= 1060445 && objectProperty.Number <= 1060449)
                {
                    int num10 = 0;
                    try
                    {
                        num10 = int.Parse(objectProperty.Arguments.Trim());
                    }
                    catch
                    {
                    }
                    int num12 = 0;
                    switch (objectProperty.Number)
                    {
                    case 1060445:
                        num12 = resistInfo1.m_Cold + (resistInfo2 == null ? 0 : resistInfo2.m_Cold);
                        break;

                    case 1060446:
                        num12 = resistInfo1.m_Energy + (resistInfo2 == null ? 0 : resistInfo2.m_Energy);
                        break;

                    case 1060447:
                        num12 = resistInfo1.m_Fire + (resistInfo2 == null ? 0 : resistInfo2.m_Fire);
                        break;

                    case 1060448:
                        num12 = resistInfo1.m_Physical + (resistInfo2 == null ? 0 : resistInfo2.m_Physical);
                        break;

                    case 1060449:
                        num12 = resistInfo1.m_Poison + (resistInfo2 == null ? 0 : resistInfo2.m_Poison);
                        break;
                    }
                    int num13 = num10 - num12;
                    if (num13 > 0)
                    {
                        glabel.Text += string.Format(" (+{0}%)", (object)num13);
                    }
                    else if (num13 < 0)
                    {
                        glabel.Text += string.Format(" (-{0}%)", (object)Math.Abs(num13));
                    }
                }
                else if (objectProperty.Number == 1061167)
                {
                    Mobile player = World.Player;
                    if (player != null)
                    {
                        double num10 = Math.Floor(40000.0 / (double)((player.CurrentStamina + 100) * num8)) / 2.0;
                        glabel.Text += string.Format(" ({0:F1}s)", (object)num10);
                    }
                }
                glabel.Y -= glabel.Image.yMin;
                glabel.X -= glabel.Image.xMin;
                Y         = glabel.Y + glabel.Image.yMax + 5;
                if (10 + (glabel.Image.xMax - glabel.Image.xMin + 1) > num1)
                {
                    num1 = 10 + (glabel.Image.xMax - glabel.Image.xMin + 1);
                }
                this.m_Children.Add((Gump)glabel);
                if (index2 == 0)
                {
                    this.m_CompactHeight = Y;
                }
            }
            this.m_TotalWidth  = num1;
            this.m_TotalHeight = Y;
            if (this.m_Timer == null)
            {
                this.Width  = num1;
                this.Height = Y;
            }
            foreach (GLabel glabel in this.m_Children.ToArray())
            {
                glabel.X = (num1 - (glabel.Image.xMax - glabel.Image.xMin + 1)) / 2 - glabel.Image.xMin;
                glabel.Scissor(1 - glabel.X, 1 - glabel.Y, this.Width - 2, this.Height - 2);
            }
        }
示例#28
0
        private void ProcessLayout(LayoutEntry[] list, string[] text)
        {
            int  num1 = 0;
            int  num2 = 0;
            bool flag = false;

            for (int index = 0; index < list.Length; ++index)
            {
                LayoutEntry le = list[index];
                switch (le.Name)
                {
                case "nodispose":
                case "noresize":
                    goto case "nodispose";

                case "checkertrans":
                    this.Pages(num1).Add((Gump) new GTransparentRegion(this, le[0], le[1], le[2], le[3]));
                    goto case "nodispose";

                case "page":
                    num1 = le[0];
                    if (num1 == 0)
                    {
                        flag = false;
                        num2 = 0;
                        goto case "nodispose";
                    }
                    else if (!flag || num1 < num2)
                    {
                        num2 = num1;
                        flag = true;
                        goto case "nodispose";
                    }
                    else
                    {
                        goto case "nodispose";
                    }

                case "noclose":
                    this.m_CanClose = false;
                    goto case "nodispose";

                case "nomove":
                    this.m_CanMove = false;
                    goto case "nodispose";

                case "resizepic":
                    this.Pages(num1).Add((Gump) new GServerBackground(this, le[0], le[1], le[3], le[4], le[2] + 4, true));
                    goto case "nodispose";

                case "gumppictiled":
                    this.Pages(num1).Add((Gump) new GServerBackground(this, le[0], le[1], le[2], le[3], le[4], false));
                    goto case "nodispose";

                case "gumppic":
                    string attribute = le.GetAttribute("hue");
                    IHue   hue;
                    if (attribute != null)
                    {
                        try
                        {
                            hue = Hues.Load(Convert.ToInt32(attribute) + 1);
                        }
                        catch
                        {
                            hue = Hues.Default;
                        }
                    }
                    else
                    {
                        hue = Hues.Default;
                    }
                    if (le.GetAttribute("class") == "VirtueGumpItem")
                    {
                        this.Pages(num1).Add((Gump) new GVirtueItem(this, le[0], le[1], le[2], hue));
                        goto case "nodispose";
                    }
                    else
                    {
                        this.Pages(num1).Add((Gump) new GServerImage(this, le[0], le[1], le[2], hue));
                        goto case "nodispose";
                    }

                case "textentry":
                    this.Pages(num1).Add((Gump) new GServerTextBox(text[le[6]], le));
                    goto case "nodispose";

                case "tilepic":
                    this.Pages(num1).Add((Gump) new GItemArt(le[0], le[1], le[2]));
                    goto case "nodispose";

                case "tilepichue":
                    this.Pages(num1).Add((Gump) new GItemArt(le[0], le[1], le[2], Hues.GetItemHue(le[2], le[3] + 1)));
                    goto case "nodispose";

                case "button":
                    this.Pages(num1).Add((Gump) new GServerButton(this, le));
                    goto case "nodispose";

                case "radio":
                    this.Pages(num1).Add((Gump) new GServerRadio(this, le));
                    goto case "nodispose";

                case "checkbox":
                    this.Pages(num1).Add((Gump) new GServerCheckBox(this, le));
                    goto case "nodispose";

                case "text":
                    int num3 = le[2];
                    this.Pages(num1).Add((Gump) new GLabel(text[le[3]], (IFont)Engine.GetUniFont(1), Hues.Load(num3 + 1), le[0] - 1, le[1]));
                    goto case "nodispose";

                case "croppedtext":
                    int    num4   = le[4];
                    string str    = text[le[5]];
                    int    xWidth = le[2];
                    IFont  Font   = (IFont)Engine.GetUniFont(1);
                    if (Font.GetStringWidth(str) > xWidth)
                    {
                        while (str.Length > 0 && Font.GetStringWidth(str + "...") > xWidth)
                        {
                            str = str.Substring(0, str.Length - 1);
                        }
                        str += "...";
                    }
                    GLabel glabel = new GLabel(str, Font, Hues.Load(num4 + 1), le[0] - 1, le[1]);
                    glabel.Scissor(0, 0, xWidth, le[3]);
                    this.Pages(num1).Add((Gump)glabel);
                    goto case "nodispose";

                case "xmfhtmlgump":
                    this.ProcessHtmlGump(num1, le[0], le[1], le[2], le[3], Localization.GetString(le[4]), le[5] != 0, le[6] != 0, le[5] != 0 || le[6] == 0 ? 0 : 16777215);
                    goto case "nodispose";

                case "xmfhtmlgumpcolor":
                    this.ProcessHtmlGump(num1, le[0], le[1], le[2], le[3], Localization.GetString(le[4]), le[5] != 0, le[6] != 0, Engine.C16232(le[7]));
                    goto case "nodispose";

                case "htmlgump":
                    this.ProcessHtmlGump(num1, le[0], le[1], le[2], le[3], text[le[4]], le[5] != 0, le[6] != 0, le[5] != 0 || le[6] == 0 ? 0 : 16777215);
                    goto case "nodispose";

                default:
                    Engine.AddTextMessage(le.Name);
                    goto case "nodispose";
                }
            }
            this.Page = num2 == 0 ? 1 : num2;
        }
示例#29
0
        public GStatusBar(Mobile m, int X, int Y)
            : base(0.25f, 0.25f, 0.6f, 10860, X, Y)
        {
            this.m_Mobile    = m;
            this.m_CanDrop   = true;
            this.m_QuickDrag = true;
            IFont font = (IFont)Engine.GetFont(9);
            IHue  hue  = Hues.Load(1109);

            this.m_Name      = new GLabel("", font, hue, 38, 50);
            this.m_Str       = new GLabel("0", font, hue, 88, 77);
            this.m_Hits      = new GAttributeCurMax(146, 72, 34, 21, this.m_Mobile.CurrentHitPoints, this.m_Mobile.MaximumHitPoints, font, hue);
            this.m_Dex       = new GLabel("0", font, hue, 88, 105);
            this.m_Stam      = new GAttributeCurMax(146, 100, 34, 21, this.m_Mobile.CurrentStamina, this.m_Mobile.MaximumStamina, font, hue);
            this.m_Int       = new GLabel("0", font, hue, 88, 133);
            this.m_Mana      = new GAttributeCurMax(146, 128, 34, 21, this.m_Mobile.CurrentMana, this.m_Mobile.MaximumMana, font, hue);
            this.m_Armor     = new GLabel("0", font, hue, 355, 74);
            this.m_Fire      = new GLabel("0", font, hue, 355, 91);
            this.m_Cold      = new GLabel("0", font, hue, 355, 106);
            this.m_Poison    = new GLabel("0", font, hue, 355, 119);
            this.m_Energy    = new GLabel("0", font, hue, 355, 133);
            this.m_Luck      = new GLabel("0", font, hue, 220, 105);
            this.m_Damages   = new GLabel("0-0", font, hue, 280, 77);
            this.m_Gold      = new GLabel("0", font, hue, 280, 105);
            this.m_Weight    = new GAttributeCurMax(216, 128, 34, 21, this.m_Mobile.Weight, this.GetMaxWeight(this.m_Mobile.Strength), font, hue);
            this.m_StatCap   = new GLabel("0", font, hue, 220, 77);
            this.m_Followers = new GLabel("0/0", font, hue, 285, 133);
            this.m_Name.X    = 39 + (352 - (this.m_Name.Image.xMax - this.m_Name.Image.xMin + 1)) / 2;
            this.m_Name.X   -= this.m_Name.Image.xMin;
            this.m_Children.Add((Gump)this.m_Name);
            this.m_Children.Add((Gump)this.m_Str);
            this.m_Children.Add((Gump)this.m_Hits);
            this.m_Children.Add((Gump)this.m_Dex);
            this.m_Children.Add((Gump)this.m_Stam);
            this.m_Children.Add((Gump)this.m_Int);
            this.m_Children.Add((Gump)this.m_Mana);
            this.m_Children.Add((Gump)this.m_Armor);
            this.m_Children.Add((Gump)this.m_Fire);
            this.m_Children.Add((Gump)this.m_Cold);
            this.m_Children.Add((Gump)this.m_Poison);
            this.m_Children.Add((Gump)this.m_Energy);
            this.m_Children.Add((Gump)this.m_Luck);
            this.m_Children.Add((Gump)this.m_Damages);
            this.m_Children.Add((Gump)this.m_Gold);
            this.m_Children.Add((Gump)this.m_Weight);
            this.m_Children.Add((Gump)this.m_StatCap);
            this.m_Children.Add((Gump)this.m_Followers);
            this.m_Children.Add((Gump) new GStatusBar.GMinimizer(this));
            this.AddTooltip(55, 70, 64, 26, 1061146);
            this.AddTooltip(55, 98, 64, 26, 1061147);
            this.AddTooltip(55, 126, 64, 26, 1061148);
            this.AddTooltip(121, 70, 63, 26, 1061149);
            this.AddTooltip(121, 98, 63, 26, 1061150);
            this.AddTooltip(121, 126, 63, 26, 1061151);
            this.AddTooltip(186, 70, 69, 26, 1061152);
            this.AddTooltip(186, 98, 69, 26, 1061153);
            this.AddTooltip(186, 126, 69, 26, 1061154);
            this.AddTooltip(257, 70, 72, 26, 1061155);
            this.AddTooltip(257, 98, 72, 26, 1061156);
            this.AddTooltip(257, 126, 72, 26, 1061157);
            this.AddTooltip(333, 74, 46, 14, 1061158);
            this.AddTooltip(333, 91, 46, 14, 1061159);
            this.AddTooltip(333, 106, 46, 13, 1061160);
            this.AddTooltip(333, 120, 46, 11, 1061161);
            this.AddTooltip(333, 133, 46, 16, 1061162);
            this.OnRefresh();
            if (!Engine.ServerFeatures.AOS)
            {
                return;
            }
            this.Tooltip = (ITooltip) new MobileTooltip(m);
        }