use of net.minecraft.client.gui.GuiButton in project AgriCraft by AgriCraft.
the class GuiPeripheral method loadButtonList.
private void loadButtonList() {
this.buttonList.add(new GuiButton(BUTTON_ID_OPEN_GUIDE, this.guiLeft + 154, this.guiTop + 7, 12, 12, "?"));
this.buttonList.add(new GuiButton(BUTTON_ID_SCROLL_TOP, this.guiLeft + 154, this.guiTop + 20, 10, 10, "\u219F"));
this.buttonList.add(new GuiButton(BUTTON_ID_SCROLL_UP, this.guiLeft + 154, this.guiTop + 31, 10, 10, "\u2191"));
this.buttonList.add(new GuiButton(BUTTON_ID_SCROLL_DOWN, this.guiLeft + 154, this.guiTop + 42, 10, 10, "\u2193"));
this.buttonList.add(new GuiButton(BUTTON_ID_SCROLL_BOTTOM, this.guiLeft + 154, this.guiTop + 53, 10, 10, "\u21A1"));
for (int i = 0; i < methods.length; i++) {
this.buttonList.add(new GuiButtonMethod(BUTTON_METHOD_OFFSET + i, this.guiLeft + guideOffset + 3, this.guiTop + 8 + 16 * i, 68, 16, methods[i].getId()));
}
updateButtons();
}
use of net.minecraft.client.gui.GuiButton in project MorePlanets by SteveKunG.
the class GuiShieldGenerator method initGui.
@Override
public void initGui() {
super.initGui();
List<String> batterySlotDesc = new ArrayList<>();
batterySlotDesc.add(GCCoreUtil.translate("gui.battery_slot.desc.0"));
batterySlotDesc.add(GCCoreUtil.translate("gui.battery_slot.desc.1"));
this.infoRegions.add(new GuiElementInfoRegionMP((this.width - this.xSize) / 2 + 151, (this.height - this.ySize) / 2 + 77, 18, 18, batterySlotDesc, this.width, this.height, this));
List<String> electricityDesc = new ArrayList<>();
electricityDesc.add(GCCoreUtil.translate("gui.energy_storage.desc.0"));
electricityDesc.add(EnumColor.YELLOW + GCCoreUtil.translate("gui.energy_storage.desc.1") + ((int) Math.floor(this.tile.getEnergyStoredGC()) + " / " + (int) Math.floor(this.tile.getMaxEnergyStoredGC())));
this.electricInfoRegion = new GuiElementInfoRegionMP((this.width - this.xSize) / 2 + 156, (this.height - this.ySize) / 2 + 21, 8, 43, electricityDesc, this.width, this.height, this);
this.infoRegions.add(this.electricInfoRegion);
this.buttonList.add(this.buttonEnable = new GuiButton(0, this.width / 2 - 76, this.height / 2 - 6, 72, 20, !this.tile.getDisabled(0) ? GCCoreUtil.translate("gui.button.disable.name") : GCCoreUtil.translate("gui.button.enable.name")));
this.buttonList.add(this.buttonConfig = new GuiButton(1, this.width / 2 + 4, this.height / 2 - 6, 72, 20, GCCoreUtil.translate("gui.button.config.name")));
}
use of net.minecraft.client.gui.GuiButton in project MorePlanets by SteveKunG.
the class GuiRocketSchematicMP method initGui.
@Override
public void initGui() {
super.initGui();
this.buttonList.clear();
this.buttonList.add(new GuiButton(0, this.width / 2 - 130, this.height / 2 - 110, 40, 20, GCCoreUtil.translate("gui.button.back.name")));
this.buttonList.add(new GuiButton(1, this.width / 2 - 130, this.height / 2 - 110 + 25, 40, 20, GCCoreUtil.translate("gui.button.next.name")));
}
use of net.minecraft.client.gui.GuiButton in project MorePlanets by SteveKunG.
the class GuiDarkEnergyGenerator method initGui.
@Override
public void initGui() {
super.initGui();
List<String> electricityDesc = new ArrayList<>();
electricityDesc.add(GCCoreUtil.translate("gui.energy_storage.desc.0"));
electricityDesc.add(EnumColor.YELLOW + GCCoreUtil.translate("gui.energy_storage.desc.1") + ((int) Math.floor(this.tile.getEnergyStoredGC()) + " / " + (int) Math.floor(this.tile.getMaxEnergyStoredGC())));
this.electricInfoRegion = new GuiElementInfoRegionMP((this.width - this.xSize) / 2 + 51, (this.height - this.ySize) / 2 + 24, 54, 9, electricityDesc, this.width, this.height, this);
this.infoRegions.add(this.electricInfoRegion);
this.infoRegions.add(new GuiElementInfoRegionMP((this.width - this.xSize) / 2 + 7, (this.height - this.ySize) / 2 + 84, 18, 18, Arrays.asList(GCCoreUtil.translate("gui.battery_slot.desc.0"), GCCoreUtil.translate("gui.battery_slot.desc.1")), this.width, this.height, this));
this.infoRegions.add(new GuiElementInfoRegionMP((this.width - this.xSize) / 2 + 25, (this.height - this.ySize) / 2 + 84, 18, 18, Arrays.asList(GCCoreUtil.translate("gui.battery_slot.desc.0"), GCCoreUtil.translate("gui.battery_slot.desc.1")), this.width, this.height, this));
this.buttonList.add(this.buttonEnable = new GuiButton(0, this.width / 2 + 5, this.height / 2 - 18, 72, 20, !this.tile.getDisabled(0) ? GCCoreUtil.translate("gui.button.disable.name") : GCCoreUtil.translate("gui.button.enable.name")));
this.buttonEnable.enabled = this.tile.disableCooldown == 0;
}
use of net.minecraft.client.gui.GuiButton in project MorePlanets by SteveKunG.
the class GuiShieldGeneratorConfig method initGui.
@Override
public void initGui() {
super.initGui();
Keyboard.enableRepeatEvents(true);
int width = (this.width - this.xSize) / 2;
int height = (this.height - this.ySize) / 2;
this.tempDamage = this.tile.shieldDamage;
this.tempSize = this.tile.maxShieldSize;
List<String> batterySlotDesc = new ArrayList<>();
batterySlotDesc.add(GCCoreUtil.translate("gui.battery_slot.desc.0"));
batterySlotDesc.add(GCCoreUtil.translate("gui.battery_slot.desc.1"));
this.infoRegions.add(new GuiElementInfoRegionMP(width + 151, height + 77, 18, 18, batterySlotDesc, this.width, this.height, this));
this.infoRegions.add(new GuiElementInfoRegionMP(width + 151, height + 59, 18, 18, Arrays.asList(GCCoreUtil.translate("gui.shield_capacity_upgrade.desc.0"), GCCoreUtil.translate("gui.shield_capacity_upgrade.desc.1")), this.width, this.height, this));
this.infoRegions.add(new GuiElementInfoRegionMP(width + 151, height + 41, 18, 18, Arrays.asList(GCCoreUtil.translate("gui.shield_size_upgrade.desc.0"), GCCoreUtil.translate("gui.shield_size_upgrade.desc.1")), this.width, this.height, this));
this.infoRegions.add(new GuiElementInfoRegionMP(width + 151, height + 23, 18, 18, Arrays.asList(GCCoreUtil.translate("gui.shield_damage_upgrade.desc.0"), GCCoreUtil.translate("gui.shield_damage_upgrade.desc.1")), this.width, this.height, this));
this.infoRegions.add(new GuiElementInfoRegionMP(width + 60, height + 70, 13, 13, Arrays.asList(GCCoreUtil.translate("gui.shield_visible.desc")), this.width, this.height, this));
this.infoRegions.add(new GuiElementInfoRegionMP(width + 80, height + 70, 13, 13, Arrays.asList(GCCoreUtil.translate("gui.enable_shield.desc")), this.width, this.height, this));
this.infoRegions.add(new GuiElementInfoRegionMP(width + 100, height + 70, 13, 13, Arrays.asList(GCCoreUtil.translate("gui.enable_shield_damage.desc")), this.width, this.height, this));
this.checkboxRenderShield = new GuiElementCheckbox(100, this, width + 60, height + 70, "");
this.checkboxEnableShield = new GuiElementCheckbox(101, this, width + 80, height + 70, "");
this.checkboxEnableDamage = new GuiElementCheckbox(102, this, width + 100, height + 70, "");
this.buttonList.add(this.checkboxRenderShield);
this.buttonList.add(this.checkboxEnableShield);
this.buttonList.add(this.checkboxEnableDamage);
this.buttonList.add(this.buttonBack = new GuiButton(0, this.width / 2 - 76, this.height / 2 - 6, 72, 20, GCCoreUtil.translate("gui.button.back.name")));
this.buttonList.add(this.buttonDone = new GuiButton(1, this.width / 2 + 4, this.height / 2 - 6, 72, 20, GCCoreUtil.translate("gui.done")));
this.shieldDamageText = new GuiNumberField(1, this.fontRenderer, this.width / 2 - 3, this.height / 2 - 83, 30, 16);
this.shieldDamageText.setMaxStringLength(2);
this.shieldDamageText.setFocused(false);
this.shieldDamageText.setCanLoseFocus(true);
this.shieldDamageText.setEnableBackgroundDrawing(true);
this.shieldDamageText.setTextColor(16777215);
this.shieldDamageText.setText(String.valueOf(this.tile.shieldDamage));
this.shieldSizeText = new GuiNumberField(2, this.fontRenderer, this.width / 2 - 3, this.height / 2 - 62, 30, 16);
this.shieldSizeText.setMaxStringLength(2);
this.shieldSizeText.setFocused(false);
this.shieldSizeText.setCanLoseFocus(true);
this.shieldSizeText.setEnableBackgroundDrawing(true);
this.shieldSizeText.setTextColor(16777215);
this.shieldSizeText.setText(String.valueOf(this.tile.maxShieldSize));
if (this.tempDamage > this.tile.maxShieldDamage) {
this.tempDamage = this.tile.maxShieldDamage;
this.shieldDamageText.setText(String.valueOf(this.tempDamage));
GalacticraftCore.packetPipeline.sendToServer(new PacketSimpleMP(EnumSimplePacketMP.S_SHIELD_GENERATOR_OPTION, GCCoreUtil.getDimensionID(this.tile.getWorld()), this.tile.getPos(), this.tempDamage, "damage"));
}
if (this.tempSize > this.tile.maxShieldSizeUpgrade) {
this.tempSize = this.tile.maxShieldSizeUpgrade;
this.shieldSizeText.setText(String.valueOf(this.tempSize));
GalacticraftCore.packetPipeline.sendToServer(new PacketSimpleMP(EnumSimplePacketMP.S_SHIELD_GENERATOR_OPTION, GCCoreUtil.getDimensionID(this.tile.getWorld()), this.tile.getPos(), this.tempSize, "size"));
}
}
Aggregations