Allow camera zooming by default without it in json

Also had to add an extra check if json isn't loaded
This commit is contained in:
Pazaz 2022-06-19 20:03:02 -04:00
parent 5792a3c92b
commit 299ebc243d
3 changed files with 5 additions and 2 deletions

View file

@ -51,6 +51,8 @@ public class GlobalConfig {
public static boolean USE_SHIFT_CLICK = true;
public static boolean USE_TWEENING = true;
public static boolean BILINEAR_MINIMAP = true;
public static boolean MOUSEWHEEL_ZOOM = true;
public static int JS5_RESPONSE_TIMEOUT = 5000;
}

View file

@ -25,5 +25,6 @@ public class GlobalJsonConfig {
int server_port;
int wl_port;
int js5_port;
boolean mouseWheelZoom;
boolean mouseWheelZoom = GlobalConfig.MOUSEWHEEL_ZOOM;
}

View file

@ -37,7 +37,7 @@ public final class JavaMouseWheel extends MouseWheel implements MouseWheelListen
this.anInt4233 += arg0.getWheelRotation();
int diff = this.anInt4233 - previous;
if (GlobalJsonConfig.instance.mouseWheelZoom && Keyboard.instance.isShiftPressed()) {
if (((GlobalJsonConfig.instance != null && GlobalJsonConfig.instance.mouseWheelZoom) || (GlobalJsonConfig.instance == null && GlobalConfig.MOUSEWHEEL_ZOOM)) && Keyboard.instance.isShiftPressed()) {
Camera.ZOOM = clamp(200, 1200, Camera.ZOOM + (diff >= 0 ? 50: -50));
}
}