use of ivorius.reccomplex.gui.table.Bounds in project RecurrentComplex by Ivorforce.
the class TableCellPresetAction method initGui.
@Override
public void initGui(GuiTable screen) {
super.initGui(screen);
Bounds bounds = bounds();
int buttonY = bounds.getMinY() + (bounds.getHeight() - 20) / 2;
int presetButtonWidth = bounds.getWidth() - DIRECTION_BUTTON_WIDTH * 2;
boolean canChange = actions.size() > 1 || (actions.size() == 1 && !Objects.equals(getPropertyValue(), actions.get(0).actionID));
leftButton = new GuiButton(-1, bounds.getMinX(), buttonY, DIRECTION_BUTTON_WIDTH - 1, 20, TableCellEnum.LEFT_ARROW);
leftButton.visible = !isHidden();
leftButton.enabled = canChange;
screen.addButton(this, 0, leftButton);
rightButton = new GuiButton(-1, bounds.getMinX() + DIRECTION_BUTTON_WIDTH + presetButtonWidth + 1, buttonY, DIRECTION_BUTTON_WIDTH - 1, 20, TableCellEnum.RIGHT_ARROW);
rightButton.visible = !isHidden();
rightButton.enabled = canChange;
screen.addButton(this, 1, rightButton);
for (TableCellButton action : actions) action.initGui(screen);
}
use of ivorius.reccomplex.gui.table.Bounds in project RecurrentComplex by Ivorforce.
the class TableCellTitle 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 = getFontRenderer();
screen.drawCenteredString(fontRenderer, displayString, bounds.getCenterX(), positioning.getY(fontRenderer, bounds.getMinY(), bounds.getMaxY()), 0xffffffff);
}
use of ivorius.reccomplex.gui.table.Bounds in project RecurrentComplex by Ivorforce.
the class TitledCell method drawFloating.
@Override
public void drawFloating(GuiTable screen, int mouseX, int mouseY, float partialTicks) {
super.drawFloating(screen, mouseX, mouseY, partialTicks);
cell.drawFloating(screen, mouseX, mouseY, partialTicks);
Bounds bounds = bounds();
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
String title = getTitle();
if (title != null) {
int stringWidth = Math.max(fontRenderer.getStringWidth(title), 100);
List<String> tooltip = getTitleTooltip();
if (tooltip != null)
screen.drawTooltipRect(tooltip, Bounds.fromSize(bounds.getMinX() + TITLE_WIDTH - stringWidth - 10, bounds.getCenterY() - 6, stringWidth, 12), mouseX, mouseY, fontRenderer);
}
}
use of ivorius.reccomplex.gui.table.Bounds in project RecurrentComplex by Ivorforce.
the class TableCellButton method initGui.
@Override
public void initGui(GuiTable screen) {
super.initGui(screen);
Bounds bounds = bounds();
button = new GuiTexturedButton(-1, bounds.getMinX(), bounds.getMinY() + (bounds.getHeight() - 20) / 2, bounds.getWidth(), 20, title);
button.setTexture(texture);
button.visible = !isHidden();
button.enabled = enabled;
screen.addButton(this, 0, button);
}
use of ivorius.reccomplex.gui.table.Bounds 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);
}
Aggregations