use of me.desht.pneumaticcraft.client.gui.widget.GuiRadioButton in project pnc-repressurized by TeamPneumatic.
the class GuiProgWidgetArea method actionPerformed.
@Override
public void actionPerformed(IGuiWidget guiWidget) {
if (guiWidget instanceof GuiRadioButton) {
AreaType areaType = allAreaTypes.get(guiWidget.getID());
widget.type = areaType;
switchToWidgets(areaType);
}
super.actionPerformed(guiWidget);
}
use of me.desht.pneumaticcraft.client.gui.widget.GuiRadioButton 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);
}
}
use of me.desht.pneumaticcraft.client.gui.widget.GuiRadioButton in project pnc-repressurized by TeamPneumatic.
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, 0xFF404040, I18n.format(EnumOperator.values()[i].getUnlocalizedName()));
radioButtons.add(radioButton);
radioButton.checked = widget.getOperator().ordinal() == i;
radioButton.otherChoices = radioButtons;
addWidget(radioButton);
}
variableField = new WidgetComboBox(fontRenderer, guiLeft + 90, guiTop + 42, 80, fontRenderer.FONT_HEIGHT + 1);
variableField.setElements(guiProgrammer.te.getAllVariables());
addWidget(variableField);
variableField.setText(widget.getVariable());
}
use of me.desht.pneumaticcraft.client.gui.widget.GuiRadioButton in project pnc-repressurized by TeamPneumatic.
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, 0xFF404040, "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, 0xFF404040, "Done when departing");
radioButton2.checked = ((ProgWidgetGoToLocation) widget).doneWhenDeparting;
addWidget(radioButton2);
radioButtons.add(radioButton2);
radioButton2.otherChoices = radioButtons;
}
use of me.desht.pneumaticcraft.client.gui.widget.GuiRadioButton in project pnc-repressurized by TeamPneumatic.
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, 0xFF404040, PneumaticCraftUtils.getOrientationName(EnumFacing.getFront(i)));
radioButton.checked = widget.placeDir.ordinal() == i;
addWidget(radioButton);
radioButtons.add(radioButton);
radioButton.otherChoices = radioButtons;
}
}
Aggregations