Пример #1
0
        public void OnStickEventReceived(StickEventArgs stick_event)
        {
            //Logger.Log(stick_event);
            ls_x = stick_event.StickStatus.X;
            ls_y = stick_event.StickStatus.Y;

            rs_x = stick_event.StickStatus.RX;
            rs_y = stick_event.StickStatus.RY;

            // Left Stick
            if (Math.Abs(ls_x - 32767) < 5000 && Math.Abs(ls_y - 32767) < 5000)
            {
                Keyboard.KeyPress(VK.VK_S);
                //Mouse.Move(1920/2,1080/2);
            }
            else
            {
                double px = (ls_x / 65535.0) * DeviceUtils.ScreenSizeX * 0.5 * (DeviceUtils.ScreenSizeY / DeviceUtils.ScreenSizeX) + (0.5 * DeviceUtils.ScreenSizeX - 0.25 * DeviceUtils.ScreenSizeY);
                double py = (ls_y / 65535.0) * DeviceUtils.ScreenSizeY * 0.5 + 0.25 * DeviceUtils.ScreenSizeY;
                Mouse.RightClick((int)px, (int)py);
            }

            // Right Stick
            if (Math.Abs(rs_x - 32767) > 500 || Math.Abs(rs_y - 32767) > 500)
            {
                Shifting = true;
            }
            else
            {
                Shifting = false;
            }
        }
Пример #2
0
 public void OnStickRemoved(DynamiteGame sender, StickEventArgs e)
 {
     audio.PlaySound(32);
 }
Пример #3
0
 private void OnStickRemoved(DynamiteGame sender, StickEventArgs e)
 {
     Record(new StickRemoval(e.HoleIndex, e.Stick.Index, e.Stick.Holes, e.Stick.Grooves, e.Stick.Length, e.Stick.Weight));
 }
Пример #4
0
 public void OnStickInserted(DynamiteGame sender, StickEventArgs e)
 {
     audio.PlaySound(31);
 }
Пример #5
0
 private void OnStickMoved(object sender, StickEventArgs e)
 {
     log.Debug("StickMoved controller #" + e.Controller + " with side=" + e.Side + ", direction=" + e.Direction + ", x=" + e.X + ", y=" + e.Y);
 }
Пример #6
0
 public void OnStickRemoved(DynamiteGame sender, StickEventArgs e)
 {
     UpdateHoleLabel(e.HoleIndex, -1);
 }
Пример #7
0
 public void OnStickInserted(DynamiteGame sender, StickEventArgs e)
 {
     UpdateHoleLabel(e.HoleIndex, e.Stick.Index);
 }
Пример #8
0
 private void onStickRemoved(DynamiteGame sender, StickEventArgs e)
 {
     Statistics.dynamiteStickRemovals++;
     Statistics.dynamiteSticksInHoles--;
 }
Пример #9
0
 private void onStickInserted(DynamiteGame sender, StickEventArgs e)
 {
     Statistics.dynamiteStickInsertions++;
     Statistics.dynamiteSticksInHoles++;
 }