use of com.cleanroommc.multiblocked.api.gui.widget.imp.SceneWidget in project Multiblocked by CleanroomMC.
the class ComponentWidget method createScene.
@SideOnly(Side.CLIENT)
protected WidgetGroup createScene(int x, int y, String text, String tips, IRenderer init, Consumer<IRenderer> onUpdate) {
TrackedDummyWorld world = new TrackedDummyWorld();
world.addBlock(BlockPos.ORIGIN, new BlockInfo(MbdComponents.DummyComponentBlock));
DummyComponentTileEntity tileEntity = (DummyComponentTileEntity) world.getTileEntity(BlockPos.ORIGIN);
tileEntity.setDefinition(new PartDefinition(new ResourceLocation(Multiblocked.MODID, "component_widget")));
tileEntity.getDefinition().baseRenderer = init;
WidgetGroup widgetGroup = new WidgetGroup(x, y, 90, 90);
widgetGroup.addWidget(new LabelWidget(0, 0, text));
widgetGroup.addWidget(new ImageWidget(0, 12, 90, 80, new ColorBorderTexture(2, 0xff4A82F7)));
widgetGroup.addWidget(new SceneWidget(0, 12, 90, 80, world).setRenderedCore(Collections.singleton(BlockPos.ORIGIN), null).setRenderSelect(false).setRenderFacing(false));
widgetGroup.addWidget(new ButtonWidget(90 - 15, 12, 15, 15, new ResourceTexture("multiblocked:textures/gui/option.png"), (cd) -> new IRendererWidget(this, tileEntity.getRenderer(), r -> {
tileEntity.getDefinition().baseRenderer = r;
onUpdate.accept(r);
})).setHoverBorderTexture(1, -1).setHoverTooltip(tips));
return widgetGroup;
}
use of com.cleanroommc.multiblocked.api.gui.widget.imp.SceneWidget in project Multiblocked by CleanroomMC.
the class PartBuilderWidget method initScene.
@SideOnly(Side.CLIENT)
private void initScene() {
TrackedDummyWorld world = new TrackedDummyWorld();
world.addBlock(BlockPos.ORIGIN, new BlockInfo(MbdComponents.DummyComponentBlock));
tileEntity = (DummyComponentTileEntity) world.getTileEntity(BlockPos.ORIGIN);
this.addWidget(new ImageWidget(30, 59, 138, 138, new GuiTextureGroup(new ColorBorderTexture(3, -1), new ColorRectTexture(0xaf444444))));
this.addWidget(new SceneWidget(30, 59, 138, 138, world).setRenderedCore(Collections.singleton(BlockPos.ORIGIN), null).setRenderSelect(false).setRenderFacing(false));
}
Aggregations