use of mcjty.lib.gui.Window in project RFTools by McJty.
the class GuiSequencer method initGui.
@Override
public void initGui() {
super.initGui();
Panel toplevel = new Panel(mc, this).setFilledRectThickness(2).setLayout(new VerticalLayout());
initGuiGrid(toplevel);
Button clearButton = new Button(mc, this).setText("Clear").setTooltips("Clear the grid").setDesiredHeight(13).setDesiredWidth(38).addButtonEvent(parent -> fillGrid());
Button flipButton = new Button(mc, this).setText("Flip").setTooltips("Invert all values in the grid").setDesiredHeight(13).setDesiredWidth(34).addButtonEvent(parent -> flipGrid());
Label endLabel = new Label(mc, this).setText("End on:");
ImageChoiceLabel choiceLabel = new ImageChoiceLabel(mc, this).addChoiceEvent((parent, newChoice) -> setEndState(newChoice)).setDesiredHeight(11).addChoice("0", "Disabled", iconGuiElements, 160, 0).addChoice("1", "Enabled", iconGuiElements, 176, 0);
choiceLabel.setCurrentChoice(tileEntity.getEndState() ? 1 : 0);
Panel buttonPanel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(clearButton).addChild(flipButton).addChild(endLabel).addChild(choiceLabel);
toplevel.addChild(buttonPanel);
initGuiMode();
Label speedLabel = new Label(mc, this).setText("Delay:");
speedField = new TextField(mc, this).addTextEvent((parent, newText) -> setDelay());
int delay = tileEntity.getDelay();
if (delay <= 0) {
delay = 1;
}
speedField.setText(String.valueOf(delay));
Panel bottomPanel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(mode).addChild(speedLabel).addChild(speedField);
toplevel.addChild(bottomPanel);
Label countLabel = new Label(mc, this).setText("Sequence length:");
countField = new TextField(mc, this).addTextEvent((parent, newText) -> setCount());
int count = tileEntity.getStepCount();
if (count < 1 || count > 64) {
count = 64;
}
countField.setText(String.valueOf(count));
Panel countPanel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(countLabel).addChild(countField);
toplevel.addChild(countPanel);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, SEQUENCER_WIDTH, SEQUENCER_HEIGHT));
window = new Window(this, toplevel);
}
use of mcjty.lib.gui.Window in project RFTools by McJty.
the class GuiLiquidMonitor method initGui.
@Override
public void initGui() {
super.initGui();
list = new WidgetList(mc, this).addSelectionEvent(new DefaultSelectionEvent() {
@Override
public void select(Widget parent, int index) {
setSelectedBlock(index);
}
});
listDirty = 0;
Slider listSlider = new Slider(mc, this).setDesiredWidth(10).setVertical().setScrollable(list);
Panel listPanel = new Panel(mc, this).setLayout(new HorizontalLayout().setHorizontalMargin(3).setSpacing(1)).addChild(list).addChild(listSlider);
alarmModeChoiceLabel = new ChoiceLabel(mc, this).addChoices(RFMonitorMode.MODE_OFF.getDescription(), RFMonitorMode.MODE_LESS.getDescription(), RFMonitorMode.MODE_MORE.getDescription()).setDesiredWidth(60).setDesiredHeight(15).setTooltips("Control when a redstone", "signal should be sent").addChoiceEvent((parent, newChoice) -> changeAlarmMode(RFMonitorMode.getModeFromDescription(newChoice)));
alarmModeChoiceLabel.setChoice(tileEntity.getAlarmMode().getDescription());
alarmLabel = new ScrollableLabel(mc, this).setSuffix("%").setDesiredWidth(30).setRealMinimum(0).setRealMaximum(100).setRealValue(tileEntity.getAlarmLevel()).addValueEvent((parent, newValue) -> changeAlarmValue(newValue));
Slider alarmSlider = new Slider(mc, this).setDesiredHeight(15).setMinimumKnobSize(15).setHorizontal().setTooltips("Alarm level").setScrollable(alarmLabel);
Panel alarmPanel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(alarmModeChoiceLabel).addChild(alarmSlider).addChild(alarmLabel).setDesiredHeight(20);
Panel toplevel = new Panel(mc, this).setFilledRectThickness(2).setLayout(new VerticalLayout()).addChild(listPanel).addChild(alarmPanel);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
window = new Window(this, toplevel);
fromServer_clientAdjacentBlocks = new ArrayList<>();
RFToolsMessages.INSTANCE.sendToServer(new PacketGetAdjacentTankBlocks(tileEntity.getPos()));
}
use of mcjty.lib.gui.Window in project RFTools by McJty.
the class GuiRFMonitor method initGui.
@Override
public void initGui() {
super.initGui();
list = new WidgetList(mc, this).addSelectionEvent(new DefaultSelectionEvent() {
@Override
public void select(Widget parent, int index) {
setSelectedBlock(index);
}
});
listDirty = 0;
Slider listSlider = new Slider(mc, this).setDesiredWidth(10).setVertical().setScrollable(list);
Panel listPanel = new Panel(mc, this).setLayout(new HorizontalLayout().setHorizontalMargin(3).setSpacing(1)).addChild(list).addChild(listSlider);
alarmModeChoiceLabel = new ChoiceLabel(mc, this).addChoices(RFMonitorMode.MODE_OFF.getDescription(), RFMonitorMode.MODE_LESS.getDescription(), RFMonitorMode.MODE_MORE.getDescription()).setDesiredWidth(60).setDesiredHeight(15).setTooltips("Control when a redstone", "signal should be sent").addChoiceEvent((parent, newChoice) -> changeAlarmMode(RFMonitorMode.getModeFromDescription(newChoice)));
alarmModeChoiceLabel.setChoice(tileEntity.getAlarmMode().getDescription());
alarmLabel = new ScrollableLabel(mc, this).setSuffix("%").setDesiredWidth(30).setRealMinimum(0).setRealMaximum(100).setRealValue(tileEntity.getAlarmLevel()).addValueEvent((parent, newValue) -> changeAlarmValue(newValue));
Slider alarmSlider = new Slider(mc, this).setDesiredHeight(15).setHorizontal().setMinimumKnobSize(15).setTooltips("Alarm level").setScrollable(alarmLabel);
Panel alarmPanel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(alarmModeChoiceLabel).addChild(alarmSlider).addChild(alarmLabel).setDesiredHeight(20);
Panel toplevel = new Panel(mc, this).setFilledRectThickness(2).setLayout(new VerticalLayout()).addChild(listPanel).addChild(alarmPanel);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
window = new Window(this, toplevel);
fromServer_clientAdjacentBlocks = new ArrayList<>();
RFToolsMessages.INSTANCE.sendToServer(new PacketGetAdjacentBlocks(tileEntity.getPos()));
}
use of mcjty.lib.gui.Window 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);
}
use of mcjty.lib.gui.Window in project RFTools by McJty.
the class GuiCoalGenerator method initGui.
@Override
public void initGui() {
super.initGui();
int maxEnergyStored = tileEntity.getMaxEnergyStored();
energyBar = new EnergyBar(mc, this).setVertical().setMaxValue(maxEnergyStored).setLayoutHint(new PositionalLayout.PositionalHint(10, 7, 8, 54)).setShowText(false);
energyBar.setValue(GenericEnergyStorageTileEntity.getCurrentRF());
initRedstoneMode();
Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout()).addChild(energyBar).addChild(redstoneMode);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
window = new Window(this, toplevel);
tileEntity.requestRfFromServer(RFTools.MODID);
}
Aggregations