use of net.minecraft.client.gui.GuiButton in project SecurityCraft by Geforce132.
the class GuiBriefcase method initGui.
@Override
public void initGui() {
super.initGui();
for (int i = 0; i < keycodeTopButtons.length; i++) {
keycodeTopButtons[i] = new GuiButton(i, width / 2 - 40 + (i * 20), height / 2 - 52, 20, 20, UP_ARROW);
buttonList.add(keycodeTopButtons[i]);
}
for (int i = 0; i < keycodeBottomButtons.length; i++) {
keycodeBottomButtons[i] = new GuiButton(4 + i, width / 2 - 40 + (i * 20), height / 2, 20, 20, DOWN_ARROW);
buttonList.add(keycodeBottomButtons[i]);
}
continueButton = new GuiButton(8, (width / 2 + 42), height / 2 - 26, 20, 20, ">");
buttonList.add(continueButton);
for (int i = 0; i < keycodeTextboxes.length; i++) {
keycodeTextboxes[i] = new GuiTextField(9 + i, fontRendererObj, (width / 2 - 37) + (i * 20), height / 2 - 22, 14, 12);
keycodeTextboxes[i].setTextColor(-1);
keycodeTextboxes[i].setDisabledTextColour(-1);
keycodeTextboxes[i].setEnableBackgroundDrawing(true);
keycodeTextboxes[i].setMaxStringLength(1);
keycodeTextboxes[i].setText("0");
}
}
use of net.minecraft.client.gui.GuiButton in project SecurityCraft by Geforce132.
the class GuiBriefcaseSetup method initGui.
@Override
public void initGui() {
super.initGui();
Keyboard.enableRepeatEvents(true);
buttonList.add(saveAndContinueButton = new GuiButton(0, width / 2 - 48, height / 2 + 30 + 10, 100, 20, !flag ? StatCollector.translateToLocal("gui.keycardSetup.save") : StatCollector.translateToLocal("gui.password.invalidCode")));
keycodeTextbox = new GuiTextField(1, fontRendererObj, width / 2 - 37, height / 2 - 47, 77, 12);
keycodeTextbox.setTextColor(-1);
keycodeTextbox.setDisabledTextColour(-1);
keycodeTextbox.setEnableBackgroundDrawing(true);
keycodeTextbox.setMaxStringLength(4);
updateButtonText();
}
use of net.minecraft.client.gui.GuiButton in project SecurityCraft by Geforce132.
the class GuiCustomizeBlock method initGui.
@Override
public void initGui() {
super.initGui();
for (int i = 0; i < tileEntity.getNumberOfCustomizableOptions(); i++) {
descriptionButtons[i] = new GuiItemButton(i, guiLeft + 130, (guiTop + 10) + (i * 25), 20, 20, "", itemRender, new ItemStack(tileEntity.acceptedModules()[i].getItem()));
buttonList.add(descriptionButtons[i]);
hoverCheckers[i] = new HoverChecker(descriptionButtons[i], 20);
}
if (tileEntity.customOptions() != null)
for (int i = 0; i < tileEntity.customOptions().length; i++) {
Option option = tileEntity.customOptions()[i];
if (option instanceof OptionDouble && ((OptionDouble) option).isSlider()) {
optionButtons[i] = new GuiSlider((StatCollector.translateToLocal("option." + blockName + "." + option.getName()) + " ").replace("#", option.toString()), blockName, i, guiLeft + 178, (guiTop + 10) + (i * 25), 120, 20, "", "", (Double) option.getMin(), (Double) option.getMax(), (Double) option.getValue(), true, true, (OptionDouble) option);
optionButtons[i].packedFGColour = 14737632;
} else {
optionButtons[i] = new GuiButton(i, guiLeft + 178, (guiTop + 10) + (i * 25), 120, 20, getOptionButtonTitle(option));
optionButtons[i].packedFGColour = option.toString().matches(option.getDefaultValue().toString()) ? 16777120 : 14737632;
}
buttonList.add(optionButtons[i]);
hoverCheckers[i + tileEntity.getNumberOfCustomizableOptions()] = new HoverChecker(optionButtons[i], 20);
}
}
use of net.minecraft.client.gui.GuiButton in project SecurityCraft by Geforce132.
the class GuiKeyChanger method initGui.
@Override
public void initGui() {
super.initGui();
Keyboard.enableRepeatEvents(true);
buttonList.add(confirmButton = new GuiButton(0, width / 2 - 52, height / 2 + 52, 100, 20, StatCollector.translateToLocal("gui.universalKeyChanger.confirm")));
confirmButton.enabled = false;
textboxNewPasscode = new GuiTextField(0, fontRendererObj, width / 2 - 57, height / 2 - 47, 110, 12);
textboxNewPasscode.setTextColor(-1);
textboxNewPasscode.setDisabledTextColour(-1);
textboxNewPasscode.setEnableBackgroundDrawing(true);
textboxNewPasscode.setMaxStringLength(20);
textboxConfirmPasscode = new GuiTextField(1, fontRendererObj, width / 2 - 57, height / 2 - 7, 110, 12);
textboxConfirmPasscode.setTextColor(-1);
textboxConfirmPasscode.setDisabledTextColour(-1);
textboxConfirmPasscode.setEnableBackgroundDrawing(true);
textboxConfirmPasscode.setMaxStringLength(20);
}
use of net.minecraft.client.gui.GuiButton in project SecurityCraft by Geforce132.
the class GuiMRATDeactivate method initGui.
@Override
public void initGui() {
super.initGui();
for (int i = 1; i < 7; i++) {
buttons[i - 1] = new GuiButton(i - 1, width / 2 - 49 - 25, height / 2 - 7 - 60 + ((i - 1) * 25), 149, 20, StatCollector.translateToLocal("gui.mrat.notBound"));
buttons[i - 1].enabled = false;
if (item.getItem() != null && item.getItem() == SCContent.remoteAccessMine && item.getTagCompound() != null && item.getTagCompound().getIntArray("mine" + i) != null && item.getTagCompound().getIntArray("mine" + i).length > 0) {
int[] coords = item.getTagCompound().getIntArray("mine" + i);
if (coords[0] == 0 && coords[1] == 0 && coords[2] == 0) {
buttonList.add(buttons[i - 1]);
continue;
}
buttons[i - 1].displayString = StatCollector.translateToLocal("gui.mrat.mineLocations").replace("#location", Utils.getFormattedCoordinates(new BlockPos(coords[0], coords[1], coords[2])));
buttons[i - 1].enabled = (BlockUtils.getBlock(mc.theWorld, coords[0], coords[1], coords[2]) instanceof IExplosive && ((IExplosive) BlockUtils.getBlock(mc.theWorld, coords[0], coords[1], coords[2])).isDefusable() && ((IExplosive) BlockUtils.getBlock(mc.theWorld, coords[0], coords[1], coords[2])).isActive(mc.theWorld, BlockUtils.toPos(coords[0], coords[1], coords[2]))) ? true : false;
buttons[i - 1].id = i - 1;
}
buttonList.add(buttons[i - 1]);
}
}
Aggregations