Search in sources :

Example 11 with ChoiceLabel

use of mcjty.lib.gui.widgets.ChoiceLabel in project RFToolsControl by McJty.

the class SideEditor 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"));
    label = 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:", label, "Side relative to processor or node", "for the desired block"));
    createEditorPanel(mc, gui, panel, callback, constantPanel, ParameterType.PAR_SIDE);
}
Also used : Window(mcjty.lib.gui.Window) ParameterType(mcjty.rftoolscontrol.api.parameters.ParameterType) TextField(mcjty.lib.gui.widgets.TextField) Gui(net.minecraft.client.gui.Gui) Panel(mcjty.lib.gui.widgets.Panel) ParameterValue(mcjty.rftoolscontrol.api.parameters.ParameterValue) Minecraft(net.minecraft.client.Minecraft) BlockSide(mcjty.rftoolscontrol.api.parameters.BlockSide) EnumFacing(net.minecraft.util.EnumFacing) ChoiceLabel(mcjty.lib.gui.widgets.ChoiceLabel) VerticalLayout(mcjty.lib.gui.layout.VerticalLayout) StringUtils(org.apache.commons.lang3.StringUtils) Panel(mcjty.lib.gui.widgets.Panel) ChoiceLabel(mcjty.lib.gui.widgets.ChoiceLabel) VerticalLayout(mcjty.lib.gui.layout.VerticalLayout) TextField(mcjty.lib.gui.widgets.TextField)

Aggregations

ChoiceLabel (mcjty.lib.gui.widgets.ChoiceLabel)11 Panel (mcjty.lib.gui.widgets.Panel)10 Window (mcjty.lib.gui.Window)8 PositionalLayout (mcjty.lib.gui.layout.PositionalLayout)5 TextField (mcjty.lib.gui.widgets.TextField)5 Argument (mcjty.lib.network.Argument)5 Label (mcjty.lib.gui.widgets.Label)4 java.awt (java.awt)3 GenericGuiContainer (mcjty.lib.container.GenericGuiContainer)3 HorizontalAlignment (mcjty.lib.gui.layout.HorizontalAlignment)3 VerticalLayout (mcjty.lib.gui.layout.VerticalLayout)3 RFTools (mcjty.rftools.RFTools)3 RFToolsMessages (mcjty.rftools.network.RFToolsMessages)3 ParameterType (mcjty.rftoolscontrol.api.parameters.ParameterType)3 ParameterValue (mcjty.rftoolscontrol.api.parameters.ParameterValue)3 Minecraft (net.minecraft.client.Minecraft)3 Gui (net.minecraft.client.gui.Gui)3 ResourceLocation (net.minecraft.util.ResourceLocation)3 HorizontalLayout (mcjty.lib.gui.layout.HorizontalLayout)2 EnumFacing (net.minecraft.util.EnumFacing)2