Search in sources :

Example 1 with GuiStateTexture

use of mekanism.generators.client.gui.element.GuiStateTexture 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 2 with GuiStateTexture

use of mekanism.generators.client.gui.element.GuiStateTexture in project Mekanism by mekanism.

the class GuiWindGenerator method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiInnerScreen(this, 48, 21, 80, 44, () -> {
        List<ITextComponent> list = new ArrayList<>();
        list.add(EnergyDisplay.of(tile.getEnergyContainer()).getTextComponent());
        list.add(GeneratorsLang.POWER.translate(MekanismUtils.convertToDisplay(MekanismGeneratorsConfig.generators.windGenerationMin.get().multiply(tile.getCurrentMultiplier())).toString(2)));
        list.add(GeneratorsLang.OUTPUT_RATE_SHORT.translate(EnergyDisplay.of(tile.getMaxOutput())));
        if (!tile.getActive()) {
            ILangEntry reason = tile.isBlacklistDimension() ? GeneratorsLang.NO_WIND : GeneratorsLang.SKY_BLOCKED;
            list.add(reason.translateColored(EnumColor.DARK_RED));
        }
        return list;
    }));
    addButton(new GuiEnergyTab(this, () -> Arrays.asList(GeneratorsLang.PRODUCING_AMOUNT.translate(tile.getActive() ? EnergyDisplay.of(MekanismGeneratorsConfig.generators.windGenerationMin.get().multiply(tile.getCurrentMultiplier())) : EnergyDisplay.ZERO), MekanismLang.MAX_OUTPUT.translate(EnergyDisplay.of(tile.getMaxOutput())))));
    addButton(new GuiVerticalPowerBar(this, tile.getEnergyContainer(), 164, 15));
    addButton(new GuiStateTexture(this, 18, 35, tile::getActive, MekanismGenerators.rl(ResourceType.GUI.getPrefix() + "wind_on.png"), MekanismGenerators.rl(ResourceType.GUI.getPrefix() + "wind_off.png")));
}
Also used : GuiInnerScreen(mekanism.client.gui.element.GuiInnerScreen) GuiStateTexture(mekanism.generators.client.gui.element.GuiStateTexture) ArrayList(java.util.ArrayList) List(java.util.List) GuiVerticalPowerBar(mekanism.client.gui.element.bar.GuiVerticalPowerBar) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab) ILangEntry(mekanism.api.text.ILangEntry)

Aggregations

GuiInnerScreen (mekanism.client.gui.element.GuiInnerScreen)2 GuiVerticalPowerBar (mekanism.client.gui.element.bar.GuiVerticalPowerBar)2 GuiEnergyTab (mekanism.client.gui.element.tab.GuiEnergyTab)2 GuiStateTexture (mekanism.generators.client.gui.element.GuiStateTexture)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 ILangEntry (mekanism.api.text.ILangEntry)1