public void HideClickButtonList() { bool hide = true; if (ClickButtonList.IntersectingMouse()) { hide = false; } for (int i = 0; i < ClickButtonList.Count; i++) { if (ClickButtonList[i].ClickButtonList.IntersectingMouse() || ClickButtonList[i].HoverButtonList.IntersectingMouse()) { hide = false; break; } } if (!DrawEnabled) { hide = true; } if (hide) { ClickButtonList.Hide(); } }
public virtual void Update() { if (!eventsPolled_ && !reset_ && (hovering_ || pressing_ || rightPressing_)) { OnResetState(); } if (Mouse.GetState().LeftButton == ButtonState.Pressed && ClickButtonList.Showing && !ClickButtonList.IntersectingMouse() || Mouse.GetState().RightButton == ButtonState.Pressed && ClickButtonList.Showing && !ClickButtonList.IntersectingMouse()) { HideClickButtonList(); } HideHoverButtonList(); if (newPos != Position) { ClickButtonList.UpdatePosition(Position); HoverButtonList.UpdatePosition(Position); } newPos = Position; eventsPolled_ = false; }