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);
}
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);
}
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());
}
}
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);
}
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);
}
Aggregations