Search in sources :

Example 1 with GuiSimpleButton

use of mods.railcraft.client.gui.buttons.GuiSimpleButton in project Railcraft by Railcraft.

the class GuiTradeStation method initGui.

@Override
public void initGui() {
    super.initGui();
    buttonList.clear();
    int w = (width - xSize) / 2;
    int h = (height - ySize) / 2;
    buttonList.add(new GuiSimpleButton(0, w + 118, h + 64, 10, StandardButtonTextureSets.LEFT_BUTTON, ""));
    buttonList.add(new GuiSimpleButton(1, w + 156, h + 64, 10, StandardButtonTextureSets.RIGHT_BUTTON, ""));
    GuiSimpleButton[] dice = new GuiSimpleButton[3];
    ToolTip tip = ToolTip.buildToolTip("gui.railcraft.trade.station.dice.tips");
    if (tip != null)
        tip.get(0).format = TextFormatting.YELLOW;
    for (int b = 0; b < 3; b++) {
        dice[b] = new GuiSimpleButton(2 + b, w + 93, h + 24 + 21 * b, 16, StandardButtonTextureSets.DICE_BUTTON, "");
        dice[b].setToolTip(tip);
        buttonList.add(dice[b]);
    }
}
Also used : ToolTip(mods.railcraft.common.gui.tooltips.ToolTip) GuiSimpleButton(mods.railcraft.client.gui.buttons.GuiSimpleButton)

Example 2 with GuiSimpleButton

use of mods.railcraft.client.gui.buttons.GuiSimpleButton in project Railcraft by Railcraft.

the class GuiRoutingTable method initGui.

/**
     * Adds the buttons (and other controls) to the screen in question.
     */
@Override
public void initGui() {
    super.initGui();
    buttonList.clear();
    Keyboard.enableRepeatEvents(true);
    if (editable) {
        List<GuiSimpleButton> buttons = new ArrayList<GuiSimpleButton>();
        buttons.add(buttonSign = new GuiSimpleButton(3, 0, 4 + bookImageHeight, 65, LocalizationPlugin.translate(TABLE_LOC_TAG + "name")));
        buttons.add(buttonHelp = new GuiSimpleButton(4, 0, 4 + bookImageHeight, 65, LocalizationPlugin.translate("gui.railcraft.help")));
        buttons.add(buttonDone = new GuiSimpleButton(0, 0, 4 + bookImageHeight, 65, I18n.translateToLocal("gui.done")));
        GuiTools.newButtonRowAuto(buttonList, width / 2 - 100, 200, buttons);
    } else
        buttonList.add(buttonDone = new GuiSimpleButton(0, width / 2 - 100, 4 + bookImageHeight, 200, I18n.translateToLocal("gui.done")));
    int xOffset = (width - bookImageWidth) / 2;
    byte yOffset = 2;
    buttonList.add(buttonNextPage = new GuiButtonRoutingTableNextPage(1, xOffset + 200, yOffset + 154, true));
    buttonList.add(buttonPreviousPage = new GuiButtonRoutingTableNextPage(2, xOffset + 30, yOffset + 154, false));
    updateButtons();
}
Also used : GuiButtonRoutingTableNextPage(mods.railcraft.client.gui.buttons.GuiButtonRoutingTableNextPage) GuiSimpleButton(mods.railcraft.client.gui.buttons.GuiSimpleButton) ArrayList(java.util.ArrayList)

Aggregations

GuiSimpleButton (mods.railcraft.client.gui.buttons.GuiSimpleButton)2 ArrayList (java.util.ArrayList)1 GuiButtonRoutingTableNextPage (mods.railcraft.client.gui.buttons.GuiButtonRoutingTableNextPage)1 ToolTip (mods.railcraft.common.gui.tooltips.ToolTip)1