use of mcjty.lib.gui.widgets.ChoiceLabel in project RFToolsControl by McJty.
the class NumberEditor method build.
@Override
public void build(Minecraft mc, Gui gui, Panel panel, ParameterEditorCallback callback) {
Panel constantPanel = new Panel(mc, gui).setLayout(new VerticalLayout());
typeLabel = new ChoiceLabel(mc, gui).addChoices("Integer", "Long", "Float", "Double").addChoiceEvent((parent, newChoice) -> callback.valueChanged(readValue())).setDesiredWidth(60);
constantPanel.addChild(createLabeledPanel(mc, gui, "Type:", typeLabel, "Type of the number"));
field = new TextField(mc, gui).addTextEvent((parent, newText) -> callback.valueChanged(readValue())).addTextEnterEvent((parent, newText) -> closeWindow());
constantPanel.addChild(field);
createEditorPanel(mc, gui, panel, callback, constantPanel, ParameterType.PAR_NUMBER);
}
use of mcjty.lib.gui.widgets.ChoiceLabel in project RFToolsControl by McJty.
the class BooleanEditor method build.
@Override
public void build(Minecraft mc, Gui gui, Panel panel, ParameterEditorCallback callback) {
Panel constantPanel = new Panel(mc, gui).setLayout(new HorizontalLayout());
label = new ChoiceLabel(mc, gui).addChoices("*", "true", "false").addChoiceEvent((parent, newChoice) -> callback.valueChanged(readValue())).setDesiredWidth(60);
constantPanel.addChild(label);
createEditorPanel(mc, gui, panel, callback, constantPanel, ParameterType.PAR_BOOLEAN);
}
use of mcjty.lib.gui.widgets.ChoiceLabel in project RFToolsControl by McJty.
the class ExceptionEditor method build.
@Override
public void build(Minecraft mc, Gui gui, Panel panel, ParameterEditorCallback callback) {
Panel constantPanel = new Panel(mc, gui).setLayout(new HorizontalLayout());
label = new ChoiceLabel(mc, gui).setDesiredWidth(160);
label.addChoices("*");
for (ExceptionType exception : ExceptionType.values()) {
label.addChoices(exception.getCode());
}
label.addChoiceEvent((parent, newChoice) -> callback.valueChanged(readValue()));
constantPanel.addChild(label);
createEditorPanel(mc, gui, panel, callback, constantPanel, ParameterType.PAR_EXCEPTION);
}
use of mcjty.lib.gui.widgets.ChoiceLabel in project RFToolsControl by McJty.
the class InventoryEditor method build.
@Override
public void build(Minecraft mc, Gui gui, Panel panel, ParameterEditorCallback callback) {
Panel constantPanel = new Panel(mc, gui).setLayout(new VerticalLayout());
nameLabel = new TextField(mc, gui).addTextEvent((o, text) -> callback.valueChanged(readValue())).addTextEnterEvent((parent, newText) -> closeWindow()).setDesiredWidth(50).setDesiredHeight(14);
constantPanel.addChild(createLabeledPanel(mc, gui, "Node name:", nameLabel, "Optional name of a node in the network"));
sideLabel = new ChoiceLabel(mc, gui).addChoices("*", "Down", "Up", "North", "South", "West", "East").addChoiceEvent((parent, newChoice) -> callback.valueChanged(readValue())).setDesiredWidth(60);
constantPanel.addChild(createLabeledPanel(mc, gui, "Side:", sideLabel, "Side relative to processor or node", "for the desired inventory"));
intSideLabel = new ChoiceLabel(mc, gui).addChoices("*", "Down", "Up", "North", "South", "West", "East").addChoiceEvent((parent, newChoice) -> callback.valueChanged(readValue())).setDesiredWidth(60);
constantPanel.addChild(createLabeledPanel(mc, gui, "Access:", intSideLabel, "Optional side from which we want to", "access the given inventory"));
createEditorPanel(mc, gui, panel, callback, constantPanel, ParameterType.PAR_INVENTORY);
}
use of mcjty.lib.gui.widgets.ChoiceLabel in project RFTools by McJty.
the class GuiInvChecker method initGui.
@Override
public void initGui() {
super.initGui();
Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout());
amountField = new TextField(mc, this).setTooltips("Set the amount of items in slot").setLayoutHint(new PositionalLayout.PositionalHint(60, 19, 80, 14)).addTextEvent((parent, newText) -> setAmount());
int amount = tileEntity.getAmount();
amountField.setText(String.valueOf(amount));
slotField = new TextField(mc, this).setTooltips("Set the slot index").setLayoutHint(new PositionalLayout.PositionalHint(60, 3, 80, 14)).addTextEvent((parent, newText) -> setSlot());
int current = tileEntity.getSlot();
slotField.setText(String.valueOf(current));
metaLabel = new ChoiceLabel(mc, this).addChoices(META_IGNORE, META_MATCH).addChoiceEvent((parent, newChoice) -> setMetaUsage()).setChoiceTooltip(META_IGNORE, "Ignore meta/damage on item").setChoiceTooltip(META_MATCH, "Meta/damage on item must match");
metaLabel.setLayoutHint(new PositionalLayout.PositionalHint(60, 35, 80, 14));
metaLabel.setChoice(tileEntity.isUseMeta() ? META_MATCH : META_IGNORE);
oreDictLabel = new ChoiceLabel(mc, this).addChoices(OREDICT_IGNORE, OREDICT_USE).addChoiceEvent((parent, newChoice) -> setOredictUsage()).setChoiceTooltip(OREDICT_IGNORE, "Ingore ore dictionary").setChoiceTooltip(OREDICT_USE, "Use ore dictionary matching");
oreDictLabel.setLayoutHint(new PositionalLayout.PositionalHint(60, 51, 80, 14));
oreDictLabel.setChoice(tileEntity.isOreDict() ? OREDICT_USE : OREDICT_IGNORE);
toplevel.addChild(new Label(mc, this).setText("Slot:").setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT).setLayoutHint(new PositionalLayout.PositionalHint(10, 3, 50, 14))).addChild(slotField).addChild(new Label(mc, this).setText("Amount:").setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT).setLayoutHint(new PositionalLayout.PositionalHint(10, 19, 50, 14))).addChild(amountField).addChild(new Label(mc, this).setText("Meta:").setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT).setLayoutHint(new PositionalLayout.PositionalHint(10, 35, 50, 14))).addChild(metaLabel).addChild(new Label(mc, this).setText("Oredict:").setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT).setLayoutHint(new PositionalLayout.PositionalHint(10, 51, 50, 14))).addChild(oreDictLabel);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
window = new Window(this, toplevel);
}
Aggregations