Search in sources :

Example 1 with WidgetTank

use of me.desht.pneumaticcraft.client.gui.widget.WidgetTank in project pnc-repressurized by TeamPneumatic.

the class GuiRefinery method initGui.

@Override
public void initGui() {
    super.initGui();
    addWidget(new WidgetTemperature(-1, guiLeft + 32, guiTop + 20, 273, 673, te.getHeatExchangerLogic(null), 373));
    addWidget(new WidgetTank(-1, guiLeft + 8, guiTop + 13, te.getInputTank()));
    int x = guiLeft + 95;
    int y = guiTop + 17;
    addWidget(new WidgetTank(-1, x, y, te.getOutputTank()));
    refineries = new ArrayList<>();
    refineries.add(te);
    TileEntityRefinery refinery = te;
    while (refinery.getTileCache()[EnumFacing.UP.ordinal()].getTileEntity() instanceof TileEntityRefinery) {
        refinery = (TileEntityRefinery) refinery.getTileCache()[EnumFacing.UP.ordinal()].getTileEntity();
        x += 20;
        y -= 4;
        if (refineries.size() < 4)
            addWidget(new WidgetTank(-1, x, y, refinery.getOutputTank()));
        refineries.add(refinery);
    }
    if (refineries.size() < 2 || refineries.size() > 4) {
        problemTab.openWindow();
    }
}
Also used : TileEntityRefinery(me.desht.pneumaticcraft.common.tileentity.TileEntityRefinery) WidgetTemperature(me.desht.pneumaticcraft.client.gui.widget.WidgetTemperature) WidgetTank(me.desht.pneumaticcraft.client.gui.widget.WidgetTank)

Example 2 with WidgetTank

use of me.desht.pneumaticcraft.client.gui.widget.WidgetTank in project pnc-repressurized by TeamPneumatic.

the class GuiThermopneumaticProcessingPlant method initGui.

@Override
public void initGui() {
    super.initGui();
    addWidget(new WidgetTank(-1, guiLeft + 13, guiTop + 15, te.getInputTank()));
    addWidget(new WidgetTank(-1, guiLeft + 79, guiTop + 15, te.getOutputTank()));
    addWidget(tempWidget = new WidgetTemperature(-1, guiLeft + 98, guiTop + 15, 273, 673, te.getHeatExchangerLogic(null), (int) te.requiredTemperature));
    GuiButtonSpecial dumpButton = new GuiButtonSpecial(1, guiLeft + 12, guiTop + 81, 18, 18, "");
    dumpButton.setRenderedIcon(Textures.GUI_X_BUTTON);
    dumpButton.setTooltipText(PneumaticCraftUtils.convertStringIntoList(I18n.format("gui.thermopneumatic.dumpInput")));
    addWidget(dumpButton);
}
Also used : WidgetTemperature(me.desht.pneumaticcraft.client.gui.widget.WidgetTemperature) WidgetTank(me.desht.pneumaticcraft.client.gui.widget.WidgetTank)

Example 3 with WidgetTank

use of me.desht.pneumaticcraft.client.gui.widget.WidgetTank in project pnc-repressurized by TeamPneumatic.

the class GuiKeroseneLamp method initGui.

@Override
public void initGui() {
    super.initGui();
    addWidget(new WidgetTank(-1, guiLeft + 152, guiTop + 15, te.getTank()));
    addWidget(rangeTextWidget = new WidgetLabel(guiLeft + 5, guiTop + 38, ""));
    // addWidget(timeLeftWidget = new WidgetLabel(guiLeft + 5, guiTop + 26, ""));
    String maxRange = I18n.format("gui.keroseneLamp.maxRange");
    int maxRangeLength = fontRenderer.getStringWidth(maxRange);
    addLabel(maxRange, guiLeft + 5, guiTop + 50);
    addLabel(I18n.format("gui.keroseneLamp.blocks"), guiLeft + maxRangeLength + 40, guiTop + 50);
    addWidget(rangeWidget = new WidgetTextFieldNumber(fontRenderer, guiLeft + 7 + maxRangeLength, guiTop + 50, 30, fontRenderer.FONT_HEIGHT));
    rangeWidget.minValue = 1;
    rangeWidget.maxValue = TileEntityKeroseneLamp.MAX_RANGE;
}
Also used : WidgetLabel(me.desht.pneumaticcraft.client.gui.widget.WidgetLabel) WidgetTextFieldNumber(me.desht.pneumaticcraft.client.gui.widget.WidgetTextFieldNumber) WidgetTank(me.desht.pneumaticcraft.client.gui.widget.WidgetTank)

Example 4 with WidgetTank

use of me.desht.pneumaticcraft.client.gui.widget.WidgetTank in project pnc-repressurized by TeamPneumatic.

the class GuiPlasticMixer method initGui.

@Override
public void initGui() {
    super.initGui();
    addWidget(new WidgetTemperature(0, guiLeft + 55, guiTop + 25, 295, 500, te.getLogic(0)));
    addWidget(new WidgetTemperature(1, guiLeft + 82, guiTop + 25, 295, 500, te.getLogic(1), PneumaticValues.PLASTIC_MIXER_MELTING_TEMP));
    addWidget(new WidgetTank(3, guiLeft + 152, guiTop + 14, te.getTank()));
    GuiAnimatedStat stat = addAnimatedStat("gui.tab.plasticMixer.plasticSelection", new ItemStack(Itemss.PLASTIC, 1, 1), 0xFF005500, false);
    List<String> text = new ArrayList<>();
    for (int i = 0; i < 12; i++) {
        text.add("                      ");
    }
    stat.setTextWithoutCuttingString(text);
    buttons = new GuiButtonSpecial[16];
    for (int x = 0; x < 4; x++) {
        for (int y = 0; y < 4; y++) {
            int index = y * 4 + x;
            ItemStack plastic = new ItemStack(Itemss.PLASTIC, 1, index);
            buttons[index] = new GuiButtonSpecial(index + 1, x * 21 + 4, y * 21 + 30, 20, 20, "").setRenderStacks(plastic).setTooltipText(plastic.getDisplayName());
            stat.addWidget(buttons[index]);
        }
    }
    stat.addWidget(lockSelection = new GuiCheckBox(17, 4, 18, 0xFF000000, "gui.plasticMixer.lockSelection").setChecked(te.lockSelection).setTooltip(I18n.format("gui.plasticMixer.lockSelection.tooltip")));
}
Also used : WidgetTemperature(me.desht.pneumaticcraft.client.gui.widget.WidgetTemperature) ArrayList(java.util.ArrayList) GuiCheckBox(me.desht.pneumaticcraft.client.gui.widget.GuiCheckBox) WidgetTank(me.desht.pneumaticcraft.client.gui.widget.WidgetTank) GuiAnimatedStat(me.desht.pneumaticcraft.client.gui.widget.GuiAnimatedStat) ItemStack(net.minecraft.item.ItemStack)

Example 5 with WidgetTank

use of me.desht.pneumaticcraft.client.gui.widget.WidgetTank in project pnc-repressurized by TeamPneumatic.

the class PneumaticCraftCategory method setRecipe.

@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
    if (recipeWrapper instanceof PneumaticCraftCategory.MultipleInputOutputRecipeWrapper) {
        MultipleInputOutputRecipeWrapper recipe = (MultipleInputOutputRecipeWrapper) recipeWrapper;
        for (int i = 0; i < ingredients.getInputs(ItemStack.class).size(); i++) {
            recipeLayout.getItemStacks().init(i, true, recipe.input.get(i).getX() - 1, recipe.input.get(i).getY() - 1);
            recipeLayout.getItemStacks().set(i, recipe.input.get(i).getStacks());
        }
        for (int i = 0; i < ingredients.getOutputs(ItemStack.class).size(); i++) {
            recipeLayout.getItemStacks().init(i + recipe.input.size(), false, recipe.output.get(i).getX() - 1, recipe.output.get(i).getY() - 1);
            recipeLayout.getItemStacks().set(i + recipe.input.size(), recipe.output.get(i).getStacks());
        }
        for (int i = 0; i < ingredients.getInputs(FluidStack.class).size(); i++) {
            WidgetTank tank = recipe.inputLiquids.get(i);
            IDrawable tankOverlay = new ResourceDrawable(Textures.WIDGET_TANK, 0, 0, 0, 0, tank.getBounds().width, tank.getBounds().height, tank.getBounds().width, tank.getBounds().height);
            recipeLayout.getFluidStacks().init(i, true, tank.x, tank.y, tank.getBounds().width, tank.getBounds().height, tank.getTank().getCapacity(), true, tankOverlay);
            recipeLayout.getFluidStacks().set(i, tank.getFluid());
        }
        for (int i = 0; i < ingredients.getOutputs(FluidStack.class).size(); i++) {
            WidgetTank tank = recipe.outputLiquids.get(i);
            IDrawable tankOverlay = new ResourceDrawable(Textures.WIDGET_TANK, 0, 0, 0, 0, tank.getBounds().width, tank.getBounds().height, tank.getBounds().width, tank.getBounds().height);
            recipeLayout.getFluidStacks().init(recipe.inputLiquids.size() + i, false, tank.x, tank.y, tank.getBounds().width, tank.getBounds().height, tank.getTank().getCapacity(), true, tankOverlay);
            recipeLayout.getFluidStacks().set(recipe.inputLiquids.size() + i, tank.getFluid());
        }
    }
}
Also used : WidgetTank(me.desht.pneumaticcraft.client.gui.widget.WidgetTank)

Aggregations

WidgetTank (me.desht.pneumaticcraft.client.gui.widget.WidgetTank)8 ItemStack (net.minecraft.item.ItemStack)4 ArrayList (java.util.ArrayList)3 GuiAnimatedStat (me.desht.pneumaticcraft.client.gui.widget.GuiAnimatedStat)3 WidgetTemperature (me.desht.pneumaticcraft.client.gui.widget.WidgetTemperature)3 GuiCheckBox (me.desht.pneumaticcraft.client.gui.widget.GuiCheckBox)1 WidgetLabel (me.desht.pneumaticcraft.client.gui.widget.WidgetLabel)1 WidgetTextFieldNumber (me.desht.pneumaticcraft.client.gui.widget.WidgetTextFieldNumber)1 TileEntityRefinery (me.desht.pneumaticcraft.common.tileentity.TileEntityRefinery)1