Search in sources :

Example 1 with WidgetLabel

use of pneumaticCraft.client.gui.widget.WidgetLabel in project PneumaticCraft by MineMaarten.

the class GuiProgWidgetItemAssign method initGui.

@Override
public void initGui() {
    super.initGui();
    textfield = new WidgetComboBox(fontRendererObj, guiLeft + 10, guiTop + 40, 160, 10);
    textfield.setElements(guiProgrammer.te.getAllVariables());
    textfield.setMaxStringLength(1000);
    textfield.setText(widget.getVariable());
    addWidget(textfield);
    addWidget(new WidgetLabel(guiLeft + 10, guiTop + 30, "Setting variable:"));
}
Also used : WidgetLabel(pneumaticCraft.client.gui.widget.WidgetLabel) WidgetComboBox(pneumaticCraft.client.gui.widget.WidgetComboBox)

Example 2 with WidgetLabel

use of pneumaticCraft.client.gui.widget.WidgetLabel in project PneumaticCraft by MineMaarten.

the class GuiAmadronAddTrade method initGui.

@Override
public void initGui() {
    super.initGui();
    ContainerAmadronAddTrade container = (ContainerAmadronAddTrade) inventorySlots;
    addLabel(I18n.format("gui.amadron.addTrade.selling"), guiLeft + 4, guiTop + 5);
    addLabel(I18n.format("gui.amadron.addTrade.buying"), guiLeft + 93, guiTop + 5);
    buttonList.add(new GuiButton(0, guiLeft + 4, guiTop + 20, 85, 20, "Search item..."));
    buttonList.add(new GuiButton(1, guiLeft + 4, guiTop + 42, 85, 20, "Search inv..."));
    buttonList.add(new GuiButton(2, guiLeft + 4, guiTop + 64, 85, 20, "Search fluid..."));
    buttonList.add(new GuiButton(3, guiLeft + 93, guiTop + 20, 85, 20, "Search item..."));
    buttonList.add(new GuiButton(4, guiLeft + 93, guiTop + 42, 85, 20, "Search inv..."));
    buttonList.add(new GuiButton(5, guiLeft + 93, guiTop + 64, 85, 20, "Search fluid..."));
    buttonList.add(addButton = new GuiButton(8, guiLeft + 50, guiTop + 164, 85, 20, "Add Trade"));
    Fluid oldInputFluid = inputFluid != null ? inputFluid.getFluid() : null;
    Fluid oldOutputFluid = outputFluid != null ? outputFluid.getFluid() : null;
    inputFluid = new WidgetFluidFilter(-1, guiLeft + 10, guiTop + 90);
    outputFluid = new WidgetFluidFilter(-1, guiLeft + 99, guiTop + 90);
    inputFluid.setFluid(oldInputFluid);
    outputFluid.setFluid(oldOutputFluid);
    addWidget(inputFluid);
    addWidget(outputFluid);
    GuiButtonSpecial gpsButton1 = new GuiButtonSpecial(6, guiLeft + 10, guiTop + 115, 20, 20, "");
    GuiButtonSpecial gpsButton2 = new GuiButtonSpecial(7, guiLeft + 99, guiTop + 115, 20, 20, "");
    gpsButton1.setTooltipText(Arrays.asList(WordUtils.wrap(I18n.format("gui.amadron.button.selectSellingBlock.tooltip"), 40).split(System.getProperty("line.separator"))));
    gpsButton2.setTooltipText(Arrays.asList(WordUtils.wrap(I18n.format("gui.amadron.button.selectPaymentBlock.tooltip"), 40).split(System.getProperty("line.separator"))));
    gpsButton1.setRenderStacks(new ItemStack(Itemss.GPSTool));
    gpsButton2.setRenderStacks(new ItemStack(Itemss.GPSTool));
    addWidget(gpsButton1);
    addWidget(gpsButton2);
    inputNumber = new WidgetTextFieldNumber(fontRendererObj, guiLeft + 6, guiTop + 145, 40, fontRendererObj.FONT_HEIGHT).setValue(inputNumber != null ? inputNumber.getValue() : 0);
    outputNumber = new WidgetTextFieldNumber(fontRendererObj, guiLeft + 95, guiTop + 145, 40, fontRendererObj.FONT_HEIGHT).setValue(outputNumber != null ? outputNumber.getValue() : 0);
    inputNumber.setTooltip(I18n.format("gui.amadron.addTrade.itemFluidAmount"));
    outputNumber.setTooltip(I18n.format("gui.amadron.addTrade.itemFluidAmount"));
    addWidget(inputNumber);
    addWidget(outputNumber);
    if (searchGui != null) {
        if (isSettingInput) {
            inputFluid.setFluid(null);
            container.setStack(0, searchGui.getSearchStack());
        } else {
            outputFluid.setFluid(null);
            container.setStack(1, searchGui.getSearchStack());
        }
    }
    if (invSearchGui != null) {
        if (isSettingInput) {
            inputFluid.setFluid(null);
            container.setStack(0, invSearchGui.getSearchStack());
        } else {
            outputFluid.setFluid(null);
            container.setStack(1, invSearchGui.getSearchStack());
        }
    }
    if (fluidGui != null) {
        if (isSettingInput) {
            container.setStack(0, null);
            inputFluid.setFluid(fluidGui.getFilter());
        } else {
            container.setStack(1, null);
            outputFluid.setFluid(fluidGui.getFilter());
        }
    }
    if (gpsSearchGui != null) {
        if (isSettingInput) {
            inputPosition = gpsSearchGui.getSearchStack() != null ? ItemGPSTool.getGPSLocation(gpsSearchGui.getSearchStack()) : null;
        } else {
            outputPosition = gpsSearchGui.getSearchStack() != null ? ItemGPSTool.getGPSLocation(gpsSearchGui.getSearchStack()) : null;
        }
    }
    searchGui = null;
    fluidGui = null;
    invSearchGui = null;
    gpsSearchGui = null;
    inputNumberLabel = new WidgetLabel(guiLeft + 52, guiTop + 145, container.getStack(0) != null ? "x" : inputFluid.getFluid() != null ? "mB" : "");
    outputNumberLabel = new WidgetLabel(guiLeft + 149, guiTop + 145, container.getStack(1) != null ? "x" : outputFluid.getFluid() != null ? "mB" : "");
    addWidget(inputNumberLabel);
    addWidget(outputNumberLabel);
}
Also used : WidgetLabel(pneumaticCraft.client.gui.widget.WidgetLabel) ContainerAmadronAddTrade(pneumaticCraft.common.inventory.ContainerAmadronAddTrade) GuiButton(net.minecraft.client.gui.GuiButton) WidgetTextFieldNumber(pneumaticCraft.client.gui.widget.WidgetTextFieldNumber) Fluid(net.minecraftforge.fluids.Fluid) WidgetFluidFilter(pneumaticCraft.client.gui.widget.WidgetFluidFilter) ItemStack(net.minecraft.item.ItemStack)

Example 3 with WidgetLabel

use of pneumaticCraft.client.gui.widget.WidgetLabel in project PneumaticCraft by MineMaarten.

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 = fontRendererObj.getStringWidth(maxRange);
    addLabel(maxRange, guiLeft + 5, guiTop + 50);
    addLabel(I18n.format("gui.keroseneLamp.blocks"), guiLeft + maxRangeLength + 40, guiTop + 50);
    addWidget(rangeWidget = new WidgetTextFieldNumber(fontRendererObj, guiLeft + 7 + maxRangeLength, guiTop + 50, 30, fontRendererObj.FONT_HEIGHT));
    rangeWidget.minValue = 1;
    rangeWidget.maxValue = 30;
}
Also used : WidgetLabel(pneumaticCraft.client.gui.widget.WidgetLabel) WidgetTextFieldNumber(pneumaticCraft.client.gui.widget.WidgetTextFieldNumber) WidgetTank(pneumaticCraft.client.gui.widget.WidgetTank)

Example 4 with WidgetLabel

use of pneumaticCraft.client.gui.widget.WidgetLabel in project PneumaticCraft by MineMaarten.

the class GuiLogisticsBase method initGui.

@Override
public void initGui() {
    super.initGui();
    if (searchGui != null) {
        inventorySlots.getSlot(editingSlot).putStack(searchGui.getSearchStack());
        NetworkHandler.sendToServer(new PacketSetLogisticsFilterStack(logistics, searchGui.getSearchStack(), editingSlot));
        searchGui = null;
    }
    if (fluidSearchGui != null && fluidSearchGui.getFilter() != null) {
        FluidStack filter = new FluidStack(fluidSearchGui.getFilter(), 1000);
        logistics.setFilter(editingSlot, filter);
        NetworkHandler.sendToServer(new PacketSetLogisticsFluidFilterStack(logistics, filter, editingSlot));
        fluidSearchGui = null;
    }
    String invisibleText = I18n.format("gui.logisticFrame.invisible");
    addWidget(invisible = new GuiCheckBox(9, guiLeft + xSize - 15 - fontRendererObj.getStringWidth(invisibleText), guiTop + 7, 0xFF000000, invisibleText));
    invisible.setTooltip(Arrays.asList(WordUtils.wrap(I18n.format("gui.logisticFrame.invisible.tooltip"), 40).split(System.getProperty("line.separator"))));
    addWidget(new WidgetLabel(guiLeft + 8, guiTop + 18, I18n.format(String.format("gui.%s.filters", SemiBlockManager.getKeyForSemiBlock(logistics)))));
    addWidget(new WidgetLabel(guiLeft + 8, guiTop + 90, I18n.format("gui.logisticFrame.liquid")));
    for (int i = 0; i < 9; i++) {
        addWidget(new WidgetFluidStack(i, guiLeft + i * 18 + 8, guiTop + 101, logistics.getTankFilter(i)));
    }
    addInfoTab(I18n.format("gui.tab.info." + SemiBlockManager.getKeyForSemiBlock(logistics)));
}
Also used : WidgetLabel(pneumaticCraft.client.gui.widget.WidgetLabel) PacketSetLogisticsFilterStack(pneumaticCraft.common.network.PacketSetLogisticsFilterStack) PacketSetLogisticsFluidFilterStack(pneumaticCraft.common.network.PacketSetLogisticsFluidFilterStack) WidgetFluidStack(pneumaticCraft.client.gui.widget.WidgetFluidStack) FluidStack(net.minecraftforge.fluids.FluidStack) WidgetFluidStack(pneumaticCraft.client.gui.widget.WidgetFluidStack) GuiCheckBox(pneumaticCraft.client.gui.widget.GuiCheckBox)

Example 5 with WidgetLabel

use of pneumaticCraft.client.gui.widget.WidgetLabel in project PneumaticCraft by MineMaarten.

the class GuiProgWidgetArea method initGui.

@Override
public void initGui() {
    super.initGui();
    addLabel("Point 1", guiLeft + 50, guiTop + 10);
    addLabel("Point 2", guiLeft + 177, guiTop + 10);
    addLabel("Area Type:", guiLeft + 4, guiTop + 50);
    boolean advancedMode = Config.getProgrammerDifficulty() == 2;
    GuiButtonSpecial gpsButton1 = new GuiButtonSpecial(0, guiLeft + (advancedMode ? 6 : 55), guiTop + 20, 20, 20, "");
    GuiButtonSpecial gpsButton2 = new GuiButtonSpecial(1, guiLeft + (advancedMode ? 133 : 182), guiTop + 20, 20, 20, "");
    gpsButton1.setTooltipText(I18n.format("gui.progWidget.area.selectGPS1"));
    gpsButton2.setTooltipText(I18n.format("gui.progWidget.area.selectGPS2"));
    gpsButton1.setRenderStacks(new ItemStack(Itemss.GPSTool));
    gpsButton2.setRenderStacks(new ItemStack(Itemss.GPSTool));
    buttonList.add(gpsButton1);
    buttonList.add(gpsButton2);
    variableField1 = new WidgetComboBox(fontRendererObj, guiLeft + 28, guiTop + 25, 88, fontRendererObj.FONT_HEIGHT + 1);
    variableField2 = new WidgetComboBox(fontRendererObj, guiLeft + 155, guiTop + 25, 88, fontRendererObj.FONT_HEIGHT + 1);
    Set<String> variables = guiProgrammer.te.getAllVariables();
    variableField1.setElements(variables);
    variableField2.setElements(variables);
    variableField1.setText(widget.getCoord1Variable());
    variableField2.setText(widget.getCoord2Variable());
    typeInfoField = new WidgetTextFieldNumber(fontRendererObj, guiLeft + 160, guiTop + 110, 20, fontRendererObj.FONT_HEIGHT + 1);
    typeInfoField.setValue(widget.typeInfo);
    typeInfoField.setTooltip(I18n.format("gui.progWidget.area.extraInfo.tooltip"));
    addWidget(typeInfoField);
    addWidget(new WidgetLabel(guiLeft + 160, guiTop + 100, I18n.format("gui.progWidget.area.extraInfo")));
    if (advancedMode) {
        addWidget(variableField1);
        addWidget(variableField2);
    }
    List<GuiRadioButton> radioButtons = new ArrayList<GuiRadioButton>();
    ProgWidgetArea.EnumAreaType[] areaTypes = ProgWidgetArea.EnumAreaType.values();
    for (int i = 0; i < areaTypes.length; i++) {
        GuiRadioButton radioButton = new GuiRadioButton(i, guiLeft + 7 + i / 7 * 80, guiTop + 60 + i % 7 * 12, 0xFF000000, areaTypes[i].toString());
        radioButton.checked = areaTypes[i] == widget.type;
        addWidget(radioButton);
        radioButtons.add(radioButton);
        radioButton.otherChoices = radioButtons;
    }
    if (invSearchGui != null) {
        ChunkPosition pos = invSearchGui.getSearchStack() != null ? ItemGPSTool.getGPSLocation(invSearchGui.getSearchStack()) : null;
        if (pos != null) {
            if (pointSearched == 0) {
                widget.x1 = pos.chunkPosX;
                widget.y1 = pos.chunkPosY;
                widget.z1 = pos.chunkPosZ;
            } else {
                widget.x2 = pos.chunkPosX;
                widget.y2 = pos.chunkPosY;
                widget.z2 = pos.chunkPosZ;
            }
        } else {
            if (pointSearched == 0) {
                widget.x1 = widget.y1 = widget.z1 = 0;
            } else {
                widget.x2 = widget.y2 = widget.z2 = 0;
            }
        }
    }
}
Also used : WidgetLabel(pneumaticCraft.client.gui.widget.WidgetLabel) WidgetTextFieldNumber(pneumaticCraft.client.gui.widget.WidgetTextFieldNumber) ChunkPosition(net.minecraft.world.ChunkPosition) ArrayList(java.util.ArrayList) GuiButtonSpecial(pneumaticCraft.client.gui.GuiButtonSpecial) GuiRadioButton(pneumaticCraft.client.gui.widget.GuiRadioButton) ItemStack(net.minecraft.item.ItemStack) WidgetComboBox(pneumaticCraft.client.gui.widget.WidgetComboBox)

Aggregations

WidgetLabel (pneumaticCraft.client.gui.widget.WidgetLabel)5 WidgetTextFieldNumber (pneumaticCraft.client.gui.widget.WidgetTextFieldNumber)3 ItemStack (net.minecraft.item.ItemStack)2 WidgetComboBox (pneumaticCraft.client.gui.widget.WidgetComboBox)2 ArrayList (java.util.ArrayList)1 GuiButton (net.minecraft.client.gui.GuiButton)1 ChunkPosition (net.minecraft.world.ChunkPosition)1 Fluid (net.minecraftforge.fluids.Fluid)1 FluidStack (net.minecraftforge.fluids.FluidStack)1 GuiButtonSpecial (pneumaticCraft.client.gui.GuiButtonSpecial)1 GuiCheckBox (pneumaticCraft.client.gui.widget.GuiCheckBox)1 GuiRadioButton (pneumaticCraft.client.gui.widget.GuiRadioButton)1 WidgetFluidFilter (pneumaticCraft.client.gui.widget.WidgetFluidFilter)1 WidgetFluidStack (pneumaticCraft.client.gui.widget.WidgetFluidStack)1 WidgetTank (pneumaticCraft.client.gui.widget.WidgetTank)1 ContainerAmadronAddTrade (pneumaticCraft.common.inventory.ContainerAmadronAddTrade)1 PacketSetLogisticsFilterStack (pneumaticCraft.common.network.PacketSetLogisticsFilterStack)1 PacketSetLogisticsFluidFilterStack (pneumaticCraft.common.network.PacketSetLogisticsFluidFilterStack)1