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

Commit 6f0cb00

Browse files
committed
Hot fix for stuff
1 parent 5bf3408 commit 6f0cb00

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/main/java/io/github/darkkronicle/kronhud/gui/AbstractHudEntry.java

+3
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ public DrawPosition getScaledPos() {
145145
}
146146

147147
public DrawPosition getScaledPos(float scale) {
148+
if (client.getWindow() == null) {
149+
return new DrawPosition(0, 0);
150+
}
148151
int scaledX = floatToInt((float) x.getDoubleValue(), client.getWindow().getScaledWidth(),
149152
Math.round(width * scale));
150153
int scaledY = floatToInt((float) y.getDoubleValue(), client.getWindow().getScaledHeight(),

src/main/java/io/github/darkkronicle/kronhud/gui/hud/KeystrokeHud.java

+5
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ public static Optional<String> getMouseKeyBindName(KeyBinding keyBinding) {
4646
}
4747

4848
public void setKeystrokes() {
49+
if (client.getWindow() == null) {
50+
keystrokes = null;
51+
return;
52+
// Wait until render is called
53+
}
4954
keystrokes = new ArrayList<>();
5055
DrawPosition pos = getPos();
5156
// LMB

0 commit comments

Comments
 (0)