当前位置: 首页>>代码示例>>C#>>正文


C# Gump.GetType方法代码示例

本文整理汇总了C#中Client.Gump.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Gump.GetType方法的具体用法?C# Gump.GetType怎么用?C# Gump.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Client.Gump的用法示例。


在下文中一共展示了Gump.GetType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnDragDrop

 protected internal override void OnDragDrop(Gump g)
 {
     if ((g != null) && (g.GetType() == typeof(GDraggedItem)))
     {
         GDraggedItem item = (GDraggedItem) g;
         Item toEquip = item.Item;
         Item item3 = null;
         Gump[] gumpArray = base.m_Children.ToArray();
         Point point = base.PointToClient(new Point(Engine.m_xMouse, Engine.m_yMouse));
         for (int i = gumpArray.Length - 1; i >= 0; i--)
         {
             if ((gumpArray[i] is GPaperdollItem) && gumpArray[i].HitTest(point.X - gumpArray[i].X, point.Y - gumpArray[i].Y))
             {
                 item3 = ((GPaperdollItem) gumpArray[i]).Item;
                 break;
             }
         }
         if ((item3 != null) && Map.m_ItemFlags[item3.ID & 0x3fff][TileFlag.Container])
         {
             Network.Send(new PDropItem(toEquip.Serial, -1, -1, 0, item3.Serial));
         }
         else if (Map.m_ItemFlags[toEquip.ID & 0x3fff][TileFlag.Wearable])
         {
             Network.Send(new PEquipItem(toEquip, this.m_Mobile));
         }
         else
         {
             Network.Send(new PDropItem(toEquip.Serial, -1, -1, 0, World.Serial));
         }
         Gumps.Destroy(item);
     }
     if (this.m_Image != null)
     {
         Gumps.Destroy(this.m_Image);
         this.m_Image = null;
     }
 }
开发者ID:Skinny1001,项目名称:PlayUO,代码行数:37,代码来源:GPaperdoll.cs

示例2: OnDragDrop

 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);
         }
     }
 }
开发者ID:Skinny1001,项目名称:PlayUO,代码行数:31,代码来源:GContainerItem.cs

示例3: OnDragEnter

 protected internal override void OnDragEnter(Gump g)
 {
     if ((g != null) && (g.GetType() == typeof(GDraggedItem)))
     {
         GDraggedItem item = (GDraggedItem) g;
         Item item2 = item.Item;
         int iD = item2.ID;
         int hue = item2.Hue;
         Engine.ItemArt.Translate(ref iD, ref hue);
         if (Map.m_ItemFlags[iD][TileFlag.Wearable])
         {
             if (this.m_Image != null)
             {
                 Gumps.Destroy(this.m_Image);
             }
             this.m_Image = new GImage(Gumps.GetEquipGumpID(iD, this.m_Gender, ref hue), Hues.GetItemHue(iD, hue), 8, 0x13);
             this.m_Image.Alpha = 0.5f;
             int count = base.m_Children.Count;
             LayerComparer paperdoll = LayerComparer.Paperdoll;
             int num4 = paperdoll.GetValue(iD, (Layer) Map.GetQuality(iD));
             for (int i = 0; i < base.m_Children.Count; i++)
             {
                 Gump gump = base.m_Children[i];
                 if (gump.GetType() == typeof(GPaperdollItem))
                 {
                     GPaperdollItem item3 = (GPaperdollItem) gump;
                     if (paperdoll.GetValue(item3.Item.ID, (Layer) ((byte) item3.Layer)) < num4)
                     {
                         count = i;
                         break;
                     }
                 }
             }
             base.m_Children.Insert(count, this.m_Image);
         }
     }
 }
开发者ID:Skinny1001,项目名称:PlayUO,代码行数:37,代码来源:GPaperdoll.cs

示例4: RecurseKeyDown

 private static bool RecurseKeyDown(Gump g, char c)
 {
     if (!g.Visible)
     {
         return false;
     }
     Gump[] gumpArray = g.Children.ToArray();
     for (int i = gumpArray.Length - 1; i >= 0; i--)
     {
         if (RecurseKeyDown(gumpArray[i], c))
         {
             return true;
         }
     }
     return ((g.GetType() != typeof(GTextBox)) && g.OnKeyDown(c));
 }
开发者ID:Skinny1001,项目名称:PlayUO,代码行数:16,代码来源:Gumps.cs


注:本文中的Client.Gump.GetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。