Search in sources :

Example 1 with FusionReactorMultiblockData

use of mekanism.generators.common.content.fusion.FusionReactorMultiblockData in project Mekanism by mekanism.

the class GuiFusionReactorHeat 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 GuiNumberGauge(new INumberInfoHandler() {

        @Override
        public TextureAtlasSprite getIcon() {
            return MekanismRenderer.getBaseFluidTexture(Fluids.LAVA, FluidType.STILL);
        }

        @Override
        public double getLevel() {
            return tile.getMultiblock().getLastPlasmaTemp();
        }

        @Override
        public double getScaledLevel() {
            return Math.min(1, getLevel() / MAX_LEVEL);
        }

        @Override
        public ITextComponent getText() {
            return GeneratorsLang.REACTOR_PLASMA.translate(MekanismUtils.getTemperatureDisplay(getLevel(), TemperatureUnit.KELVIN, true));
        }
    }, GaugeType.STANDARD, this, 7, 50));
    addButton(new GuiProgress(() -> {
        FusionReactorMultiblockData multiblock = tile.getMultiblock();
        return multiblock.getLastPlasmaTemp() > multiblock.getLastCaseTemp();
    }, ProgressType.SMALL_RIGHT, this, 29, 76));
    addButton(new GuiNumberGauge(new INumberInfoHandler() {

        @Override
        public TextureAtlasSprite getIcon() {
            return MekanismRenderer.getBaseFluidTexture(Fluids.LAVA, FluidType.STILL);
        }

        @Override
        public double getLevel() {
            return tile.getMultiblock().getLastCaseTemp();
        }

        @Override
        public double getScaledLevel() {
            return Math.min(1, getLevel() / MAX_LEVEL);
        }

        @Override
        public ITextComponent getText() {
            return GeneratorsLang.REACTOR_CASE.translate(MekanismUtils.getTemperatureDisplay(getLevel(), TemperatureUnit.KELVIN, true));
        }
    }, GaugeType.STANDARD, this, 61, 50));
    addButton(new GuiProgress(() -> tile.getMultiblock().getCaseTemp() > 0, ProgressType.SMALL_RIGHT, this, 83, 61));
    addButton(new GuiProgress(() -> {
        FusionReactorMultiblockData multiblock = tile.getMultiblock();
        return multiblock.getCaseTemp() > 0 && !multiblock.waterTank.isEmpty() && multiblock.steamTank.getStored() < multiblock.steamTank.getCapacity();
    }, ProgressType.SMALL_RIGHT, this, 83, 91));
    addButton(new GuiFluidGauge(() -> tile.getMultiblock().waterTank, () -> tile.getFluidTanks(null), GaugeType.SMALL, this, 115, 84));
    addButton(new GuiGasGauge(() -> tile.getMultiblock().steamTank, () -> tile.getGasTanks(null), GaugeType.SMALL, this, 151, 84));
    addButton(new GuiEnergyGauge(tile.getMultiblock().energyContainer, GaugeType.SMALL, this, 115, 46));
    addButton(new GuiFusionReactorTab(this, tile, FusionReactorTab.FUEL));
    addButton(new GuiFusionReactorTab(this, tile, FusionReactorTab.STAT));
}
Also used : GuiFusionReactorTab(mekanism.generators.client.gui.element.GuiFusionReactorTab) FusionReactorMultiblockData(mekanism.generators.common.content.fusion.FusionReactorMultiblockData) GuiFluidGauge(mekanism.client.gui.element.gauge.GuiFluidGauge) GuiProgress(mekanism.client.gui.element.progress.GuiProgress) GuiGasGauge(mekanism.client.gui.element.gauge.GuiGasGauge) GuiEnergyGauge(mekanism.client.gui.element.gauge.GuiEnergyGauge) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab) INumberInfoHandler(mekanism.client.gui.element.gauge.GuiNumberGauge.INumberInfoHandler) GuiNumberGauge(mekanism.client.gui.element.gauge.GuiNumberGauge)

Example 2 with FusionReactorMultiblockData

use of mekanism.generators.common.content.fusion.FusionReactorMultiblockData in project Mekanism by mekanism.

the class GuiFusionReactorController method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    if (tile.getMultiblock().isFormed()) {
        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));
        addButton(new GuiFusionReactorTab(this, tile, FusionReactorTab.STAT));
    }
}
Also used : GuiFusionReactorTab(mekanism.generators.client.gui.element.GuiFusionReactorTab) FusionReactorMultiblockData(mekanism.generators.common.content.fusion.FusionReactorMultiblockData) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab)

Example 3 with FusionReactorMultiblockData

use of mekanism.generators.common.content.fusion.FusionReactorMultiblockData 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 4 with FusionReactorMultiblockData

use of mekanism.generators.common.content.fusion.FusionReactorMultiblockData in project Mekanism by mekanism.

the class GuiFusionReactorStats method drawForegroundText.

@Override
protected void drawForegroundText(@Nonnull MatrixStack matrix, int mouseX, int mouseY) {
    drawTitleText(matrix, GeneratorsLang.FUSION_REACTOR.translate(), titleLabelY);
    FusionReactorMultiblockData multiblock = tile.getMultiblock();
    if (multiblock.isFormed()) {
        drawString(matrix, GeneratorsLang.REACTOR_PASSIVE.translateColored(EnumColor.DARK_GREEN), 6, 26, titleTextColor());
        drawTextScaledBound(matrix, GeneratorsLang.REACTOR_MIN_INJECTION.translate(multiblock.getMinInjectionRate(false)), 16, 36, titleTextColor(), 156);
        drawTextScaledBound(matrix, GeneratorsLang.REACTOR_IGNITION.translate(MekanismUtils.getTemperatureDisplay(multiblock.getIgnitionTemperature(false), TemperatureUnit.KELVIN, true)), 16, 46, titleTextColor(), 156);
        drawTextScaledBound(matrix, GeneratorsLang.REACTOR_MAX_PLASMA.translate(MekanismUtils.getTemperatureDisplay(multiblock.getMaxPlasmaTemperature(false), TemperatureUnit.KELVIN, true)), 16, 56, titleTextColor(), 156);
        drawTextScaledBound(matrix, GeneratorsLang.REACTOR_MAX_CASING.translate(MekanismUtils.getTemperatureDisplay(multiblock.getMaxCasingTemperature(false), TemperatureUnit.KELVIN, true)), 16, 66, titleTextColor(), 156);
        drawTextScaledBound(matrix, GeneratorsLang.REACTOR_PASSIVE_RATE.translate(EnergyDisplay.of(multiblock.getPassiveGeneration(false, false))), 16, 76, titleTextColor(), 156);
        drawString(matrix, GeneratorsLang.REACTOR_ACTIVE.translateColored(EnumColor.DARK_BLUE), 6, 92, titleTextColor());
        drawTextScaledBound(matrix, GeneratorsLang.REACTOR_MIN_INJECTION.translate(multiblock.getMinInjectionRate(true)), 16, 102, titleTextColor(), 156);
        drawTextScaledBound(matrix, GeneratorsLang.REACTOR_IGNITION.translate(MekanismUtils.getTemperatureDisplay(multiblock.getIgnitionTemperature(true), TemperatureUnit.KELVIN, true)), 16, 112, titleTextColor(), 156);
        drawTextScaledBound(matrix, GeneratorsLang.REACTOR_MAX_PLASMA.translate(MekanismUtils.getTemperatureDisplay(multiblock.getMaxPlasmaTemperature(true), TemperatureUnit.KELVIN, true)), 16, 122, titleTextColor(), 156);
        drawTextScaledBound(matrix, GeneratorsLang.REACTOR_MAX_CASING.translate(MekanismUtils.getTemperatureDisplay(multiblock.getMaxCasingTemperature(true), TemperatureUnit.KELVIN, true)), 16, 132, titleTextColor(), 156);
        drawTextScaledBound(matrix, GeneratorsLang.REACTOR_PASSIVE_RATE.translate(EnergyDisplay.of(multiblock.getPassiveGeneration(true, false))), 16, 142, titleTextColor(), 156);
        drawTextScaledBound(matrix, GeneratorsLang.REACTOR_STEAM_PRODUCTION.translate(TextUtils.format(multiblock.getSteamPerTick(false))), 16, 152, titleTextColor(), 156);
    }
    super.drawForegroundText(matrix, mouseX, mouseY);
}
Also used : FusionReactorMultiblockData(mekanism.generators.common.content.fusion.FusionReactorMultiblockData)

Example 5 with FusionReactorMultiblockData

use of mekanism.generators.common.content.fusion.FusionReactorMultiblockData 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)

Aggregations

FusionReactorMultiblockData (mekanism.generators.common.content.fusion.FusionReactorMultiblockData)7 GuiEnergyTab (mekanism.client.gui.element.tab.GuiEnergyTab)4 GuiFusionReactorTab (mekanism.generators.client.gui.element.GuiFusionReactorTab)4 GuiGasGauge (mekanism.client.gui.element.gauge.GuiGasGauge)2 GuiProgress (mekanism.client.gui.element.progress.GuiProgress)2 IVertexBuilder (com.mojang.blaze3d.vertex.IVertexBuilder)1 GuiEnergyGauge (mekanism.client.gui.element.gauge.GuiEnergyGauge)1 GuiFluidGauge (mekanism.client.gui.element.gauge.GuiFluidGauge)1 GuiNumberGauge (mekanism.client.gui.element.gauge.GuiNumberGauge)1 INumberInfoHandler (mekanism.client.gui.element.gauge.GuiNumberGauge.INumberInfoHandler)1 GuiTextField (mekanism.client.gui.element.text.GuiTextField)1