|
26 | 26 | import io.github.axolotlclient.AxolotlClientConfig.Color; |
27 | 27 | import io.github.axolotlclient.AxolotlClientConfig.options.BooleanOption; |
28 | 28 | import io.github.axolotlclient.AxolotlClientConfig.options.ColorOption; |
| 29 | +import io.github.axolotlclient.AxolotlClientConfig.options.GraphicsOption; |
29 | 30 | import io.github.axolotlclient.AxolotlClientConfig.options.Option; |
30 | 31 | import io.github.axolotlclient.modules.hud.gui.entry.TextHudEntry; |
31 | 32 | import io.github.axolotlclient.modules.hud.util.DrawPosition; |
@@ -58,6 +59,28 @@ public class KeystrokeHud extends TextHudEntry { |
58 | 59 | private final ColorOption pressedBackgroundColor = new ColorOption("heldbackgroundcolor", 0x64FFFFFF); |
59 | 60 | private final ColorOption pressedOutlineColor = new ColorOption("heldoutlinecolor", Color.BLACK); |
60 | 61 | 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); |
61 | 84 | private ArrayList<Keystroke> keystrokes; |
62 | 85 | private final MinecraftClient client; |
63 | 86 |
|
@@ -121,6 +144,8 @@ public void setKeystrokes() { |
121 | 144 | })); |
122 | 145 | KeyBind.unpressAll(); |
123 | 146 | KeyBind.updatePressedStates(); |
| 147 | + |
| 148 | + onMouseMovementOption(mouseMovement.get()); |
124 | 149 | } |
125 | 150 |
|
126 | 151 | @Override |
@@ -152,11 +177,13 @@ public void renderComponent(MatrixStack matrices, float delta) { |
152 | 177 | float calculatedMouseX = (lastMouseX + ((mouseX - lastMouseX) * delta)) - 5; |
153 | 178 | float calculatedMouseY = (lastMouseY + ((mouseY - lastMouseY) * delta)) - 5; |
154 | 179 |
|
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); |
156 | 182 |
|
157 | 183 | matrices.translate(calculatedMouseX, calculatedMouseY, 0); // Woah KodeToad, good use of translate |
158 | 184 |
|
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); |
160 | 187 | } |
161 | 188 | } |
162 | 189 |
|
@@ -238,6 +265,8 @@ public List<Option<?>> getConfigurationOptions() { |
238 | 265 | options.add(enabled); |
239 | 266 | options.add(scale); |
240 | 267 | options.add(mouseMovement); |
| 268 | + options.add(mouseMovementIndicatorInner); |
| 269 | + options.add(mouseMovementIndicatorOuter); |
241 | 270 | options.add(textColor); |
242 | 271 | options.add(pressedTextColor); |
243 | 272 | options.add(shadow); |
|
0 commit comments