Skip to content

Commit 3bf72aa

Browse files
committed
update config lib, add Snap Perspective option
1 parent d4b9d18 commit 3bf72aa

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,9 @@
7070
- add option to hide Beacon Beams
7171
- port to 1.19.3
7272

73+
### 2.2.7
74+
75+
- fix KeyBindOptions not being saved
76+
- since this is a critical fix, this will also be released for 1.19.2
77+
- add 'Snap-Perspective' mode to Freelook
78+

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ loader_version = 0.18.1-beta.21
1111
qsl_version = 4.0.0-beta.1
1212

1313
# AxolotlClientConfig
14-
config_version = 1.0.14
14+
config_version = 1.0.15
1515

1616
# Mod Properties
1717
version = 2.2.6

src/main/java/io/github/axolotlclient/modules/freelook/Freelook.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public class Freelook extends AbstractModule {
4747
private final OptionCategory category = new OptionCategory("freelook");
4848
public final BooleanOption enabled = new BooleanOption("enabled", false);
4949
private final KeyBindOption keyOption = new KeyBindOption("key.freelook", KEY = new KeyBind("key.freelook", InputUtil.KEY_V_CODE, "category.axolotlclient"), (key)->{});
50+
private final EnumOption mode = new EnumOption("mode", new String[]{"snap_perspective", "freelook"}, "freelook");
5051
private final EnumOption perspective = new EnumOption("perspective", Perspective.values(),
5152
Perspective.THIRD_PERSON_BACK.toString());
5253
private final BooleanOption invert = new BooleanOption("invert", false);
@@ -62,7 +63,7 @@ public static Freelook getInstance() {
6263
@Override
6364
public void init() {
6465
//KeyBindingHelper.registerKeyBinding(KEY);
65-
category.add(enabled, keyOption, perspective, invert, toggle);
66+
category.add(enabled, keyOption, mode, perspective, invert, toggle);
6667
AxolotlClient.CONFIG.addCategory(category);
6768
}
6869

@@ -93,6 +94,7 @@ public void tick() {
9394
private void start() {
9495
active = true;
9596

97+
9698
previousPerspective = client.options.getPerspective();
9799
setPerspective(Perspective.valueOf(perspective.get()));
98100

@@ -114,7 +116,7 @@ private void stop() {
114116
}
115117

116118
public boolean consumeRotation(double dx, double dy) {
117-
if (!active || !enabled.get())
119+
if (!active || !enabled.get() || !mode.get().equals("freelook"))
118120
return false;
119121

120122
if (!invert.get())
@@ -138,14 +140,14 @@ public boolean consumeRotation(double dx, double dy) {
138140
}
139141

140142
public float yaw(float defaultValue) {
141-
if (!active || !enabled.get())
143+
if (!active || !enabled.get() || !mode.get().equals("freelook"))
142144
return defaultValue;
143145

144146
return yaw;
145147
}
146148

147149
public float pitch(float defaultValue) {
148-
if (!active || !enabled.get())
150+
if (!active || !enabled.get() || !mode.get().equals("freelook"))
149151
return defaultValue;
150152

151153
return pitch;

src/main/resources/assets/axolotlclient/lang/en_us.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,8 @@
304304
"off": "Disabled",
305305

306306
"freelook": "Freelook",
307+
"mode": "Mode",
308+
"snap_perspective": "Snap Perspective",
307309
"perspective": "Perspective",
308310
"FIRST_PERSON": "First Person",
309311
"THIRD_PERSON_BACK": "Third Person (Back)",

src/main/resources/quilt.mod.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"issues": "https://github.com/AxolotlClient/Axolotlclient-mod/issues",
1919
"sources": "https://github.com/Axolotlclient?tab=repositories"
2020
},
21+
"license": "LGPL-3.0-or-later",
2122
"icon": "assets/axolotlclient/icon.png"
2223
},
2324
"intermediate_mappings": "net.fabricmc:intermediary",

0 commit comments

Comments
 (0)