fix(hud): populate KeyBindRow display fields so module names render
The render path in KeyBindsHud.renderRows draws row.displayName / row.keyName and lays out rows using row.nameWidth, but the KeyBindRow constructor (and update()) only assigned name/key, leaving displayName, keyName and nameWidth at their default null/0. That's why only the 'Hotkeys' header showed up while every module row stayed blank with zero width. Initialize displayName, keyName, nameWidth and widthValue from name / key in both the constructor and update(). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -94,6 +94,10 @@ extends HudElement {
|
||||
this.entry = entry;
|
||||
this.name = entry != null ? entry.name : module.getName();
|
||||
this.key = entry != null ? entry.key : module.getBind().getName();
|
||||
this.displayName = this.name;
|
||||
this.keyName = this.key;
|
||||
this.nameWidth = GlHelper.getStringWidth(this.name, parent.keyFont);
|
||||
this.widthValue = this.nameWidth + 10.0f;
|
||||
}
|
||||
|
||||
public void startRemove() {
|
||||
@@ -108,6 +112,10 @@ extends HudElement {
|
||||
this.entry = e;
|
||||
this.name = e != null ? e.name : this.module.getName();
|
||||
this.key = e != null ? e.key : this.module.getBind().getName();
|
||||
this.displayName = this.name;
|
||||
this.keyName = this.key;
|
||||
this.nameWidth = GlHelper.getStringWidth(this.name, this.parent.keyFont);
|
||||
this.widthValue = this.nameWidth + 10.0f;
|
||||
}
|
||||
|
||||
public boolean isRemoveDone() {
|
||||
|
||||
Reference in New Issue
Block a user