Search in sources :

Example 1 with GuiElementInfoRegion

use of micdoodle8.mods.galacticraft.core.client.gui.element.GuiElementInfoRegion in project Galacticraft by micdoodle8.

the class GuiWaterElectrolyzer method initGui.

@Override
public void initGui() {
    super.initGui();
    this.gasTankRegion.xPosition = (this.width - this.xSize) / 2 + 7;
    this.gasTankRegion.yPosition = (this.height - this.ySize) / 2 + 28;
    this.gasTankRegion.parentWidth = this.width;
    this.gasTankRegion.parentHeight = this.height;
    this.infoRegions.add(this.gasTankRegion);
    List<String> batterySlotDesc = new ArrayList<String>();
    batterySlotDesc.add(GCCoreUtil.translate("gui.battery_slot.desc.0"));
    batterySlotDesc.add(GCCoreUtil.translate("gui.battery_slot.desc.1"));
    this.infoRegions.add(new GuiElementInfoRegion((this.width - this.xSize) / 2 + 33, (this.height - this.ySize) / 2 + 49, 18, 18, batterySlotDesc, this.width, this.height, this));
    this.fuelTankRegion.xPosition = (this.width - this.xSize) / 2 + 132;
    this.fuelTankRegion.yPosition = (this.height - this.ySize) / 2 + 28;
    this.fuelTankRegion.parentWidth = this.width;
    this.fuelTankRegion.parentHeight = this.height;
    this.infoRegions.add(this.fuelTankRegion);
    this.fuelTank2Region.xPosition = (this.width - this.xSize) / 2 + 153;
    this.fuelTank2Region.yPosition = (this.height - this.ySize) / 2 + 28;
    this.fuelTank2Region.parentWidth = this.width;
    this.fuelTank2Region.parentHeight = this.height;
    this.infoRegions.add(this.fuelTank2Region);
    // this.infoRegions.add(new GuiElementInfoRegion((this.width - this.xSize) / 2 + 152, (this.height - this.ySize) / 2 + 6, 18, 18, fuelSlotDesc, this.width, this.height, this));
    // this.infoRegions.add(new GuiElementInfoRegion((this.width - this.xSize) / 2 + 131, (this.height - this.ySize) / 2 + 6, 18, 18, fuelSlotDesc, this.width, this.height, this));
    List<String> fuelSlotDesc = new ArrayList<String>();
    fuelSlotDesc.addAll(GCCoreUtil.translateWithSplit("gui.water_bucket_slot.desc"));
    this.infoRegions.add(new GuiElementInfoRegion((this.width - this.xSize) / 2 + 6, (this.height - this.ySize) / 2 + 6, 18, 18, fuelSlotDesc, this.width, this.height, this));
    this.electricInfoRegion.xPosition = (this.width - this.xSize) / 2 + 42;
    this.electricInfoRegion.yPosition = (this.height - this.ySize) / 2 + 16;
    this.electricInfoRegion.parentWidth = this.width;
    this.electricInfoRegion.parentHeight = this.height;
    this.infoRegions.add(this.electricInfoRegion);
    this.addToolTips();
    this.buttonList.add(this.buttonDisable = new GuiButton(0, this.width / 2 - 49, this.height / 2 - 56, 76, 20, GCCoreUtil.translate("gui.button.liquefy.name")));
}
Also used : GuiElementInfoRegion(micdoodle8.mods.galacticraft.core.client.gui.element.GuiElementInfoRegion) GuiButton(net.minecraft.client.gui.GuiButton) ArrayList(java.util.ArrayList)

Example 2 with GuiElementInfoRegion

use of micdoodle8.mods.galacticraft.core.client.gui.element.GuiElementInfoRegion in project Galacticraft by micdoodle8.

the class GuiLaunchController method drawScreen.

@Override
public void drawScreen(int par1, int par2, float par3) {
    if (this.launchController.disableCooldown > 0) {
        this.enableControllerButton.enabled = false;
        this.hideDestinationFrequency.enabled = false;
    } else {
        boolean isOwner = PlayerUtil.getName(this.mc.thePlayer).equals(this.launchController.getOwnerName());
        this.enableControllerButton.enabled = isOwner;
        this.hideDestinationFrequency.enabled = isOwner;
    }
    this.enableControllerButton.displayString = this.launchController.getDisabled(0) ? GCCoreUtil.translate("gui.button.enable.name") : GCCoreUtil.translate("gui.button.disable.name");
    this.hideDestinationFrequency.displayString = !this.launchController.getDisabled(2) ? GCCoreUtil.translate("gui.button.unhide_dest.name") : GCCoreUtil.translate("gui.button.hide_dest.name");
    // Hacky way of rendering buttons properly, possibly bugs here:
    List<GuiButton> buttonList = new ArrayList<>(this.buttonList);
    List<GuiLabel> labelList = new ArrayList<>(this.labelList);
    List<GuiElementInfoRegion> infoRegions = new ArrayList<>(this.infoRegions);
    this.buttonList.clear();
    this.labelList.clear();
    this.infoRegions.clear();
    super.drawScreen(par1, par2, par3);
    GL11.glColor3f(1, 1, 1);
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    RenderHelper.disableStandardItemLighting();
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_DEPTH_TEST);
    int k;
    for (k = 0; k < buttonList.size(); ++k) {
        ((GuiButton) buttonList.get(k)).drawButton(this.mc, par1, par2);
    }
    for (k = 0; k < labelList.size(); ++k) {
        ((GuiLabel) labelList.get(k)).drawLabel(this.mc, par1, par2);
    }
    for (k = 0; k < infoRegions.size(); ++k) {
        infoRegions.get(k).drawRegion(par1, par2);
    }
    this.buttonList = buttonList;
    this.labelList = labelList;
    this.infoRegions = infoRegions;
    // GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glEnable(GL11.GL_DEPTH_TEST);
    RenderHelper.enableStandardItemLighting();
    if (Math.random() < 0.025 && !destinationFrequency.isTextFocused) {
        if (!PlayerUtil.getName(this.mc.thePlayer).equals(this.launchController.getOwnerName()) && !this.launchController.getDisabled(2)) {
            // in case the player is not equal to the owner of the controller,
            // scramble the destination number such that other players can't
            // fly to it directly
            Random r = new Random();
            String fakefrequency = "";
            for (int i = 0; i < this.destinationFrequency.getMaxLength(); i++) {
                fakefrequency += (char) (r.nextInt(126 - 33) + 33);
            }
            destinationFrequency.text = fakefrequency;
        } else {
            destinationFrequency.text = String.valueOf(this.launchController.destFrequency);
        }
    }
}
Also used : GuiElementInfoRegion(micdoodle8.mods.galacticraft.core.client.gui.element.GuiElementInfoRegion) GuiButton(net.minecraft.client.gui.GuiButton) Random(java.util.Random) ArrayList(java.util.ArrayList) GuiLabel(net.minecraft.client.gui.GuiLabel)

Example 3 with GuiElementInfoRegion

use of micdoodle8.mods.galacticraft.core.client.gui.element.GuiElementInfoRegion in project Galacticraft by micdoodle8.

the class GuiLaunchControllerAdvanced method initGui.

@Override
public void initGui() {
    super.initGui();
    this.buttonList.clear();
    final int xLeft = (this.width - this.xSize) / 2;
    final int yTop = (this.height - this.ySize) / 2;
    this.enablePadRemovalButton = new GuiElementCheckbox(1, this, this.width / 2 - 61, yTop + 20, GCCoreUtil.translate("gui.message.remove_pad.name"));
    this.launchWhenCheckbox = new GuiElementCheckbox(2, this, this.width / 2 - 61, yTop + 38, GCCoreUtil.translate("gui.message.launch_when.name") + ": ");
    this.dropdownTest = new GuiElementDropdown(3, this, xLeft + 52, yTop + 52, EnumAutoLaunch.CARGO_IS_UNLOADED.getTitle(), EnumAutoLaunch.CARGO_IS_FULL.getTitle(), EnumAutoLaunch.ROCKET_IS_FUELED.getTitle(), EnumAutoLaunch.INSTANT.getTitle(), EnumAutoLaunch.TIME_10_SECONDS.getTitle(), EnumAutoLaunch.TIME_30_SECONDS.getTitle(), EnumAutoLaunch.TIME_1_MINUTE.getTitle(), EnumAutoLaunch.REDSTONE_SIGNAL.getTitle());
    this.closeAdvancedConfig = new GuiButton(4, xLeft + 5, yTop + 5, 20, 20, "<");
    this.buttonList.add(this.enablePadRemovalButton);
    this.buttonList.add(this.launchWhenCheckbox);
    this.buttonList.add(this.dropdownTest);
    this.buttonList.add(this.closeAdvancedConfig);
    List<String> batterySlotDesc = new ArrayList<String>();
    batterySlotDesc.add(GCCoreUtil.translate("gui.battery_slot.desc.0"));
    batterySlotDesc.add(GCCoreUtil.translate("gui.battery_slot.desc.1"));
    this.infoRegions.add(new GuiElementInfoRegion(xLeft + 151, yTop + 104, 18, 18, batterySlotDesc, this.width, this.height, this));
    batterySlotDesc = new ArrayList<String>();
    batterySlotDesc.addAll(GCCoreUtil.translateWithSplit("gui.launch_controller.desc.2"));
    this.infoRegions.add(new GuiElementInfoRegion(xLeft + 27, yTop + 20, 13, 13, batterySlotDesc, this.width, this.height, this));
    batterySlotDesc = new ArrayList<String>();
    batterySlotDesc.addAll(GCCoreUtil.translateWithSplit("gui.launch_controller.desc.3"));
    this.infoRegions.add(new GuiElementInfoRegion(xLeft + 52, yTop + 53, 99, 13, batterySlotDesc, this.width, this.height, this));
}
Also used : GuiElementInfoRegion(micdoodle8.mods.galacticraft.core.client.gui.element.GuiElementInfoRegion) GuiElementCheckbox(micdoodle8.mods.galacticraft.core.client.gui.element.GuiElementCheckbox) GuiButton(net.minecraft.client.gui.GuiButton) GuiElementDropdown(micdoodle8.mods.galacticraft.core.client.gui.element.GuiElementDropdown) ArrayList(java.util.ArrayList)

Example 4 with GuiElementInfoRegion

use of micdoodle8.mods.galacticraft.core.client.gui.element.GuiElementInfoRegion in project Galacticraft by micdoodle8.

the class GuiMethaneSynthesizer method initGui.

@Override
public void initGui() {
    super.initGui();
    int edgeLeft = (this.width - this.xSize) / 2;
    int edgeTop = (this.height - this.ySize) / 2;
    this.gasTankRegion.xPosition = edgeLeft + 7;
    this.gasTankRegion.yPosition = edgeTop + 28;
    this.gasTankRegion.parentWidth = this.width;
    this.gasTankRegion.parentHeight = this.height;
    this.infoRegions.add(this.gasTankRegion);
    this.gasTank2Region.xPosition = edgeLeft + 28;
    this.gasTank2Region.yPosition = edgeTop + 28;
    this.gasTank2Region.parentWidth = this.width;
    this.gasTank2Region.parentHeight = this.height;
    this.infoRegions.add(this.gasTank2Region);
    List<String> batterySlotDesc = new ArrayList<String>();
    batterySlotDesc.add(GCCoreUtil.translate("gui.battery_slot.desc.0"));
    batterySlotDesc.add(GCCoreUtil.translate("gui.battery_slot.desc.1"));
    this.infoRegions.add(new GuiElementInfoRegion(edgeLeft + 53, edgeTop + 53, 18, 18, batterySlotDesc, this.width, this.height, this));
    List<String> carbonSlotDesc = new ArrayList<String>();
    carbonSlotDesc.add(GCCoreUtil.translate("gui.carbon_slot.desc.0"));
    this.infoRegions.add(new GuiElementInfoRegion(edgeLeft + 27, edgeTop + 53, 18, 18, carbonSlotDesc, this.width, this.height, this));
    this.fuelTankRegion.xPosition = edgeLeft + 153;
    this.fuelTankRegion.yPosition = edgeTop + 28;
    this.fuelTankRegion.parentWidth = this.width;
    this.fuelTankRegion.parentHeight = this.height;
    this.infoRegions.add(this.fuelTankRegion);
    List<String> fuelSlotDesc = new ArrayList<String>();
    fuelSlotDesc.add(GCCoreUtil.translate("gui.fuel_output.desc.0"));
    fuelSlotDesc.add(GCCoreUtil.translate("gui.fuel_output.desc.1"));
    fuelSlotDesc.add(GCCoreUtil.translate("gui.methane_output.desc.2"));
    this.infoRegions.add(new GuiElementInfoRegion(edgeLeft + 152, edgeTop + 6, 18, 18, fuelSlotDesc, this.width, this.height, this));
    this.infoRegions.add(new GuiElementInfoRegion(edgeLeft + 131, edgeTop + 6, 18, 18, fuelSlotDesc, this.width, this.height, this));
    fuelSlotDesc = new ArrayList<String>();
    fuelSlotDesc.addAll(GCCoreUtil.translateWithSplit("gui.hydrogen_input.desc.0"));
    fuelSlotDesc.addAll(GCCoreUtil.translateWithSplit("gui.hydrogen_input.desc.1"));
    fuelSlotDesc.add("(" + GCCoreUtil.translate("gui.message.with_atmosphere0.name"));
    fuelSlotDesc.add(GCCoreUtil.lowerCaseNoun("fluid.hydrogen"));
    fuelSlotDesc.add(GCCoreUtil.translate("gui.message.with_atmosphere1.name") + ")");
    this.infoRegions.add(new GuiElementInfoRegion(edgeLeft + 6, edgeTop + 6, 18, 18, fuelSlotDesc, this.width, this.height, this));
    fuelSlotDesc = new ArrayList<String>();
    fuelSlotDesc.add(GCCoreUtil.translate("item.atmospheric_valve.name"));
    fuelSlotDesc.add("(" + GCCoreUtil.translate("gui.message.with_atmosphere0.name"));
    fuelSlotDesc.add(GCCoreUtil.lowerCaseNoun("gas.carbondioxide.name"));
    fuelSlotDesc.add(GCCoreUtil.translate("gui.message.with_atmosphere1.name") + ")");
    this.infoRegions.add(new GuiElementInfoRegion(edgeLeft + 27, edgeTop + 6, 18, 18, fuelSlotDesc, this.width, this.height, this));
    this.electricInfoRegion.xPosition = edgeLeft + 66;
    this.electricInfoRegion.yPosition = edgeTop + 16;
    this.electricInfoRegion.parentWidth = this.width;
    this.electricInfoRegion.parentHeight = this.height;
    this.infoRegions.add(this.electricInfoRegion);
    this.addToolTips();
    this.buttonList.add(this.buttonDisable = new GuiButton(0, this.width / 2 - 28, this.height / 2 - 56, 76, 20, GCCoreUtil.translate("gui.button.liquefy.name")));
}
Also used : GuiElementInfoRegion(micdoodle8.mods.galacticraft.core.client.gui.element.GuiElementInfoRegion) GuiButton(net.minecraft.client.gui.GuiButton) ArrayList(java.util.ArrayList)

Example 5 with GuiElementInfoRegion

use of micdoodle8.mods.galacticraft.core.client.gui.element.GuiElementInfoRegion in project Galacticraft by micdoodle8.

the class GuiCargoRocket method initGui.

@Override
public void initGui() {
    super.initGui();
    final int var6 = (this.height - this.ySize) / 2;
    final int var7 = (this.width - this.xSize) / 2;
    this.launchButton = new GuiButton(0, var7 + 116, var6 + 26, 50, 20, GCCoreUtil.translate("gui.message.launch.name"));
    this.buttonList.add(this.launchButton);
    List<String> fuelTankDesc = new ArrayList<String>();
    fuelTankDesc.add(GCCoreUtil.translate("gui.fuel_tank.desc.0"));
    fuelTankDesc.add(GCCoreUtil.translate("gui.fuel_tank.desc.1"));
    this.infoRegions.add(new GuiElementInfoRegion((this.width - this.xSize) / 2 + (this.rocket.rocketType.getInventorySpace() == 2 ? 70 : 71), (this.height - this.ySize) / 2 + 6, 36, 40, fuelTankDesc, this.width, this.height, this));
}
Also used : GuiElementInfoRegion(micdoodle8.mods.galacticraft.core.client.gui.element.GuiElementInfoRegion) GuiButton(net.minecraft.client.gui.GuiButton) ArrayList(java.util.ArrayList)

Aggregations

GuiElementInfoRegion (micdoodle8.mods.galacticraft.core.client.gui.element.GuiElementInfoRegion)30 ArrayList (java.util.ArrayList)29 GuiButton (net.minecraft.client.gui.GuiButton)18 GuiElementCheckbox (micdoodle8.mods.galacticraft.core.client.gui.element.GuiElementCheckbox)3 GuiElementTextBox (micdoodle8.mods.galacticraft.core.client.gui.element.GuiElementTextBox)2 Random (java.util.Random)1 GuiElementDropdown (micdoodle8.mods.galacticraft.core.client.gui.element.GuiElementDropdown)1 GuiLabel (net.minecraft.client.gui.GuiLabel)1