use of com.lowdragmc.lowdraglib.gui.widget.SceneWidget in project Multiblocked by Low-Drag-MC.
the class PartBuilderWidget method initScene.
@OnlyIn(Dist.CLIENT)
private void initScene() {
TrackedDummyWorld world = new TrackedDummyWorld();
world.addBlock(BlockPos.ZERO, BlockInfo.fromBlockState(MbdComponents.DummyComponentBlock.defaultBlockState()));
tileEntity = (DummyComponentTileEntity) world.getBlockEntity(BlockPos.ZERO);
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.ZERO), null).setRenderSelect(false).setRenderFacing(false));
this.addWidget(new ImageWidget(30, 65, 138, 15, textTexture = new TextTexture("", 0xff00ff00).setDropShadow(true).setWidth(138).setType(TextTexture.TextType.ROLL)));
}
use of com.lowdragmc.lowdraglib.gui.widget.SceneWidget in project Multiblocked by Low-Drag-MC.
the class ComponentWidget method createScene.
@OnlyIn(Dist.CLIENT)
protected WidgetGroup createScene(int x, int y, String text, String tips, IMultiblockedRenderer init, Consumer<IMultiblockedRenderer> onUpdate) {
TrackedDummyWorld world = new TrackedDummyWorld();
world.addBlock(BlockPos.ZERO, BlockInfo.fromBlockState(MbdComponents.DummyComponentBlock.defaultBlockState()));
DummyComponentTileEntity tileEntity = (DummyComponentTileEntity) world.getBlockEntity(BlockPos.ZERO);
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.ZERO), 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).setHoverTooltips(tips));
return widgetGroup;
}
Aggregations