Skip to content
This repository was archived by the owner on Nov 28, 2025. It is now read-only.

Commit 268738f

Browse files
committed
fix a few bugs
1 parent f23b4f0 commit 268738f

File tree

20 files changed

+103
-17
lines changed

20 files changed

+103
-17
lines changed

1.16_combat-6/src/main/java/io/github/axolotlclient/config/screen/ProfilesScreen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public void render(MatrixStack guiGraphics, int index, int top, int left, int wi
161161

162162
boolean current = Profiles.getInstance().getCurrent() == profile;
163163
loadButton.setMessage(current ? CURRENT_TEXT : LOAD_BUTTON_TITLE);
164-
loadButton.active = !current;
164+
loadButton.active = removeButton.active = !current;
165165
i -= loadButton.getWidth();
166166
this.loadButton.x = i;
167167
loadButton.y = j;

1.16_combat-6/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/KeystrokeHud.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,7 @@ public boolean isLabelEditable() {
475475
}
476476

477477
public void saveKeystrokes() {
478+
if (keystrokes == null) return;
478479
try {
479480
var path = AxolotlClientCommon.resolveProfileConfigFile(KEYSTROKE_SAVE_FILE_NAME);
480481
Files.createDirectories(path.getParent());
@@ -493,7 +494,11 @@ public void loadKeystrokes() {
493494
var loaded = entries.stream().map(e -> (Map<String, Object>) e)
494495
.map(KeystrokeHud.this::deserializeKey)
495496
.toList();
496-
keystrokes.clear();
497+
if (keystrokes == null) {
498+
keystrokes = new ArrayList<>();
499+
} else {
500+
keystrokes.clear();
501+
}
497502
keystrokes.addAll(loaded);
498503
} else {
499504
saveKeystrokes();

1.16_combat-6/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/vanilla/ScoreboardHud.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,4 +261,14 @@ public Identifier getId() {
261261
public AnchorPoint getAnchor() {
262262
return anchor.get();
263263
}
264+
265+
@Override
266+
public double getDefaultX() {
267+
return 1.0;
268+
}
269+
270+
@Override
271+
public double getDefaultY() {
272+
return 0.5;
273+
}
264274
}

1.20/src/main/java/io/github/axolotlclient/config/screen/ProfilesScreen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public void render(GuiGraphics guiGraphics, int index, int top, int left, int wi
174174

175175
boolean current = Profiles.getInstance().getCurrent() == profile;
176176
loadButton.setMessage(current ? CURRENT_TEXT : LOAD_BUTTON_TITLE);
177-
loadButton.active = !current;
177+
loadButton.active = removeButton.active = !current;
178178
i -= loadButton.getWidth();
179179
this.loadButton.setPosition(i, j);
180180
this.loadButton.render(guiGraphics, mouseX, mouseY, partialTick);

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ public boolean isLabelEditable() {
480480
}
481481

482482
public void saveKeystrokes() {
483+
if (keystrokes == null) return;
483484
try {
484485
var path = AxolotlClientCommon.resolveProfileConfigFile(KEYSTROKE_SAVE_FILE_NAME);
485486
Files.createDirectories(path.getParent());
@@ -498,7 +499,11 @@ public void loadKeystrokes() {
498499
var loaded = entries.stream().map(e -> (Map<String, Object>) e)
499500
.map(KeystrokeHud.this::deserializeKey)
500501
.toList();
501-
keystrokes.clear();
502+
if (keystrokes == null) {
503+
keystrokes = new ArrayList<>();
504+
} else {
505+
keystrokes.clear();
506+
}
502507
keystrokes.addAll(loaded);
503508
} else {
504509
saveKeystrokes();

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,16 @@ public Identifier getId() {
249249

250250
@Override
251251
public AnchorPoint getAnchor() {
252-
return (anchor.get());
252+
return anchor.get();
253+
}
254+
255+
@Override
256+
public double getDefaultX() {
257+
return 1.0;
258+
}
259+
260+
@Override
261+
public double getDefaultY() {
262+
return 0.5;
253263
}
254264
}

1.21/src/main/java/io/github/axolotlclient/config/screen/ProfilesScreen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public void render(GuiGraphics guiGraphics, int index, int top, int left, int wi
180180

181181
boolean current = Profiles.getInstance().getCurrent() == profile;
182182
loadButton.setMessage(current ? CURRENT_TEXT : LOAD_BUTTON_TITLE);
183-
loadButton.active = !current;
183+
loadButton.active = removeButton.active = !current;
184184
i -= loadButton.getWidth();
185185
this.loadButton.setPosition(i, j);
186186
this.loadButton.render(guiGraphics, mouseX, mouseY, partialTick);

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ public boolean isLabelEditable() {
477477
}
478478

479479
public void saveKeystrokes() {
480+
if (keystrokes == null) return;
480481
try {
481482
var path = AxolotlClientCommon.resolveProfileConfigFile(KEYSTROKE_SAVE_FILE_NAME);
482483
Files.createDirectories(path.getParent());
@@ -495,7 +496,11 @@ public void loadKeystrokes() {
495496
var loaded = entries.stream().map(e -> (Map<String, Object>) e)
496497
.map(KeystrokeHud.this::deserializeKey)
497498
.toList();
498-
keystrokes.clear();
499+
if (keystrokes == null) {
500+
keystrokes = new ArrayList<>();
501+
} else {
502+
keystrokes.clear();
503+
}
499504
keystrokes.addAll(loaded);
500505
} else {
501506
saveKeystrokes();

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,16 @@ public Identifier getId() {
226226

227227
@Override
228228
public AnchorPoint getAnchor() {
229-
return (anchor.get());
229+
return anchor.get();
230+
}
231+
232+
@Override
233+
public double getDefaultX() {
234+
return 1.0;
235+
}
236+
237+
@Override
238+
public double getDefaultY() {
239+
return 0.5;
230240
}
231241
}

1.8.9/src/main/java/io/github/axolotlclient/config/screen/ProfilesScreen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public void render(int index, int top, int left, int width, int height, int mous
161161

162162
boolean current = Profiles.getInstance().getCurrent() == profile;
163163
loadButton.setMessage(current ? CURRENT_TEXT : LOAD_BUTTON_TITLE);
164-
loadButton.active = !current;
164+
loadButton.active = removeButton.active = !current;
165165
i -= loadButton.getWidth();
166166
this.loadButton.setPosition(i, j);
167167
this.loadButton.render(mouseX, mouseY, partialTick);

0 commit comments

Comments
 (0)