Search in sources :

Example 1 with TriplePlaneMirror

use of com.simibubi.create.content.curiosities.symmetry.mirror.TriplePlaneMirror in project Create by Creators-of-Create.

the class SymmetryWandScreen method init.

@Override
public void init() {
    setWindowSize(background.width, background.height);
    setWindowOffset(-20, 0);
    super.init();
    int x = guiLeft;
    int y = guiTop;
    labelType = new Label(x + 49, y + 28, TextComponent.EMPTY).colored(0xFFFFFFFF).withShadow();
    labelAlign = new Label(x + 49, y + 50, TextComponent.EMPTY).colored(0xFFFFFFFF).withShadow();
    int state = currentElement instanceof TriplePlaneMirror ? 2 : currentElement instanceof CrossPlaneMirror ? 1 : 0;
    areaType = new SelectionScrollInput(x + 45, y + 21, 109, 18).forOptions(SymmetryMirror.getMirrors()).titled(mirrorType.plainCopy()).writingTo(labelType).setState(state);
    areaType.calling(position -> {
        switch(position) {
            case 0:
                currentElement = new PlaneMirror(currentElement.getPosition());
                break;
            case 1:
                currentElement = new CrossPlaneMirror(currentElement.getPosition());
                break;
            case 2:
                currentElement = new TriplePlaneMirror(currentElement.getPosition());
                break;
            default:
                break;
        }
        initAlign(currentElement, x, y);
    });
    initAlign(currentElement, x, y);
    addRenderableWidget(labelAlign);
    addRenderableWidget(areaType);
    addRenderableWidget(labelType);
    confirmButton = new IconButton(x + background.width - 33, y + background.height - 24, AllIcons.I_CONFIRM);
    confirmButton.withCallback(() -> {
        onClose();
    });
    addRenderableWidget(confirmButton);
}
Also used : TriplePlaneMirror(com.simibubi.create.content.curiosities.symmetry.mirror.TriplePlaneMirror) CrossPlaneMirror(com.simibubi.create.content.curiosities.symmetry.mirror.CrossPlaneMirror) PlaneMirror(com.simibubi.create.content.curiosities.symmetry.mirror.PlaneMirror) IconButton(com.simibubi.create.foundation.gui.widget.IconButton) Label(com.simibubi.create.foundation.gui.widget.Label) CrossPlaneMirror(com.simibubi.create.content.curiosities.symmetry.mirror.CrossPlaneMirror) TriplePlaneMirror(com.simibubi.create.content.curiosities.symmetry.mirror.TriplePlaneMirror) SelectionScrollInput(com.simibubi.create.foundation.gui.widget.SelectionScrollInput)

Aggregations

CrossPlaneMirror (com.simibubi.create.content.curiosities.symmetry.mirror.CrossPlaneMirror)1 PlaneMirror (com.simibubi.create.content.curiosities.symmetry.mirror.PlaneMirror)1 TriplePlaneMirror (com.simibubi.create.content.curiosities.symmetry.mirror.TriplePlaneMirror)1 IconButton (com.simibubi.create.foundation.gui.widget.IconButton)1 Label (com.simibubi.create.foundation.gui.widget.Label)1 SelectionScrollInput (com.simibubi.create.foundation.gui.widget.SelectionScrollInput)1