use of lumien.randomthings.client.gui.elements.GuiCustomButton in project Random-Things by lumien231.
the class GuiVoxelProjector method initGui.
@Override
public void initGui() {
super.initGui();
this.buttonList.add(new GuiSlider(0, this.guiLeft + 5, this.guiTop + 90, 120, 20, "Model Rotation: ", "", 0, 360, this.te.getModelRotation(), false, true, new GuiSlider.ISlider() {
@Override
public void onChangeSliderValue(GuiSlider slider) {
int rotation = slider.getValueInt();
GuiVoxelProjector.this.te.setModelRotation(rotation);
if (rotation != GuiVoxelProjector.this.oldRotation) {
GuiVoxelProjector.this.oldRotation = (int) Math.floor(slider.sliderValue * 360);
MessageVoxelProjector message = new MessageVoxelProjector(GuiVoxelProjector.this.te.getPos());
message.setModelRotation(rotation);
PacketHandler.INSTANCE.sendToServer(message);
}
}
}));
this.buttonList.add(new GuiSlider(1, this.guiLeft + 5, this.guiTop + 60, 120, 20, "Scale: ", "", 1, 20, this.te.getScale(), false, true, new GuiSlider.ISlider() {
@Override
public void onChangeSliderValue(GuiSlider slider) {
int scale = slider.getValueInt();
GuiVoxelProjector.this.te.setScale(scale);
if (scale != GuiVoxelProjector.this.oldScale) {
GuiVoxelProjector.this.oldScale = scale;
MessageVoxelProjector message = new MessageVoxelProjector(GuiVoxelProjector.this.te.getPos());
message.setScale(scale);
PacketHandler.INSTANCE.sendToServer(message);
}
}
}));
this.buttonList.add(new GuiSlider(2, this.guiLeft + 5, this.guiTop + 120, 120, 20, "Rotation Speed: ", "", 0, 40, this.te.getRotationSpeed(), false, true, new GuiSlider.ISlider() {
@Override
public void onChangeSliderValue(GuiSlider slider) {
int rotationSpeed = slider.getValueInt();
GuiVoxelProjector.this.te.setRotationSpeed(rotationSpeed);
if (rotationSpeed != GuiVoxelProjector.this.oldRotationSpeed) {
GuiVoxelProjector.this.oldRotationSpeed = rotationSpeed;
MessageVoxelProjector message = new MessageVoxelProjector(GuiVoxelProjector.this.te.getPos());
message.setRotationSpeed(rotationSpeed);
PacketHandler.INSTANCE.sendToServer(message);
}
}
}));
toggleAmbientLight = new GuiCustomButton(this, 3, te.ambientLight(), this.guiLeft + xSize - 25, this.guiTop + 60, 20, 20, "", buttons, 0, 0);
toggleRandomizer = new GuiCustomButton(this, 4, te.randomize(), this.guiLeft + xSize - 25, this.guiTop + 85, 20, 20, "", buttons, 42, 0);
this.buttonList.add(toggleAmbientLight);
this.buttonList.add(toggleRandomizer);
availableModels = new GuiStringList(this, Minecraft.getMinecraft(), 120, 50, this.guiLeft + 5, this.guiTop + 150, width, height, Lists.<String>newArrayList());
}
use of lumien.randomthings.client.gui.elements.GuiCustomButton in project Random-Things by lumien231.
the class GuiChatDetector method initGui.
@Override
public void initGui() {
super.initGui();
chatMessageInput = new GuiTextField(0, this.fontRenderer, (width / 2 - xSize / 2) + 5, (height / 2), 127, 20);
chatMessageInput.setFocused(false);
chatMessageInput.setCanLoseFocus(true);
chatMessageInput.setText(te.getChatMessage());
consumeButton = new GuiCustomButton(this, 0, te.consume(), guiLeft + 112, guiTop + 5, 20, 20, "", background, 136, 0);
this.buttonList.add(consumeButton);
}
use of lumien.randomthings.client.gui.elements.GuiCustomButton in project Random-Things by lumien231.
the class GuiGlobalChatDetector method initGui.
@Override
public void initGui() {
super.initGui();
chatMessageInput = new GuiTextField(0, this.fontRenderer, (width / 2 - xSize / 2) + 8, guiTop + 20, 127, 15);
chatMessageInput.setFocused(false);
chatMessageInput.setCanLoseFocus(true);
chatMessageInput.setText(te.getChatMessage());
consumeButton = new GuiCustomButton(this, 0, te.consume(), guiLeft + 151, guiTop + 5, 20, 20, "", background, 176, 0);
this.buttonList.add(consumeButton);
}
use of lumien.randomthings.client.gui.elements.GuiCustomButton in project Random-Things by lumien231.
the class GuiItemFilter method actionPerformed.
@Override
protected void actionPerformed(GuiButton pressedButton) {
if (pressedButton instanceof GuiCustomButton) {
((GuiCustomButton) pressedButton).toggle();
}
MessageItemFilter message = new MessageItemFilter(pressedButton.id);
PacketHandler.INSTANCE.sendToServer(message);
}
use of lumien.randomthings.client.gui.elements.GuiCustomButton in project Random-Things by lumien231.
the class GuiEntityDetector method initGui.
@Override
public void initGui() {
super.initGui();
minusX = new GuiButtonExt(0, this.guiLeft + 15 + 24, this.guiTop + 25, 10, 10, "-");
plusX = new GuiButtonExt(1, this.guiLeft + 15 + 90 + 14, this.guiTop + 25, 10, 10, "+");
minusY = new GuiButtonExt(2, this.guiLeft + 15 + 24, this.guiTop + 45, 10, 10, "-");
plusY = new GuiButtonExt(3, this.guiLeft + 15 + 90 + 14, this.guiTop + 45, 10, 10, "+");
minusZ = new GuiButtonExt(4, this.guiLeft + 15 + 24, this.guiTop + 65, 10, 10, "-");
plusZ = new GuiButtonExt(5, this.guiLeft + 15 + 90 + 14, this.guiTop + 65, 10, 10, "+");
filter = new GuiButtonExt(6, this.guiLeft + 15 + 5, this.guiTop + 95, 70, 16, "");
invert = new GuiCustomButton(this, 7, entityDetector.invert(), this.guiLeft + 15 + 77, this.guiTop + 93, 20, 20, "", background, 176, 0, 20, 20);
invert.setToolTips("tooltip.entityDetector.normalOutput", "tooltip.entityDetector.invertedOutput");
strongOutput = new GuiCustomButton(this, 8, entityDetector.strongOutput(), this.guiLeft + 15 + 100, this.guiTop + 93, 20, 20, "", background, 216, 0, 20, 20);
strongOutput.setToolTips("tooltip.entityDetector.weakOutput", "tooltip.entityDetector.strongOutput");
this.buttonList.add(minusX);
this.buttonList.add(plusX);
this.buttonList.add(minusY);
this.buttonList.add(plusY);
this.buttonList.add(minusZ);
this.buttonList.add(plusZ);
this.buttonList.add(filter);
this.buttonList.add(strongOutput);
this.buttonList.add(invert);
}
Aggregations