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(); } } }
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(); } } }
public void HandleMouseWheel(MouseWheelEventArgs e) { z += e.GetDeltaPrecise() / 5; screen.OnMouseWheel(e); }
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; } } }
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); } }