Search in sources :

Example 1 with WidgetTextFieldNumber

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

the class GuiPressureModuleSimple method initGui.

@Override
public void initGui() {
    super.initGui();
    String title = I18n.format("item." + module.getType() + ".name");
    addLabel(title, width / 2 - fontRenderer.getStringWidth(title) / 2, guiTop + 5);
    advancedMode = new GuiCheckBox(0, guiLeft + 6, guiTop + 15, 0xFF404040, "gui.tubeModule.advancedConfig").setTooltip(I18n.format("gui.tubeModule.advancedConfig.tooltip"));
    advancedMode.checked = false;
    addWidget(advancedMode);
    thresholdField = new WidgetTextFieldNumber(fontRenderer, guiLeft + 110, guiTop + 33, 30, fontRenderer.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(me.desht.pneumaticcraft.client.gui.widget.WidgetTextFieldNumber) TubeModuleRedstoneReceiving(me.desht.pneumaticcraft.common.block.tubes.TubeModuleRedstoneReceiving) GuiCheckBox(me.desht.pneumaticcraft.client.gui.widget.GuiCheckBox) GuiButtonSpecial(me.desht.pneumaticcraft.client.gui.GuiButtonSpecial)

Example 2 with WidgetTextFieldNumber

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

the class GuiProgWidgetImportExport method initGui.

@Override
public void initGui() {
    super.initGui();
    if (showSides()) {
        for (int i = 0; i < 6; i++) {
            String sideName = PneumaticCraftUtils.getOrientationName(EnumFacing.getFront(i));
            GuiCheckBox checkBox = new GuiCheckBox(i, guiLeft + 4, guiTop + 30 + i * 12, 0xFF404040, sideName);
            checkBox.checked = ((ProgWidgetInventoryBase) widget).getSides()[i];
            addWidget(checkBox);
        }
    }
    useItemCount = new GuiCheckBox(6, guiLeft + 4, guiTop + (showSides() ? 115 : 30), 0xFF404040, 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(me.desht.pneumaticcraft.common.progwidgets.ProgWidgetInventoryBase) WidgetTextFieldNumber(me.desht.pneumaticcraft.client.gui.widget.WidgetTextFieldNumber) GuiCheckBox(me.desht.pneumaticcraft.client.gui.widget.GuiCheckBox)

Example 3 with WidgetTextFieldNumber

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

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(fontRenderer, guiLeft + 20, guiTop + 105, 38, 10);
    xValueField.setValue(widget.settingCoordinate.getX());
    xValueField.setTooltip(valueTooltip);
    addWidget(xValueField);
    yValueField = new WidgetTextFieldNumber(fontRenderer, guiLeft + 78, guiTop + 105, 38, 10);
    yValueField.setValue(widget.settingCoordinate.getY());
    yValueField.setTooltip(valueTooltip);
    addWidget(yValueField);
    zValueField = new WidgetTextFieldNumber(fontRenderer, guiLeft + 136, guiTop + 105, 38, 10);
    zValueField.setValue(widget.settingCoordinate.getZ());
    zValueField.setTooltip(valueTooltip);
    addWidget(zValueField);
    widthField = new WidgetTextFieldNumber(fontRenderer, guiLeft + 100, guiTop + 123, 60, 10);
    widthField.setValue(widget.getWidth());
    widthField.minValue = 10;
    addWidget(widthField);
    heightField = new WidgetTextFieldNumber(fontRenderer, guiLeft + 100, guiTop + 138, 60, 10);
    heightField.setValue(widget.getHeight());
    heightField.minValue = 10;
    heightField.maxValue = 20;
    addWidget(heightField);
}
Also used : WidgetTextFieldNumber(me.desht.pneumaticcraft.client.gui.widget.WidgetTextFieldNumber)

Example 4 with WidgetTextFieldNumber

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

the class GuiGPSTool method initGui.

@Override
public void initGui() {
    super.initGui();
    int[] oldText = new int[3];
    if (textFields[0] == null) {
        oldText[0] = oldGPSLoc.getX();
        oldText[1] = oldGPSLoc.getY();
        oldText[2] = oldGPSLoc.getZ();
    } else {
        for (int i = 0; i < 3; i++) oldText[i] = textFields[i].getValue();
    }
    int xMiddle = width / 2;
    int yMiddle = height / 2;
    for (int i = 0; i < 3; i++) {
        textFields[i] = new WidgetTextFieldNumber(fontRenderer, xMiddle - TEXTFIELD_WIDTH / 2, yMiddle - 27 + i * 22, TEXTFIELD_WIDTH, fontRenderer.FONT_HEIGHT);
        textFields[i].setValue(oldText[i]);
        if (i == 1) {
            textFields[i].minValue = 0;
            textFields[i].maxValue = 255;
        }
        addWidget(textFields[i]);
    }
    for (int i = 0; i < 3; i++) {
        buttonList.add(new GuiButton(0 + i * 4, xMiddle - 49 - TEXTFIELD_WIDTH / 2, yMiddle - 32 + i * 22, 22, 20, "-10"));
        buttonList.add(new GuiButton(1 + i * 4, xMiddle - 25 - TEXTFIELD_WIDTH / 2, yMiddle - 32 + i * 22, 22, 20, "-1"));
        buttonList.add(new GuiButton(2 + i * 4, xMiddle + 3 + TEXTFIELD_WIDTH / 2, yMiddle - 32 + i * 22, 22, 20, "+1"));
        buttonList.add(new GuiButton(3 + i * 4, xMiddle + 27 + TEXTFIELD_WIDTH / 2, yMiddle - 32 + i * 22, 22, 20, "+10"));
    }
    if (variableField != null)
        oldVarName = variableField.getText();
    variableField = new WidgetTextField(fontRenderer, xMiddle - 50, yMiddle + 60, 100, fontRenderer.FONT_HEIGHT);
    variableField.setText(oldVarName);
    addWidget(variableField);
    String var = I18n.format("gui.progWidget.coordinate.variable");
    addLabel(var, xMiddle - 62 - fontRenderer.getStringWidth(var), yMiddle + 61);
    addLabel("#", xMiddle - 60, yMiddle + 61);
}
Also used : WidgetTextFieldNumber(me.desht.pneumaticcraft.client.gui.widget.WidgetTextFieldNumber) GuiButton(net.minecraft.client.gui.GuiButton) WidgetTextField(me.desht.pneumaticcraft.client.gui.widget.WidgetTextField)

Example 5 with WidgetTextFieldNumber

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

Aggregations

WidgetTextFieldNumber (me.desht.pneumaticcraft.client.gui.widget.WidgetTextFieldNumber)10 GuiCheckBox (me.desht.pneumaticcraft.client.gui.widget.GuiCheckBox)3 WidgetLabel (me.desht.pneumaticcraft.client.gui.widget.WidgetLabel)3 WidgetTextField (me.desht.pneumaticcraft.client.gui.widget.WidgetTextField)3 ArrayList (java.util.ArrayList)2 WidgetComboBox (me.desht.pneumaticcraft.client.gui.widget.WidgetComboBox)2 GuiButton (net.minecraft.client.gui.GuiButton)2 GuiButtonSpecial (me.desht.pneumaticcraft.client.gui.GuiButtonSpecial)1 GuiRadioButton (me.desht.pneumaticcraft.client.gui.widget.GuiRadioButton)1 IGuiWidget (me.desht.pneumaticcraft.client.gui.widget.IGuiWidget)1 WidgetFluidFilter (me.desht.pneumaticcraft.client.gui.widget.WidgetFluidFilter)1 WidgetTank (me.desht.pneumaticcraft.client.gui.widget.WidgetTank)1 TubeModuleRedstoneReceiving (me.desht.pneumaticcraft.common.block.tubes.TubeModuleRedstoneReceiving)1 ContainerAmadronAddTrade (me.desht.pneumaticcraft.common.inventory.ContainerAmadronAddTrade)1 ProgWidgetInventoryBase (me.desht.pneumaticcraft.common.progwidgets.ProgWidgetInventoryBase)1 AreaType (me.desht.pneumaticcraft.common.progwidgets.area.AreaType)1 AreaTypeWidget (me.desht.pneumaticcraft.common.progwidgets.area.AreaType.AreaTypeWidget)1 AreaTypeWidgetEnum (me.desht.pneumaticcraft.common.progwidgets.area.AreaType.AreaTypeWidgetEnum)1 AreaTypeWidgetInteger (me.desht.pneumaticcraft.common.progwidgets.area.AreaType.AreaTypeWidgetInteger)1 IActionWidgetLabeled (me.desht.pneumaticcraft.common.remote.IActionWidgetLabeled)1