Search in sources :

Example 1 with GuiCheckBox

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

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

the class GuiProgWidgetCondition method initGui.

@Override
public void initGui() {
    super.initGui();
    if (isSidedWidget()) {
        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 = ((ISidedWidget) widget).getSides()[i];
            addWidget(checkBox);
        }
    }
    int baseX = isSidedWidget() ? 90 : 4;
    int baseY = isUsingAndOr() ? 60 : 30;
    List<GuiRadioButton> radioButtons;
    GuiRadioButton radioButton;
    if (isUsingAndOr()) {
        radioButtons = new ArrayList<>();
        radioButton = new GuiRadioButton(6, guiLeft + baseX, guiTop + 30, 0xFF404040, "Any block");
        radioButton.checked = !((ICondition) widget).isAndFunction();
        addWidget(radioButton);
        radioButtons.add(radioButton);
        radioButton.otherChoices = radioButtons;
        radioButton = new GuiRadioButton(7, guiLeft + baseX, guiTop + 42, 0xFF404040, "All blocks");
        radioButton.checked = ((ICondition) widget).isAndFunction();
        addWidget(radioButton);
        radioButtons.add(radioButton);
        radioButton.otherChoices = radioButtons;
    }
    if (requiresNumber()) {
        radioButtons = new ArrayList<>();
        for (int i = 0; i < ICondition.Operator.values().length; i++) {
            radioButton = new GuiRadioButton(8 + i, guiLeft + baseX, guiTop + baseY + i * 12, 0xFF404040, ICondition.Operator.values()[i].toString());
            radioButton.checked = ((ICondition) widget).getOperator().ordinal() == i;
            addWidget(radioButton);
            radioButtons.add(radioButton);
            radioButton.otherChoices = radioButtons;
        }
        textField = new WidgetTextField(Minecraft.getMinecraft().fontRenderer, guiLeft + baseX, guiTop + baseY + 30, 50, 11);
        textField.setText(((ICondition) widget).getRequiredCount() + "");
        addWidget(textField);
    }
}
Also used : ISidedWidget(me.desht.pneumaticcraft.common.progwidgets.ISidedWidget) GuiCheckBox(me.desht.pneumaticcraft.client.gui.widget.GuiCheckBox) GuiRadioButton(me.desht.pneumaticcraft.client.gui.widget.GuiRadioButton) ICondition(me.desht.pneumaticcraft.common.progwidgets.ICondition) WidgetTextField(me.desht.pneumaticcraft.client.gui.widget.WidgetTextField)

Example 3 with GuiCheckBox

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

the class GuiProgWidgetEmitRedstone method initGui.

@Override
public void initGui() {
    super.initGui();
    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 = widget.getSides()[i];
        addWidget(checkBox);
    }
}
Also used : GuiCheckBox(me.desht.pneumaticcraft.client.gui.widget.GuiCheckBox)

Example 4 with GuiCheckBox

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

the class GuiProgWidgetExternalProgram method initGui.

@Override
public void initGui() {
    super.initGui();
    shareVariables = new GuiCheckBox(-1, guiLeft + 10, guiTop + 22, 0xFF404040, I18n.format("gui.progWidget.externalProgram.shareVariables"));
    addWidget(shareVariables);
    shareVariables.setTooltip(I18n.format("gui.progWidget.externalProgram.shareVariables.tooltip"));
    shareVariables.setChecked(widget.shareVariables);
}
Also used : GuiCheckBox(me.desht.pneumaticcraft.client.gui.widget.GuiCheckBox)

Example 5 with GuiCheckBox

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

Aggregations

GuiCheckBox (me.desht.pneumaticcraft.client.gui.widget.GuiCheckBox)19 GuiRadioButton (me.desht.pneumaticcraft.client.gui.widget.GuiRadioButton)4 ArrayList (java.util.ArrayList)3 GuiAnimatedStat (me.desht.pneumaticcraft.client.gui.widget.GuiAnimatedStat)3 WidgetTextFieldNumber (me.desht.pneumaticcraft.client.gui.widget.WidgetTextFieldNumber)3 ItemStack (net.minecraft.item.ItemStack)3 WidgetComboBox (me.desht.pneumaticcraft.client.gui.widget.WidgetComboBox)2 WidgetTextField (me.desht.pneumaticcraft.client.gui.widget.WidgetTextField)2 GuiButton (net.minecraft.client.gui.GuiButton)2 Point (java.awt.Point)1 GuiButtonSpecial (me.desht.pneumaticcraft.client.gui.GuiButtonSpecial)1 GuiProgWidgetCondition (me.desht.pneumaticcraft.client.gui.programmer.GuiProgWidgetCondition)1 IGuiWidget (me.desht.pneumaticcraft.client.gui.widget.IGuiWidget)1 WidgetFluidStack (me.desht.pneumaticcraft.client.gui.widget.WidgetFluidStack)1 WidgetLabel (me.desht.pneumaticcraft.client.gui.widget.WidgetLabel)1 WidgetTank (me.desht.pneumaticcraft.client.gui.widget.WidgetTank)1 WidgetTemperature (me.desht.pneumaticcraft.client.gui.widget.WidgetTemperature)1 WidgetTooltipArea (me.desht.pneumaticcraft.client.gui.widget.WidgetTooltipArea)1 TubeModuleRedstoneReceiving (me.desht.pneumaticcraft.common.block.tubes.TubeModuleRedstoneReceiving)1 PacketGuiButton (me.desht.pneumaticcraft.common.network.PacketGuiButton)1