use of net.minecraft.client.gui.Gui in project RFToolsControl by McJty.
the class IntegerEditor method build.
@Override
public void build(Minecraft mc, Gui gui, Panel panel, ParameterEditorCallback callback) {
Panel constantPanel = new Panel(mc, gui).setLayout(new HorizontalLayout());
field = new TextField(mc, gui).addTextEvent((parent, newText) -> callback.valueChanged(readValue())).addTextEnterEvent((parent, newText) -> closeWindow());
constantPanel.addChild(field);
hexMode = new ToggleButton(mc, gui).addButtonEvent(widget -> updateHex()).setCheckMarker(true).setText("Hex");
constantPanel.addChild(hexMode);
createEditorPanel(mc, gui, panel, callback, constantPanel, ParameterType.PAR_INTEGER);
}
use of net.minecraft.client.gui.Gui 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 net.minecraft.client.gui.Gui in project BiomesOPlenty by Glitchfiend.
the class GuiBOPPageTable method resetRows.
private void resetRows() {
this.allRows.clear();
for (int i = 0; i < this.fields.length; i += 2) {
GuiBOPPageList.GuiFieldEntry guilistentryLeft = this.fields[i];
GuiBOPPageList.GuiFieldEntry guilistentryRight = i < this.fields.length - 1 ? this.fields[i + 1] : null;
Gui guiLeft = this.fieldIdToGuiMap.get(guilistentryLeft.getFieldId());
Gui guiRight = guilistentryRight != null ? this.fieldIdToGuiMap.get(guilistentryRight.getFieldId()) : null;
GuiBOPPageList.GuiRowEntry guientry = new GuiBOPPageList.GuiRowEntry(guiLeft, guiRight);
this.allRows.add(guientry);
}
}
use of net.minecraft.client.gui.Gui in project BiomesOPlenty by Glitchfiend.
the class GuiBOPPageTable method setVisible.
@Override
public void setVisible(boolean isVisible) {
if (isVisible) {
for (GuiBOPPageList.GuiFieldEntry field : this.fields) {
if (field != null) {
Gui gui = this.fieldIdToGuiMap.get(field.getFieldId());
this.setVisible(gui, true);
}
}
} else {
for (GuiBOPPageList.GuiFieldEntry field : this.fields) {
if (field != null) {
Gui gui = this.fieldIdToGuiMap.get(field.getFieldId());
this.setVisible(gui, false);
}
}
}
}
use of net.minecraft.client.gui.Gui in project BiomesOPlenty by Glitchfiend.
the class GuiBOPPageTable method setup.
@Override
public void setup() {
// go through the fields in twos (so they go in 2 columns)
for (int k = 0; k < fields.length; k += 2) {
GuiBOPPageList.GuiFieldEntry fieldLeft = fields[k];
GuiBOPPageList.GuiFieldEntry fieldRight = k < fields.length - 1 ? fields[k + 1] : null;
Gui guiLeft = this.createGui(fieldLeft, 0, fieldRight == null);
Gui guiRight = this.createGui(fieldRight, 160, fieldLeft == null);
GuiBOPPageList.GuiRowEntry row = new GuiBOPPageList.GuiRowEntry(guiLeft, guiRight);
this.allRows.add(row);
if (fieldLeft != null && guiLeft != null) {
this.fieldIdToGuiMap.put(fieldLeft.getFieldId(), guiLeft);
if (guiLeft instanceof GuiTextField) {
this.allTextFieldGuis.add((GuiTextField) guiLeft);
}
}
if (fieldRight != null && guiRight != null) {
this.fieldIdToGuiMap.put(fieldRight.getFieldId(), guiRight);
if (guiRight instanceof GuiTextField) {
this.allTextFieldGuis.add((GuiTextField) guiRight);
}
}
}
this.resetRows();
}
Aggregations