コード例 #1
0
 public override void receiveLeftClick(int x, int y, bool playSound = true)
 {
     if (!this.active)
     {
         return;
     }
     LeftClickAction?.Invoke(this, new Coordinate(x, y));
     base.receiveLeftClick(x, y, playSound);
 }
コード例 #2
0
 private void ElementMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     LeftClickAction.Execute();
     e.Handled = true;
 }
コード例 #3
0
        private void RadioLeftClick_Checked(object sender, RoutedEventArgs e)
        {
            try
            {
                if (!_isInitialized)
                {
                    return;
                }

                _leftClickAction = GetLeftClickAction();

                bool showCombo = false;
                bool isPanCamera = false;
                bool showTrackbar = false;
                bool showLineCheckbox = false;
                bool showBeamSettings = false;

                switch (_leftClickAction)
                {
                    case LeftClickAction.ShootBall:
                        showCombo = true;
                        //showTrackbar = true;		// just use the trkBulletSpeed slider
                        break;

                    case LeftClickAction.PanCamera:
                        isPanCamera = true;
                        break;

                    case LeftClickAction.Remove:
                    case LeftClickAction.RemoveLine:
                        showLineCheckbox = true;
                        break;

                    case LeftClickAction.Explode:
                    case LeftClickAction.ExplodeLine:
                    case LeftClickAction.Implode:
                    case LeftClickAction.ImplodeLine:
                        showTrackbar = true;
                        showLineCheckbox = true;
                        break;

                    case LeftClickAction.ForceBeam:
                        showBeamSettings = true;
                        _forceBeamSettings = forceBeamSettings1.BeamSettings;		// just making sure it's current
                        break;

                    default:
                        throw new ApplicationException("Unknown LeftClickAction: " + _leftClickAction.ToString());
                }

                // Combo
                if (showCombo)
                {
                    cboLeftBallType.Visibility = Visibility.Visible;
                }
                else
                {
                    cboLeftBallType.Visibility = Visibility.Collapsed;
                }

                // Trackball
                _trackball.Mappings.Clear();
                if (isPanCamera)
                {
                    _trackball.Mappings.AddRange(TrackBallMapping.GetPrebuilt(TrackBallMapping.PrebuiltMapping.MouseComplete));
                }
                else
                {
                    _trackball.Mappings.AddRange(TrackBallMapping.GetPrebuilt(TrackBallMapping.PrebuiltMapping.MouseComplete_NoLeft));
                }

                // Trackbar
                if (showTrackbar)
                {
                    trkLeftExplodePower.Visibility = Visibility.Visible;
                }
                else
                {
                    trkLeftExplodePower.Visibility = Visibility.Collapsed;
                }

                // Checkbox
                if (showLineCheckbox)
                {
                    chkLeftLine.Visibility = Visibility.Visible;
                }
                else
                {
                    chkLeftLine.Visibility = Visibility.Collapsed;
                }

                // Force Beam Settings
                if (showBeamSettings)
                {
                    forceBeamSettings1.Visibility = Visibility.Visible;
                }
                else
                {
                    forceBeamSettings1.Visibility = Visibility.Collapsed;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), this.Title, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }