Search in sources :

Example 6 with GuiRadioButton

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

the class GuiWidgetCoordinateCondition method initGui.

@Override
public void initGui() {
    super.initGui();
    checkingAxis[0] = new GuiCheckBox(0, guiLeft + 10, guiTop + 30, 0xFF000000, "X");
    checkingAxis[1] = new GuiCheckBox(1, guiLeft + 10, guiTop + 42, 0xFF000000, "Y");
    checkingAxis[2] = new GuiCheckBox(2, guiLeft + 10, guiTop + 54, 0xFF000000, "Z");
    for (int i = 0; i < 3; i++) {
        checkingAxis[i] = new GuiCheckBox(i, guiLeft + 10, guiTop + 30 + i * 12, 0xFF000000, i == 0 ? "X" : i == 1 ? "Y" : "Z");
        addWidget(checkingAxis[i]);
        checkingAxis[i].setChecked(widget.checkingAxis[i]);
    }
    radioButtons = new ArrayList<GuiRadioButton>();
    for (int i = 0; i < ICondition.Operator.values().length; i++) {
        GuiRadioButton radioButton = new GuiRadioButton(3 + i, guiLeft + 80, guiTop + 30 + i * 12, 0xFF000000, ICondition.Operator.values()[i].toString());
        radioButton.checked = widget.getOperator().ordinal() == i;
        addWidget(radioButton);
        radioButtons.add(radioButton);
        radioButton.otherChoices = radioButtons;
    }
}
Also used : GuiCheckBox(pneumaticCraft.client.gui.widget.GuiCheckBox) GuiRadioButton(pneumaticCraft.client.gui.widget.GuiRadioButton)

Example 7 with GuiRadioButton

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

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

the class GuiProgWidgetCoordinateOperator method initGui.

@Override
public void initGui() {
    super.initGui();
    List<GuiRadioButton> radioButtons = new ArrayList<GuiRadioButton>();
    for (int i = 0; i < EnumOperator.values().length; i++) {
        GuiRadioButton radioButton = new GuiRadioButton(i, guiLeft + 7, guiTop + 42 + 12 * i, 0xFF000000, I18n.format(EnumOperator.values()[i].getUnlocalizedName()));
        radioButtons.add(radioButton);
        radioButton.checked = widget.getOperator().ordinal() == i;
        radioButton.otherChoices = radioButtons;
        addWidget(radioButton);
    }
    variableField = new WidgetComboBox(fontRendererObj, guiLeft + 90, guiTop + 42, 80, fontRendererObj.FONT_HEIGHT + 1);
    variableField.setElements(guiProgrammer.te.getAllVariables());
    addWidget(variableField);
    variableField.setText(widget.getVariable());
}
Also used : ArrayList(java.util.ArrayList) GuiRadioButton(pneumaticCraft.client.gui.widget.GuiRadioButton) WidgetComboBox(pneumaticCraft.client.gui.widget.WidgetComboBox)

Example 9 with GuiRadioButton

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

the class GuiProgWidgetGoto method initGui.

@Override
public void initGui() {
    super.initGui();
    List<GuiRadioButton> radioButtons = new ArrayList<GuiRadioButton>();
    GuiRadioButton radioButton = new GuiRadioButton(0, guiLeft + 4, guiTop + 44, 0xFF000000, "Done when arrived");
    radioButton.checked = !((ProgWidgetGoToLocation) widget).doneWhenDeparting;
    addWidget(radioButton);
    radioButtons.add(radioButton);
    radioButton.otherChoices = radioButtons;
    GuiRadioButton radioButton2 = new GuiRadioButton(1, guiLeft + 4, guiTop + 58, 0xFF000000, "Done when departing");
    radioButton2.checked = ((ProgWidgetGoToLocation) widget).doneWhenDeparting;
    addWidget(radioButton2);
    radioButtons.add(radioButton2);
    radioButton2.otherChoices = radioButtons;
}
Also used : ProgWidgetGoToLocation(pneumaticCraft.common.progwidgets.ProgWidgetGoToLocation) ArrayList(java.util.ArrayList) GuiRadioButton(pneumaticCraft.client.gui.widget.GuiRadioButton)

Example 10 with GuiRadioButton

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

the class GuiProgWidgetPlace method initGui.

@Override
public void initGui() {
    super.initGui();
    List<GuiRadioButton> radioButtons = new ArrayList<GuiRadioButton>();
    for (int i = 0; i < 6; i++) {
        GuiRadioButton radioButton = new GuiRadioButton(i + 10, guiLeft + 4, guiTop + 80 + i * 12, 0xFF000000, PneumaticCraftUtils.getOrientationName(ForgeDirection.getOrientation(i)));
        radioButton.checked = widget.placeDir.ordinal() == i;
        addWidget(radioButton);
        radioButtons.add(radioButton);
        radioButton.otherChoices = radioButtons;
    }
}
Also used : ArrayList(java.util.ArrayList) GuiRadioButton(pneumaticCraft.client.gui.widget.GuiRadioButton)

Aggregations

GuiRadioButton (pneumaticCraft.client.gui.widget.GuiRadioButton)10 ArrayList (java.util.ArrayList)7 GuiCheckBox (pneumaticCraft.client.gui.widget.GuiCheckBox)4 WidgetComboBox (pneumaticCraft.client.gui.widget.WidgetComboBox)3 WidgetTextFieldNumber (pneumaticCraft.client.gui.widget.WidgetTextFieldNumber)3 ItemStack (net.minecraft.item.ItemStack)2 ChunkPosition (net.minecraft.world.ChunkPosition)2 GuiButtonSpecial (pneumaticCraft.client.gui.GuiButtonSpecial)2 WidgetTextField (pneumaticCraft.client.gui.widget.WidgetTextField)2 Point (java.awt.Point)1 GuiButton (net.minecraft.client.gui.GuiButton)1 WidgetLabel (pneumaticCraft.client.gui.widget.WidgetLabel)1 PacketGuiButton (pneumaticCraft.common.network.PacketGuiButton)1 PacketProgrammerUpdate (pneumaticCraft.common.network.PacketProgrammerUpdate)1 ICondition (pneumaticCraft.common.progwidgets.ICondition)1 ISidedWidget (pneumaticCraft.common.progwidgets.ISidedWidget)1 ProgWidgetDropItem (pneumaticCraft.common.progwidgets.ProgWidgetDropItem)1 ProgWidgetGoToLocation (pneumaticCraft.common.progwidgets.ProgWidgetGoToLocation)1