use of mcjty.lib.gui.layout.HorizontalLayout in project RFTools by McJty.
the class GuiShapeCard method setupVoidPanel.
private void setupVoidPanel(ItemStack heldItem) {
voidPanel = new Panel(mc, this).setLayout(new HorizontalLayout()).setDesiredHeight(26).setFilledRectThickness(-2).setFilledBackground(StyleConfig.colorListBackground);
voidPanel.setLayoutHint(new PositionalLayout.PositionalHint(5, 155, 350, 26));
Label label = new Label(mc, this).setText("Void:");
stone = new ToggleButton(mc, this).setDesiredWidth(20).setDesiredHeight(20).setTooltips("Void stone").addButtonEvent(widget -> updateVoidSettings());
cobble = new ToggleButton(mc, this).setDesiredWidth(20).setDesiredHeight(20).setTooltips("Void cobble").addButtonEvent(widget -> updateVoidSettings());
dirt = new ToggleButton(mc, this).setDesiredWidth(20).setDesiredHeight(20).setTooltips("Void dirt").addButtonEvent(widget -> updateVoidSettings());
gravel = new ToggleButton(mc, this).setDesiredWidth(20).setDesiredHeight(20).setTooltips("Void gravel").addButtonEvent(widget -> updateVoidSettings());
sand = new ToggleButton(mc, this).setDesiredWidth(20).setDesiredHeight(20).setTooltips("Void sand").addButtonEvent(widget -> updateVoidSettings());
netherrack = new ToggleButton(mc, this).setDesiredWidth(20).setDesiredHeight(20).setTooltips("Void netherrack").addButtonEvent(widget -> updateVoidSettings());
endstone = new ToggleButton(mc, this).setDesiredWidth(20).setDesiredHeight(20).setTooltips("Void end stone").addButtonEvent(widget -> updateVoidSettings());
oredict = new ToggleButton(mc, this).setDesiredWidth(60).setDesiredHeight(15).setTooltips("Enable ore dictionary matching").setText("Oredict").setCheckMarker(true).addButtonEvent(widget -> updateVoidSettings());
stone.setPressed(ShapeCardItem.isVoiding(heldItem, "stone"));
cobble.setPressed(ShapeCardItem.isVoiding(heldItem, "cobble"));
dirt.setPressed(ShapeCardItem.isVoiding(heldItem, "dirt"));
gravel.setPressed(ShapeCardItem.isVoiding(heldItem, "gravel"));
sand.setPressed(ShapeCardItem.isVoiding(heldItem, "sand"));
netherrack.setPressed(ShapeCardItem.isVoiding(heldItem, "netherrack"));
endstone.setPressed(ShapeCardItem.isVoiding(heldItem, "endstone"));
oredict.setPressed(ShapeCardItem.isOreDictionary(heldItem));
voidPanel.addChild(label).addChild(stone).addChild(cobble).addChild(dirt).addChild(gravel).addChild(sand).addChild(netherrack).addChild(endstone).addChild(oredict);
}
use of mcjty.lib.gui.layout.HorizontalLayout in project RFTools by McJty.
the class GuiDevelopersDelight method createNbtDataPage.
private Panel createNbtDataPage() {
nbtDataList = new WidgetList(mc, this);
Slider listSlider = new Slider(mc, this).setDesiredWidth(11).setVertical().setScrollable(nbtDataList);
return new Panel(mc, this).setLayout(new HorizontalLayout().setSpacing(1).setHorizontalMargin(3)).addChild(nbtDataList).addChild(listSlider);
}
use of mcjty.lib.gui.layout.HorizontalLayout 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((parent, 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));
Panel 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.layout.HorizontalLayout in project RFTools by McJty.
the class GuiDevelopersDelight method populateLists.
private void populateLists() {
if (!listsDirty) {
return;
}
if (teClasses == null || blockClasses == null || nbtData == null) {
return;
}
listsDirty = false;
blockClassList.removeChildren();
IBlockState state = Minecraft.getMinecraft().world.getBlockState(selected);
Block block = state.getBlock();
blockClassList.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setText("Loc Name: " + block.getLocalizedName()).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT));
blockClassList.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setText("Unloc Name: " + block.getUnlocalizedName()).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT));
blockClassList.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setText("Block Name: " + Block.REGISTRY.getNameForObject(block)).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT));
for (String c : blockClasses) {
blockClassList.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setText("Class: " + c).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT));
}
teClassList.removeChildren();
for (String c : teClasses) {
teClassList.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setText(c).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT));
}
nbtDataList.removeChildren();
for (Map.Entry<String, DelightingInfoHelper.NBTDescription> me : nbtData.entrySet()) {
Panel panel = new Panel(mc, this).setLayout(new HorizontalLayout());
panel.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setText(me.getKey()).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT).setDesiredWidth(70));
DelightingInfoHelper.NBTDescription value = me.getValue();
panel.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setText(value.getType()).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT).setDesiredWidth(50));
panel.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setText(value.getValue()).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT));
nbtDataList.addChild(panel);
}
metaData.setText(String.valueOf(server_metadata));
}
use of mcjty.lib.gui.layout.HorizontalLayout in project RFTools by McJty.
the class GuiTeleportProbe method populateList.
private void populateList() {
if (serverDestinationList == null) {
return;
}
if (serverDestinationList.equals(destinationList)) {
return;
}
destinationList = new ArrayList<>(serverDestinationList);
list.removeChildren();
for (TeleportDestinationClientInfo destination : destinationList) {
BlockPos coordinate = destination.getCoordinate();
int dim = destination.getDimension();
Panel panel = new Panel(mc, this).setLayout(new HorizontalLayout());
panel.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT).setText(destination.getName()).setDesiredWidth(100));
panel.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT).setText(BlockPosTools.toString(coordinate)).setDesiredWidth(75));
panel.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT).setText("Id " + dim).setDesiredWidth(75));
list.addChild(panel);
}
}
Aggregations