use of mcjty.lib.gui.events.ChoiceEvent in project RFTools by McJty.
the class GuiEnvironmentalController method initRedstoneMode.
private void initRedstoneMode() {
redstoneMode = new ImageChoiceLabel(mc, this).setDesiredHeight(16).setDesiredWidth(16).addChoiceEvent(new ChoiceEvent() {
@Override
public void choiceChanged(Widget parent, String newChoice) {
changeRedstoneMode();
}
}).addChoice(RedstoneMode.REDSTONE_IGNORED.getDescription(), "Redstone mode:\nIgnored", iconGuiElements, 0, 0).addChoice(RedstoneMode.REDSTONE_OFFREQUIRED.getDescription(), "Redstone mode:\nOff to activate", iconGuiElements, 16, 0).addChoice(RedstoneMode.REDSTONE_ONREQUIRED.getDescription(), "Redstone mode:\nOn to activate", iconGuiElements, 32, 0);
redstoneMode.setCurrentChoice(tileEntity.getRedstoneMode().ordinal());
}
use of mcjty.lib.gui.events.ChoiceEvent in project RFTools by McJty.
the class GuiDevelopersDelight method initGui.
@Override
public void initGui() {
super.initGui();
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
tabbedPanel = new TabbedPanel(mc, this);
Panel tab1 = createBlockClassesPage();
Panel tab2 = createTeClassesPage();
Panel tab3 = createNbtDataPage();
tabbedPanel.addPage("Block", tab1).addPage("TE", tab2).addPage("NBT", tab3);
ToggleButton tab1Button = createToggleButton("Block");
ToggleButton tab2Button = createToggleButton("TE");
ToggleButton tab3Button = createToggleButton("NBT");
clientServerMode = new ChoiceLabel(mc, this).setDesiredWidth(60).addChoices("Server", "Client").setChoice("Server").addChoiceEvent(new ChoiceEvent() {
@Override
public void choiceChanged(Widget parent, String newChoice) {
requestNewLists();
}
}).setDesiredHeight(16).setTooltips("Switch between client", "and server information");
metaData = new TextField(mc, this).setDesiredHeight(14).setTooltips("Metadata for this block");
Panel buttonPanel = new Panel(mc, this).setLayout(new VerticalLayout()).setDesiredWidth(62).addChild(tab1Button).addChild(tab2Button).addChild(tab3Button).addChild(new Label(mc, this).setDynamic(true)).addChild(clientServerMode).addChild(metaData).addChild(new Label(mc, this).setDynamic(true));
Widget toplevel = new Panel(mc, this).setFilledRectThickness(2).setLayout(new HorizontalLayout()).addChild(buttonPanel).addChild(tabbedPanel);
toplevel.setBounds(new Rectangle(k, l, xSize, ySize));
window = new Window(this, toplevel);
requestNewLists();
}
use of mcjty.lib.gui.events.ChoiceEvent in project RFTools by McJty.
the class GuiBlockProtector method initRedstoneMode.
private void initRedstoneMode() {
redstoneMode = new ImageChoiceLabel(mc, this).addChoiceEvent(new ChoiceEvent() {
@Override
public void choiceChanged(Widget parent, String newChoice) {
changeRedstoneMode();
}
}).addChoice(RedstoneMode.REDSTONE_IGNORED.getDescription(), "Redstone mode:\nIgnored", iconGuiElements, 0, 0).addChoice(RedstoneMode.REDSTONE_OFFREQUIRED.getDescription(), "Redstone mode:\nOff to activate", iconGuiElements, 16, 0).addChoice(RedstoneMode.REDSTONE_ONREQUIRED.getDescription(), "Redstone mode:\nOn to activate", iconGuiElements, 32, 0);
redstoneMode.setLayoutHint(new PositionalLayout.PositionalHint(150, 46, 16, 16));
redstoneMode.setCurrentChoice(tileEntity.getRedstoneMode().ordinal());
}
Aggregations