private void MainMunuOnClick(IControl control, GameObjectClickEventArgs eventArgs) { var button = (Button)control; if (button.Tags.Contains("IsAddPoint")) { MainMenu.ResetSysSettings(); SysSettings.IsAddPoint = true; } else if (button.Tags.Contains("IsAddLine")) { MainMenu.ResetSysSettings(); SysSettings.IsAddLine = true; } else if (button.Tags.Contains("IsRemovePoint")) { MainMenu.ResetSysSettings(); SysSettings.IsRemovePoint = true; } else if (button.Tags.Contains("IsPointingPath")) { MainMenu.ResetSysSettings(); SysSettings.IsPointingPath = true; } else if (button.Tags.Contains("SearchPath")) { MainMenu.ResetSysSettings(); ResetPreviousPath(); SearchPath(); } }
private void GraphPanelClick(object o, GameObjectClickEventArgs gameObjectClickEventArgs) { var pointSize = SysSettings.PointSize; var newPosition = GameManager.MousePosition.Location.ToVector2() - new Vector2(pointSize.X / 2, pointSize.Y / 2) - GraphPanel.Position; if (gameObjectClickEventArgs.MouseState.LeftButton == ButtonState.Pressed) { if (SysSettings.IsAddPoint) { GraphPanel.AddPoint(newPosition); } else if (SysSettings.IsAddLine) { GraphPanel.AddLine(newPosition); } else if (SysSettings.IsPointingPath) { GraphPanel.SetPointingPath(newPosition); } else if (SysSettings.IsRemovePoint) { GraphPanel.RepovePoint(newPosition); } } if (gameObjectClickEventArgs.MouseState.RightButton == ButtonState.Pressed) { if (GraphPanel.CurrentLine != null) { GraphPanel.Remove(GraphPanel.CurrentLine); } } }
protected void OnClick(GameObjectClickEventArgs eventArgs) { Click?.Invoke(this, eventArgs); }