Ejemplo n.º 1
0
 public static void BeginRender()
 {
     while (m_ToRemove.Count > 0)
     {
         object obj2 = m_ToRemove.Dequeue();
         m_Messages.Remove(obj2);
         Gumps.Destroy((Gump)obj2);
     }
     m_yStack = (Engine.GameY + Engine.GameHeight) - 0x16;
     RecurseProcessItemGumps(Gumps.Desktop, 0, 0, false);
     for (int i = 0; i < m_Messages.Count; i++)
     {
         ((IMessage)m_Messages[i]).OnBeginRender();
     }
     while (m_ToRemove.Count > 0)
     {
         object obj3 = m_ToRemove.Dequeue();
         m_Messages.Remove(obj3);
         Gumps.Destroy((Gump)obj3);
     }
     if (Gumps.Invalidated)
     {
         if (Engine.m_LastMouseArgs != null)
         {
             Engine.MouseMove(Engine.m_Display, Engine.m_LastMouseArgs);
             Engine.MouseMoveQueue();
         }
         Gumps.Invalidated = false;
     }
 }
Ejemplo n.º 2
0
 protected internal override void OnDragDrop(Gump g)
 {
     if ((g != null) && (g.GetType() == typeof(GDraggedItem)))
     {
         GDraggedItem item  = (GDraggedItem)g;
         Client.Item  item2 = item.Item;
         if (((GContainer)base.m_Parent).m_HitTest)
         {
             TileFlags flags = Map.m_ItemFlags[this.m_Item.ID & 0x3fff];
             if (flags[TileFlag.Container])
             {
                 Network.Send(new PDropItem(item2.Serial, -1, -1, 0, this.m_Item.Serial));
                 Gumps.Destroy(item);
             }
             else if ((flags[TileFlag.Generic] && (item2.ID == this.m_Item.ID)) && (item2.Hue == this.m_Item.Hue))
             {
                 Point point = ((GContainer)base.m_Parent).Clip(item.Image, item.Double, base.m_Parent.PointToClient(new Point(Engine.m_xMouse - item.m_OffsetX, Engine.m_yMouse - item.m_OffsetY)), item.m_OffsetX, item.m_OffsetY);
                 Network.Send(new PDropItem(item2.Serial, (short)point.X, (short)point.Y, 0, this.m_Item.Serial));
                 Gumps.Destroy(item);
             }
             else
             {
                 base.m_Parent.OnDragDrop(item);
             }
         }
         else
         {
             base.m_Parent.OnDragDrop(item);
         }
     }
 }
Ejemplo n.º 3
0
        protected internal override void OnDragDrop(Gump g)
        {
            if (g == null || !(g.GetType() == typeof(GDraggedItem)))
            {
                return;
            }
            GDraggedItem gdraggedItem = (GDraggedItem)g;
            Item         obj          = gdraggedItem.Item;

            if (((GContainer)this.m_Parent).m_HitTest)
            {
                TileFlags tileFlags = Map.m_ItemFlags[this.m_Item.ID & 16383];
                if (tileFlags[(TileFlag)2097152L])
                {
                    Network.Send((Packet) new PDropItem(obj.Serial, -1, -1, 0, this.m_Item.Serial));
                    Gumps.Destroy((Gump)gdraggedItem);
                }
                else if (tileFlags[(TileFlag)2048L] && obj.ID == this.m_Item.ID && (int)obj.Hue == (int)this.m_Item.Hue)
                {
                    Point point = ((GContainer)this.m_Parent).Clip(gdraggedItem.Image, gdraggedItem.Double, this.m_Parent.PointToClient(new Point(Engine.m_xMouse - gdraggedItem.m_OffsetX, Engine.m_yMouse - gdraggedItem.m_OffsetY)), gdraggedItem.m_OffsetX, gdraggedItem.m_OffsetY);
                    Network.Send((Packet) new PDropItem(obj.Serial, (int)(short)point.X, (int)(short)point.Y, 0, this.m_Item.Serial));
                    Gumps.Destroy((Gump)gdraggedItem);
                }
                else
                {
                    this.m_Parent.OnDragDrop((Gump)gdraggedItem);
                }
            }
            else
            {
                this.m_Parent.OnDragDrop((Gump)gdraggedItem);
            }
        }
Ejemplo n.º 4
0
 protected internal override void OnDragDrop(Gump g)
 {
     if (!this.m_HitTest)
     {
         this.m_Parent.OnDragDrop(g);
     }
     else
     {
         if (g == null || !(g.GetType() == typeof(GDraggedItem)))
         {
             return;
         }
         GDraggedItem gdraggedItem = (GDraggedItem)g;
         Point        point        = this.Clip(gdraggedItem.Image, gdraggedItem.Double, this.PointToClient(new Point(Engine.m_xMouse - g.m_OffsetX, Engine.m_yMouse - g.m_OffsetY)), g.m_OffsetX, g.m_OffsetY);
         int          num          = gdraggedItem.Item.ID & 16383;
         if (num >= 13701 && num <= 13706)
         {
             point.Y += 20;
         }
         else if (num >= 13708 && num <= 13713)
         {
             point.Y += 20;
         }
         Gumps.Destroy((Gump)gdraggedItem);
         Network.Send((Packet) new PDropItem(gdraggedItem.Item.Serial, (int)(short)point.X, (int)(short)point.Y, 0, this.m_Item.Serial));
     }
 }
Ejemplo n.º 5
0
 public static void BeginRender()
 {
     while (MessageManager.m_ToRemove.Count > 0)
     {
         object obj = MessageManager.m_ToRemove.Dequeue();
         MessageManager.m_Messages.Remove(obj);
         Gumps.Destroy((Gump)obj);
     }
     MessageManager.m_yStack = Engine.GameY + Engine.GameHeight - 22;
     MessageManager.RecurseProcessItemGumps(Gumps.Desktop, 0, 0, false);
     for (int index = 0; index < MessageManager.m_Messages.Count; ++index)
     {
         ((IMessage)MessageManager.m_Messages[index]).OnBeginRender();
     }
     while (MessageManager.m_ToRemove.Count > 0)
     {
         object obj = MessageManager.m_ToRemove.Dequeue();
         MessageManager.m_Messages.Remove(obj);
         Gumps.Destroy((Gump)obj);
     }
     if (!Gumps.Invalidated)
     {
         return;
     }
     if (Engine.m_LastMouseArgs != null)
     {
         Engine.MouseMove((object)Engine.m_Display, Engine.m_LastMouseArgs);
         Engine.MouseMoveQueue();
     }
     Gumps.Invalidated = false;
 }
Ejemplo n.º 6
0
        protected internal override void OnDragStart()
        {
            int num = (int)this._item.Layer;

            if (this._canLift && num >= 1 && (num <= 24 && num != 11) && num != 16 && num != 21)
            {
                this.m_IsDragging = false;
                Gumps.LastOver    = (Gump)null;
                Gumps.Drag        = (Gump)null;
                Gump gump = this._item.OnBeginDrag();
                if (gump.GetType() == typeof(GDragAmount))
                {
                    ((GDragAmount)gump).ToDestroy = (object)this;
                }
                else
                {
                    this._item.RestoreInfo = new RestoreInfo(this._item);
                    World.Remove(this._item);
                    Gumps.Destroy((Gump)this);
                }
            }
            else
            {
                this.m_IsDragging = false;
                Gumps.Drag        = (Gump)null;
                Point point = this.PointToScreen(new Point(0, 0)) - this.m_Parent.PointToScreen(new Point(0, 0));
                this.m_Parent.m_OffsetX    = point.X + this.m_OffsetX;
                this.m_Parent.m_OffsetY    = point.Y + this.m_OffsetY;
                this.m_Parent.m_IsDragging = true;
                Gumps.Drag = this.m_Parent;
            }
        }
Ejemplo n.º 7
0
 protected internal override void OnDragStart()
 {
     if (this.m_ValidDrag && (this.m_Item != null))
     {
         base.m_IsDragging = false;
         Gumps.LastOver    = null;
         Gumps.Drag        = null;
         Gump gump = this.m_Item.OnBeginDrag();
         if (gump.GetType() == typeof(GDragAmount))
         {
             ((GDragAmount)gump).ToDestroy = this;
         }
         else
         {
             this.m_Item.RestoreInfo = new RestoreInfo(this.m_Item);
             World.Remove(this.m_Item);
             Gumps.Destroy(this);
         }
     }
     else
     {
         base.m_IsDragging = false;
         Gumps.Drag        = null;
         Point point = base.PointToScreen(new Point(0, 0)) - base.m_Parent.PointToScreen(new Point(0, 0));
         base.m_Parent.m_OffsetX    = point.X + base.m_OffsetX;
         base.m_Parent.m_OffsetY    = point.Y + base.m_OffsetY;
         base.m_Parent.m_IsDragging = true;
         Gumps.Drag = base.m_Parent;
     }
 }
Ejemplo n.º 8
0
        private void OpenList_OnClick(Gump g)
        {
            if (this.m_Dropdown != null)
            {
                Gumps.Destroy((Gump)this.m_Dropdown);
            }
            Point screen = this.PointToScreen(new Point(0, 0));

            this.m_Dropdown = new GBackground(this.m_BackID, this.Width, this.m_Count * 20 + (this.Height - this.UseHeight), screen.X, screen.Y, true);
            this.m_Dropdown.DestroyOnUnfocus = true;
            int offsetY = this.m_Dropdown.OffsetY;
            int num1    = 0;

            for (int index = 0; index < this.m_Count; ++index)
            {
                GTextButton gtextButton = new GTextButton(this.m_List[index], this.m_Font, this.m_HRegular, this.m_HOver, this.m_Dropdown.OffsetX, offsetY, new OnClick(this.SetIndex_OnClick));
                gtextButton.SetTag("Index", (object)index);
                this.m_Dropdown.Children.Add((Gump)gtextButton);
                offsetY += gtextButton.Height;
                if (gtextButton.Width + 3 > num1)
                {
                    num1 = gtextButton.Width + 3;
                }
            }
            this.m_Dropdown.Height = offsetY + (this.m_Dropdown.Height - (this.m_Dropdown.OffsetY + this.m_Dropdown.UseHeight));
            int num2 = num1 + (this.m_Dropdown.Width - this.m_Dropdown.UseWidth);

            if (num2 > this.m_Dropdown.Width)
            {
                this.m_Dropdown.Width = num2;
            }
            Gumps.Desktop.Children.Add((Gump)this.m_Dropdown);
        }
Ejemplo n.º 9
0
        private void OpenList_OnClick(Gump g)
        {
            if (this.m_Dropdown != null)
            {
                Gumps.Destroy(this.m_Dropdown);
            }
            Point point = base.PointToScreen(new Point(0, 0));

            this.m_Dropdown = new GBackground(this.m_BackID, this.Width, (this.m_Count * 20) + (this.Height - base.UseHeight), point.X, point.Y, true);
            this.m_Dropdown.DestroyOnUnfocus = true;
            int offsetY = this.m_Dropdown.OffsetY;
            int num2    = 0;

            for (int i = 0; i < this.m_Count; i++)
            {
                GTextButton toAdd = new GTextButton(this.m_List[i], this.m_Font, this.m_HRegular, this.m_HOver, this.m_Dropdown.OffsetX, offsetY, new OnClick(this.SetIndex_OnClick));
                toAdd.SetTag("Index", i);
                this.m_Dropdown.Children.Add(toAdd);
                offsetY += toAdd.Height;
                if ((toAdd.Width + 3) > num2)
                {
                    num2 = toAdd.Width + 3;
                }
            }
            this.m_Dropdown.Height = offsetY + (this.m_Dropdown.Height - (this.m_Dropdown.OffsetY + this.m_Dropdown.UseHeight));
            num2 += this.m_Dropdown.Width - this.m_Dropdown.UseWidth;
            if (num2 > this.m_Dropdown.Width)
            {
                this.m_Dropdown.Width = num2;
            }
            Gumps.Desktop.Children.Add(this.m_Dropdown);
        }
Ejemplo n.º 10
0
 protected internal override void OnMouseDown(int x, int y, MouseButtons mb)
 {
     if ((mb & MouseButtons.Right) != MouseButtons.None)
     {
         Gumps.Destroy(this.m_Owner);
     }
 }
Ejemplo n.º 11
0
 protected internal override void OnMouseUp(int X, int Y, MouseButtons mb)
 {
     if (mb == MouseButtons.Right)
     {
         Gumps.Destroy(this);
     }
 }
Ejemplo n.º 12
0
        private void Entry_OnClick(Gump Sender)
        {
            int tag = (int)Sender.GetTag("EntryID");

            Network.Send(new PPopupResponse(this.m_Owner, tag));
            Gumps.Destroy(this);
        }
Ejemplo n.º 13
0
 protected internal override void OnDragStart()
 {
     if (this.m_Item != null)
     {
         base.m_IsDragging = false;
         Gumps.LastOver    = null;
         Gumps.Drag        = null;
         this.State        = 0;
         Gump gump = this.m_Item.OnBeginDrag();
         if (gump.GetType() == typeof(GDragAmount))
         {
             ((GDragAmount)gump).ToDestroy = this;
         }
         else
         {
             this.m_Item.RestoreInfo = new RestoreInfo(this.m_Item);
             World.Remove(this.m_Item);
             gump.m_OffsetX = base.m_OffsetX;
             gump.m_OffsetY = base.m_OffsetY;
             gump.X         = Engine.m_xMouse - base.m_OffsetX;
             gump.Y         = Engine.m_yMouse - base.m_OffsetY;
             if (base.m_Parent is GContainer)
             {
                 ((GContainer)base.m_Parent).m_Hash[this.m_Item] = null;
             }
             Gumps.Destroy(this);
         }
     }
 }
Ejemplo n.º 14
0
 protected internal override void OnFocusChanged(Gump g)
 {
     if (this.m_Destroy && ((g == null) || !g.IsChildOf(this)))
     {
         Gumps.Destroy(this);
     }
 }
Ejemplo n.º 15
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);
                }
            }
        }
Ejemplo n.º 16
0
        private void UpdateLabel(bool forceUpdate, IHue hue)
        {
            string text = this.m_String;

            if (this.m_PassChar != '\0')
            {
                text = new string(this.m_PassChar, text.Length);
            }
            if (this.m_Focus && this.ShowCaret)
            {
                text = text + "_";
            }
            if ((this.m_Text != null) && !forceUpdate)
            {
                this.m_Text.Text = text;
                this.m_Text.Hue  = hue;
            }
            else
            {
                if (this.m_Text != null)
                {
                    Gumps.Destroy(this.m_Text);
                }
                if (this.m_MaxChars >= 0)
                {
                    this.m_Text = new GWrappedLabel(text, 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(text, this.m_Font, this.m_HNormal, 0, 0);
                }
            }
        }
Ejemplo n.º 17
0
 protected internal override void OnDragDrop(Gump g)
 {
     if (g != null && g.GetType() == typeof(GDraggedItem))
     {
         GDraggedItem gdraggedItem = (GDraggedItem)g;
         Item         toEquip      = gdraggedItem.Item;
         Item         obj          = (Item)null;
         Gump[]       array        = this.m_Children.ToArray();
         Point        client       = this.PointToClient(new Point(Engine.m_xMouse, Engine.m_yMouse));
         for (int index = array.Length - 1; index >= 0; --index)
         {
             if (array[index] is GPaperdollItem && array[index].HitTest(client.X - array[index].X, client.Y - array[index].Y))
             {
                 obj = ((GPaperdollItem)array[index]).Item;
                 break;
             }
         }
         if (obj != null && Map.m_ItemFlags[obj.ID & 16383][(TileFlag)2097152L])
         {
             Network.Send((Packet) new PDropItem(toEquip.Serial, -1, -1, 0, obj.Serial));
         }
         else if (Map.m_ItemFlags[toEquip.ID & 16383][(TileFlag)4194304L])
         {
             Network.Send((Packet) new PEquipItem(toEquip, this.m_Mobile));
         }
         else
         {
             Network.Send((Packet) new PDropItem(toEquip.Serial, -1, -1, 0, World.Serial));
         }
         Gumps.Destroy((Gump)gdraggedItem);
     }
     this._dragPreview = (Item)null;
 }
Ejemplo n.º 18
0
 private void Entry_OnClick(Gump g)
 {
     if ((g.HasTag("HueID") && g.HasTag("Buttons")) && g.HasTag("Index"))
     {
         int          tag     = (int)g.GetTag("HueID");
         MouseButtons buttons = (MouseButtons)g.GetTag("Buttons");
         int          index   = (int)g.GetTag("Index");
         if ((buttons & MouseButtons.Right) != MouseButtons.None)
         {
             QuickHues.Remove(index);
             Gumps.Destroy(this);
             GQuickHues toAdd = new GQuickHues(this.m_Picker, this.m_Brightness, this.m_Okay);
             if (this.m_Expanded)
             {
                 toAdd.m_Expanded = true;
                 toAdd.Height     = toAdd.m_ExpandedHeight;
             }
             base.m_Parent.Children.Add(toAdd);
         }
         else if ((tag >= 2) && (tag < 0x3ea))
         {
             tag -= 2;
             int num3 = tag % 5;
             tag /= 5;
             int num4 = tag % 20;
             tag /= 20;
             int num5 = tag;
             this.m_Picker.Brightness = num3;
             this.m_Picker.ShadeX     = num4;
             this.m_Picker.ShadeY     = num5;
             this.m_Brightness.Refresh();
             this.m_Okay.Click();
         }
     }
 }
Ejemplo n.º 19
0
 public void Close()
 {
     if ((Engine.m_Highlight == this.m_Mobile) && !this.m_Mobile.Player)
     {
         Engine.m_Highlight = null;
     }
     Gumps.Destroy(this);
 }
Ejemplo n.º 20
0
 public void Reset()
 {
     if (this.m_Picker != null)
     {
         Gumps.Destroy(this.m_Picker);
     }
     this.m_Picker = null;
 }
Ejemplo n.º 21
0
 protected internal override void OnFocusChanged(Gump g)
 {
     if (!this.m_Destroy || g != null && g.IsChildOf((Gump)this))
     {
         return;
     }
     Gumps.Destroy((Gump)this);
 }
Ejemplo n.º 22
0
 protected internal override void OnDragLeave(Gump g)
 {
     if (this.m_Image != null)
     {
         Gumps.Destroy(this.m_Image);
         this.m_Image = null;
     }
 }
Ejemplo n.º 23
0
 public void OnChildRemoved(Item removed)
 {
     if (removed.PaperdollItem.Parent != this)
     {
         return;
     }
     Gumps.Destroy((Gump)removed.PaperdollItem);
 }
Ejemplo n.º 24
0
 public static void Hide()
 {
     if (m_Instance != null)
     {
         Gumps.Destroy(m_Instance);
     }
     m_Instance = null;
 }
Ejemplo n.º 25
0
 public void Close()
 {
     if (Engine.m_Highlight == this.m_Mobile && !this.m_Mobile.Player)
     {
         Engine.m_Highlight = (object)null;
     }
     Gumps.Destroy((Gump)this);
 }
Ejemplo n.º 26
0
 protected internal override void OnMouseDown(int X, int Y, MouseButtons mb)
 {
     if (mb != MouseButtons.Right)
     {
         return;
     }
     Gumps.Destroy((Gump)this);
 }
Ejemplo n.º 27
0
 protected internal override void OnMouseUp(int X, int Y, MouseButtons mb)
 {
     if (this.m_CanClose && (mb == MouseButtons.Right))
     {
         Gumps.Destroy(this);
         Engine.CancelClick();
     }
 }
Ejemplo n.º 28
0
 protected internal override void OnMouseUp(int x, int y, MouseButtons mb)
 {
     if ((mb & MouseButtons.Right) != MouseButtons.None)
     {
         Network.Send(new PQuestionMenuCancel(this.m_Serial, this.m_MenuID));
         Gumps.Destroy(this);
     }
 }
Ejemplo n.º 29
0
 protected internal override void OnMouseUp(int X, int Y, MouseButtons mb)
 {
     if (!GRadar.m_ToClose)
     {
         return;
     }
     Gumps.Destroy((Gump)this);
 }
Ejemplo n.º 30
0
 public static void Hide()
 {
     if (GObjectProperties.m_Instance != null)
     {
         Gumps.Destroy((Gump)GObjectProperties.m_Instance);
     }
     GObjectProperties.m_Instance = (GObjectProperties)null;
 }