Example #1
0
 public GPaperdollItem(int X, int Y, int GumpID, int Serial, IHue Hue, int Layer, Mobile owner, bool canDrag)
     : base(X, Y)
 {
     this.m_fAlpha = 1f;
     this.m_GumpID = GumpID;
     this.m_Serial = Serial;
     this.m_Hue = Hue;
     this.m_Layer = Layer;
     this.m_Item = World.FindItem(this.m_Serial);
     if ((this.m_Item != null) && Engine.Features.AOS)
     {
         base.Tooltip = new ItemTooltip(this.m_Item);
     }
     this.m_Image = this.m_Hue.GetGump(this.m_GumpID);
     if ((this.m_Image != null) && !this.m_Image.IsEmpty())
     {
         this.m_Width = this.m_Image.Width;
         this.m_Height = this.m_Image.Height;
         this.m_Draw = this.m_Item != null;
     }
     else
     {
         this.m_Width = 0;
         this.m_Height = 0;
         this.m_Draw = false;
     }
     base.m_ITranslucent = true;
     this.m_ValidDrag = (((canDrag && (this.m_Layer >= 1)) && ((this.m_Layer <= 0x18) && (this.m_Layer != 11))) && (this.m_Layer != 0x10)) && (this.m_Layer != 0x15);
     base.m_CanDrag = true;
     base.m_QuickDrag = (((this.m_Layer < 1) || (this.m_Layer > 0x18)) || (this.m_Layer == 11)) || (this.m_Layer == 0x10);
 }
Example #2
0
 public GServerList(Server[] servers, int x, int y, int width, int height, int gumpID, IFont font, IHue hue, int selectionBorderColor, int selectionFillColor, int selectionFillAlpha)
     : base(gumpID, width, height, x, y, true)
 {
     this.m_xLast = -2147483648;
     this.m_yLast = -2147483648;
     int offsetX = base.OffsetX;
     int offsetY = base.OffsetY;
     int useWidth = base.UseWidth;
     this.m_Entries = new GServerEntry[servers.Length];
     for (int i = 0; i < servers.Length; i++)
     {
         this.m_Entries[i] = new GServerEntry(servers[i], font, hue, offsetX, offsetY, useWidth, selectionBorderColor, selectionFillColor, ((float) selectionFillAlpha) / 255f);
         offsetY += this.m_Entries[i].Height - 1;
         base.m_Children.Add(this.m_Entries[i]);
     }
     offsetY++;
     offsetY -= base.OffsetY;
     if (offsetY > (base.UseHeight - 2))
     {
         base.m_Children.Add(new GImage(0x101, this.Width - 6, 4));
         base.m_Children.Add(new GImage(0xff, this.Width - 6, this.Height - 0x25));
         for (int j = 0x22; (j + 0x20) < (this.Height - 5); j += 30)
         {
             base.m_Children.Add(new GImage(0x100, this.Width - 6, j));
         }
         base.m_NonRestrictivePicking = true;
         this.m_Slider = new GVSlider(0xfe, this.Width - 5, 0x11, 13, 0xec, 0.0, 0.0, (double) (offsetY - (base.UseHeight - 2)), 1.0);
         this.m_Slider.OnValueChange = new OnValueChange(this.OnScroll);
         this.m_Slider.ScrollOffset = 20.0;
         base.m_Children.Add(this.m_Slider);
         base.m_Children.Add(new GHotspot(this.Width - 6, 4, 15, this.Height - 9, this.m_Slider));
     }
 }
Example #3
0
 public AnimatedItemEffect(int Source, int xSource, int ySource, int zSource, int ItemID, IHue Hue, int duration)
     : this(ItemID, Hue, duration)
 {
     Mobile source = World.FindMobile(Source);
     if (source != null)
     {
         base.SetSource(source);
         if ((!source.Player && !source.IsMoving) && (((xSource != 0) || (ySource != 0)) || (zSource != 0)))
         {
             source.SetLocation((short) xSource, (short) ySource, (short) zSource);
             source.Update();
             source.UpdateReal();
         }
     }
     else
     {
         Item item = World.FindItem(Source);
         if (item != null)
         {
             base.SetSource(item);
             if (((xSource != 0) || (ySource != 0)) || (zSource != 0))
             {
                 item.SetLocation((short) xSource, (short) ySource, (short) zSource);
                 item.Update();
             }
         }
         else
         {
             base.SetSource(xSource, ySource, zSource);
         }
     }
 }
Example #4
0
 public AnimatedItemEffect(int ItemID, IHue Hue, int duration)
 {
     base.m_Children = new EffectList();
     this.m_Duration = duration;
     this.m_Hue = Hue;
     ItemID &= 0x3fff;
     this.m_ItemID = ItemID | 0x4000;
     this.m_Animated = true;
     AnimData anim = Map.GetAnim(ItemID);
     this.m_FrameCount = anim.frameCount;
     this.m_Delay = anim.frameInterval;
     this.m_Animation = new sbyte[0x40];
     for (int i = 0; i < 0x40; i++)
     {
         this.m_Animation[i] = anim[i];
     }
     if (this.m_FrameCount == 0)
     {
         this.m_FrameCount = 1;
         this.m_Animation[0] = 0;
     }
     if (this.m_Delay == 0)
     {
         this.m_Delay = 1;
     }
 }
Example #5
0
 public GItemListEntry(int x, AnswerEntry entry, GItemList owner)
     : base(x, 0x2d)
 {
     this.m_Entry = entry;
     this.m_Owner = owner;
     int hue = entry.Hue;
     if (hue > 0)
     {
         hue++;
     }
     this.m_Hue = Hues.GetItemHue(entry.ItemID, hue);
     this.m_Image = this.m_Hue.GetItem(entry.ItemID);
     if ((this.m_Image != null) && !this.m_Image.IsEmpty())
     {
         this.m_Draw = true;
         this.m_Height = 0x2f;
         int num2 = (this.m_Image.xMax - this.m_Image.xMin) + 1;
         this.m_Width = 0x2f;
         if (num2 > this.m_Width)
         {
             this.m_Width = num2;
         }
         this.m_ImageOffsetX = ((this.m_Width - ((this.m_Image.xMax - this.m_Image.xMin) + 1)) / 2) - this.m_Image.xMin;
         this.m_ImageOffsetY = ((this.m_Height - ((this.m_Image.yMax - this.m_Image.yMin) + 1)) / 2) - this.m_Image.yMin;
     }
 }
Example #6
0
 public JournalEntry(string text, IHue hue, int serial)
 {
     this.m_Text = text;
     this.m_Hue = hue;
     this.m_Serial = serial;
     this.m_Time = DateTime.Now;
 }
Example #7
0
 public GSpellName(int SpellID, string Name, IFont Font, IHue HRegular, IHue HOver, int X, int Y)
     : base(Name, Font, HRegular, HOver, X, Y, null)
 {
     this.m_SpellID = SpellID;
     base.m_CanDrag = true;
     base.m_QuickDrag = false;
 }
Example #8
0
 public GServerImage(GServerGump owner, int x, int y, int gumpID, IHue hue)
     : base(gumpID, hue, x, y)
 {
     this.m_Owner = owner;
     base.m_QuickDrag = true;
     base.m_CanDrag = owner.CanMove;
 }
Example #9
0
 public GServerEntry(Server server, IFont font, IHue hue, int x, int y, int width, int selectedBorderColor, int selectedFillColor, float selectedFillAlpha)
     : base(x, y)
 {
     this.m_yBase = y;
     this.m_SelectedBorderColor = selectedBorderColor;
     this.m_SelectedFillColor = selectedFillColor;
     this.m_SelectedFillAlpha = selectedFillAlpha;
     this.m_Server = server;
     this.m_Name = new GLabel(server.Name, font, hue, 4, 4);
     this.m_Name.X -= this.m_Name.Image.xMin;
     base.m_Children.Add(this.m_Name);
     this.m_PercentFull = new GLabel(string.Format("{0}% full", server.PercentFull), font, hue, width - 5, 4);
     this.m_PercentFull.X -= this.m_PercentFull.Image.xMax;
     base.m_Children.Add(this.m_PercentFull);
     int num = (this.m_Name.Image.yMax - this.m_Name.Image.yMin) + 1;
     this.m_Height = num;
     num = (this.m_PercentFull.Image.yMax - this.m_PercentFull.Image.yMin) + 1;
     if (num > this.m_Height)
     {
         this.m_Height = num;
     }
     this.m_Height += 8;
     this.m_Name.Y = ((this.m_Height - ((this.m_Name.Image.yMax - this.m_Name.Image.yMin) + 1)) / 2) - this.m_Name.Image.yMin;
     this.m_PercentFull.Y = ((this.m_Height - ((this.m_PercentFull.Image.yMax - this.m_PercentFull.Image.yMin) + 1)) / 2) - this.m_PercentFull.Image.yMin;
     this.m_Width = width;
 }
Example #10
0
 public GFader(float Duration, float FadeInDuration, float FadeTo, int GumpID, int X, int Y, IHue h)
     : base(GumpID, h, X, Y)
 {
     this.m_fDuration = Duration;
     this.m_fFadeTo = FadeTo;
     this.m_fFadeInDuration = FadeInDuration;
     this.State = FadeState.O2F;
 }
Example #11
0
 public GListBox(IFont Font, IHue HRegular, IHue HOver, int BackID, int X, int Y, int Width, int Height, bool HasBorder)
     : base(BackID, Width, Height, X, Y, HasBorder)
 {
     this.m_Font = Font;
     this.m_HRegular = HRegular;
     this.m_HOver = HOver;
     this.m_ItemCount = base.UseHeight / 0x12;
 }
Example #12
0
 public Texture ReadFromDisk(int TextureID, IHue Hue)
 {
     if (this.m_Factory == null)
     {
         this.m_Factory = new TexMapFactory(this);
     }
     return this.m_Factory.Load(TextureID, Hue);
 }
Example #13
0
 public GImage(int gumpID, IHue hue, int x, int y)
     : base(x, y)
 {
     this.m_GumpID = gumpID;
     this.m_Hue = hue;
     this.Invalidate();
     this.Refresh();
     base.m_ITranslucent = true;
 }
Example #14
0
 public StaticTarget(int x, int y, int z, int id, int realID, IHue hue)
 {
     this.m_X = x;
     this.m_Y = y;
     this.m_Z = z;
     this.m_ID = id;
     this.m_RealID = realID;
     this.m_Hue = hue;
 }
Example #15
0
 private GDynamicMessage(bool unremovable, IMessageOwner owner, string text, IFont font, IHue hue, float duration)
     : base(text, font, hue, Hues.Load(0x35), 0, 0, null)
 {
     this.m_Unremovable = unremovable;
     base.m_OverridesCursor = false;
     this.m_Owner = owner;
     this.m_SolidDuration = duration;
     this.m_Dispose = new TimeSync((double) (this.m_SolidDuration + 1f));
 }
Example #16
0
 private DynamicItem(Item i)
 {
     this.m_Item = i;
     this.m_ID = i.ID;
     this.m_ID = (short) (this.m_ID & 0x3fff);
     this.m_ID = (short) (this.m_ID + 0x4000);
     this.m_Z = (sbyte) i.Z;
     this.m_Hue = Hues.GetItemHue(this.m_ID, i.Hue);
     this.m_Height = Map.GetHeight(this.m_ID);
 }
Example #17
0
 public GWrappedLabel(string text, IFont font, IHue hue, int x, int y, int width)
     : base(x, y)
 {
     this.m_WrapWidth = width;
     base.m_Text = text;
     base.m_Font = font;
     base.m_Hue = hue;
     base.m_ITranslucent = true;
     this.Refresh();
 }
Example #18
0
 public GSystemMessage(string text, IFont font, IHue hue, float duration)
     : base(text, font, hue, 0, 0)
 {
     base.m_OverridesCursor = false;
     this.m_SolidDuration = duration;
     this.m_Dispose = new TimeSync((double) (this.m_SolidDuration + 1f));
     this.m_UpdateTime = DateTime.Now;
     this.m_DupeCount = 1;
     this.m_OrigText = text;
 }
Example #19
0
 public GAttributeCurMax(int x, int y, int w, int h, int c, int m, IFont font, IHue hue)
     : base(x, y, w, h)
 {
     this.m_Current = c;
     this.m_Maximum = m;
     this.m_GCurrent = new GWrappedLabel(this.m_Current.ToString(), font, hue, 0, 0, w * 2);
     this.m_GMaximum = new GWrappedLabel(this.m_Maximum.ToString(), font, hue, 0, 11, w * 2);
     base.m_Children.Add(this.m_GCurrent);
     base.m_Children.Add(this.m_GMaximum);
     this.Update();
 }
Example #20
0
 public void Dispose()
 {
     IEnumerator enumerator = this.m_Cache.Values.GetEnumerator();
     while (enumerator.MoveNext())
     {
         ((Texture) enumerator.Current).Dispose();
     }
     this.m_Cache.Clear();
     this.m_Cache = null;
     this.m_Hue = null;
 }
Example #21
0
 private StaticItem(short ItemID, sbyte Z, int serial)
 {
     this.m_ID = ItemID;
     this.m_RealID = (short) ((this.m_ID & 0x3fff) | 0x4000);
     this.m_ID = (short) (this.m_ID & 0x3fff);
     this.m_ID = (short) (this.m_ID + 0x4000);
     this.m_Z = Z;
     this.m_Height = Map.GetHeight(this.m_ID);
     this.m_Hue = Hues.Default;
     this.Serial = serial;
     this.m_vPool = VertexConstructor.Create();
 }
Example #22
0
 public GDraggedItem(Client.Item item)
     : base(0, 0)
 {
     this.m_vCache = new VertexCache();
     this.m_Item = item;
     int index = this.m_Item.ID & 0x3fff;
     int amount = (ushort) this.m_Item.Amount;
     this.m_Double = Map.m_ItemFlags[index][TileFlag.Generic] && (amount > 1);
     if ((index >= 0xeea) && (index <= 0xef2))
     {
         int num3 = (index - 0xeea) / 3;
         num3 *= 3;
         num3 += 0xeea;
         this.m_Double = false;
         if (amount <= 1)
         {
             index = num3;
         }
         else if ((amount >= 2) && (amount <= 5))
         {
             index = num3 + 1;
         }
         else
         {
             index = num3 + 2;
         }
     }
     this.m_Hue = Hues.GetItemHue(index, this.m_Item.Hue);
     this.m_Image = this.m_Hue.GetItem(index);
     if ((this.m_Image != null) && !this.m_Image.IsEmpty())
     {
         this.m_Draw = true;
         this.m_Width = this.m_Image.Width;
         this.m_Height = this.m_Image.Height;
         int num4 = this.m_Double ? 6 : 1;
         this.m_xOffset = base.m_OffsetX = this.m_Image.xMin + (((this.m_Image.xMax - this.m_Image.xMin) + num4) / 2);
         this.m_yOffset = this.m_Image.yMin;
         base.m_OffsetY = this.m_yOffset + (((this.m_Image.yMax - this.m_Image.yMin) + num4) / 2);
         if (this.m_Double)
         {
             this.m_Width += 5;
             this.m_Height += 5;
         }
     }
     base.m_DragCursor = false;
     base.m_CanDrag = true;
     base.m_QuickDrag = true;
     base.m_IsDragging = true;
     Gumps.Drag = this;
     Gumps.LastOver = this;
     base.m_X = Engine.m_xMouse - base.m_OffsetX;
     base.m_Y = Engine.m_yMouse - base.m_OffsetY;
 }
Example #23
0
 public GLabel(string Text, IFont Font, IHue Hue, int X, int Y)
     : base(X, Y)
 {
     this.m_Invalidated = true;
     this.m_Text = "";
     this.m_fAlpha = 1f;
     this.m_Text = Text;
     this.m_Font = Font;
     this.m_Hue = Hue;
     base.m_ITranslucent = true;
     this.Refresh();
 }
Example #24
0
 public GTextButton(string text, IFont font, IHue defaultHue, IHue focusHue, int x, int y, Client.OnClick onClick)
     : base(x, y)
 {
     this.m_CanHitTest = true;
     this.m_Hues = new IHue[] { defaultHue, focusHue };
     this.m_OnClick = onClick;
     base.m_Text = text;
     base.m_Font = font;
     base.m_Hue = defaultHue;
     base.m_ITranslucent = true;
     this.Refresh();
 }
Example #25
0
 private unsafe StaticItem(byte* pvSrc, int si, int serial)
 {
     this.m_ID = *((short*) pvSrc);
     this.m_Z = *((sbyte*) (pvSrc + 4));
     this.m_RealID = (short) ((this.m_ID & 0x3fff) | 0x4000);
     this.m_ID = (short) (this.m_ID & 0x3fff);
     this.m_ID = (short) (this.m_ID + 0x4000);
     this.m_Hue = Hues.GetItemHue(this.m_ID, *((ushort*) (pvSrc + 5)));
     this.m_Height = Map.GetHeight(this.m_ID);
     this.m_SortInfluence = si;
     this.Serial = serial;
     this.m_vPool = VertexConstructor.Create();
 }
Example #26
0
 private StaticItem(HuedTile tile, int influence, int serial)
 {
     this.m_ID = (short) tile.ID;
     this.m_Z = (sbyte) tile.Z;
     this.m_RealID = (short) ((tile.ID & 0x3fff) | 0x4000);
     this.m_ID = (short) (this.m_ID & 0x3fff);
     this.m_ID = (short) (this.m_ID + 0x4000);
     this.m_Hue = Hues.GetItemHue(this.m_ID, tile.Hue);
     this.m_Height = Map.GetHeight(this.m_ID);
     this.m_SortInfluence = influence;
     this.Serial = serial;
     this.m_vPool = VertexConstructor.Create();
 }
Example #27
0
 public GItemArt(int x, int y, int itemID, IHue hue)
     : base(x, y)
 {
     this.m_vCache = new VertexCache();
     this.m_Hue = hue;
     this.m_ItemID = itemID;
     this.m_Image = hue.GetItem(itemID);
     if ((this.m_Image != null) && !this.m_Image.IsEmpty())
     {
         this.m_Width = this.m_Image.Width;
         this.m_Height = this.m_Image.Height;
         this.m_Draw = true;
     }
 }
Example #28
0
 public GComboBox(string[] List, int Index, int BackID, int NormalID, int OverID, int PressedID, int X, int Y, int Width, int Height, IFont Font, IHue HRegular, IHue HOver)
     : base(BackID, Width, Height, X, Y, true)
 {
     this.m_Index = -1;
     this.m_BackID = BackID;
     this.m_Font = Font;
     this.m_HRegular = HRegular;
     this.m_HOver = HOver;
     this.m_Button = new GButton(NormalID, OverID, PressedID, 0, 0, new OnClick(this.OpenList_OnClick));
     base.m_Children.Add(this.m_Button);
     this.m_Button.Center();
     this.m_Button.X = ((base.OffsetX + base.UseWidth) - this.m_Button.Width) - 1;
     this.m_Button.Y++;
     this.List = List;
     this.Index = Index;
 }
Example #29
0
 public GContainerItem(Client.Item Item, Client.Item Container)
     : base(Item.ContainerX, Item.ContainerY)
 {
     this.m_Item = Item;
     this.m_Container = Container;
     this.m_TileID = this.m_Item.ID;
     this.m_Hue = Hues.GetItemHue(this.m_TileID, this.m_Item.Hue);
     this.State = 0;
     base.m_CanDrag = true;
     base.m_CanDrop = true;
     base.m_QuickDrag = false;
     base.m_DragCursor = false;
     if (Engine.Features.AOS)
     {
         base.Tooltip = new ItemTooltip(this.m_Item);
     }
 }
Example #30
0
 public GTextBox(int GumpID, bool HasBorder, int X, int Y, int Width, int Height, string StartText, IFont f, IHue HNormal, IHue HOver, IHue HFocus, char PassChar)
     : base(X, Y)
 {
     this.m_String = "";
     this.m_MaxChars = -1;
     this.m_Transparent = GumpID == 0;
     this.m_Back = new GBackground(GumpID, Width, Height, HasBorder);
     this.m_PassChar = PassChar;
     this.m_String = StartText;
     this.m_Font = f;
     this.m_HNormal = HNormal;
     this.m_HFocus = HFocus;
     this.m_HOver = HOver;
     this.m_Width = Width;
     this.m_Height = Height;
     base.m_OverCursor = 14;
     this.UpdateLabel(false, this.m_HNormal);
 }
Example #31
0
 public override Texture Reconstruct(object[] args)
 {
     this.m_LandID = (int)args[0];
     this.m_Hue    = (IHue)args[1];
     return(this.Construct(true));
 }
Example #32
0
 public GWindowsTextBox(int x, int y, int width, int height, string initialText, IFont font, IHue normalHue, IHue overHue, IHue focusHue, char passChar) : base(x, y)
 {
     this.m_Width   = width;
     this.m_Height  = height;
     this.m_TextBox = new GTextBox(0, false, 3, 3, width - 6, height - 6, initialText, font, normalHue, overHue, focusHue, passChar);
     this.Layout();
     base.m_Children.Add(this.m_TextBox);
 }
Example #33
0
 public Texture Load(int landID, IHue hue)
 {
     this.m_LandID = landID & 16383;
     this.m_Hue    = hue;
     return(this.Construct(false));
 }
Example #34
0
 public TextMessage(string Message, float Delay, IFont Font, IHue Hue)
 {
     this.m_Timestamp = Engine.Ticks;
     this.m_Image     = Font.GetString(Message, Hue);
     this.m_Delay     = new TimeDelay(Delay);
 }
Example #35
0
 public GDynamicMessage(bool unremovable, Item i, string text, IFont font, IHue hue) : this(unremovable, i, text, font, hue, Engine.ItemDuration)
 {
 }
Example #36
0
 private GDynamicMessage(bool unremovable, IMessageOwner owner, string text, IFont font, IHue hue, float duration) : base(text, font, hue, Hues.Load(0x35), 0, 0, null)
 {
     this.m_Unremovable     = unremovable;
     base.m_OverridesCursor = false;
     this.m_Owner           = owner;
     this.m_SolidDuration   = duration;
     this.m_Dispose         = new TimeSync((double)(this.m_SolidDuration + 1f));
 }
Example #37
0
 public GDynamicMessage(bool unremovable, Mobile m, string text, IFont font, IHue hue) : this(unremovable, m, text, font, hue, Engine.MobileDuration)
 {
 }