use of net.minecraft.client.gui.GuiButton in project PneumaticCraft by MineMaarten.
the class GuiSecurityStationInventory method initGui.
@Override
public void initGui() {
super.initGui();
int xStart = (width - xSize) / 2;
int yStart = (height - ySize) / 2;
statusStat = addAnimatedStat("Security Status", new ItemStack(Blockss.securityStation), 0xFFFFAA00, false);
accessStat = addAnimatedStat("Shared Users", new ItemStack(Items.skull, 1, 3), 0xFF005500, false);
Rectangle accessButtonRectangle = accessStat.getButtonScaledRectangle(145, 10, 20, 20);
addButton = getButtonFromRectangle(1, accessButtonRectangle, "+");
rebootButton = new GuiButton(2, xStart + 110, yStart + 20, 60, 20, "Reboot");
sharedUserTextField = getTextFieldFromRectangle(accessStat.getButtonScaledRectangle(20, 15, 120, 10));
accessStat.addWidget(sharedUserTextField);
accessStat.addWidget(addButton);
buttonList.add(new GuiButton(3, guiLeft + 108, guiTop + 103, 64, 20, I18n.format("gui.securityStation.test")));
buttonList.add(rebootButton);
buttonList.add(new GuiButton(-1, guiLeft + 108, guiTop + 125, 64, 20, I18n.format("gui.universalSensor.button.showRange")));
updateUserRemoveButtons();
nodeHandler = new NetworkConnectionBackground(this, te, xStart + 25, yStart + 30, 18, 0xFF2222FF);
}
use of net.minecraft.client.gui.GuiButton in project PneumaticCraft by MineMaarten.
the class GuiSecurityStationInventory method updateScreen.
@Override
public void updateScreen() {
super.updateScreen();
statusStat.setText(getStatusText());
accessStat.setTextWithoutCuttingString(getAccessText());
String rebootButtonString;
if (te.getRebootTime() > 0) {
rebootButtonString = te.getRebootTime() % 100 < 50 ? "Rebooting.." : PneumaticCraftUtils.convertTicksToMinutesAndSeconds(te.getRebootTime(), false);
} else {
rebootButtonString = "Reboot";
}
rebootButton.displayString = rebootButtonString;
addButton.visible = accessStat.isDoneExpanding();
for (GuiButton button : removeUserButtons) {
button.enabled = accessStat.isDoneExpanding();
}
if (removeUserButtons.size() != te.sharedUsers.size()) {
updateUserRemoveButtons();
}
}
use of net.minecraft.client.gui.GuiButton in project PneumaticCraft by MineMaarten.
the class GuiEntityTrackOptions method initGui.
@Override
public void initGui(IGuiScreen gui) {
gui.getButtonList().add(new GuiButton(10, 30, 128, 150, 20, "Move Stat Screen..."));
textField = new GuiTextField(gui.getFontRenderer(), 35, 60, 140, 10);
textField.setFocused(true);
if (PneumaticCraft.proxy.getPlayer() != null)
textField.setText(ItemPneumaticArmor.getEntityFilter(PneumaticCraft.proxy.getPlayer().getCurrentArmor(3)));
}
use of net.minecraft.client.gui.GuiButton in project PneumaticCraft by MineMaarten.
the class GuiSearchUpgradeOptions method initGui.
@Override
public void initGui(IGuiScreen gui) {
gui.getButtonList().add(new GuiButton(10, 30, 40, 150, 20, "Search for item..."));
gui.getButtonList().add(new GuiButton(11, 30, 128, 150, 20, "Move Stat Screen..."));
if (searchGui != null && player.getCurrentArmor(3) != null) {
ItemStack searchStack = searchGui.getSearchStack();
ItemStack helmetStack = ItemPneumaticArmor.getSearchedStack(player.getCurrentArmor(3));
if (searchStack == null && helmetStack != null || searchStack != null && helmetStack == null || searchStack != null && helmetStack != null && !searchStack.isItemEqual(helmetStack)) {
NetworkHandler.sendToServer(new PacketUpdateSearchStack(searchStack));
NBTTagCompound tag = NBTUtil.getCompoundTag(player.getCurrentArmor(3), "SearchStack");
tag.setInteger("itemID", searchStack != null ? Item.getIdFromItem(searchStack.getItem()) : -1);
tag.setInteger("itemDamage", searchStack != null ? searchStack.getItemDamage() : -1);
}
}
}
use of net.minecraft.client.gui.GuiButton in project MinecraftForge by MinecraftForge.
the class GuiJava8Error method initGui.
@Override
public void initGui() {
super.initGui();
this.buttonList.remove(1);
if (java8VersionException.getMods().isEmpty()) {
this.buttonList.remove(0);
this.buttonList.add(new GuiButton(1, 50, this.height - 38, this.width / 2 - 55, 20, I18n.format("fml.button.continue")));
}
this.buttonList.add(new GuiButton(2, this.width / 2 + 5, this.height - 38, this.width / 2 - 55, 20, I18n.format("fml.button.visitjavadownloads")));
}
Aggregations