예제 #1
0
    public override void OnMouseWheelChanged(Game game_, MouseWheelEventArgs args)
    {
        float delta = args.GetDeltaPrecise();

        if ((game_.guistate == GuiState.Normal || (game_.guistate == GuiState.Inventory && !IsMouseOverCells())) &&
            (!game_.keyboardState[game_.GetKey(GlKeys.LShift)]))
        {
            game_.ActiveMaterial -= game_.platform.FloatToInt(delta);
            game_.ActiveMaterial  = game_.ActiveMaterial % 10;
            while (game_.ActiveMaterial < 0)
            {
                game_.ActiveMaterial += 10;
            }
        }
        if (IsMouseOverCells() && game.guistate == GuiState.Inventory)
        {
            if (delta > 0)
            {
                ScrollUp();
            }
            if (delta < 0)
            {
                ScrollDown();
            }
        }
    }
예제 #2
0
 public override void OnMouseWheelChanged(Game game_, MouseWheelEventArgs args)
 {
     if (IsMouseOverCells() && game.guistate == GuiState.Inventory)
     {
         float delta = args.GetDeltaPrecise();
         if (delta > 0)
         {
             ScrollUp();
         }
         if (delta < 0)
         {
             ScrollDown();
         }
     }
 }
예제 #3
0
 public void HandleMouseWheel(MouseWheelEventArgs e)
 {
     z += e.GetDeltaPrecise() / 5;
     screen.OnMouseWheel(e);
 }
예제 #4
0
 public override void OnMouseWheelChanged(Game game_, MouseWheelEventArgs args)
 {
     if (IsMouseOverCells() && game.guistate == GuiState.Inventory)
     {
         float delta = args.GetDeltaPrecise();
         if (delta > 0)
         {
             ScrollUp();
         }
         if (delta < 0)
         {
             ScrollDown();
         }
     }
 }
예제 #5
0
 public void HandleMouseWheel(MouseWheelEventArgs e)
 {
     z += e.GetDeltaPrecise() / 5;
     screen.OnMouseWheel(e);
 }
예제 #6
0
 internal void MouseWheelChanged(MouseWheelEventArgs e)
 {
     float eDeltaPrecise = e.GetDeltaPrecise();
     if (keyboardState[GetKey(GlKeys.LShift)])
     {
         if (cameratype == CameraType.Overhead)
         {
             overheadcameradistance -= eDeltaPrecise;
             if (overheadcameradistance < TPP_CAMERA_DISTANCE_MIN) { overheadcameradistance = TPP_CAMERA_DISTANCE_MIN; }
             if (overheadcameradistance > TPP_CAMERA_DISTANCE_MAX) { overheadcameradistance = TPP_CAMERA_DISTANCE_MAX; }
         }
         if (cameratype == CameraType.Tpp)
         {
             tppcameradistance -= eDeltaPrecise;
             if (tppcameradistance < TPP_CAMERA_DISTANCE_MIN) { tppcameradistance = TPP_CAMERA_DISTANCE_MIN; }
             if (tppcameradistance > TPP_CAMERA_DISTANCE_MAX) { tppcameradistance = TPP_CAMERA_DISTANCE_MAX; }
         }
     }
     for (int i = 0; i < clientmodsCount; i++)
     {
         if (clientmods[i] == null) { continue; }
         clientmods[i].OnMouseWheelChanged(this, e);
     }
     if ((guistate != GuiState.Inventory)
         && (!keyboardState[GetKey(GlKeys.LShift)]))
     {
         ActiveMaterial -= platform.FloatToInt(eDeltaPrecise);
         ActiveMaterial = ActiveMaterial % 10;
         while (ActiveMaterial < 0)
         {
             ActiveMaterial += 10;
         }
     }
 }
예제 #7
0
 public override void OnMouseWheelChanged(Game game_, MouseWheelEventArgs args)
 {
     float delta = args.GetDeltaPrecise();
     if ((game_.guistate == GuiState.Normal || (game_.guistate == GuiState.Inventory && !IsMouseOverCells()))
         && (!game_.keyboardState[game_.GetKey(GlKeys.LShift)]))
     {
         game_.ActiveMaterial -= game_.platform.FloatToInt(delta);
         game_.ActiveMaterial = game_.ActiveMaterial % 10;
         while (game_.ActiveMaterial < 0)
         {
             game_.ActiveMaterial += 10;
         }
     }
     if (IsMouseOverCells() && game.guistate == GuiState.Inventory)
     {
         if (delta > 0)
         {
             ScrollUp();
         }
         if (delta < 0)
         {
             ScrollDown();
         }
     }
 }
예제 #8
0
 internal void MouseWheelChanged(MouseWheelEventArgs e)
 {
     float eDeltaPrecise = e.GetDeltaPrecise();
     if (keyboardState[GetKey(GlKeys.LShift)])
     {
         if (cameratype == CameraType.Overhead)
         {
             overheadcameradistance -= eDeltaPrecise;
             if (overheadcameradistance < TPP_CAMERA_DISTANCE_MIN) { overheadcameradistance = TPP_CAMERA_DISTANCE_MIN; }
             if (overheadcameradistance > TPP_CAMERA_DISTANCE_MAX) { overheadcameradistance = TPP_CAMERA_DISTANCE_MAX; }
         }
         if (cameratype == CameraType.Tpp)
         {
             tppcameradistance -= eDeltaPrecise;
             if (tppcameradistance < TPP_CAMERA_DISTANCE_MIN) { tppcameradistance = TPP_CAMERA_DISTANCE_MIN; }
             if (tppcameradistance > TPP_CAMERA_DISTANCE_MAX) { tppcameradistance = TPP_CAMERA_DISTANCE_MAX; }
         }
     }
     for (int i = 0; i < clientmodsCount; i++)
     {
         if (clientmods[i] == null) { continue; }
         clientmods[i].OnMouseWheelChanged(this, e);
     }
 }