use of net.minecraft.client.gui.GuiButton 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, "<");
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, ">");
rightButton.visible = !isHidden();
rightButton.enabled = canChange;
screen.addButton(this, 1, rightButton);
for (TableCellButton action : actions) action.initGui(screen);
}
use of net.minecraft.client.gui.GuiButton in project RecurrentComplex by Ivorforce.
the class TableCellEnum 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() - TableCellPresetAction.DIRECTION_BUTTON_WIDTH * 2;
boolean canChange = options.size() > 1 || (options.size() == 1 && !Objects.equals(getPropertyValue(), options.get(0).value));
leftButton = new GuiButton(-1, bounds.getMinX(), buttonY, TableCellPresetAction.DIRECTION_BUTTON_WIDTH - 1, 20, "<");
leftButton.visible = !isHidden();
leftButton.enabled = canChange;
screen.addButton(this, 0, leftButton);
rightButton = new GuiButton(-1, bounds.getMinX() + TableCellPresetAction.DIRECTION_BUTTON_WIDTH + presetButtonWidth + 1, buttonY, TableCellPresetAction.DIRECTION_BUTTON_WIDTH - 1, 20, ">");
rightButton.visible = !isHidden();
rightButton.enabled = canChange;
screen.addButton(this, 1, rightButton);
}
use of net.minecraft.client.gui.GuiButton in project RecurrentComplex by Ivorforce.
the class GuiEditInventoryGenItems method mouseReleased.
@Override
protected void mouseReleased(int mouseX, int mouseY, int state) {
super.mouseReleased(mouseX, mouseY, state);
if (state == 0) {
for (Object object : buttonList) {
GuiButton button = (GuiButton) object;
button.mouseReleased(mouseX, mouseY);
}
}
}
use of net.minecraft.client.gui.GuiButton in project SecurityCraft by Geforce132.
the class GuiKeypadChestSetup method initGui.
public void initGui() {
super.initGui();
Keyboard.enableRepeatEvents(true);
int j = (this.height - this.height) / 2;
this.buttonList.add(this.saveAndContinueButton = new GuiButton(0, this.width / 2 - 48, this.height / 2 + 30 + 10, 100, 20, !this.flag ? "Save & continue." : "Invalid code!"));
this.textboxKeycode = new GuiTextField(this.fontRendererObj, this.width / 2 - 37, this.height / 2 - 47, 77, 12);
this.textboxKeycode.setTextColor(-1);
this.textboxKeycode.setDisabledTextColour(-1);
this.textboxKeycode.setEnableBackgroundDrawing(true);
this.textboxKeycode.setMaxStringLength(11);
this.updateButtonText();
}
use of net.minecraft.client.gui.GuiButton in project SecurityCraft by Geforce132.
the class GuiRetinalScanner method initGui.
public void initGui() {
super.initGui();
Keyboard.enableRepeatEvents(true);
int j = (this.height - this.height) / 2;
this.buttonList.add(new GuiButton(0, this.width / 2 - 48, this.height / 2 + 30 + 20, 100, 20, "Continue."));
this.buttonList.add(new GuiButton(1, this.width / 4, this.height / 2, 20, 20, "X."));
}
Aggregations