Exemplo n.º 1
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;
 }
Exemplo n.º 2
0
 private static void RecurseProcessItemGumps(Gump g, int x, int y, bool isItemGump)
 {
     if (isItemGump)
     {
         IItemGump itemGump = (IItemGump)g;
         Item      obj      = itemGump.Item;
         obj.MessageX     = x + itemGump.xOffset;
         obj.MessageY     = y + itemGump.yOffset;
         obj.BottomY      = y + itemGump.yBottom;
         obj.MessageFrame = Renderer.m_ActFrames;
         Gump     desktop  = Gumps.Desktop;
         GumpList children = desktop.Children;
         Gump     Child    = g;
         while (Child.Parent != desktop)
         {
             Child = Child.Parent;
         }
         int num = children.IndexOf(Child);
         for (int index1 = 0; index1 < MessageManager.m_Messages.Count; ++index1)
         {
             if (MessageManager.m_Messages[index1] is GDynamicMessage && ((GDynamicMessage)MessageManager.m_Messages[index1]).Owner == obj)
             {
                 int index2 = children.IndexOf((Gump)MessageManager.m_Messages[index1]);
                 if (index2 < num && index2 >= 0)
                 {
                     children.RemoveAt(index2);
                     num = children.IndexOf(Child);
                     children.Insert(num + 1, (Gump)MessageManager.m_Messages[index1]);
                 }
             }
         }
     }
     else
     {
         foreach (Gump g1 in g.Children.ToArray())
         {
             if (g1 is IItemGump)
             {
                 MessageManager.RecurseProcessItemGumps(g1, x + g1.X, y + g1.Y, true);
             }
             else if (g1.Children.Count > 0)
             {
                 MessageManager.RecurseProcessItemGumps(g1, x + g1.X, y + g1.Y, false);
             }
         }
     }
 }