use of pneumaticCraft.client.gui.widget.WidgetComboBox 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());
}
use of pneumaticCraft.client.gui.widget.WidgetComboBox in project PneumaticCraft by MineMaarten.
the class GuiProgWidgetForEach method initGui.
@Override
public void initGui() {
super.initGui();
variableField = new WidgetComboBox(fontRendererObj, guiLeft + 10, guiTop + 42, 160, fontRendererObj.FONT_HEIGHT + 1);
variableField.setElements(guiProgrammer.te.getAllVariables());
addWidget(variableField);
variableField.setText(((IVariableSetWidget) widget).getVariable());
}
use of pneumaticCraft.client.gui.widget.WidgetComboBox in project PneumaticCraft by MineMaarten.
the class GuiProgWidgetItemFilter method initGui.
@Override
public void initGui() {
super.initGui();
// metaInfoStat = new GuiAnimatedStat(this, "Metadata?", Textures.GUI_INFO_LOCATION, xStart + xSize, yStart + 5, 0xFF00AA00, null, false);
buttonList.add(new GuiButton(0, guiLeft + 4, guiTop + 20, 70, 20, "Search item..."));
buttonList.add(new GuiButton(1, guiLeft + 78, guiTop + 20, 100, 20, "Search inventory..."));
decButton = new GuiButton(2, guiLeft + 140, guiTop + 85, 10, 20, "-");
incButton = new GuiButton(3, guiLeft + 167, guiTop + 85, 10, 20, "+");
buttonList.add(decButton);
buttonList.add(incButton);
checkBoxUseDamage = new GuiCheckBox(0, guiLeft + 4, guiTop + 72, 0xFF000000, "Use metadata / damage values");
checkBoxUseDamage.setTooltip(Arrays.asList(new String[] { "Check to handle differently damaged tools", "or different colors of Wool as different." }));
checkBoxUseDamage.checked = widg.useMetadata;
addWidget(checkBoxUseDamage);
checkBoxUseNBT = new GuiCheckBox(2, guiLeft + 4, guiTop + 108, 0xFF000000, "Use NBT");
checkBoxUseNBT.setTooltip(Arrays.asList(new String[] { "Check to handle items like Enchanted Books", "or Firework as different." }));
checkBoxUseNBT.checked = widg.useNBT;
addWidget(checkBoxUseNBT);
checkBoxUseOreDict = new GuiCheckBox(3, guiLeft + 4, guiTop + 120, 0xFF000000, "Use Ore Dictionary");
checkBoxUseOreDict.setTooltip(Arrays.asList(new String[] { "Check to handle items registered in the", "Ore Dictionary (like Wood) as the same." }));
checkBoxUseOreDict.checked = widg.useOreDict;
addWidget(checkBoxUseOreDict);
checkBoxUseModSimilarity = new GuiCheckBox(4, guiLeft + 4, guiTop + 132, 0xFF000000, "Use Mod similarity");
checkBoxUseModSimilarity.setTooltip(Arrays.asList(new String[] { "Check to handle items from the", "same mod as the same." }));
checkBoxUseModSimilarity.checked = widg.useModSimilarity;
addWidget(checkBoxUseModSimilarity);
variableField = new WidgetComboBox(fontRendererObj, guiLeft + 90, guiTop + 56, 80, fontRendererObj.FONT_HEIGHT + 1);
variableField.setElements(guiProgrammer.te.getAllVariables());
variableField.setText(widg.getVariable());
if (Config.getProgrammerDifficulty() == 2) {
addWidget(variableField);
}
checkBoxUseDamage.enabled = !checkBoxUseOreDict.checked && !checkBoxUseModSimilarity.checked;
incButton.enabled = checkBoxUseDamage.enabled && checkBoxUseDamage.checked;
decButton.enabled = checkBoxUseDamage.enabled && checkBoxUseDamage.checked;
checkBoxUseNBT.enabled = !checkBoxUseOreDict.checked && !checkBoxUseModSimilarity.checked;
checkBoxUseOreDict.enabled = !checkBoxUseModSimilarity.checked;
checkBoxUseModSimilarity.enabled = !checkBoxUseOreDict.checked;
if (searchGui != null)
widg.setFilter(searchGui.getSearchStack());
if (invSearchGui != null)
widg.setFilter(invSearchGui.getSearchStack());
}
use of pneumaticCraft.client.gui.widget.WidgetComboBox in project PneumaticCraft by MineMaarten.
the class GuiRemoteOptionBase method initGui.
@Override
public void initGui() {
super.initGui();
String title = I18n.format("remote." + widget.getId() + ".name");
addLabel(I18n.format("gui.remote.enable"), guiLeft + 10, guiTop + 150);
addLabel(title, width / 2 - fontRendererObj.getStringWidth(title) / 2, guiTop + 5);
addLabel("#", guiLeft + 10, guiTop + 161);
if (widget instanceof IActionWidgetLabeled) {
addLabel(I18n.format("gui.remote.text"), guiLeft + 10, guiTop + 20);
addLabel(I18n.format("gui.remote.tooltip"), guiLeft + 10, guiTop + 46);
}
addLabel(I18n.format("gui.remote.enableValue"), guiLeft + 10, guiTop + 175);
addLabel("X:", guiLeft + 10, guiTop + 186);
addLabel("Y:", guiLeft + 67, guiTop + 186);
addLabel("Z:", guiLeft + 124, guiTop + 186);
enableField = new WidgetComboBox(fontRendererObj, guiLeft + 18, guiTop + 160, 152, 10);
enableField.setElements(((ContainerRemote) guiRemote.inventorySlots).variables);
enableField.setText(widget.getEnableVariable());
enableField.setTooltip(I18n.format("gui.remote.enable.tooltip"));
addWidget(enableField);
String valueTooltip = I18n.format("gui.remote.enableValue.tooltip");
xValueField = new WidgetTextFieldNumber(fontRendererObj, guiLeft + 20, guiTop + 185, 38, 10);
xValueField.setValue(widget.getEnablingValue().chunkPosX);
xValueField.setTooltip(valueTooltip);
addWidget(xValueField);
yValueField = new WidgetTextFieldNumber(fontRendererObj, guiLeft + 78, guiTop + 185, 38, 10);
yValueField.setValue(widget.getEnablingValue().chunkPosY);
yValueField.setTooltip(valueTooltip);
addWidget(yValueField);
zValueField = new WidgetTextFieldNumber(fontRendererObj, guiLeft + 136, guiTop + 185, 38, 10);
zValueField.setValue(widget.getEnablingValue().chunkPosZ);
zValueField.setTooltip(valueTooltip);
addWidget(zValueField);
if (widget instanceof IActionWidgetLabeled) {
labelField = new WidgetTextField(fontRendererObj, guiLeft + 10, guiTop + 30, 160, 10);
labelField.setText(((IActionWidgetLabeled) widget).getText());
labelField.setTooltip(I18n.format("gui.remote.label.tooltip"));
labelField.setMaxStringLength(1000);
addWidget(labelField);
tooltipField = new WidgetTextField(fontRendererObj, guiLeft + 10, guiTop + 56, 160, 10);
tooltipField.setText(((IActionWidgetLabeled) widget).getTooltip());
addWidget(tooltipField);
}
}
use of pneumaticCraft.client.gui.widget.WidgetComboBox in project PneumaticCraft by MineMaarten.
the class ActionWidgetDropdown method getWidget.
@Override
public WidgetComboBox getWidget() {
if (widget == null) {
widget = new WidgetComboBox(Minecraft.getMinecraft().fontRenderer, x, y, width, height);
widget.setElements(getDropdownElements());
widget.setFixedOptions();
updateWidget();
}
return widget;
}
Aggregations