use of mcjty.lib.gui.layout.HorizontalLayout in project RFTools by McJty.
the class GuiCrafter method addRecipeLine.
private void addRecipeLine(ItemStack craftingResult) {
String readableName = BlockTools.getReadableName(craftingResult);
int color = StyleConfig.colorTextInListNormal;
if (craftingResult.isEmpty()) {
readableName = "<no recipe>";
color = 0xFF505050;
}
Panel panel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(new BlockRender(mc, this).setRenderItem(craftingResult).setTooltips("Double click to edit this recipe")).addChild(new Label(mc, this).setColor(color).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT).setDynamic(true).setText(readableName).setTooltips("Double click to edit this recipe"));
recipeList.addChild(panel);
}
use of mcjty.lib.gui.layout.HorizontalLayout in project RFTools by McJty.
the class GuiChamberDetails method initGui.
@Override
public void initGui() {
super.initGui();
blockList = new WidgetList(mc, this);
Slider listSlider = new Slider(mc, this).setDesiredWidth(10).setVertical().setScrollable(blockList);
Panel listPanel = new Panel(mc, this).setLayout(new HorizontalLayout().setSpacing(1).setHorizontalMargin(3)).addChild(blockList).addChild(listSlider);
infoLabel = new Label(mc, this).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT);
infoLabel.setDesiredWidth(380).setDesiredHeight(14);
info2Label = new Label(mc, this).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT);
info2Label.setDesiredWidth(380).setDesiredHeight(14);
Panel toplevel = new Panel(mc, this).setFilledRectThickness(2).setLayout(new VerticalLayout().setSpacing(1).setVerticalMargin(3)).addChild(listPanel).addChild(infoLabel).addChild(info2Label);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
window = new Window(this, toplevel);
}
use of mcjty.lib.gui.layout.HorizontalLayout in project RFTools by McJty.
the class GuiShapeCard method initGui.
@Override
public void initGui() {
super.initGui();
this.guiLeft = (this.width - this.xSize) / 2;
this.guiTop = (this.height - this.ySize) / 2;
ItemStack heldItem = getStackToEdit();
if (heldItem.isEmpty()) {
// Cannot happen!
return;
}
isQuarryCard = ShapeCardType.fromDamage(heldItem.getItemDamage()).isQuarry();
if (isQuarryCard) {
ySize = 160 + 28;
}
getShapeRenderer().initView(getPreviewLeft(), guiTop);
shapeLabel = new ChoiceLabel(mc, this).setDesiredWidth(100).setDesiredHeight(16).addChoices(mcjty.rftools.shapes.Shape.SHAPE_BOX.getDescription(), mcjty.rftools.shapes.Shape.SHAPE_TOPDOME.getDescription(), mcjty.rftools.shapes.Shape.SHAPE_BOTTOMDOME.getDescription(), mcjty.rftools.shapes.Shape.SHAPE_SPHERE.getDescription(), mcjty.rftools.shapes.Shape.SHAPE_CYLINDER.getDescription(), mcjty.rftools.shapes.Shape.SHAPE_CAPPEDCYLINDER.getDescription(), mcjty.rftools.shapes.Shape.SHAPE_PRISM.getDescription(), mcjty.rftools.shapes.Shape.SHAPE_TORUS.getDescription(), mcjty.rftools.shapes.Shape.SHAPE_CONE.getDescription(), mcjty.rftools.shapes.Shape.SHAPE_HEART.getDescription(), mcjty.rftools.shapes.Shape.SHAPE_COMPOSITION.getDescription(), mcjty.rftools.shapes.Shape.SHAPE_SCAN.getDescription()).addChoiceEvent((parent, newChoice) -> updateSettings());
solidLabel = new ChoiceLabel(mc, this).setDesiredWidth(50).setDesiredHeight(16).addChoices("Hollow", "Solid").addChoiceEvent((parent, newChoice) -> updateSettings());
Panel shapePanel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(shapeLabel).addChild(solidLabel);
mcjty.rftools.shapes.Shape shape = ShapeCardItem.getShape(heldItem);
shapeLabel.setChoice(shape.getDescription());
boolean solid = ShapeCardItem.isSolid(heldItem);
solidLabel.setChoice(solid ? "Solid" : "Hollow");
blocksLabel = new Label(mc, this).setText("# ").setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT);
blocksLabel.setDesiredWidth(100).setDesiredHeight(16);
Panel modePanel = new Panel(mc, this).setLayout(new VerticalLayout()).setDesiredWidth(170).addChild(shapePanel).addChild(blocksLabel);
BlockPos dim = ShapeCardItem.getDimension(heldItem);
BlockPos offset = ShapeCardItem.getOffset(heldItem);
dimX = new TextField(mc, this).addTextEvent((parent, newText) -> {
if (isTorus()) {
dimZ.setText(newText);
}
updateSettings();
}).setText(String.valueOf(dim.getX()));
dimY = new TextField(mc, this).addTextEvent((parent, newText) -> updateSettings()).setText(String.valueOf(dim.getY()));
dimZ = new TextField(mc, this).addTextEvent((parent, newText) -> updateSettings()).setText(String.valueOf(dim.getZ()));
Panel dimPanel = new Panel(mc, this).setLayout(new HorizontalLayout().setHorizontalMargin(0)).addChild(new Label(mc, this).setText("Dim:").setHorizontalAlignment(HorizontalAlignment.ALIGN_RIGHT).setDesiredWidth(40)).setDesiredHeight(18).addChild(dimX).addChild(dimY).addChild(dimZ);
offsetX = new TextField(mc, this).addTextEvent((parent, newText) -> updateSettings()).setText(String.valueOf(offset.getX()));
offsetY = new TextField(mc, this).addTextEvent((parent, newText) -> updateSettings()).setText(String.valueOf(offset.getY()));
offsetZ = new TextField(mc, this).addTextEvent((parent, newText) -> updateSettings()).setText(String.valueOf(offset.getZ()));
Panel offsetPanel = new Panel(mc, this).setLayout(new HorizontalLayout().setHorizontalMargin(0)).addChild(new Label(mc, this).setText("Offset:").setHorizontalAlignment(HorizontalAlignment.ALIGN_RIGHT).setDesiredWidth(40)).setDesiredHeight(18).addChild(offsetX).addChild(offsetY).addChild(offsetZ);
Panel settingsPanel = new Panel(mc, this).setLayout(new VerticalLayout().setSpacing(1).setVerticalMargin(1).setHorizontalMargin(0)).addChild(dimPanel).addChild(offsetPanel);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
Panel modeSettingsPanel = new Panel(mc, this).setLayout(new VerticalLayout().setHorizontalMargin(0)).addChild(modePanel).addChild(settingsPanel);
modeSettingsPanel.setLayoutHint(new PositionalLayout.PositionalHint(0, 0, 180, 160));
Panel toplevel;
if (isQuarryCard) {
setupVoidPanel(heldItem);
toplevel = new Panel(mc, this).setLayout(new PositionalLayout()).setFilledRectThickness(2).addChild(modeSettingsPanel).addChild(voidPanel);
} else {
toplevel = new Panel(mc, this).setLayout(new PositionalLayout()).setFilledRectThickness(2).addChild(modeSettingsPanel);
}
toplevel.setBounds(new Rectangle(k, l, xSize, ySize));
window = new Window(this, toplevel);
}
use of mcjty.lib.gui.layout.HorizontalLayout in project RFTools by McJty.
the class GuiDevelopersDelight method createBlockClassesPage.
private Panel createBlockClassesPage() {
blockClassList = new WidgetList(mc, this);
Slider listSlider = new Slider(mc, this).setDesiredWidth(11).setVertical().setScrollable(blockClassList);
return new Panel(mc, this).setLayout(new HorizontalLayout().setSpacing(1).setHorizontalMargin(3)).addChild(blockClassList).addChild(listSlider);
}
use of mcjty.lib.gui.layout.HorizontalLayout in project RFTools by McJty.
the class GuiDevelopersDelight method createTeClassesPage.
private Panel createTeClassesPage() {
teClassList = new WidgetList(mc, this);
Slider listSlider = new Slider(mc, this).setDesiredWidth(11).setVertical().setScrollable(teClassList);
return new Panel(mc, this).setLayout(new HorizontalLayout().setSpacing(1).setHorizontalMargin(3)).addChild(teClassList).addChild(listSlider);
}
Aggregations