Search in sources :

Example 1 with GuiHeatTab

use of mekanism.client.gui.element.tab.GuiHeatTab in project Mekanism by mekanism.

the class GuiResistiveHeater method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiInnerScreen(this, 48, 23, 80, 42, () -> Arrays.asList(MekanismLang.TEMPERATURE.translate(MekanismUtils.getTemperatureDisplay(tile.getTotalTemperature(), TemperatureUnit.KELVIN, true)), MekanismLang.RESISTIVE_HEATER_USAGE.translate(EnergyDisplay.of(tile.getEnergyContainer().getEnergyPerTick())))).clearFormat());
    addButton(new GuiVerticalPowerBar(this, tile.getEnergyContainer(), 164, 15));
    addButton(new GuiEnergyTab(this, tile.getEnergyContainer()));
    addButton(new GuiHeatTab(this, () -> {
        ITextComponent environment = MekanismUtils.getTemperatureDisplay(tile.getLastEnvironmentLoss(), TemperatureUnit.KELVIN, false);
        return Collections.singletonList(MekanismLang.DISSIPATED_RATE.translate(environment));
    }));
    energyUsageField = addButton(new GuiTextField(this, 50, 51, 76, 12));
    energyUsageField.setText(energyUsageField.getText());
    energyUsageField.setMaxStringLength(7);
    energyUsageField.setInputValidator(InputValidator.DIGIT);
    energyUsageField.configureDigitalInput(this::setEnergyUsage);
    energyUsageField.setFocused(true);
}
Also used : GuiInnerScreen(mekanism.client.gui.element.GuiInnerScreen) ITextComponent(net.minecraft.util.text.ITextComponent) GuiVerticalPowerBar(mekanism.client.gui.element.bar.GuiVerticalPowerBar) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab) GuiTextField(mekanism.client.gui.element.text.GuiTextField) GuiHeatTab(mekanism.client.gui.element.tab.GuiHeatTab)

Example 2 with GuiHeatTab

use of mekanism.client.gui.element.tab.GuiHeatTab in project Mekanism by mekanism.

the class GuiQuantumEntangloporter method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiFrequencySelector<>(this, 14));
    addButton(new GuiEnergyTab(this, () -> {
        InventoryFrequency frequency = getFrequency();
        EnergyDisplay storing = frequency == null ? EnergyDisplay.ZERO : EnergyDisplay.of(frequency.storedEnergy);
        EnergyDisplay rate = EnergyDisplay.of(tile.getInputRate());
        return Arrays.asList(MekanismLang.STORING.translate(storing), MekanismLang.MATRIX_INPUT_RATE.translate(rate));
    }));
    addButton(new GuiHeatTab(this, () -> {
        ITextComponent transfer = MekanismUtils.getTemperatureDisplay(tile.getLastTransferLoss(), TemperatureUnit.KELVIN, false);
        ITextComponent environment = MekanismUtils.getTemperatureDisplay(tile.getLastEnvironmentLoss(), TemperatureUnit.KELVIN, false);
        return Arrays.asList(MekanismLang.TRANSFERRED_RATE.translate(transfer), MekanismLang.DISSIPATED_RATE.translate(environment));
    }));
}
Also used : EnergyDisplay(mekanism.common.util.text.EnergyDisplay) ITextComponent(net.minecraft.util.text.ITextComponent) InventoryFrequency(mekanism.common.content.entangloporter.InventoryFrequency) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab) GuiHeatTab(mekanism.client.gui.element.tab.GuiHeatTab)

Example 3 with GuiHeatTab

use of mekanism.client.gui.element.tab.GuiHeatTab in project Mekanism by mekanism.

the class GuiThermalEvaporationController method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiInnerScreen(this, 48, 19, 80, 40, () -> {
        EvaporationMultiblockData multiblock = tile.getMultiblock();
        return Arrays.asList(MekanismLang.MULTIBLOCK_FORMED.translate(), MekanismLang.EVAPORATION_HEIGHT.translate(multiblock.height()), MekanismLang.TEMPERATURE.translate(MekanismUtils.getTemperatureDisplay(multiblock.getTemperature(), TemperatureUnit.KELVIN, true)), MekanismLang.FLUID_PRODUCTION.translate(Math.round(multiblock.lastGain * 100D) / 100D));
    }).spacing(1).jeiCategory(tile));
    addButton(new GuiDownArrow(this, 32, 39));
    addButton(new GuiDownArrow(this, 136, 39));
    addButton(new GuiHorizontalRateBar(this, new IBarInfoHandler() {

        @Override
        public ITextComponent getTooltip() {
            return MekanismUtils.getTemperatureDisplay(tile.getMultiblock().getTemperature(), TemperatureUnit.KELVIN, true);
        }

        @Override
        public double getLevel() {
            return Math.min(1, tile.getMultiblock().getTemperature() / EvaporationMultiblockData.MAX_MULTIPLIER_TEMP);
        }
    }, 48, 63));
    addButton(new GuiFluidGauge(() -> tile.getMultiblock().inputTank, () -> tile.getMultiblock().getFluidTanks(null), GaugeType.STANDARD, this, 6, 13));
    addButton(new GuiFluidGauge(() -> tile.getMultiblock().outputTank, () -> tile.getMultiblock().getFluidTanks(null), GaugeType.STANDARD, this, 152, 13));
    addButton(new GuiHeatTab(this, () -> {
        ITextComponent environment = MekanismUtils.getTemperatureDisplay(tile.getMultiblock().lastEnvironmentLoss, TemperatureUnit.KELVIN, false);
        return Collections.singletonList(MekanismLang.DISSIPATED_RATE.translate(environment));
    }));
}
Also used : GuiInnerScreen(mekanism.client.gui.element.GuiInnerScreen) GuiFluidGauge(mekanism.client.gui.element.gauge.GuiFluidGauge) GuiDownArrow(mekanism.client.gui.element.GuiDownArrow) IBarInfoHandler(mekanism.client.gui.element.bar.GuiBar.IBarInfoHandler) GuiHorizontalRateBar(mekanism.client.gui.element.bar.GuiHorizontalRateBar) ITextComponent(net.minecraft.util.text.ITextComponent) EvaporationMultiblockData(mekanism.common.content.evaporation.EvaporationMultiblockData) GuiHeatTab(mekanism.client.gui.element.tab.GuiHeatTab)

Example 4 with GuiHeatTab

use of mekanism.client.gui.element.tab.GuiHeatTab in project Mekanism by mekanism.

the class GuiFissionReactor method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiFissionReactorTab(this, tile, FissionReactorTab.STAT));
    addButton(new GuiInnerScreen(this, 45, 17, 105, 56, () -> {
        FissionReactorMultiblockData multiblock = tile.getMultiblock();
        return Arrays.asList(MekanismLang.STATUS.translate(multiblock.isActive() ? EnumColor.BRIGHT_GREEN : EnumColor.RED, ActiveDisabled.of(multiblock.isActive())), GeneratorsLang.GAS_BURN_RATE.translate(multiblock.lastBurnRate), GeneratorsLang.FISSION_HEATING_RATE.translate(TextUtils.format(multiblock.lastBoilRate)), MekanismLang.TEMPERATURE.translate(tile.getTempColor(), MekanismUtils.getTemperatureDisplay(multiblock.heatCapacitor.getTemperature(), TemperatureUnit.KELVIN, true)), GeneratorsLang.FISSION_DAMAGE.translate(tile.getDamageColor(), tile.getDamageString()));
    }).spacing(2).jeiCategories(JEI_LOCATION));
    addButton(new GuiHybridGauge(() -> tile.getMultiblock().gasCoolantTank, () -> tile.getMultiblock().getGasTanks(null), () -> tile.getMultiblock().fluidCoolantTank, () -> tile.getMultiblock().getFluidTanks(null), GaugeType.STANDARD, this, 6, 13).setLabel(GeneratorsLang.FISSION_COOLANT_TANK.translateColored(EnumColor.AQUA)));
    addButton(new GuiGasGauge(() -> tile.getMultiblock().fuelTank, () -> tile.getMultiblock().getGasTanks(null), GaugeType.STANDARD, this, 25, 13).setLabel(GeneratorsLang.FISSION_FUEL_TANK.translateColored(EnumColor.DARK_GREEN)));
    addButton(new GuiGasGauge(() -> tile.getMultiblock().heatedCoolantTank, () -> tile.getMultiblock().getGasTanks(null), GaugeType.STANDARD, this, 152, 13).setLabel(GeneratorsLang.FISSION_HEATED_COOLANT_TANK.translateColored(EnumColor.ORANGE)));
    addButton(new GuiGasGauge(() -> tile.getMultiblock().wasteTank, () -> tile.getMultiblock().getGasTanks(null), GaugeType.STANDARD, this, 171, 13).setLabel(GeneratorsLang.FISSION_WASTE_TANK.translateColored(EnumColor.BROWN)));
    addButton(new GuiHeatTab(this, () -> {
        ITextComponent environment = MekanismUtils.getTemperatureDisplay(tile.getMultiblock().lastEnvironmentLoss, TemperatureUnit.KELVIN, false);
        return Collections.singletonList(MekanismLang.DISSIPATED_RATE.translate(environment));
    }));
    activateButton = addButton(new TranslationButton(this, 6, 75, 81, 16, GeneratorsLang.FISSION_ACTIVATE, () -> MekanismGenerators.packetHandler.sendToServer(new PacketGeneratorsGuiInteract(GeneratorsGuiInteraction.FISSION_ACTIVE, tile, 1)), null, () -> EnumColor.DARK_GREEN) {

        @Override
        public void renderForeground(MatrixStack matrix, int mouseX, int mouseY) {
            super.renderForeground(matrix, mouseX, mouseY);
            if (!active && tile.getMultiblock().isForceDisabled()) {
                active = true;
                // Temporarily set active to true, so we can easily check if the mouse is over the button
                if (isMouseOverCheckWindows(mouseX, mouseY)) {
                    displayTooltip(matrix, GeneratorsLang.FISSION_FORCE_DISABLED.translate(), mouseX - getGuiLeft(), mouseY - getGuiTop());
                }
                active = false;
            }
        }
    });
    scramButton = addButton(new TranslationButton(this, 89, 75, 81, 16, GeneratorsLang.FISSION_SCRAM, () -> MekanismGenerators.packetHandler.sendToServer(new PacketGeneratorsGuiInteract(GeneratorsGuiInteraction.FISSION_ACTIVE, tile, 0)), null, () -> EnumColor.DARK_RED));
    addButton(new GuiBigLight(this, 173, 76, tile.getMultiblock()::isActive));
    addButton(new GuiDynamicHorizontalRateBar(this, new IBarInfoHandler() {

        @Override
        public ITextComponent getTooltip() {
            return MekanismUtils.getTemperatureDisplay(tile.getMultiblock().heatCapacitor.getTemperature(), TemperatureUnit.KELVIN, true);
        }

        @Override
        public double getLevel() {
            return Math.min(1, tile.getMultiblock().heatCapacitor.getTemperature() / FissionReactorMultiblockData.MAX_DAMAGE_TEMPERATURE);
        }
    }, 5, 102, imageWidth - 12));
    heatGraph = addButton(new GuiGraph(this, 5, 123, imageWidth - 10, 38, temp -> MekanismUtils.getTemperatureDisplay(temp, TemperatureUnit.KELVIN, true)));
    heatGraph.setMinScale(1_600);
    updateButtons();
}
Also used : GuiFissionReactorTab(mekanism.generators.client.gui.element.GuiFissionReactorTab) IBarInfoHandler(mekanism.client.gui.element.bar.GuiBar.IBarInfoHandler) GuiGraph(mekanism.client.gui.element.GuiGraph) TranslationButton(mekanism.client.gui.element.button.TranslationButton) MatrixStack(com.mojang.blaze3d.matrix.MatrixStack) GuiGasGauge(mekanism.client.gui.element.gauge.GuiGasGauge) ITextComponent(net.minecraft.util.text.ITextComponent) FissionReactorMultiblockData(mekanism.generators.common.content.fission.FissionReactorMultiblockData) GuiHeatTab(mekanism.client.gui.element.tab.GuiHeatTab) GuiHybridGauge(mekanism.client.gui.element.gauge.GuiHybridGauge) PacketGeneratorsGuiInteract(mekanism.generators.common.network.to_server.PacketGeneratorsGuiInteract) GuiInnerScreen(mekanism.client.gui.element.GuiInnerScreen) GuiDynamicHorizontalRateBar(mekanism.client.gui.element.bar.GuiDynamicHorizontalRateBar) GuiBigLight(mekanism.client.gui.element.GuiBigLight)

Example 5 with GuiHeatTab

use of mekanism.client.gui.element.tab.GuiHeatTab in project Mekanism by mekanism.

the class GuiHeatGenerator method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiEnergyTab(this, () -> Arrays.asList(GeneratorsLang.PRODUCING_AMOUNT.translate(EnergyDisplay.of(tile.getProducingEnergy())), MekanismLang.MAX_OUTPUT.translate(EnergyDisplay.of(tile.getMaxOutput())))));
    addButton(new GuiFluidGauge(() -> tile.lavaTank, () -> tile.getFluidTanks(null), GaugeType.WIDE, this, 55, 18));
    addButton(new GuiVerticalPowerBar(this, tile.getEnergyContainer(), 164, 15));
    addButton(new GuiHeatTab(this, () -> {
        ITextComponent temp = MekanismUtils.getTemperatureDisplay(tile.getTotalTemperature(), TemperatureUnit.KELVIN, true);
        ITextComponent transfer = MekanismUtils.getTemperatureDisplay(tile.getLastTransferLoss(), TemperatureUnit.KELVIN, false);
        ITextComponent environment = MekanismUtils.getTemperatureDisplay(tile.getLastEnvironmentLoss(), TemperatureUnit.KELVIN, false);
        return Arrays.asList(MekanismLang.TEMPERATURE.translate(temp), MekanismLang.TRANSFERRED_RATE.translate(transfer), MekanismLang.DISSIPATED_RATE.translate(environment));
    }));
}
Also used : GuiFluidGauge(mekanism.client.gui.element.gauge.GuiFluidGauge) ITextComponent(net.minecraft.util.text.ITextComponent) GuiVerticalPowerBar(mekanism.client.gui.element.bar.GuiVerticalPowerBar) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab) GuiHeatTab(mekanism.client.gui.element.tab.GuiHeatTab)

Aggregations

GuiHeatTab (mekanism.client.gui.element.tab.GuiHeatTab)8 ITextComponent (net.minecraft.util.text.ITextComponent)8 GuiInnerScreen (mekanism.client.gui.element.GuiInnerScreen)5 IBarInfoHandler (mekanism.client.gui.element.bar.GuiBar.IBarInfoHandler)3 GuiFluidGauge (mekanism.client.gui.element.gauge.GuiFluidGauge)3 GuiEnergyTab (mekanism.client.gui.element.tab.GuiEnergyTab)3 GuiGraph (mekanism.client.gui.element.GuiGraph)2 GuiVerticalPowerBar (mekanism.client.gui.element.bar.GuiVerticalPowerBar)2 GuiGasGauge (mekanism.client.gui.element.gauge.GuiGasGauge)2 GuiBoilerTab (mekanism.client.gui.element.tab.GuiBoilerTab)2 MatrixStack (com.mojang.blaze3d.matrix.MatrixStack)1 GuiBigLight (mekanism.client.gui.element.GuiBigLight)1 GuiDownArrow (mekanism.client.gui.element.GuiDownArrow)1 GuiDynamicHorizontalRateBar (mekanism.client.gui.element.bar.GuiDynamicHorizontalRateBar)1 GuiHorizontalRateBar (mekanism.client.gui.element.bar.GuiHorizontalRateBar)1 GuiVerticalRateBar (mekanism.client.gui.element.bar.GuiVerticalRateBar)1 TranslationButton (mekanism.client.gui.element.button.TranslationButton)1 GuiHybridGauge (mekanism.client.gui.element.gauge.GuiHybridGauge)1 GuiFlame (mekanism.client.gui.element.progress.GuiFlame)1 IProgressInfoHandler (mekanism.client.gui.element.progress.IProgressInfoHandler)1