Search in sources :

Example 11 with Bounds

use of ivorius.reccomplex.gui.table.Bounds 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)

Example 12 with Bounds

use of ivorius.reccomplex.gui.table.Bounds in project RecurrentComplex by Ivorforce.

the class TitledCell method draw.

@Override
public void draw(GuiTable screen, int mouseX, int mouseY, float partialTicks) {
    super.draw(screen, mouseX, mouseY, partialTicks);
    Bounds bounds = bounds();
    FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
    String title = getTitle();
    if (title != null)
        screen.drawString(fontRenderer, RCStrings.shorten(title, fontRenderer, TITLE_WIDTH - 5), bounds.getMinX(), bounds.getCenterY() - 4, 0xffffffff);
    cell.draw(screen, mouseX, mouseY, partialTicks);
}
Also used : Bounds(ivorius.reccomplex.gui.table.Bounds) FontRenderer(net.minecraft.client.gui.FontRenderer)

Example 13 with Bounds

use of ivorius.reccomplex.gui.table.Bounds in project RecurrentComplex by Ivorforce.

the class TableCellEnum method drawFloating.

@Override
public void drawFloating(GuiTable screen, int mouseX, int mouseY, float partialTicks) {
    super.drawFloating(screen, mouseX, mouseY, partialTicks);
    Option<T> option = currentOption();
    if (option != null && option.tooltip != null) {
        Bounds bounds = bounds();
        screen.drawTooltipRect(option.tooltip, Bounds.fromSize(bounds.getMinX() + TableCellPresetAction.DIRECTION_BUTTON_WIDTH, bounds.getMinY(), bounds.getWidth() - TableCellPresetAction.DIRECTION_BUTTON_WIDTH * 2, bounds.getHeight()), mouseX, mouseY, getFontRenderer());
    }
}
Also used : Bounds(ivorius.reccomplex.gui.table.Bounds)

Example 14 with Bounds

use of ivorius.reccomplex.gui.table.Bounds in project RecurrentComplex by Ivorforce.

the class TableCellIntegerRange method initGui.

@Override
public void initGui(GuiTable screen) {
    super.initGui(screen);
    Bounds bounds = bounds();
    if (slider == null) {
        slider = new GuiSliderRange(-1, 0, 0, 0, 0, "");
        slider.addListener(this);
    }
    updateSliderBounds(bounds);
    updateSliderString();
    slider.setMinValue(min);
    slider.setMaxValue(max);
    slider.enabled = enabled;
    slider.setRange(new FloatRange(property));
    slider.visible = !isHidden();
    screen.addButton(this, 0, slider);
}
Also used : Bounds(ivorius.reccomplex.gui.table.Bounds)

Example 15 with Bounds

use of ivorius.reccomplex.gui.table.Bounds in project RecurrentComplex by Ivorforce.

the class TableCellBoolean method initGui.

@Override
public void initGui(GuiTable screen) {
    super.initGui(screen);
    Bounds bounds = bounds();
    button = new GuiButton(-1, bounds.getMinX(), bounds.getMinY() + (bounds.getHeight() - 20) / 2, bounds.getWidth(), 20, getCurrentButtonTitle());
    button.enabled = enabled;
    button.visible = !isHidden();
    screen.addButton(this, 0, button);
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) Bounds(ivorius.reccomplex.gui.table.Bounds)

Aggregations

Bounds (ivorius.reccomplex.gui.table.Bounds)15 FontRenderer (net.minecraft.client.gui.FontRenderer)4 GuiButton (net.minecraft.client.gui.GuiButton)4 GuiSlider (ivorius.ivtoolkit.gui.GuiSlider)3 GuiSliderRange (ivorius.ivtoolkit.gui.GuiSliderRange)1 GuiTexturedButton (ivorius.reccomplex.gui.GuiTexturedButton)1 GuiValidityStateIndicator (ivorius.reccomplex.gui.GuiValidityStateIndicator)1 GuiTextField (net.minecraft.client.gui.GuiTextField)1