SliderComponent: Works with resizing now

This commit is contained in:
noil 2021-01-09 01:03:29 -05:00
parent f45438c590
commit 494a616f35
2 changed files with 5 additions and 1 deletions

View File

@ -24,6 +24,7 @@ public final class SliderComponent extends HudComponent {
protected final DecimalFormat decimalFormat = new DecimalFormat("#.#");
protected boolean sliding;
protected float lastPositionX = -1;
protected float lastWidth = -1;
public SliderComponent(String name, Value value) {
super(name);
@ -53,6 +54,9 @@ public final class SliderComponent extends HudComponent {
if (this.getX() != this.lastPositionX) {
this.sliderBar.updatePositionToValue();
this.lastPositionX = this.getX();
} else if (this.getW() != this.lastWidth) {
this.sliderBar.updatePositionToValue();
this.lastWidth = this.getW();
}
} else {
if (mouseX < this.getX() || mouseX > this.getX() + this.getW()) { // mouse must be inside X at all times to slide

View File

@ -52,7 +52,7 @@ public final class ModuleListComponent extends ResizableHudComponent {
private ModuleSettingsComponent currentSettings;
public ModuleListComponent(Module.ModuleType type) {
super(StringUtils.capitalize(type.name().toLowerCase()), 100, 100, 150, 1000);
super(StringUtils.capitalize(type.name().toLowerCase()), 100, 100, 150, 400);
this.type = type;
this.originalName = StringUtils.capitalize(type.name().toLowerCase());
this.hudEditorModule = (HudEditorModule) Seppuku.INSTANCE.getModuleManager().find(HudEditorModule.class);