Пример #1
0
 public StaticMessage(int xMouse, int yMouse, int Serial, string Message)
     : base(Message, Engine.ItemDuration, Engine.DefaultFont, Hues.Load(946))
 {
     this.m_Serial = Serial;
     this.m_X      = xMouse - (this.m_Image.Width >> 1);
     this.m_Y      = yMouse - this.m_Image.Height;
 }
Пример #2
0
 public GUsableSkillName(Skill skill)
     : base(skill.Name, (IFont)Engine.GetUniFont(1), Hues.Bright, Hues.Load(53), 20, 0, (OnClick)null)
 {
     this.m_Skill     = skill;
     this.m_CanDrag   = true;
     this.m_QuickDrag = false;
 }
Пример #3
0
        /// <summary>
        /// Called by Phoenix.Initialize().
        /// </summary>
        /// <param name="param">Client directory.</param>
        internal static void Load(object param)
        {
            string dir = param.ToString();

            try {
                Trace.WriteLine("Loading ultima data files started..", "MulLib");

                tiledata = TileData.Load(Path.Combine(dir, "tiledata.mul"));
                hues     = Hues.Load(Path.Combine(dir, "hues.mul"));
                radarCol = RadarCol.Load(Path.Combine(dir, "radarcol.mul"));
                skills   = Skills.Load(Path.Combine(dir, "skills.idx"), Path.Combine(dir, "skills.mul"));
                art      = Art.Load(Path.Combine(dir, "artidx.mul"), Path.Combine(dir, "art.mul"), MulFileAccessMode.ReadOnly);
                multi    = Multi.Load(Path.Combine(dir, "multi.idx"), Path.Combine(dir, "multi.mul"), MulFileAccessMode.ReadOnly);

                Trace.WriteLine("Loading ultima data files finished.", "MulLib");
            }
            catch (Exception e) {
                string msg = String.Format("Unable to load ultima data files. Program will be terminated. Exception:\r\n{0}", e);
                Trace.WriteLine(msg, "MulLib");
                MessageBox.Show(msg, "Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Core.Terminate();
            }

            try {
                SyncEvent.Invoke(Loaded, null, EventArgs.Empty);
            }
            catch (Exception e) {
                Trace.WriteLine("Unhandled exception in DataFiles.Loaded event. Exception:\r\n" + e.ToString(), "MulLib");
            }
        }
Пример #4
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);
        }
Пример #5
0
        public GItemList(int serial, int menuID, string question, AnswerEntry[] answers) : base(0x910, 0x19, 0x19)
        {
            this.m_xLast      = -1234;
            this.m_yLast      = -1234;
            this.m_Serial     = serial;
            this.m_MenuID     = menuID;
            this.m_EntryLabel = new GLabel("", Engine.GetFont(1), Hues.Load(0x75f), 0x27, 0x6a);
            base.m_Children.Add(this.m_EntryLabel);
            GLabel toAdd = new GLabel(question, Engine.GetFont(1), Hues.Load(0x75f), 0x27, 0x13);

            toAdd.Scissor(0, 0, 0xda, 11);
            base.m_Children.Add(toAdd);
            int x = 0x25;

            for (int i = 0; i < answers.Length; i++)
            {
                GItemListEntry entry = new GItemListEntry(x, answers[i], this);
                base.m_Children.Add(entry);
                x += entry.Width;
            }
            x -= 0x25;
            if (x >= 0xde)
            {
                this.m_xOffsetCap = -(x - 0xde);
                this.m_Left       = new GItemListScroller(0x17, this, 150);
                this.m_Right      = new GItemListScroller(0x105, this, -150);
                base.m_Children.Add(this.m_Left);
                base.m_Children.Add(this.m_Right);
            }
        }
Пример #6
0
 public GDamageLabel(int damage, Mobile m)
     : base(damage.ToString(), Engine.DefaultFont, Hues.Load(m.IsPoisoned ? 63 : 38), m.ScreenX, m.ScreenY - 30)
 {
     this.m_Mobile = m;
     this.m_Sync   = new TimeSync(0.75);
     this.UpdatePosition();
 }
Пример #7
0
        public GBuyGump_OfferMenu(GBuyGump owner) : base(0x871, 170, 0xd6)
        {
            string str;

            this.m_Owner = owner;
            Mobile player = World.Player;

            if (((player != null) && ((str = player.Name) != null)) && ((str = str.Trim()).Length > 0))
            {
                this.m_Signature         = new GLabel(str, Engine.GetFont(5), Hues.Load(0x455), 0x48, 0xc2);
                this.m_Signature.Visible = false;
                base.m_Children.Add(this.m_Signature);
            }
            base.m_Children.Add(new GLabel((player != null) ? player.Gold.ToString() : "0", Engine.GetFont(6), Hues.Default, 0xbc, 0xa7));
            this.m_Total  = new GLabel("0", Engine.GetFont(6), Hues.Default, 0x44, 0xa7);
            this.m_Accept = new GBuyAccept(owner);
            this.m_Clear  = new GBuyClear(owner);
            base.m_Children.Add(this.m_Total);
            base.m_Children.Add(this.m_Accept);
            base.m_Children.Add(this.m_Clear);
            base.m_CanDrag   = true;
            base.m_QuickDrag = true;
            GVSlider toAdd = new GVSlider(0x828, 0xed, 0x51, 0x22, 0x3a, 0.0, 0.0, 50.0, 1.0);

            this.m_Slider = toAdd;
            base.m_Children.Add(toAdd);
            base.m_Children.Add(new GHotspot(0xed, 0x42, 0x22, 0x54, toAdd));
        }
Пример #8
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);
        }
Пример #9
0
 private IHue GetDefaultHue()
 {
     if (this.m_Object is Mobile)
     {
         return(Hues.GetNotoriety(((Mobile)this.m_Object).Notoriety));
     }
     return(Hues.Load(0x34));
 }
Пример #10
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);
        }
Пример #11
0
 private GDynamicMessage(bool unremovable, IMessageOwner owner, string text, IFont font, IHue hue, float duration)
     : base(text, font, hue, Hues.Load(53), 0, 0, (OnClick)null)
 {
     this.m_Unremovable     = unremovable;
     this.m_OverridesCursor = false;
     this.m_Owner           = owner;
     this.m_SolidDuration   = duration;
     this.m_Dispose         = new TimeSync((double)this.m_SolidDuration + 1.0);
 }
Пример #12
0
 private GMenuItem FormatMenu(GMenuItem mi)
 {
     mi.FillAlpha     = 1f;
     mi.DefaultColor  = GumpPaint.Blend(Color.WhiteSmoke, SystemColors.Control, (float)0.5f);
     mi.OverColor     = GumpPaint.Blend(Color.SteelBlue, SystemColors.Control, (float)0.5f);
     mi.ExpandedColor = GumpPaint.Blend(Color.SteelBlue, SystemColors.Control, (float)0.5f);
     mi.SetHue(Hues.Load(1));
     return(mi);
 }
Пример #13
0
 static GTracker()
 {
     GTracker.m_Hues[0] = Hues.Load(68);
     GTracker.m_Hues[1] = Hues.Load(63);
     GTracker.m_Hues[2] = Hues.Load(58);
     GTracker.m_Hues[3] = Hues.Load(53);
     GTracker.m_Hues[4] = Hues.Load(48);
     GTracker.m_Hues[5] = Hues.Load(43);
     GTracker.m_Hues[6] = Hues.Load(38);
 }
Пример #14
0
        public Bitmap GetGump(int GumpID, int HueID)
        {
            Texture gump = Hues.Load(HueID).GetGump(GumpID);

            if ((gump == null) || gump.IsEmpty())
            {
                return(null);
            }
            return(gump.ToBitmap());
        }
Пример #15
0
 public GMessageBoxYesNo(string prompt, bool modal, MBYesNoCallback callback) : base(0x816, 0, 0)
 {
     this.m_Callback = callback;
     this.Center();
     base.m_CanClose = false;
     base.m_Children.Add(new GLabel(prompt, Engine.GetFont(1), Hues.Load(0x39f), 0x21, 0x1b));
     base.m_Children.Add(new GMBYNButton(this, 0x817, 0x25, false));
     base.m_Children.Add(new GMBYNButton(this, 0x81a, 100, true));
     Gumps.Modal = this;
 }
Пример #16
0
        public Bitmap GetLand(int LandID, int HueID)
        {
            Texture land = Hues.Load(HueID).GetLand(LandID);

            if ((land == null) || land.IsEmpty())
            {
                return(null);
            }
            return(land.ToBitmap());
        }
Пример #17
0
 public GSkillIconName(Skill skill)
     : base(skill.Name, (IFont)Engine.GetUniFont(0), Hues.Bright, Hues.Load(53), 4, 4, (OnClick)null)
 {
     this.m_Skill     = skill;
     this.m_CanDrag   = true;
     this.m_QuickDrag = false;
     this.X          -= this.Image.xMin;
     this.Y          -= this.Image.yMin;
     this.m_Tooltip   = (ITooltip) new SkillTooltip(skill);
 }
Пример #18
0
        public Bitmap GetItem(int ItemID, int HueID)
        {
            Texture item = Hues.Load(HueID).GetItem(ItemID);

            if ((item == null) || item.IsEmpty())
            {
                return(null);
            }
            return(item.ToBitmap());
        }
Пример #19
0
        public GSellGump_OfferedItem(GSellGump owner, SellInfo si)
            : base(32, 67, 196, 0)
        {
            this.m_OfferMenu = owner.OfferMenu;
            IFont font = (IFont)Engine.GetUniFont(3);
            IHue  hue  = Hues.Load(648);

            this.m_xAmount     = si.ToSell;
            this.m_Amount      = new GLabel(si.ToSell.ToString(), font, hue, 0, 0);
            this.m_Description = (GLabel) new GWrappedLabel(string.Format("{0} at {1} gp", (object)si.Name, (object)si.Price), font, hue, 41, 0, 105);
            this.m_More        = new GSellGump_AmountButton(owner, si, 5, 55, 155);
            this.m_Less        = new GSellGump_AmountButton(owner, si, -5, 56, 173);
            this.m_Height      = this.m_Amount.Image.yMax - this.m_Amount.Image.yMin + 1;
            int num = this.m_Description.Image.yMax - this.m_Description.Image.yMin + 1;

            if (num > this.m_Height)
            {
                this.m_Height = num;
            }
            int height1 = this.m_More.Height;

            if (height1 > this.m_Height)
            {
                this.m_Height = height1;
            }
            int height2 = this.m_Less.Height;

            if (height2 > this.m_Height)
            {
                this.m_Height = height2;
            }
            this.m_Amount.X      -= this.m_Amount.Image.xMin;
            this.m_Amount.Y       = (this.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  = (this.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         = (this.m_Height - this.m_More.Height) / 2;
            this.m_Less.Y         = (this.m_Height - this.m_Less.Height) / 2;
            this.m_Children.Add((Gump)this.m_Amount);
            this.m_Children.Add((Gump)this.m_Description);
            this.m_Children.Add((Gump)this.m_More);
            this.m_Children.Add((Gump)this.m_Less);
            this.Clipper = this.m_OfferMenu.ContentClipper;
            if (!Engine.ServerFeatures.AOS)
            {
                return;
            }
            this.Tooltip = (ITooltip) new ItemTooltip(si.Item);
        }
Пример #20
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);
        }
Пример #21
0
 public GMessageBoxYesNo(string prompt, bool modal, MBYesNoCallback callback)
     : base(2070, 0, 0)
 {
     this.m_Callback = callback;
     this.Center();
     this.m_CanClose = false;
     this.m_Children.Add((Gump) new GLabel(prompt, (IFont)Engine.GetFont(1), Hues.Load(927), 33, 27));
     this.m_Children.Add((Gump) new GMessageBoxYesNo.GMBYNButton(this, 2071, 37, false));
     this.m_Children.Add((Gump) new GMessageBoxYesNo.GMBYNButton(this, 2074, 100, true));
     Gumps.Modal = (Gump)this;
 }
Пример #22
0
 public static void Update()
 {
     for (int i = 0; i < m_Instances.Count; i++)
     {
         GAbilityIcon icon = (GAbilityIcon)m_Instances[i];
         AbilityInfo  info = icon.m_Primary ? AbilityInfo.Primary : AbilityInfo.Secondary;
         icon.GumpID        = info.Icon;
         icon.Hue           = (info == AbilityInfo.Active) ? Hues.Load(0x8026) : Hues.Default;
         icon.Tooltip       = new Tooltip(Localization.GetString(info.Name), true);
         icon.Tooltip.Delay = 0.25f;
     }
 }
Пример #23
0
 public GPingDisplay()
     : base("", Engine.DefaultFont, Engine.DefaultHue, 4, 4)
 {
     this.m_Hues    = new IHue[7];
     this.m_Hues[0] = Hues.Load(68);
     this.m_Hues[1] = Hues.Load(63);
     this.m_Hues[2] = Hues.Load(58);
     this.m_Hues[3] = Hues.Load(53);
     this.m_Hues[4] = Hues.Load(48);
     this.m_Hues[5] = Hues.Load(43);
     this.m_Hues[6] = Hues.Load(38);
 }
Пример #24
0
 public static void Update()
 {
     for (int index = 0; index < GAbilityIcon.m_Instances.Count; ++index)
     {
         GAbilityIcon gabilityIcon = (GAbilityIcon)GAbilityIcon.m_Instances[index];
         AbilityInfo  abilityInfo  = gabilityIcon.m_Primary ? AbilityInfo.Primary : AbilityInfo.Secondary;
         gabilityIcon.GumpID        = abilityInfo.Icon;
         gabilityIcon.Hue           = abilityInfo == AbilityInfo.Active ? Hues.Load(32806) : Hues.Default;
         gabilityIcon.Tooltip       = (ITooltip) new Tooltip(Localization.GetString(abilityInfo.Name), true);
         gabilityIcon.Tooltip.Delay = 0.25f;
     }
 }
Пример #25
0
        private Gump CreateLabel(string text, bool scroll)
        {
            text = text.Replace('\r', '\n');
            GBackground   background = new GBackground(0xbbc, 200, 100, true);
            GWrappedLabel toAdd      = new GWrappedLabel(text, Engine.GetFont(1), Hues.Load(0x455), background.OffsetX, background.OffsetY, background.UseWidth);

            background.Height = toAdd.Height + (background.Height - background.UseHeight);
            background.Children.Add(toAdd);
            toAdd.Center();
            background.SetMouseOverride(this);
            return(background);
        }
Пример #26
0
        public static bool UseWand_OnAction(string args)
        {
            if (MacroHandlers._wandEffects == null)
            {
                MacroHandlers._wandEffects = MacroHandlers.CreateWandEffectTable();
            }
            WandEffect effect;

            if (MacroHandlers._wandEffects.TryGetValue(args, out effect))
            {
                Mobile player = World.Player;
                if (player != null)
                {
                    Item pickUp = WandRepository.Find(effect);
                    if (pickUp != null)
                    {
                        if (pickUp.Parent == player)
                        {
                            pickUp.Use();
                        }
                        else
                        {
                            Item equip1 = player.FindEquip(Layer.OneHanded);
                            if (equip1 != null)
                            {
                                Item backpack = player.Backpack;
                                if (backpack != null)
                                {
                                    new MoveContext(equip1, equip1.Amount, (IEntity)backpack, false).Enqueue();
                                }
                            }
                            Item equip2 = player.FindEquip(Layer.TwoHanded);
                            if (equip2 != null)
                            {
                                Item backpack = player.Backpack;
                                if (backpack != null)
                                {
                                    new MoveContext(equip2, equip2.Amount, (IEntity)backpack, false).Enqueue();
                                }
                            }
                            new EquipContext(pickUp, pickUp.Amount, player, false).Enqueue();
                            new UseContext((IEntity)pickUp, false).Enqueue();
                        }
                    }
                    else
                    {
                        Engine.AddTextMessage("Wand not found.", Engine.DefaultFont, Hues.Load(38));
                    }
                }
            }
            return(true);
        }
Пример #27
0
 protected override bool OnTarget(Mobile mob)
 {
     mob.AddTextMessage("", "- last target set -", Engine.DefaultFont, Hues.Load(89), false);
     if (Party.State == PartyState.Joined)
     {
         string identifier = mob.Identifier;
         if (identifier != null)
         {
             Party.SendAutomatedMessage("Changing last target to {0}", (object)identifier);
         }
     }
     return(true);
 }
Пример #28
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);
            }
        }
Пример #29
0
 public GHealthBar(Mobile m, int X, int Y) : base(m.Player ? (m.Flags[MobileFlag.Warmode] ? 0x807 : 0x803) : 0x804, X, Y)
 {
     this.m_xName     = "";
     this.m_Mobile    = m;
     base.m_CanDrop   = true;
     base.m_QuickDrag = false;
     this.m_Player    = m.Player;
     if (!this.m_Player)
     {
         base.Hue = Hues.GetNotoriety(m.Notoriety);
     }
     if (Engine.Features.AOS)
     {
         base.Tooltip = new MobileTooltip(m);
     }
     if (this.m_Player)
     {
         this.m_HP   = new GImageClip(this.GetHealthGumpID(m.Flags), 0x22, 12, m.HPCur, m.HPMax);
         this.m_Mana = new GImageClip(0x806, 0x22, 0x19, m.ManaCur, m.ManaMax);
         this.m_Stam = new GImageClip(0x806, 0x22, 0x26, m.StamCur, m.StamMax);
         base.m_Children.Add(new GImage(0x805, 0x22, 12));
         base.m_Children.Add(new GImage(0x805, 0x22, 0x19));
         base.m_Children.Add(new GImage(0x805, 0x22, 0x26));
         base.m_Children.Add(this.m_HP);
         base.m_Children.Add(this.m_Mana);
         base.m_Children.Add(this.m_Stam);
         this.m_xHPCur   = m.HPCur;
         this.m_xHPMax   = m.HPMax;
         this.m_xStamCur = m.StamCur;
         this.m_xStamMax = m.StamMax;
         this.m_xManaCur = m.ManaCur;
         this.m_xManaMax = m.ManaMax;
         this.m_xFlags   = m.Flags.Clone();
     }
     else
     {
         this.m_Name   = new GLabel(m.Name, Engine.GetFont(1), Hues.Load(0x455), 0x10, 0);
         this.m_Name.Y = 11 + ((0x18 - this.m_Name.Height) / 2);
         this.m_Name.Scissor(0, 0, 0x7a, this.m_Name.Height);
         this.m_HP = new GImageClip(this.GetHealthGumpID(m.Flags), 0x22, 0x26, m.HPCur, m.HPMax);
         base.m_Children.Add(new GImage(0x805, 0x22, 0x26));
         base.m_Children.Add(this.m_Name);
         base.m_Children.Add(this.m_HP);
         this.m_xName  = m.Name;
         this.m_xHPCur = m.HPCur;
         this.m_xHPMax = m.HPMax;
         this.m_xFlags = m.Flags.Clone();
     }
 }
Пример #30
0
 public GQuestionMenuEntry(int x, int y, int xWidth, AnswerEntry a) : base(x, y)
 {
     this.m_yBase  = y;
     this.m_Answer = a;
     this.m_Radio  = new GRadioButton(210, 0xd3, false, 0, 0);
     this.m_Label  = new GWrappedLabel(a.Text, Engine.GetFont(1), Hues.Load(0x455), this.m_Radio.Width + 4, 5, (xWidth - this.m_Radio.Width) - 4);
     this.m_Width  = xWidth;
     this.m_Height = this.m_Radio.Height;
     if ((this.m_Label.Y + this.m_Label.Height) > this.m_Height)
     {
         this.m_Height = this.m_Label.Y + this.m_Label.Height;
     }
     base.m_Children.Add(this.m_Radio);
     base.m_Children.Add(this.m_Label);
 }