Search in sources :

Example 1 with IActionWidgetLabeled

use of me.desht.pneumaticcraft.common.remote.IActionWidgetLabeled in project pnc-repressurized by TeamPneumatic.

the class GuiRemoteOptionBase method initGui.

@Override
public void initGui() {
    super.initGui();
    String title = I18n.format("remote." + widget.getId() + ".name");
    addLabel(I18n.format("gui.remote.enable"), guiLeft + 10, guiTop + 150);
    addLabel(title, width / 2 - fontRenderer.getStringWidth(title) / 2, guiTop + 5);
    addLabel("#", guiLeft + 10, guiTop + 161);
    if (widget instanceof IActionWidgetLabeled) {
        addLabel(I18n.format("gui.remote.text"), guiLeft + 10, guiTop + 20);
        addLabel(I18n.format("gui.remote.tooltip"), guiLeft + 10, guiTop + 46);
    }
    addLabel(I18n.format("gui.remote.enableValue"), guiLeft + 10, guiTop + 175);
    addLabel("X:", guiLeft + 10, guiTop + 186);
    addLabel("Y:", guiLeft + 67, guiTop + 186);
    addLabel("Z:", guiLeft + 124, guiTop + 186);
    enableField = new WidgetComboBox(fontRenderer, guiLeft + 18, guiTop + 160, 152, 10);
    enableField.setElements(((ContainerRemote) guiRemote.inventorySlots).variables);
    enableField.setText(widget.getEnableVariable());
    enableField.setTooltip(I18n.format("gui.remote.enable.tooltip"));
    addWidget(enableField);
    String valueTooltip = I18n.format("gui.remote.enableValue.tooltip");
    xValueField = new WidgetTextFieldNumber(fontRenderer, guiLeft + 20, guiTop + 185, 38, 10);
    xValueField.setValue(widget.getEnablingValue().getX());
    xValueField.setTooltip(valueTooltip);
    addWidget(xValueField);
    yValueField = new WidgetTextFieldNumber(fontRenderer, guiLeft + 78, guiTop + 185, 38, 10);
    yValueField.setValue(widget.getEnablingValue().getY());
    yValueField.setTooltip(valueTooltip);
    addWidget(yValueField);
    zValueField = new WidgetTextFieldNumber(fontRenderer, guiLeft + 136, guiTop + 185, 38, 10);
    zValueField.setValue(widget.getEnablingValue().getZ());
    zValueField.setTooltip(valueTooltip);
    addWidget(zValueField);
    if (widget instanceof IActionWidgetLabeled) {
        labelField = new WidgetTextField(fontRenderer, guiLeft + 10, guiTop + 30, 160, 10);
        labelField.setText(((IActionWidgetLabeled) widget).getText());
        labelField.setTooltip(I18n.format("gui.remote.label.tooltip"));
        labelField.setMaxStringLength(1000);
        addWidget(labelField);
        tooltipField = new WidgetTextField(fontRenderer, guiLeft + 10, guiTop + 56, 160, 10);
        tooltipField.setText(((IActionWidgetLabeled) widget).getTooltip());
        addWidget(tooltipField);
    }
}
Also used : IActionWidgetLabeled(me.desht.pneumaticcraft.common.remote.IActionWidgetLabeled) WidgetTextFieldNumber(me.desht.pneumaticcraft.client.gui.widget.WidgetTextFieldNumber) WidgetComboBox(me.desht.pneumaticcraft.client.gui.widget.WidgetComboBox) WidgetTextField(me.desht.pneumaticcraft.client.gui.widget.WidgetTextField)

Aggregations

WidgetComboBox (me.desht.pneumaticcraft.client.gui.widget.WidgetComboBox)1 WidgetTextField (me.desht.pneumaticcraft.client.gui.widget.WidgetTextField)1 WidgetTextFieldNumber (me.desht.pneumaticcraft.client.gui.widget.WidgetTextFieldNumber)1 IActionWidgetLabeled (me.desht.pneumaticcraft.common.remote.IActionWidgetLabeled)1