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; private int crosshairColorBase = 0xffcfcfcf;
@Variable(name = "crosshair_color_target", type = IntType.COLOR, category = CVarCategory.GUI, display = "Fadenkreuz-Farbe (mit Ziel)") @Variable(name = "crosshair_color_target", type = IntType.COLOR, category = CVarCategory.GUI, display = "Fadenkreuz-Farbe (mit Ziel)")
private int crosshairColorTarget = 0xffffffff; 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") @Variable(name = "info_overlay", category = CVarCategory.GUI, display = "Informations-Overlay")
private boolean infoOverlay = true; private boolean infoOverlay = true;
@ -1110,8 +1112,15 @@ public class Client implements IThreadListener {
this.renderWorldDirections((float)this.tickFraction); this.renderWorldDirections((float)this.tickFraction);
} }
else if(this.crosshairSize > 0) { 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); final int color = 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); 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);
}
} }
} }

View file

@ -12,12 +12,14 @@ public class GuiGraphics extends GuiOptions {
this.addSelector("draw_void_fog", 242, 20, 240, 0); this.addSelector("draw_void_fog", 242, 20, 240, 0);
this.addSelector("draw_player_firstperson", 0, 40, 240, 0); this.addSelector("draw_player_firstperson", 0, 40, 240, 0);
this.addSelector("crosshair_size", 242, 40, 240, 0);
this.addSelector("crosshair_color_notarget", 0, 80, 240, 0); this.addSelector("crosshair_simple", 0, 60, 240, 0);
this.addSelector("crosshair_color_target", 242, 80, 240, 0); this.addSelector("crosshair_size", 242, 60, 240, 0);
this.addSelector("hud_margin", 0, 120, 240, 0); this.addSelector("crosshair_color_notarget", 0, 100, 240, 0);
this.addSelector("crosshair_color_target", 242, 100, 240, 0);
this.addSelector("hud_margin", 0, 140, 240, 0);
super.init(width, height); super.init(width, height);
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 9 KiB