private static void ContainerMouseScroll(MouseEventArgs e) { foreach (GuiContainer item in GUIWindows) { GuiContainer youngest = GetYoungestChild(item); if (youngest.Visible && youngest.DrawingBounds.Contains(e.Position)) { Scroll(e, youngest.Controls, youngest); MasterLog.DebugWriteLine("Clicking in menu: " + youngest.GetType().FullName); return; } } //If the click isn't in a GUI, then it must be in the map... ScrollMap(e); }
/// <summary> /// Handles container clicks before handling normal UI elements. /// </summary> /// <param name="clickData"></param> /// <returns></returns> private static void ContainerClick(MouseEventArgs clickData) { foreach (GuiContainer item in GUIWindows) { GuiContainer youngest = GetYoungestChild(item); if (youngest.Visible && youngest.DrawingBounds.Contains(clickData.Position)) { Click(clickData, youngest.Controls, youngest); MasterLog.DebugWriteLine("Clicking in menu: " + youngest.GetType().FullName); return; } } //If the click isn't in a GUI, then it must be in the map... MouseEventArgs transformed = TransformViaCamera(clickData); InputHistory.MapMouseClick(transformed); }