/// <summary> /// Method that handles mouse events. /// </summary> /// <param name="position">The current position of the mouse.</param> /// <param name="button">The button that is pressed or released.</param> /// <param name="pressed">Flag that indicates if button is pressed or released.</param> /// <returns>True if the key was handled and shouldn't be passed on to the underlaying elements.</returns> public bool OnMouse(Vector3 position, Purple.Input.MouseButton button, bool pressed) { ArrayList cloned = (ArrayList)list.Clone(); for (int i = cloned.Count - 1; i >= 0; i--) { IGuiElement element = (cloned[i] as IGuiElement); if (element.Enabled && element.OnMouse(position, button, pressed)) { return(true); } } return(false); }