private static bool RecurseMouseUp(int X, int Y, Gump g, int mX, int mY, MouseButtons mb) { if (g.Visible && (g.m_NonRestrictivePicking || (((mX >= X) && (mX < (X + g.Width))) && ((mY >= Y) && (mY < (Y + g.Height)))))) { Gump[] gumpArray = g.Children.ToArray(); for (int i = gumpArray.Length - 1; i >= 0; i--) { Gump gump = gumpArray[i]; if (RecurseMouseUp(X + gump.X, Y + gump.Y, gump, mX, mY, mb)) { return true; } } if (!g.m_NonRestrictivePicking || (((mX >= X) && (mX < (X + g.Width))) && ((mY >= Y) && (mY < (Y + g.Height))))) { if ((m_Modal == null) && g.HitTest(mX - X, mY - Y)) { g.OnMouseUp(mX - X, mY - Y, mb); return true; } if (((m_Modal != null) && g.IsChildOf(m_Modal)) && g.HitTest(mX - X, mY - Y)) { g.OnMouseUp(mX - X, mY - Y, mb); return true; } } } return false; }
private static bool RecurseMouseMove(int X, int Y, Gump g, int mX, int mY, MouseButtons mb) { if (g.Visible && (g.m_NonRestrictivePicking || (((mX >= X) && (mX < (X + g.Width))) && ((mY >= Y) && (mY < (Y + g.Height)))))) { Gump[] gumpArray = g.Children.ToArray(); for (int i = gumpArray.Length - 1; i >= 0; i--) { Gump gump = gumpArray[i]; if (RecurseMouseMove(X + gump.X, Y + gump.Y, gump, mX, mY, mb)) { return true; } } if (!g.m_NonRestrictivePicking || (((mX >= X) && (mX < (X + g.Width))) && ((mY >= Y) && (mY < (Y + g.Height))))) { if ((m_Modal == null) && g.HitTest(mX - X, mY - Y)) { if (m_LastOver == g) { g.OnMouseMove(mX - X, mY - Y, mb); } else { if (m_LastOver != null) { m_LastOver.OnMouseLeave(); } g.OnMouseEnter(mX - X, mY - Y, mb); if (g.Tooltip != null) { m_TipDelay = new TimeDelay(g.Tooltip.Delay); } else { m_TipDelay = null; } m_LastOver = g; } return true; } if (((m_Modal != null) && g.IsChildOf(m_Modal)) && g.HitTest(mX - X, mY - Y)) { if (m_LastOver == g) { g.OnMouseMove(mX - X, mY - Y, mb); } else { if (m_LastOver != null) { m_LastOver.OnMouseLeave(); } g.OnMouseEnter(mX - X, mY - Y, mb); if (g.Tooltip != null) { m_TipDelay = new TimeDelay(g.Tooltip.Delay); } else { m_TipDelay = null; } m_LastOver = g; } return true; } } } return false; }
private static bool RecurseMouseDown(int X, int Y, Gump g, int mX, int mY, MouseButtons mb) { if (g.Visible && (g.m_NonRestrictivePicking || (((mX >= X) && (mX < (X + g.Width))) && ((mY >= Y) && (mY < (Y + g.Height)))))) { Gump[] gumpArray = g.Children.ToArray(); for (int i = gumpArray.Length - 1; i >= 0; i--) { Gump gump = gumpArray[i]; if (RecurseMouseDown(X + gump.X, Y + gump.Y, gump, mX, mY, mb)) { return true; } } if (!g.m_NonRestrictivePicking || (((mX >= X) && (mX < (X + g.Width))) && ((mY >= Y) && (mY < (Y + g.Height))))) { if ((m_Modal == null) && g.HitTest(mX - X, mY - Y)) { if (m_TextFocus != null) { m_TextFocus.Unfocus(); m_TextFocus = null; } if (((m_Drag == null) && g.m_CanDrag) && (mb == MouseButtons.Left)) { m_StartDrag = g; m_StartDragPoint = new Point(mX, mY); g.m_OffsetX = mX - X; g.m_OffsetY = mY - Y; if (g.m_QuickDrag) { g.m_IsDragging = true; m_Drag = g; g.OnDragStart(); } } g.OnMouseDown(mX - X, mY - Y, mb); Focus = g; if (g == m_Drag) { return !IsWorldAt(mX, mY, false); } return true; } if (((m_Modal != null) && g.IsChildOf(m_Modal)) && g.HitTest(mX - X, mY - Y)) { if (m_TextFocus != null) { m_TextFocus.Unfocus(); m_TextFocus = null; } if (((m_Drag == null) && g.m_CanDrag) && (mb == MouseButtons.Left)) { m_StartDrag = g; m_StartDragPoint = new Point(mX, mY); g.m_OffsetX = mX - X; g.m_OffsetY = mY - Y; if (g.m_QuickDrag) { g.m_IsDragging = true; g.OnDragStart(); m_Drag = g; } } g.OnMouseDown(mX - X, mY - Y, mb); Focus = g; if (g == m_Drag) { return !IsWorldAt(mX, mY, false); } return true; } } } return false; }
private static bool RecurseIsWorldAt(int X, int Y, Gump g, int mX, int mY, bool CheckDrag) { if (g.Visible) { if (!CheckDrag && (g == m_Drag)) { return false; } if (g.m_NonRestrictivePicking || (((mX >= X) && (mX < (X + g.Width))) && ((mY >= Y) && (mY < (Y + g.Height))))) { Gump[] gumpArray = g.Children.ToArray(); for (int i = gumpArray.Length - 1; i >= 0; i--) { Gump gump = gumpArray[i]; if (RecurseIsWorldAt(X + gump.X, Y + gump.Y, gump, mX, mY, CheckDrag)) { return true; } } if ((!g.m_NonRestrictivePicking || (((mX >= X) && (mX < (X + g.Width))) && ((mY >= Y) && (mY < (Y + g.Height))))) && g.HitTest(mX - X, mY - Y)) { return true; } } } return false; }
private static object[] RecurseFindListForSingleClick(int x, int y, Gump g, int mx, int my) { if (g.Visible && (g.m_NonRestrictivePicking || (((mx >= x) && (mx < (x + g.Width))) && ((my >= y) && (my < (y + g.Height)))))) { Gump[] gumpArray = g.Children.ToArray(); for (int i = gumpArray.Length - 1; i >= 0; i--) { Gump gump = gumpArray[i]; object[] objArray = RecurseFindListForSingleClick(x + gump.X, y + gump.Y, gump, mx, my); if (objArray != null) { return objArray; } } if (!g.m_NonRestrictivePicking || (((mx >= x) && (mx < (x + g.Width))) && ((my >= y) && (my < (y + g.Height))))) { if ((m_Modal == null) && g.HitTest(mx - x, my - y)) { return new object[] { g, new Point(mx - x, my - y) }; } if (((m_Modal != null) && g.IsChildOf(m_Modal)) && g.HitTest(mx - x, my - y)) { return new object[] { g, new Point(mx - x, my - y) }; } } } return null; }
private static bool RecurseDoubleClick(int X, int Y, Gump g, int mX, int mY) { if (g.Visible && (g.m_NonRestrictivePicking || (((mX >= X) && (mX < (X + g.Width))) && ((mY >= Y) && (mY < (Y + g.Height)))))) { Gump[] gumpArray = g.Children.ToArray(); for (int i = gumpArray.Length - 1; i >= 0; i--) { Gump gump = gumpArray[i]; if (RecurseDoubleClick(X + gump.X, Y + gump.Y, gump, mX, mY)) { return true; } } if (!g.m_NonRestrictivePicking || (((mX >= X) && (mX < (X + g.Width))) && ((mY >= Y) && (mY < (Y + g.Height))))) { if ((m_Modal == null) && g.HitTest(mX - X, mY - Y)) { if (m_TextFocus != null) { m_TextFocus.Unfocus(); m_TextFocus = null; } g.OnDoubleClick(mX - X, mY - Y); return true; } if (((m_Modal != null) && g.IsChildOf(m_Modal)) && g.HitTest(mX - X, mY - Y)) { if (m_TextFocus != null) { m_TextFocus.Unfocus(); m_TextFocus = null; } g.OnDoubleClick(mX - X, mY - Y); return true; } } } return false; }