aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/config
diff options
context:
space:
mode:
authormartimavocado <39881008+martimavocado@users.noreply.github.com>2024-02-09 21:57:05 +0000
committerGitHub <noreply@github.com>2024-02-09 22:57:05 +0100
commitd134fece41b7cfe4d8ff1c9176ff0e7f8a05420f (patch)
treeab91741347a4082f2942aaae80ae6641475d39c0 /src/main/java/at/hannibal2/skyhanni/config
parentfc7a9d08b4d4e6fd1a089a58d789efc818a22430 (diff)
downloadskyhanni-d134fece41b7cfe4d8ff1c9176ff0e7f8a05420f.tar.gz
skyhanni-d134fece41b7cfe4d8ff1c9176ff0e7f8a05420f.tar.bz2
skyhanni-d134fece41b7cfe4d8ff1c9176ff0e7f8a05420f.zip
Added Sensitivity Reducer. #716
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/config')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/Storage.java5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/garden/GardenConfig.java5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/garden/SensitivityReducerConfig.java69
4 files changed, 83 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/Storage.java b/src/main/java/at/hannibal2/skyhanni/config/Storage.java
index 486ec5369..a9364d695 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/Storage.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/Storage.java
@@ -44,7 +44,10 @@ public class Storage {
public boolean hasPlayedBefore = false;
@Expose
- public Float savedMouseSensitivity = .5f;
+ public Float savedMouselockedSensitivity = .5f;
+
+ @Expose
+ public Float savedMouseloweredSensitivity = .5f;
@Deprecated
@Expose
diff --git a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
index 69b096b31..771bf7055 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
+++ b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
@@ -29,6 +29,7 @@ import at.hannibal2.skyhanni.features.garden.GardenAPI
import at.hannibal2.skyhanni.features.garden.GardenCropTimeCommand
import at.hannibal2.skyhanni.features.garden.GardenCropsInCommand
import at.hannibal2.skyhanni.features.garden.GardenNextJacobContest
+import at.hannibal2.skyhanni.features.garden.SensitivityReducer
import at.hannibal2.skyhanni.features.garden.composter.ComposterOverlay
import at.hannibal2.skyhanni.features.garden.farming.ArmorDropTracker
import at.hannibal2.skyhanni.features.garden.farming.CropMoneyDisplay
@@ -217,6 +218,10 @@ object Commands {
"Lock/Unlock the mouse so it will no longer rotate the player (for farming)"
) { LockMouseLook.toggleLock() }
registerCommand(
+ "shsensreduce",
+ "Lowers the mouse sensitivity for easier small adjustments (for farming)"
+ ) { SensitivityReducer.manualToggle() }
+ registerCommand(
"shresetvermintracker",
"Resets the Vermin Tracker"
) { VerminTracker.resetCommand(it) }
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/garden/GardenConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/garden/GardenConfig.java
index cdea4e3ee..9ef1fd31b 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/garden/GardenConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/garden/GardenConfig.java
@@ -105,6 +105,11 @@ public class GardenConfig {
public YawPitchDisplayConfig yawPitchDisplay = new YawPitchDisplayConfig();
@Expose
+ @ConfigOption(name = "Sensitivity Reducer", desc = "")
+ @Accordion
+ public SensitivityReducerConfig sensitivityReducerConfig = new SensitivityReducerConfig();
+
+ @Expose
@ConfigOption(name = "Crop Start Location", desc = "")
@Accordion
public CropStartLocationConfig cropStartLocation = new CropStartLocationConfig();
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/garden/SensitivityReducerConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/garden/SensitivityReducerConfig.java
new file mode 100644
index 000000000..1904dbdc1
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/garden/SensitivityReducerConfig.java
@@ -0,0 +1,69 @@
+package at.hannibal2.skyhanni.config.features.garden;
+
+import at.hannibal2.skyhanni.config.core.config.Position;
+import com.google.gson.annotations.Expose;
+import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean;
+import io.github.moulberry.moulconfig.annotations.ConfigEditorDropdown;
+import io.github.moulberry.moulconfig.annotations.ConfigEditorKeybind;
+import io.github.moulberry.moulconfig.annotations.ConfigEditorSlider;
+import io.github.moulberry.moulconfig.annotations.ConfigOption;
+import io.github.moulberry.moulconfig.observer.Property;
+import org.lwjgl.input.Keyboard;
+
+public class SensitivityReducerConfig {
+ @Expose
+ @ConfigOption(
+ name = "Mode",
+ desc = "Lowers mouse sensitivity while in the garden.")
+ @ConfigEditorDropdown()
+ public Mode mode = Mode.OFF;
+
+ public enum Mode {
+ OFF("Disabled"),
+ TOOL("Holding farming tool"),
+ KEYBIND("Holding Keybind");
+ private final String str;
+
+ Mode(String str) {
+ this.str = str;
+ }
+ @Override
+ public String toString() {
+ return str;
+ }
+ }
+
+ @Expose
+ @ConfigOption(name = "Keybind", desc = "When selected above, press this key to reduce the mouse sensitivity.")
+ @ConfigEditorKeybind(defaultKey = Keyboard.KEY_N)
+ public int keybind = Keyboard.KEY_N;
+
+ @Expose
+ @ConfigOption(name = "Reducing factor", desc = "Changes by how much the sensitivity is lowered by.")
+ @ConfigEditorSlider(minValue = 1, maxValue = 50, minStep = 1)
+ public Property<Float> reducingFactor = Property.of(15.0F);
+
+ @Expose
+ @ConfigOption(
+ name = "Show GUI",
+ desc = "Shows the GUI element while the feature is enabled.")
+ @ConfigEditorBoolean
+ public boolean showGUI = true;
+
+ @Expose
+ @ConfigOption(
+ name = "Only in Ground",
+ desc = "Lower sensitivity when standing on the ground.")
+ @ConfigEditorBoolean
+ public Property<Boolean> onGround = Property.of(false);
+
+ @Expose
+ @ConfigOption(
+ name = "Disable in Barn",
+ desc = "Disable reduced sensitivity in barn plot.")
+ @ConfigEditorBoolean
+ public Property<Boolean> onlyPlot = Property.of(true);
+
+ @Expose
+ public Position position = new Position(400, 400, 0.8f);
+}