use of pneumaticCraft.client.gui.widget.GuiCheckBox in project PneumaticCraft by MineMaarten.
the class ProgWidgetBlockCondition method getOptionWindow.
@Override
@SideOnly(Side.CLIENT)
public GuiScreen getOptionWindow(GuiProgrammer guiProgrammer) {
return new GuiProgWidgetCondition(this, guiProgrammer) {
@Override
public void initGui() {
super.initGui();
addWidget(new GuiCheckBox(500, guiLeft + 5, guiTop + 60, 0xFF000000, I18n.format("gui.progWidget.conditionBlock.checkForAir")).setChecked(checkingForAir).setTooltip(I18n.format("gui.progWidget.conditionBlock.checkForAir.tooltip")));
addWidget(new GuiCheckBox(501, guiLeft + 5, guiTop + 72, 0xFF000000, I18n.format("gui.progWidget.conditionBlock.checkForLiquids")).setChecked(checkingForLiquids).setTooltip(I18n.format("gui.progWidget.conditionBlock.checkForLiquids.tooltip")));
}
@Override
protected boolean requiresNumber() {
return false;
}
@Override
protected boolean isSidedWidget() {
return false;
}
@Override
public void actionPerformed(IGuiWidget widget) {
if (widget.getID() == 500)
checkingForAir = !checkingForAir;
if (widget.getID() == 501)
checkingForLiquids = !checkingForLiquids;
else
super.actionPerformed(widget);
}
};
}
use of pneumaticCraft.client.gui.widget.GuiCheckBox in project PneumaticCraft by MineMaarten.
the class GuiLogisticsBase method initGui.
@Override
public void initGui() {
super.initGui();
if (searchGui != null) {
inventorySlots.getSlot(editingSlot).putStack(searchGui.getSearchStack());
NetworkHandler.sendToServer(new PacketSetLogisticsFilterStack(logistics, searchGui.getSearchStack(), editingSlot));
searchGui = null;
}
if (fluidSearchGui != null && fluidSearchGui.getFilter() != null) {
FluidStack filter = new FluidStack(fluidSearchGui.getFilter(), 1000);
logistics.setFilter(editingSlot, filter);
NetworkHandler.sendToServer(new PacketSetLogisticsFluidFilterStack(logistics, filter, editingSlot));
fluidSearchGui = null;
}
String invisibleText = I18n.format("gui.logisticFrame.invisible");
addWidget(invisible = new GuiCheckBox(9, guiLeft + xSize - 15 - fontRendererObj.getStringWidth(invisibleText), guiTop + 7, 0xFF000000, invisibleText));
invisible.setTooltip(Arrays.asList(WordUtils.wrap(I18n.format("gui.logisticFrame.invisible.tooltip"), 40).split(System.getProperty("line.separator"))));
addWidget(new WidgetLabel(guiLeft + 8, guiTop + 18, I18n.format(String.format("gui.%s.filters", SemiBlockManager.getKeyForSemiBlock(logistics)))));
addWidget(new WidgetLabel(guiLeft + 8, guiTop + 90, I18n.format("gui.logisticFrame.liquid")));
for (int i = 0; i < 9; i++) {
addWidget(new WidgetFluidStack(i, guiLeft + i * 18 + 8, guiTop + 101, logistics.getTankFilter(i)));
}
addInfoTab(I18n.format("gui.tab.info." + SemiBlockManager.getKeyForSemiBlock(logistics)));
}
use of pneumaticCraft.client.gui.widget.GuiCheckBox in project PneumaticCraft by MineMaarten.
the class GuiPressureModule method initGui.
@Override
public void initGui() {
super.initGui();
int xStart = (width - xSize) / 2;
int yStart = (height - ySize) / 2;
addLabel("lower", guiLeft + 10, guiTop + 30);
addLabel("bar", guiLeft + 45, guiTop + 42);
addLabel("higher", guiLeft + 140, guiTop + 30);
String title = I18n.format("item." + module.getType() + ".name");
addLabel(title, width / 2 - fontRendererObj.getStringWidth(title) / 2, guiTop + 5);
lowerBoundField = new GuiTextField(fontRendererObj, xStart + 10, yStart + 41, 30, 10);
lowerBoundField.setText(PneumaticCraftUtils.roundNumberTo(module.lowerBound, 1));
higherBoundField = new GuiTextField(fontRendererObj, xStart + 140, yStart + 41, 30, 10);
higherBoundField.setText(PneumaticCraftUtils.roundNumberTo(module.higherBound, 1));
graphLowY = guiTop + 153;
graphHighY = guiTop + 93;
graphLeft = guiLeft + 22;
graphRight = guiLeft + 172;
addWidget(new WidgetTooltipArea(graphLeft - 20, graphHighY, 25, graphLowY - graphHighY, "gui.redstone"));
addWidget(new WidgetTooltipArea(graphLeft, graphLowY - 5, graphRight - graphLeft, 25, "gui.threshold"));
addWidget((IGuiWidget) new GuiAnimatedStat(this, "gui.tab.info", Textures.GUI_INFO_LOCATION, xStart, yStart + 5, 0xFF8888FF, null, true).setText("gui.tab.info.tubeModule"));
advancedMode = new GuiCheckBox(0, guiLeft + 6, guiTop + 15, 0xFF000000, "gui.tubeModule.advancedConfig").setTooltip(I18n.format("gui.tubeModule.advancedConfig.tooltip"));
advancedMode.checked = true;
addWidget(advancedMode);
}
use of pneumaticCraft.client.gui.widget.GuiCheckBox in project PneumaticCraft by MineMaarten.
the class GuiProgWidgetImportExport method initGui.
@Override
public void initGui() {
super.initGui();
if (showSides()) {
for (int i = 0; i < 6; i++) {
String sideName = PneumaticCraftUtils.getOrientationName(ForgeDirection.getOrientation(i));
GuiCheckBox checkBox = new GuiCheckBox(i, guiLeft + 4, guiTop + 30 + i * 12, 0xFF000000, sideName);
checkBox.checked = ((ProgWidgetInventoryBase) widget).getSides()[i];
addWidget(checkBox);
}
}
useItemCount = new GuiCheckBox(6, guiLeft + 4, guiTop + (showSides() ? 115 : 30), 0xFF000000, 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);
}
use of pneumaticCraft.client.gui.widget.GuiCheckBox in project PneumaticCraft by MineMaarten.
the class GuiProgWidgetItemFilter method actionPerformed.
@Override
public void actionPerformed(IGuiWidget guiWidget) {
if (guiWidget instanceof GuiCheckBox) {
GuiCheckBox checkBox = (GuiCheckBox) guiWidget;
switch(checkBox.getID()) {
case 0:
widg.useMetadata = checkBox.checked;
incButton.enabled = checkBoxUseDamage.enabled && checkBoxUseDamage.checked;
decButton.enabled = checkBoxUseDamage.enabled && checkBoxUseDamage.checked;
break;
case 2:
widg.useNBT = checkBox.checked;
break;
case 3:
widg.useOreDict = checkBox.checked;
checkBoxUseDamage.enabled = !checkBox.checked;
checkBoxUseNBT.enabled = !checkBox.checked;
checkBoxUseModSimilarity.enabled = !checkBox.checked;
incButton.enabled = checkBoxUseDamage.enabled && checkBoxUseDamage.checked;
decButton.enabled = checkBoxUseDamage.enabled && checkBoxUseDamage.checked;
break;
case 4:
widg.useModSimilarity = checkBox.checked;
checkBoxUseDamage.enabled = !checkBox.checked;
checkBoxUseNBT.enabled = !checkBox.checked;
checkBoxUseOreDict.enabled = !checkBox.checked;
incButton.enabled = checkBoxUseDamage.enabled && checkBoxUseDamage.checked;
decButton.enabled = checkBoxUseDamage.enabled && checkBoxUseDamage.checked;
break;
}
}
super.actionPerformed(guiWidget);
}
Aggregations