-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to 1.16-pre2, do The Flattening
OkZoomerMod is now split between the keybind management (OkZoomerClientMod) and ZoomUtils. Also, main has been split into client and nothing, you'll see why.
- Loading branch information
Past Ennui
committed
Jun 7, 2020
1 parent
57a6b9d
commit 90952e3
Showing
12 changed files
with
115 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...oaoh1/okzoomer/config/OkZoomerConfig.java → ...kzoomer/client/config/OkZoomerConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...okzoomer/config/OkZoomerConfigScreen.java → ...r/client/config/OkZoomerConfigScreen.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...onfig/modmenu/OkZoomerModMenuApiImpl.java → ...onfig/modmenu/OkZoomerModMenuApiImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
src/main/java/io/github/joaoh1/okzoomer/client/utils/ZoomUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package io.github.joaoh1.okzoomer.client.utils; | ||
|
||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
import org.lwjgl.glfw.GLFW; | ||
|
||
import io.github.joaoh1.okzoomer.client.config.OkZoomerConfig; | ||
import net.fabricmc.loader.api.FabricLoader; | ||
|
||
public class ZoomUtils { | ||
//The logger, used here for letting the user know that the zoom key isn't C if Z is chosen. | ||
protected static final Logger modLogger = LogManager.getFormatterLogger("Ok Zoomer Next"); | ||
|
||
public static final int getDefaultZoomKey() { | ||
//If OptiFabric (and therefore, OptiFine) is detected, use Z as the default value instead. | ||
if (FabricLoader.getInstance().isModLoaded("optifabric")) { | ||
modLogger.info("[Ok Zoomer Next] OptiFabric was detected! Using Z as the default key."); | ||
return GLFW.GLFW_KEY_Z; | ||
} else { | ||
return GLFW.GLFW_KEY_C; | ||
} | ||
} | ||
|
||
//The zoom signal, which is managed in an event and used by other mixins. | ||
public static boolean isZoomKeyPressed = false; | ||
|
||
//Used for post-zoom actions like updating the terrain. | ||
public static boolean zoomHasHappened = false; | ||
|
||
//The zoom divisor, managed by the zoom press and zoom scrolling. Used by other mixins. | ||
public static double zoomDivisor = OkZoomerConfig.zoomDivisor.getValue(); | ||
|
||
// | ||
public static void changeZoomDivisor(boolean increase) { | ||
if (increase) { | ||
if (zoomDivisor < OkZoomerConfig.maximumZoomDivisor.getValue()) { | ||
zoomDivisor += 0.5D; | ||
} else { | ||
zoomDivisor = OkZoomerConfig.maximumZoomDivisor.getValue(); | ||
} | ||
} else { | ||
if (zoomDivisor > OkZoomerConfig.minimumZoomDivisor.getValue()) { | ||
zoomDivisor -= 0.5D; | ||
zoomHasHappened = true; | ||
} else { | ||
zoomDivisor = OkZoomerConfig.minimumZoomDivisor.getValue(); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.