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);
}
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);
}
}
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);
}
}
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);
}
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);
}
Aggregations