Search in sources :

Example 21 with GuiEnergyTab

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

the class GuiFusionReactorFuel method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiEnergyTab(this, () -> {
        FusionReactorMultiblockData multiblock = tile.getMultiblock();
        return Arrays.asList(MekanismLang.STORING.translate(EnergyDisplay.of(multiblock.energyContainer)), GeneratorsLang.PRODUCING_AMOUNT.translate(EnergyDisplay.of(multiblock.getPassiveGeneration(false, true))));
    }));
    addButton(new GuiGasGauge(() -> tile.getMultiblock().deuteriumTank, () -> tile.getMultiblock().getGasTanks(null), GaugeType.SMALL, this, 25, 64));
    addButton(new GuiGasGauge(() -> tile.getMultiblock().fuelTank, () -> tile.getMultiblock().getGasTanks(null), GaugeType.STANDARD, this, 79, 50));
    addButton(new GuiGasGauge(() -> tile.getMultiblock().tritiumTank, () -> tile.getMultiblock().getGasTanks(null), GaugeType.SMALL, this, 133, 64));
    addButton(new GuiProgress(() -> tile.getMultiblock().isBurning(), ProgressType.SMALL_RIGHT, this, 47, 76));
    addButton(new GuiProgress(() -> tile.getMultiblock().isBurning(), ProgressType.SMALL_LEFT, this, 101, 76));
    addButton(new GuiFusionReactorTab(this, tile, FusionReactorTab.HEAT));
    addButton(new GuiFusionReactorTab(this, tile, FusionReactorTab.STAT));
    injectionRateField = addButton(new GuiTextField(this, 98, 115, 26, 11));
    injectionRateField.changeFocus(true);
    injectionRateField.setInputValidator(InputValidator.DIGIT);
    injectionRateField.setEnterHandler(this::setInjection);
    injectionRateField.setMaxStringLength(2);
}
Also used : GuiFusionReactorTab(mekanism.generators.client.gui.element.GuiFusionReactorTab) FusionReactorMultiblockData(mekanism.generators.common.content.fusion.FusionReactorMultiblockData) GuiProgress(mekanism.client.gui.element.progress.GuiProgress) GuiGasGauge(mekanism.client.gui.element.gauge.GuiGasGauge) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab) GuiTextField(mekanism.client.gui.element.text.GuiTextField)

Example 22 with GuiEnergyTab

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

the class GuiFusionReactorStats method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiEnergyTab(this, () -> {
        FusionReactorMultiblockData multiblock = tile.getMultiblock();
        return Arrays.asList(MekanismLang.STORING.translate(EnergyDisplay.of(multiblock.energyContainer)), GeneratorsLang.PRODUCING_AMOUNT.translate(EnergyDisplay.of(multiblock.getPassiveGeneration(false, true))));
    }));
    addButton(new GuiFusionReactorTab(this, tile, FusionReactorTab.HEAT));
    addButton(new GuiFusionReactorTab(this, tile, FusionReactorTab.FUEL));
}
Also used : GuiFusionReactorTab(mekanism.generators.client.gui.element.GuiFusionReactorTab) FusionReactorMultiblockData(mekanism.generators.common.content.fusion.FusionReactorMultiblockData) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab)

Example 23 with GuiEnergyTab

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

the class GuiIndustrialTurbine method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiInnerScreen(this, 50, 18, 112, 50, () -> {
        List<ITextComponent> list = new ArrayList<>();
        TurbineMultiblockData multiblock = tile.getMultiblock();
        if (multiblock.isFormed()) {
            list.add(GeneratorsLang.TURBINE_PRODUCTION_AMOUNT.translate(EnergyDisplay.of(multiblock.getProductionRate())));
            list.add(GeneratorsLang.TURBINE_FLOW_RATE.translate(TextUtils.format(multiblock.clientFlow)));
            list.add(GeneratorsLang.TURBINE_CAPACITY.translate(TextUtils.format(multiblock.getSteamCapacity())));
            list.add(GeneratorsLang.TURBINE_MAX_FLOW.translate(TextUtils.format(multiblock.getMaxFlowRate())));
        }
        return list;
    }));
    addButton(new GuiTurbineTab(this, tile, TurbineTab.STAT));
    addButton(new GuiVerticalPowerBar(this, new IBarInfoHandler() {

        @Override
        public ITextComponent getTooltip() {
            TurbineMultiblockData multiblock = tile.getMultiblock();
            if (multiblock.isFormed()) {
                return EnergyDisplay.of(multiblock.energyContainer).getTextComponent();
            }
            return EnergyDisplay.ZERO.getTextComponent();
        }

        @Override
        public double getLevel() {
            TurbineMultiblockData multiblock = tile.getMultiblock();
            if (multiblock.isFormed()) {
                return multiblock.energyContainer.getEnergy().divideToLevel(multiblock.energyContainer.getMaxEnergy());
            }
            return 1;
        }
    }, 164, 16));
    addButton(new GuiVerticalRateBar(this, new IBarInfoHandler() {

        @Override
        public ITextComponent getTooltip() {
            return GeneratorsLang.TURBINE_STEAM_INPUT_RATE.translate(TextUtils.format(tile.getMultiblock().lastSteamInput));
        }

        @Override
        public double getLevel() {
            TurbineMultiblockData multiblock = tile.getMultiblock();
            if (!multiblock.isFormed()) {
                return 0;
            }
            double rate = Math.min(multiblock.lowerVolume * multiblock.getDispersers() * MekanismGeneratorsConfig.generators.turbineDisperserGasFlow.get(), multiblock.vents * MekanismGeneratorsConfig.generators.turbineVentGasFlow.get());
            if (rate == 0) {
                return 0;
            }
            return Math.min(1, multiblock.lastSteamInput / rate);
        }
    }, 40, 13));
    addButton(new GuiGasGauge(() -> tile.getMultiblock().gasTank, () -> tile.getMultiblock().getGasTanks(null), GaugeType.MEDIUM, this, 6, 13));
    addButton(new GuiEnergyTab(this, () -> {
        EnergyDisplay storing;
        EnergyDisplay producing;
        TurbineMultiblockData multiblock = tile.getMultiblock();
        if (multiblock.isFormed()) {
            storing = EnergyDisplay.of(multiblock.energyContainer);
            producing = EnergyDisplay.of(MekanismConfig.general.maxEnergyPerSteam.get().divide(TurbineValidator.MAX_BLADES).multiply(multiblock.clientFlow * Math.min(multiblock.blades, multiblock.coils * MekanismGeneratorsConfig.generators.turbineBladesPerCoil.get())));
        } else {
            storing = EnergyDisplay.ZERO;
            producing = EnergyDisplay.ZERO;
        }
        return Arrays.asList(MekanismLang.STORING.translate(storing), GeneratorsLang.PRODUCING_AMOUNT.translate(producing));
    }));
    addButton(new GuiGasMode(this, 159, 72, true, () -> tile.getMultiblock().dumpMode, tile.getBlockPos(), 0));
}
Also used : TurbineMultiblockData(mekanism.generators.common.content.turbine.TurbineMultiblockData) IBarInfoHandler(mekanism.client.gui.element.bar.GuiBar.IBarInfoHandler) GuiTurbineTab(mekanism.generators.client.gui.element.GuiTurbineTab) GuiGasGauge(mekanism.client.gui.element.gauge.GuiGasGauge) GuiVerticalPowerBar(mekanism.client.gui.element.bar.GuiVerticalPowerBar) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab) GuiInnerScreen(mekanism.client.gui.element.GuiInnerScreen) GuiVerticalRateBar(mekanism.client.gui.element.bar.GuiVerticalRateBar) EnergyDisplay(mekanism.common.util.text.EnergyDisplay) ArrayList(java.util.ArrayList) List(java.util.List) GuiGasMode(mekanism.client.gui.element.button.GuiGasMode)

Example 24 with GuiEnergyTab

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

the class GuiSolarGenerator method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiInnerScreen(this, 48, 23, 80, 40, () -> Arrays.asList(EnergyDisplay.of(tile.getEnergyContainer()).getTextComponent(), GeneratorsLang.PRODUCING_AMOUNT.translate(EnergyDisplay.of(tile.getLastProductionAmount())), GeneratorsLang.OUTPUT_RATE_SHORT.translate(EnergyDisplay.of(tile.getMaxOutput())))));
    addButton(new GuiEnergyTab(this, () -> Arrays.asList(GeneratorsLang.PRODUCING_AMOUNT.translate(EnergyDisplay.of(tile.getLastProductionAmount())), MekanismLang.MAX_OUTPUT.translate(EnergyDisplay.of(tile.getMaxOutput())))));
    addButton(new GuiVerticalPowerBar(this, tile.getEnergyContainer(), 164, 15));
    addButton(new GuiStateTexture(this, 18, 35, tile::canSeeSun, MekanismGenerators.rl(ResourceType.GUI.getPrefix() + "sees_sun.png"), MekanismGenerators.rl(ResourceType.GUI.getPrefix() + "no_sun.png")));
}
Also used : GuiInnerScreen(mekanism.client.gui.element.GuiInnerScreen) GuiStateTexture(mekanism.generators.client.gui.element.GuiStateTexture) GuiVerticalPowerBar(mekanism.client.gui.element.bar.GuiVerticalPowerBar) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab)

Example 25 with GuiEnergyTab

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

the class GuiTurbineStats method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiTurbineTab(this, tile, TurbineTab.MAIN));
    addButton(new GuiEnergyTab(this, () -> {
        EnergyDisplay storing;
        EnergyDisplay producing;
        TurbineMultiblockData multiblock = tile.getMultiblock();
        if (multiblock.isFormed()) {
            storing = EnergyDisplay.of(multiblock.energyContainer);
            producing = EnergyDisplay.of(MekanismConfig.general.maxEnergyPerSteam.get().divide(TurbineValidator.MAX_BLADES).multiply(multiblock.clientFlow * Math.min(multiblock.blades, multiblock.coils * MekanismGeneratorsConfig.generators.turbineBladesPerCoil.get())));
        } else {
            storing = EnergyDisplay.ZERO;
            producing = EnergyDisplay.ZERO;
        }
        return Arrays.asList(MekanismLang.STORING.translate(storing), GeneratorsLang.PRODUCING_AMOUNT.translate(producing));
    }));
}
Also used : TurbineMultiblockData(mekanism.generators.common.content.turbine.TurbineMultiblockData) EnergyDisplay(mekanism.common.util.text.EnergyDisplay) GuiTurbineTab(mekanism.generators.client.gui.element.GuiTurbineTab) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab)

Aggregations

GuiEnergyTab (mekanism.client.gui.element.tab.GuiEnergyTab)42 GuiVerticalPowerBar (mekanism.client.gui.element.bar.GuiVerticalPowerBar)23 GuiProgress (mekanism.client.gui.element.progress.GuiProgress)23 GuiGasGauge (mekanism.client.gui.element.gauge.GuiGasGauge)13 GuiInnerScreen (mekanism.client.gui.element.GuiInnerScreen)12 GuiHorizontalPowerBar (mekanism.client.gui.element.bar.GuiHorizontalPowerBar)9 GuiFluidGauge (mekanism.client.gui.element.gauge.GuiFluidGauge)8 ArrayList (java.util.ArrayList)5 List (java.util.List)5 GuiEnergyGauge (mekanism.client.gui.element.gauge.GuiEnergyGauge)5 GuiSlot (mekanism.client.gui.element.slot.GuiSlot)5 GuiDownArrow (mekanism.client.gui.element.GuiDownArrow)4 GuiFusionReactorTab (mekanism.generators.client.gui.element.GuiFusionReactorTab)4 FusionReactorMultiblockData (mekanism.generators.common.content.fusion.FusionReactorMultiblockData)4 GuiUpArrow (mekanism.client.gui.element.GuiUpArrow)3 IBarInfoHandler (mekanism.client.gui.element.bar.GuiBar.IBarInfoHandler)3 GuiPigmentGauge (mekanism.client.gui.element.gauge.GuiPigmentGauge)3 GuiHeatTab (mekanism.client.gui.element.tab.GuiHeatTab)3 PacketGuiInteract (mekanism.common.network.to_server.PacketGuiInteract)3 EnergyDisplay (mekanism.common.util.text.EnergyDisplay)3