CarouselComponent: Proper capitalization

This commit is contained in:
noil 2021-01-07 15:56:59 -05:00
parent fd74c56aa4
commit cd60dea84a
2 changed files with 7 additions and 3 deletions

View File

@ -18,7 +18,7 @@ public final class CarouselComponent extends HudComponent {
super(name);
this.value = value;
this.displayValue = value.getValue().toString().toLowerCase();
this.displayValue = value.getCapitalizedValue();
this.focused = false;
}
@ -49,7 +49,7 @@ public final class CarouselComponent extends HudComponent {
this.onLeftButtonPress(mouseX);
this.onRightButtonPress(mouseX);
this.displayValue = this.value.getValue().toString().toLowerCase();
this.displayValue = this.value.getCapitalizedValue();
} else {
this.focused = false;
}

View File

@ -77,10 +77,14 @@ public class Value<T> {
}
}
public String getEnumReplacedName() {
public String getCapitalizedName() {
return Character.toString(this.getName().charAt(0)) + this.getName().toLowerCase().replaceFirst(Character.toString(this.getName().charAt(0)).toLowerCase(), "");
}
public String getCapitalizedValue() {
return this.getValue().toString().charAt(0) + this.getValue().toString().toLowerCase().replaceFirst(Character.toString(this.getValue().toString().charAt(0)).toLowerCase(), "");
}
public T getMin() {
return min;
}