This commit is contained in:
@ -75,6 +75,10 @@ DISCLAIMER: this is NOT perfect and still needs to be reworked, I'm just too laz
|
|||||||
- Integer
|
- Integer
|
||||||
- [x] Zoom
|
- [x] Zoom
|
||||||
- [x] Configurable
|
- [x] Configurable
|
||||||
|
- Smooth zoom
|
||||||
|
- Initial zoom value
|
||||||
|
- Zoom step value
|
||||||
|
- Scroll to zoom further
|
||||||
|
|
||||||
# To-do
|
# To-do
|
||||||
|
|
||||||
|
@ -15,5 +15,6 @@ public class ClientConfig {
|
|||||||
public int blockEntityRange = 512;
|
public int blockEntityRange = 512;
|
||||||
public boolean smoothCamera = true;
|
public boolean smoothCamera = true;
|
||||||
public float initialZoom = 20f;
|
public float initialZoom = 20f;
|
||||||
|
public boolean scrollToZoom = true;
|
||||||
public float zoomStep = 2.5f;
|
public float zoomStep = 2.5f;
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,8 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
import wtf.hak.survivalfabric.features.Zoom;
|
import wtf.hak.survivalfabric.features.Zoom;
|
||||||
|
|
||||||
|
import static wtf.hak.survivalfabric.config.client.ClientConfigManager.getConfig;
|
||||||
|
|
||||||
@Mixin(Mouse.class)
|
@Mixin(Mouse.class)
|
||||||
public class MouseMixin {
|
public class MouseMixin {
|
||||||
|
|
||||||
@ -16,7 +18,7 @@ public class MouseMixin {
|
|||||||
*/
|
*/
|
||||||
@Inject(method = "onMouseScroll", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "onMouseScroll", at = @At("HEAD"), cancellable = true)
|
||||||
private void onMouseScroll(long window, double horizontal, double vertical, CallbackInfo ci) {
|
private void onMouseScroll(long window, double horizontal, double vertical, CallbackInfo ci) {
|
||||||
if (Zoom.isZooming()) {
|
if (Zoom.isZooming() && getConfig().scrollToZoom) {
|
||||||
if (MinecraftClient.getInstance().player != null) {
|
if (MinecraftClient.getInstance().player != null) {
|
||||||
if (vertical > 0)
|
if (vertical > 0)
|
||||||
Zoom.modifyStep(-1);
|
Zoom.modifyStep(-1);
|
||||||
|
Reference in New Issue
Block a user