Search in sources :

Example 6 with WidgetTextFieldNumber

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

the class GuiPressureModuleSimple method initGui.

@Override
public void initGui() {
    super.initGui();
    String title = I18n.format("item." + module.getType() + ".name");
    addLabel(title, width / 2 - fontRendererObj.getStringWidth(title) / 2, guiTop + 5);
    advancedMode = new GuiCheckBox(0, guiLeft + 6, guiTop + 15, 0xFF000000, "gui.tubeModule.advancedConfig").setTooltip(I18n.format("gui.tubeModule.advancedConfig.tooltip"));
    advancedMode.checked = false;
    addWidget(advancedMode);
    thresholdField = new WidgetTextFieldNumber(fontRendererObj, guiLeft + 110, guiTop + 33, 30, fontRendererObj.FONT_HEIGHT).setDecimals(1);
    addWidget(thresholdField);
    if (module instanceof TubeModuleRedstoneReceiving) {
        thresholdField.setValue(((TubeModuleRedstoneReceiving) module).getThreshold());
        addLabel(I18n.format("gui.tubeModule.simpleConfig.threshold"), guiLeft + 6, guiTop + 33);
    } else {
        thresholdField.setValue(module.lowerBound);
        addLabel(I18n.format("gui.tubeModule.simpleConfig.turn"), guiLeft + 6, guiTop + 33);
        moreOrLessButton = new GuiButtonSpecial(1, guiLeft + 85, guiTop + 28, 20, 20, module.lowerBound < module.higherBound ? ">" : "<");
        moreOrLessButton.setTooltipText(I18n.format(module.lowerBound < module.higherBound ? "gui.tubeModule.simpleConfig.higherThan" : "gui.tubeModule.simpleConfig.lowerThan"));
        addWidget(moreOrLessButton);
    }
    addLabel(I18n.format("gui.general.bar"), guiLeft + 145, guiTop + 34);
}
Also used : WidgetTextFieldNumber(pneumaticCraft.client.gui.widget.WidgetTextFieldNumber) TubeModuleRedstoneReceiving(pneumaticCraft.common.block.tubes.TubeModuleRedstoneReceiving) GuiCheckBox(pneumaticCraft.client.gui.widget.GuiCheckBox) GuiButtonSpecial(pneumaticCraft.client.gui.GuiButtonSpecial)

Example 7 with WidgetTextFieldNumber

use of pneumaticCraft.client.gui.widget.WidgetTextFieldNumber 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)

Example 8 with WidgetTextFieldNumber

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

the class GuiProgWidgetImportExport method initGui.

@Override
public void initGui() {
    super.initGui();
    if (showSides()) {
        for (int i = 0; i < 6; i++) {
            String sideName = PneumaticCraftUtils.getOrientationName(ForgeDirection.getOrientation(i));
            GuiCheckBox checkBox = new GuiCheckBox(i, guiLeft + 4, guiTop + 30 + i * 12, 0xFF000000, sideName);
            checkBox.checked = ((ProgWidgetInventoryBase) widget).getSides()[i];
            addWidget(checkBox);
        }
    }
    useItemCount = new GuiCheckBox(6, guiLeft + 4, guiTop + (showSides() ? 115 : 30), 0xFF000000, I18n.format("gui.progWidget.itemFilter.useItemCount"));
    useItemCount.setTooltip("gui.progWidget.itemFilter.useItemCount.tooltip");
    useItemCount.checked = ((ICountWidget) widget).useCount();
    addWidget(useItemCount);
    textField = new WidgetTextFieldNumber(Minecraft.getMinecraft().fontRenderer, guiLeft + 7, guiTop + (showSides() ? 128 : 43), 50, 11);
    textField.setValue(((ICountWidget) widget).getCount());
    textField.setEnabled(useItemCount.checked);
    addWidget(textField);
}
Also used : ProgWidgetInventoryBase(pneumaticCraft.common.progwidgets.ProgWidgetInventoryBase) WidgetTextFieldNumber(pneumaticCraft.client.gui.widget.WidgetTextFieldNumber) GuiCheckBox(pneumaticCraft.client.gui.widget.GuiCheckBox)

Example 9 with WidgetTextFieldNumber

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

the class GuiRemoteButton method initGui.

@Override
public void initGui() {
    super.initGui();
    addLabel(I18n.format("gui.remote.button.settingValue"), guiLeft + 10, guiTop + 95);
    addLabel("X:", guiLeft + 10, guiTop + 106);
    addLabel("Y:", guiLeft + 67, guiTop + 106);
    addLabel("Z:", guiLeft + 124, guiTop + 106);
    addLabel(I18n.format("gui.remote.button.width"), guiLeft + 10, guiTop + 123);
    addLabel(I18n.format("gui.remote.button.height"), guiLeft + 10, guiTop + 138);
    String valueTooltip = I18n.format("gui.remote.button.value.tooltip");
    xValueField = new WidgetTextFieldNumber(fontRendererObj, guiLeft + 20, guiTop + 105, 38, 10);
    xValueField.setValue(widget.settingCoordinate.chunkPosX);
    xValueField.setTooltip(valueTooltip);
    addWidget(xValueField);
    yValueField = new WidgetTextFieldNumber(fontRendererObj, guiLeft + 78, guiTop + 105, 38, 10);
    yValueField.setValue(widget.settingCoordinate.chunkPosY);
    yValueField.setTooltip(valueTooltip);
    addWidget(yValueField);
    zValueField = new WidgetTextFieldNumber(fontRendererObj, guiLeft + 136, guiTop + 105, 38, 10);
    zValueField.setValue(widget.settingCoordinate.chunkPosZ);
    zValueField.setTooltip(valueTooltip);
    addWidget(zValueField);
    widthField = new WidgetTextFieldNumber(fontRendererObj, guiLeft + 100, guiTop + 123, 60, 10);
    widthField.setValue(widget.getWidth());
    widthField.minValue = 10;
    addWidget(widthField);
    heightField = new WidgetTextFieldNumber(fontRendererObj, guiLeft + 100, guiTop + 138, 60, 10);
    heightField.setValue(widget.getHeight());
    heightField.minValue = 10;
    heightField.maxValue = 20;
    addWidget(heightField);
}
Also used : WidgetTextFieldNumber(pneumaticCraft.client.gui.widget.WidgetTextFieldNumber)

Example 10 with WidgetTextFieldNumber

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

the class GuiRemoteDropdown method initGui.

@Override
public void initGui() {
    super.initGui();
    addLabel(I18n.format("gui.remote.button.width"), guiLeft + 10, guiTop + 100);
    addLabel(I18n.format("gui.remote.dropdown.dropDownElements"), guiLeft + 10, guiTop + 40);
    dropDownElementsField = new WidgetTextField(fontRendererObj, guiLeft + 10, guiTop + 50, 160, 10);
    dropDownElementsField.setText(widget.getDropDownElements());
    dropDownElementsField.setTooltip(I18n.format("gui.remote.dropdown.dropDownElements.tooltip"));
    addWidget(dropDownElementsField);
    widthField = new WidgetTextFieldNumber(fontRendererObj, guiLeft + 50, guiTop + 99, 30, 10);
    widthField.setValue(widget.getWidth());
    widthField.minValue = 10;
    addWidget(widthField);
}
Also used : WidgetTextFieldNumber(pneumaticCraft.client.gui.widget.WidgetTextFieldNumber) WidgetTextField(pneumaticCraft.client.gui.widget.WidgetTextField)

Aggregations

WidgetTextFieldNumber (pneumaticCraft.client.gui.widget.WidgetTextFieldNumber)11 ArrayList (java.util.ArrayList)3 ItemStack (net.minecraft.item.ItemStack)3 GuiButtonSpecial (pneumaticCraft.client.gui.GuiButtonSpecial)3 GuiCheckBox (pneumaticCraft.client.gui.widget.GuiCheckBox)3 GuiRadioButton (pneumaticCraft.client.gui.widget.GuiRadioButton)3 WidgetComboBox (pneumaticCraft.client.gui.widget.WidgetComboBox)3 WidgetLabel (pneumaticCraft.client.gui.widget.WidgetLabel)3 WidgetTextField (pneumaticCraft.client.gui.widget.WidgetTextField)3 GuiButton (net.minecraft.client.gui.GuiButton)2 ChunkPosition (net.minecraft.world.ChunkPosition)2 Fluid (net.minecraftforge.fluids.Fluid)1 WidgetFluidFilter (pneumaticCraft.client.gui.widget.WidgetFluidFilter)1 WidgetTank (pneumaticCraft.client.gui.widget.WidgetTank)1 TubeModuleRedstoneReceiving (pneumaticCraft.common.block.tubes.TubeModuleRedstoneReceiving)1 ContainerAmadronAddTrade (pneumaticCraft.common.inventory.ContainerAmadronAddTrade)1 ProgWidgetInventoryBase (pneumaticCraft.common.progwidgets.ProgWidgetInventoryBase)1 IActionWidgetLabeled (pneumaticCraft.common.remote.IActionWidgetLabeled)1