1
0
Fork 0

add crosshair texture

This commit is contained in:
Sen 2025-08-26 15:30:35 +02:00
parent 743afbed6d
commit 3e12a1c36a
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
3 changed files with 17 additions and 6 deletions

View file

@ -618,6 +618,8 @@ public class Client implements IThreadListener {
private int crosshairColorBase = 0xffcfcfcf;
@Variable(name = "crosshair_color_target", type = IntType.COLOR, category = CVarCategory.GUI, display = "Fadenkreuz-Farbe (mit Ziel)")
private int crosshairColorTarget = 0xffffffff;
@Variable(name = "crosshair_simple", category = CVarCategory.GUI, display = "Einfaches Fadenkreuz")
private boolean crosshairSimple = false;
@Variable(name = "info_overlay", category = CVarCategory.GUI, display = "Informations-Overlay")
private boolean infoOverlay = true;
@ -1110,8 +1112,15 @@ public class Client implements IThreadListener {
this.renderWorldDirections((float)this.tickFraction);
}
else if(this.crosshairSize > 0) {
Drawing.drawRect(this.fbX / 2 - 1, this.fbY / 2 - this.crosshairSize, 2, this.crosshairSize * 2, this.pointed != null && this.pointed.type != ObjectType.MISS ? this.crosshairColorTarget : this.crosshairColorBase);
Drawing.drawRect(this.fbX / 2 - this.crosshairSize, this.fbY / 2 - 1, this.crosshairSize * 2, 2, this.pointed != null && this.pointed.type != ObjectType.MISS ? this.crosshairColorTarget : this.crosshairColorBase);
final int color = this.pointed != null && this.pointed.type != ObjectType.MISS ? this.crosshairColorTarget : this.crosshairColorBase;
if(this.crosshairSimple) {
Drawing.drawRect(this.fbX / 2 - 1, this.fbY / 2 - this.crosshairSize, 2, this.crosshairSize * 2, color);
Drawing.drawRect(this.fbX / 2 - this.crosshairSize, this.fbY / 2 - 1, this.crosshairSize * 2, 2, color);
}
else {
GlState.color(color);
Drawing.drawTexturedRect(this, "textures/crosshair.png", 32, 32, this.fbX / 2 - 16, this.fbY / 2 - 16, 0, 0, 32, 32);
}
}
}