ModuleListComponent: Support all types of child component's

This commit is contained in:
noil 2021-01-08 22:50:07 -05:00
parent e97ed7da96
commit 48e539f9be
1 changed files with 14 additions and 13 deletions

View File

@ -616,25 +616,26 @@ public final class ModuleListComponent extends ResizableHudComponent {
for (HudComponent component : this.components) {
int offsetX = 0;
if (component instanceof SliderComponent || component instanceof TextComponent) {
boolean skipRendering = false;
for (HudComponent otherComponent : this.components) {
if (otherComponent instanceof ButtonComponent) {
boolean isChildComponent = component.getName().toLowerCase().startsWith(otherComponent.getName().toLowerCase());
if (isChildComponent) {
if (!((ButtonComponent) otherComponent).rightClickEnabled) {
skipRendering = true;
}
boolean skipRendering = false;
for (HudComponent otherComponent : this.components) {
if (otherComponent == component || otherComponent.getName().equals(component.getName()))
continue;
offsetX += 4;
if (otherComponent instanceof ButtonComponent) {
boolean isChildComponent = component.getName().toLowerCase().startsWith(otherComponent.getName().toLowerCase());
if (isChildComponent) {
if (!((ButtonComponent) otherComponent).rightClickEnabled) {
skipRendering = true;
}
offsetX += 4;
}
}
if (skipRendering)
continue;
}
if (skipRendering)
continue;
component.setX(this.getX() + 1 + offsetX);
component.setY(this.getY() + offsetY);
component.setW(this.getW() - offsetX);