Skip to content

Commit

Permalink
add zoom wraparound setting
Browse files Browse the repository at this point in the history
  • Loading branch information
esotericist committed Nov 29, 2019
1 parent 653adfd commit f9daf4d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/main/java/org/esotericist/mindshaft/mindshaftConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -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,",
Expand Down
12 changes: 10 additions & 2 deletions src/main/java/org/esotericist/mindshaft/zoomState.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down

0 comments on commit f9daf4d

Please sign in to comment.