diff --git a/src/main/java/org/esotericist/mindshaft/mindshaftConfig.java b/src/main/java/org/esotericist/mindshaft/mindshaftConfig.java index 516b63d..04ff08e 100644 --- a/src/main/java/org/esotericist/mindshaft/mindshaftConfig.java +++ b/src/main/java/org/esotericist/mindshaft/mindshaftConfig.java @@ -40,6 +40,11 @@ public class mindshaftConfig { @Name("Current fullscreen zoom level") public static int zoomfs = 3; + @Config.Comment({"Whether the zoom in/zoom out key bindings should wrap around.", + "e.g. when zooming in at the tightest zoom level, go to the widest zoom level."}) + @Name("Zoom Wraparound") + public static boolean zoomwrap = false; + @Config.Comment({ "How many segments (chunk tiles) can be cached per tick.", "Can increase graphical stuttering if too high.", "Lower values increase the visibility of tile scanning,", diff --git a/src/main/java/org/esotericist/mindshaft/zoomState.java b/src/main/java/org/esotericist/mindshaft/zoomState.java index dd55def..b54fcad 100644 --- a/src/main/java/org/esotericist/mindshaft/zoomState.java +++ b/src/main/java/org/esotericist/mindshaft/zoomState.java @@ -54,7 +54,11 @@ public void nextZoom() { newzoom++; if (newzoom >= zoommax) { - newzoom = 0; + if (mindshaftConfig.zoomwrap) { + newzoom = 0; + } else { + newzoom = zoommax - 1; + } } mindshaftConfig.setZoom(newzoom, fullscreen); } @@ -64,7 +68,11 @@ public void prevZoom() { newzoom--; if (newzoom < 0) { - newzoom = zoommax - 1; + if (mindshaftConfig.zoomwrap) { + newzoom = zoommax - 1; + } else { + newzoom = 0; + } } mindshaftConfig.setZoom(newzoom, fullscreen); }