Skip to content

Commit 6c3e601

Browse files
committed
customization for the mouse movement indicator
1 parent 111a60b commit 6c3e601

File tree

5 files changed

+38
-6
lines changed

5 files changed

+38
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,4 @@
9898

9999
- Add a `graphical` option type
100100
- Add custom crosshair texture option
101+
- add customization options to the mouse movement indicator of the KeystrokeHud

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ quilt_mappings = 9
88
loader_version = 0.18.1-beta.23
99

1010
# QSL
11-
qsl_version = 4.0.0-beta.3
11+
qsl_version = 4.0.0-beta.5
1212

1313
# AxolotlClientConfig
14-
config_version = 2.1.0-beta.8
14+
config_version = 2.1.0-beta.13
1515

1616
# Mod Properties
17-
version = 2.2.10-beta.1
17+
version = 2.2.10-beta.2
1818
maven_group = io.github.axolotlclient
1919
archives_base_name = AxolotlClient

src/main/java/io/github/axolotlclient/modules/hud/gui/hud/KeystrokeHud.java

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import io.github.axolotlclient.AxolotlClientConfig.Color;
2727
import io.github.axolotlclient.AxolotlClientConfig.options.BooleanOption;
2828
import io.github.axolotlclient.AxolotlClientConfig.options.ColorOption;
29+
import io.github.axolotlclient.AxolotlClientConfig.options.GraphicsOption;
2930
import io.github.axolotlclient.AxolotlClientConfig.options.Option;
3031
import io.github.axolotlclient.modules.hud.gui.entry.TextHudEntry;
3132
import io.github.axolotlclient.modules.hud.util.DrawPosition;
@@ -58,6 +59,28 @@ public class KeystrokeHud extends TextHudEntry {
5859
private final ColorOption pressedBackgroundColor = new ColorOption("heldbackgroundcolor", 0x64FFFFFF);
5960
private final ColorOption pressedOutlineColor = new ColorOption("heldoutlinecolor", Color.BLACK);
6061
private final BooleanOption mouseMovement = new BooleanOption("mousemovement", this::onMouseMovementOption, false);
62+
private final GraphicsOption mouseMovementIndicatorInner = new GraphicsOption("mouseMovementIndicator", new int[][]{
63+
new int[]{0, 0, 0, 0, 0, 0, 0},
64+
new int[]{0, 0, 0, 0, 0, 0, 0},
65+
new int[]{0, 0, 0, 0, 0, 0, 0},
66+
new int[]{0, 0, 0, -1, 0, 0, 0},
67+
new int[]{0, 0, 0, 0, 0, 0, 0},
68+
new int[]{0, 0, 0, 0, 0, 0, 0},
69+
new int[]{0, 0, 0, 0, 0, 0, 0}
70+
}, true);
71+
private final GraphicsOption mouseMovementIndicatorOuter = new GraphicsOption("mouseMovementIndicatorOuter", new int[][]{
72+
new int[]{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
73+
new int[]{-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1},
74+
new int[]{-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1},
75+
new int[]{-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1},
76+
new int[]{-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1},
77+
new int[]{-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1},
78+
new int[]{-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1},
79+
new int[]{-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1},
80+
new int[]{-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1},
81+
new int[]{-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1},
82+
new int[]{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
83+
}, true);
6184
private ArrayList<Keystroke> keystrokes;
6285
private final MinecraftClient client;
6386

@@ -121,6 +144,8 @@ public void setKeystrokes() {
121144
}));
122145
KeyBind.unpressAll();
123146
KeyBind.updatePressedStates();
147+
148+
onMouseMovementOption(mouseMovement.get());
124149
}
125150

126151
@Override
@@ -152,11 +177,13 @@ public void renderComponent(MatrixStack matrices, float delta) {
152177
float calculatedMouseX = (lastMouseX + ((mouseX - lastMouseX) * delta)) - 5;
153178
float calculatedMouseY = (lastMouseY + ((mouseY - lastMouseY) * delta)) - 5;
154179

155-
DrawUtil.fillRect(matrices, spaceX + (width / 2) - 1, spaceY + 17, 1, 1, Color.WHITE.getAsInt());
180+
mouseMovementIndicatorInner.bindTexture();
181+
drawTexture(matrices, spaceX + (width/2) - 7/2 -1, spaceY + 17 - (7/2), 0, 0, 7, 7, 7, 7);
156182

157183
matrices.translate(calculatedMouseX, calculatedMouseY, 0); // Woah KodeToad, good use of translate
158184

159-
DrawUtil.outlineRect(matrices, spaceX + (width / 2) - 1, spaceY + 17, 11, 11, Color.WHITE.getAsInt());
185+
mouseMovementIndicatorOuter.bindTexture();
186+
drawTexture(matrices, spaceX + (width / 2) - 1, spaceY + 17, 0, 0, 11, 11, 11, 11);
160187
}
161188
}
162189

@@ -238,6 +265,8 @@ public List<Option<?>> getConfigurationOptions() {
238265
options.add(enabled);
239266
options.add(scale);
240267
options.add(mouseMovement);
268+
options.add(mouseMovementIndicatorInner);
269+
options.add(mouseMovementIndicatorOuter);
241270
options.add(textColor);
242271
options.add(pressedTextColor);
243272
options.add(shadow);

src/main/java/io/github/axolotlclient/modules/hud/gui/hud/vanilla/CrosshairHud.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public class CrosshairHud extends AbstractHudEntry implements DynamicallyPositio
8686
new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
8787
new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
8888
new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
89-
});
89+
}, true);
9090

9191
public CrosshairHud() {
9292
super(15, 15);

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@
207207
"minwidth": "Minimum Width",
208208
"mode": "Mode",
209209
"motionBlur": "Motion Blur",
210+
"mouseMovementIndicator": "Mouse Movement Indicator (static)",
211+
"mouseMovementIndicatorOuter": "Mouse Movement Indicator (moving)",
210212
"mousemovement": "Show Mouse Movement",
211213
"nametagBackground": "Nametag Background",
212214
"nametagOptions": "Nametag Options",

0 commit comments

Comments
 (0)