SliderComponent: Works with resizing now
This commit is contained in:
parent
f45438c590
commit
494a616f35
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue