Search in sources :

Example 1 with GuiSlider

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);
}
Also used : Bounds(ivorius.reccomplex.gui.table.Bounds) GuiSlider(ivorius.ivtoolkit.gui.GuiSlider)

Example 2 with GuiSlider

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);
}
Also used : Bounds(ivorius.reccomplex.gui.table.Bounds) GuiSlider(ivorius.ivtoolkit.gui.GuiSlider)

Example 3 with GuiSlider

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);
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) Bounds(ivorius.reccomplex.gui.table.Bounds) GuiSlider(ivorius.ivtoolkit.gui.GuiSlider)

Aggregations

GuiSlider (ivorius.ivtoolkit.gui.GuiSlider)3 Bounds (ivorius.reccomplex.gui.table.Bounds)3 GuiButton (net.minecraft.client.gui.GuiButton)1