Skip to content

Commit

Permalink
readd smooth zoom setting
Browse files Browse the repository at this point in the history
  • Loading branch information
flustix committed Jul 16, 2022
2 parents 396a578 + b18473e commit 3e9b94a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
22 changes: 21 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
Copyright (C) 2021-2022 FoxStudios
MIT License

Copyright (c) 2021 FoxStudios

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ TODO: add a list of features
### Can I use this on a Vanilla server?
Yeah sure. FoxClient is 100% client side and doesn't require anything to be installed on the server.

###### Copyright (C) 2022 FoxStudios
### Is there gonna be a forge version?
NO [here's why](https://v.foxes4life.net/trol.png)

###### Copyright (C) 2022 FoxStudios
1 change: 1 addition & 0 deletions src/main/java/net/foxes4life/foxclient/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ void initConfig () {
KonfigCategory misc = new KonfigCategory("misc");
misc.addEntry("discord-rpc", true);
misc.addEntry("discord-rpc-show-ip", true);
misc.addEntry("smoothzoom", true);

KonfigCategory eastereggs = new KonfigCategory("eastereggs");
eastereggs.addEntry("owo", false);
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/net/foxes4life/foxclient/util/ZoomUtils.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.foxes4life.foxclient.util;

import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.foxes4life.foxclient.Main;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.util.math.MathHelper;
Expand Down Expand Up @@ -38,6 +39,8 @@ public static void smoothCam () {
}

public static void calculateZoom(CallbackInfoReturnable<Double> cir) {
ZoomUtils.actualZoomLevel = MathHelper.lerp(0.05f, ZoomUtils.actualZoomLevel, ZoomUtils.currentZoomLevel);
ZoomUtils.actualZoomLevel = (boolean)Main.konfig.get("misc", "smoothzoom") ?
MathHelper.lerp(0.05f, ZoomUtils.actualZoomLevel, ZoomUtils.currentZoomLevel) :
ZoomUtils.currentZoomLevel;
}
}

0 comments on commit 3e9b94a

Please sign in to comment.