use of ivorius.ivtoolkit.gui.GuiSlider in project RecurrentComplex by Ivorforce.
the class TableCellInteger method initGui.
@Override
public void initGui(GuiTable screen) {
super.initGui(screen);
Bounds bounds = bounds();
if (slider == null) {
slider = new GuiSlider(-1, 0, 0, 0, 0, String.valueOf(property));
slider.addListener(this);
}
updateSliderBounds(bounds);
slider.setMinValue(min);
slider.setMaxValue(max);
slider.enabled = enabled;
slider.setValue(property);
slider.visible = !isHidden();
screen.addButton(this, 0, slider);
}
use of ivorius.ivtoolkit.gui.GuiSlider in project RecurrentComplex by Ivorforce.
the class TableCellFloat method initGui.
@Override
public void initGui(GuiTable screen) {
super.initGui(screen);
Bounds bounds = bounds();
if (slider == null) {
slider = new GuiSlider(-1, 0, 0, 0, 0, String.format(titleFormat, property));
slider.addListener(this);
}
updateSliderBounds(bounds);
slider.setMinValue(scale.out(min));
slider.setMaxValue(scale.out(max));
slider.enabled = enabled;
slider.setValue(scale.out(property));
slider.visible = !isHidden();
screen.addButton(this, 0, slider);
}
use of ivorius.ivtoolkit.gui.GuiSlider in project RecurrentComplex by Ivorforce.
the class TableCellFloatNullable method initGui.
@Override
public void initGui(GuiTable screen) {
super.initGui(screen);
Bounds bounds = bounds();
if (slider == null) {
slider = new GuiSlider(-1, 0, 0, 0, 0, "");
slider.addListener(this);
}
updateSliderBounds(bounds);
slider.setMinValue(scale.out(min));
slider.setMaxValue(scale.out(max));
updateSliderValue();
slider.visible = !isHidden();
screen.addButton(this, 0, slider);
int nullButtonWidth = MathHelper.floor(bounds.getWidth() * this.nullButtonWidth);
nullButton = new GuiButton(-1, bounds.getMinX() + slider.width + 2, bounds.getMinY() + (bounds.getHeight() - 20) / 2, nullButtonWidth, 20, property != null ? buttonTitleCustom : buttonTitleNull);
nullButton.enabled = enabled;
nullButton.visible = !isHidden();
screen.addButton(this, 1, nullButton);
}