Java 类net.minecraft.client.gui.GuiButton 实例源码

项目:Backmemed    文件:GuiQualitySettingsOF.java   
/**
 * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
 */
protected void actionPerformed(GuiButton button)
{
    if (button.enabled)
    {
        if (button.id < 200 && button instanceof GuiOptionButton)
        {
            this.settings.setOptionValue(((GuiOptionButton)button).returnEnumOptions(), 1);
            button.displayString = this.settings.getKeyBinding(GameSettings.Options.getEnumOptions(button.id));
        }

        if (button.id == 200)
        {
            this.mc.gameSettings.saveOptions();
            this.mc.displayGuiScreen(this.prevScreen);
        }

        if (button.id != GameSettings.Options.AA_LEVEL.ordinal())
        {
            ScaledResolution scaledresolution = new ScaledResolution(this.mc);
            this.setWorldAndResolution(this.mc, scaledresolution.getScaledWidth(), scaledresolution.getScaledHeight());
        }
    }
}
项目:CustomWorldGen    文件:GuiContainerCreative.java   
/**
 * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
 */
protected void actionPerformed(GuiButton button) throws IOException
{
    if (button.id == 0)
    {
        this.mc.displayGuiScreen(new GuiAchievements(this, this.mc.thePlayer.getStatFileWriter()));
    }

    if (button.id == 1)
    {
        this.mc.displayGuiScreen(new GuiStats(this, this.mc.thePlayer.getStatFileWriter()));
    }

    if (button.id == 101)
    {
        tabPage = Math.max(tabPage - 1, 0);
    }
    else if (button.id == 102)
    {
        tabPage = Math.min(tabPage + 1, maxPages);
    }
}
项目:rezolve    文件:RemoteShellGuiContainer.java   
@Override
public void initGui() {
    super.initGui();

    this.nameField = new GuiTextField(NAME_FIELD, this.fontRendererObj, this.guiLeft + 11, this.guiTop + 120, 211, 18);
    this.nameField.setMaxStringLength(23);
    this.nameField.setText("");
    this.nameField.setFocused(false);
    this.nameField.setVisible(false);
    this.addControl(this.nameField);

    this.searchField = new GuiTextField(SEARCH_FIELD, this.fontRendererObj, this.guiLeft + 11, this.guiTop + 5, 211, 18);
    this.searchField.setMaxStringLength(23);
    this.searchField.setText("");
    this.searchField.setFocused(true);
    this.searchField.setVisible(true);
    this.addControl(this.searchField);

    this.securedBtn = new GuiButton(SECURED_BUTTON, this.guiLeft + 50, this.guiTop + 167, 100, 18, "Not Secured");
    this.securedBtn.visible = false;
    this.addControl(this.securedBtn);
}
项目:rezolve    文件:GuiContainerBase.java   
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {

    GlStateManager.pushMatrix();
        GlStateManager.translate(-guiLeft, -guiTop, 0);
        for (Gui control : this.controls) {
            if (control instanceof GuiTextField) {
                ((GuiTextField)control).drawTextBox();
            } else if (control instanceof GuiButton) {
                ((GuiButton)control).drawButton(this.mc, mouseX, mouseY);
            }
        }
    GlStateManager.popMatrix();     

    super.drawGuiContainerForegroundLayer(mouseX, mouseY);
}
项目:pnc-repressurized    文件:GuiSecurityStationInventory.java   
@Override
public void initGui() {
    super.initGui();

    int xStart = (width - xSize) / 2;
    int yStart = (height - ySize) / 2;

    statusStat = addAnimatedStat("Security Status", new ItemStack(Blockss.SECURITY_STATION), 0xFFFFAA00, false);
    accessStat = addAnimatedStat("Shared Users", new ItemStack(Items.SKULL, 1, 3), 0xFF005500, false);

    Rectangle accessButtonRectangle = accessStat.getButtonScaledRectangle(145, 10, 20, 20);
    addButton = getButtonFromRectangle(1, accessButtonRectangle, "+");
    rebootButton = new GuiButton(2, xStart + 110, yStart + 20, 60, 20, "Reboot");
    sharedUserTextField = getTextFieldFromRectangle(accessStat.getButtonScaledRectangle(20, 15, 120, 10));
    accessStat.addWidget(sharedUserTextField);
    accessStat.addWidget(addButton);

    buttonList.add(new GuiButton(3, guiLeft + 108, guiTop + 103, 64, 20, I18n.format("gui.securityStation.test")));
    buttonList.add(rebootButton);
    buttonList.add(new GuiButton(-1, guiLeft + 108, guiTop + 125, 64, 20, I18n.format("gui.universalSensor.button.showRange")));

    updateUserRemoveButtons();

    nodeHandler = new NetworkConnectionBackground(this, te, xStart + 25, yStart + 30, 18, 0xFF2222FF);
}
项目:Wurst-MC-1.12    文件:NavigatorFeatureScreen.java   
@Override
protected void actionPerformed(GuiButton button) throws IOException
{
    if(!button.enabled)
        return;

    WurstClient wurst = WurstClient.INSTANCE;
    switch(button.id)
    {
        case 0:
        feature.doPrimaryAction();
        primaryButton.displayString = feature.getPrimaryAction();
        break;
        case 1:
        MiscUtils.openLink("https://www.wurstclient.net/wiki/"
            + feature.getHelpPage() + "/");
        wurst.navigator.analytics.trackEvent("help", "open",
            feature.getName());
        break;
    }

    wurst.navigator.addPreference(feature.getName());
    ConfigFiles.NAVIGATOR.save();
}
项目:BaseClient    文件:GuiShaderOptions.java   
/**
 * Called when the mouse is clicked. Args : mouseX, mouseY, clickedButton
 */
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException
{
    super.mouseClicked(mouseX, mouseY, mouseButton);

    if (mouseButton == 1)
    {
        GuiButton guibutton = this.getSelectedButton(mouseX, mouseY);

        if (guibutton instanceof GuiButtonShaderOption)
        {
            GuiButtonShaderOption guibuttonshaderoption = (GuiButtonShaderOption)guibutton;
            ShaderOption shaderoption = guibuttonshaderoption.getShaderOption();

            if (shaderoption.isChanged())
            {
                guibuttonshaderoption.playPressSound(this.mc.getSoundHandler());
                shaderoption.resetValue();
                this.changed = true;
                this.updateAllButtons();
            }
        }
    }
}
项目:WurstSDK    文件:GuiInstallScreen.java   
protected final void actionPerformed(GuiButton button) {
    if (button.enabled) {
        switch (button.id) {
            case 0:
                if (StringUtils.isNotEmpty(urlBox.getText())) {
                    Thread t = new InstallThread(urlBox.getText());
                    t.setDaemon(true);
                    t.start();
                } else {
                    this.message = "Enter a valid url!";
                }
                break;
            case 1:
                this.mc.displayGuiScreen(this.prevScreen);
        }

    }
}
项目:pnc-repressurized    文件:GuiHelmetMainScreen.java   
@Override
public void initGui() {
    super.initGui();
    buttonList.clear();
    upgradePages.clear();
    upgradePageNames.clear();
    addPages();
    for (int i = 0; i < upgradePages.size(); i++) {
        GuiButton button = new GuiButton(100 + i, 210, 20 + i * 22, 200, 20, upgradePages.get(i).getPageName());
        if (page == i) button.enabled = false;
        buttonList.add(button);
    }
    if (page > upgradePages.size() - 1) {
        page = upgradePages.size() - 1;
    }
    GuiKeybindCheckBox checkBox = new GuiKeybindCheckBox(100, 40, 12, 0xFFFFFFFF,
            I18n.format("gui.enableModule", I18n.format("pneumaticHelmet.upgrade." + upgradePageNames.get(page))),
            "pneumaticHelmet.upgrade." + upgradePageNames.get(page));
    if (upgradePages.get(page).canBeTurnedOff()) addWidget(checkBox);
    upgradePages.get(page).initGui(this);
}
项目:Wurst-MC-1.12    文件:GuiZoomManager.java   
@Override
public void initGui()
{
    buttonList.clear();
    buttonList.add(new GuiButton(0, width / 2 - 100, height / 4 + 144 - 16,
        200, 20, "Back"));
    buttonList.add(new GuiButton(1, width / 2 - 79, height / 4 + 24 - 16,
        158, 20, "Zoom Key: " + Keyboard
            .getKeyName(WurstClient.INSTANCE.options.zoom.keybind)));
    buttonList.add(new GuiButton(2, width / 2 - 79, height / 4 + 72 - 16,
        50, 20, "More"));
    buttonList.add(new GuiButton(3, width / 2 - 25, height / 4 + 72 - 16,
        50, 20, "Less"));
    buttonList.add(new GuiButton(4, width / 2 + 29, height / 4 + 72 - 16,
        50, 20, "Default"));
    buttonList.add(new GuiButton(5, width / 2 - 79, height / 4 + 96 - 16,
        158, 20, "Use Mouse Wheel: "
            + (WurstClient.INSTANCE.options.zoom.scroll ? "ON" : "OFF")));
    WurstClient.INSTANCE.analytics.trackPageView("/options/keybind-manager",
        "Keybind Manager");
}
项目:LagGoggles    文件:GuiProfile.java   
@Override
public void actionPerformed(GuiButton gui){
    switch (gui.id){
        case BUTTON_START_PROFILE_ID:
            startProfile();
            break;
        case BUTTON_SHOW_TOGGLE:
            if(lagOverlayGui.isShowing.get()) {
                lagOverlayGui.hide();
                Minecraft.getMinecraft().displayGuiScreen(null);
            }else{
                lagOverlayGui.show();
                Minecraft.getMinecraft().displayGuiScreen(null);
            }
            break;
        case BUTTON_ANALYZE_RESULTS:
            analyzeResults();
            break;
        case BUTTON_DONATE:
            DonateButton.donate();
            break;
        case BUTTON_OPTIONS:
            mc.displayGuiScreen(new GuiInGameConfig(this));
            break;
    }
}
项目:Wurst-MC-1.12    文件:Gui1121Mode.java   
@Override
public void initGui()
{
    buttonList.add(new GuiButton(0, width / 2 - 150, height / 3 * 2, 100,
        20, "MC 1.12"));
    buttonList.add(new GuiButton(1, width / 2 - 50, height / 3 * 2, 100, 20,
        "MC 1.12.1"));
    buttonList.add(new GuiButton(2, width / 2 + 50, height / 3 * 2, 100, 20,
        "MC 1.12.2"));

    buttonList.add(
        new GuiButton(-1, width / 2 - 100, height / 3 * 2 + 40, "Cancel"));

    int version = WurstClient.INSTANCE.options.mc112x_compatibility;
    if(version >= 0 && version < buttonList.size() - 1)
        buttonList.get(version).enabled = false;
}
项目:BaseClient    文件:GuiTwitchUserMode.java   
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    int i = this.width / 3;
    int j = i - 130;
    this.buttonList.add(new GuiButton(1, i * 0 + j / 2, this.height - 70, 130, 20, I18n.format("stream.userinfo.timeout", new Object[0])));
    this.buttonList.add(new GuiButton(0, i * 1 + j / 2, this.height - 70, 130, 20, I18n.format("stream.userinfo.ban", new Object[0])));
    this.buttonList.add(new GuiButton(2, i * 2 + j / 2, this.height - 70, 130, 20, I18n.format("stream.userinfo.mod", new Object[0])));
    this.buttonList.add(new GuiButton(5, i * 0 + j / 2, this.height - 45, 130, 20, I18n.format("gui.cancel", new Object[0])));
    this.buttonList.add(new GuiButton(3, i * 1 + j / 2, this.height - 45, 130, 20, I18n.format("stream.userinfo.unban", new Object[0])));
    this.buttonList.add(new GuiButton(4, i * 2 + j / 2, this.height - 45, 130, 20, I18n.format("stream.userinfo.unmod", new Object[0])));
    int k = 0;

    for (IChatComponent ichatcomponent : this.field_152332_r)
    {
        k = Math.max(k, this.fontRendererObj.getStringWidth(ichatcomponent.getFormattedText()));
    }

    this.field_152334_t = this.width / 2 - k / 2;
}
项目:Industrial-Foregoing    文件:GUIBookBase.java   
@Override
protected void actionPerformed(GuiButton button) throws IOException {
    super.actionPerformed(button);
    if (hasBackButton() && back == button) {
        onBackButton();
    }
    if (hasPageRight() && right == button) {
        onRightButton();
    }
    if (hasPageLeft() && left == button) {
        onLeftButton();
    }
    if (button instanceof CategoryEntryButton) {
        for (BookCategory category : BookCategory.values()) {
            for (ResourceLocation location : category.getEntries().keySet()) {
                if (((CategoryEntryButton) button).getEntry().equals(category.getEntries().get(location))) {
                    this.mc.displayGuiScreen(new GUIBookPage(this, this, category.getEntries().get(location)));
                }
            }
        }
    }
}
项目:WurstSDK    文件:GuiPluginInfo.java   
@Override
protected void actionPerformed(GuiButton button) {
    if (getPermission(button.id) != null)
        //noinspection ConstantConditions
        logger.info("Button-action id: " + button.id + " text: " + button.displayString + " permission: " + getPermission(button.id).getName());
    if (button.id == 0) {
        ((WurstSDK) SDK.getClient()).saveConfig();
        mc.displayGuiScreen(parent);
        return;
    } else {
        if (button.displayString.equals("Enable")) {
            ((WurstSDK) SDK.getClient()).getConfig().change(plugin, getPermission(button.id), true, this);
        } else {
            ((WurstSDK) SDK.getClient()).getConfig().change(plugin, getPermission(button.id), false, this);
        }
        ((WurstSDK) SDK.getClient()).saveConfig();
    }
    mc.displayGuiScreen(new GuiPluginInfo(plugin, parent));
}
项目:Backmemed    文件:GuiOtherSettingsOF.java   
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    this.title = I18n.format("of.options.otherTitle", new Object[0]);
    this.buttonList.clear();

    for (int i = 0; i < enumOptions.length; ++i)
    {
        GameSettings.Options gamesettings$options = enumOptions[i];
        int j = this.width / 2 - 155 + i % 2 * 160;
        int k = this.height / 6 + 21 * (i / 2) - 12;

        if (!gamesettings$options.getEnumFloat())
        {
            this.buttonList.add(new GuiOptionButtonOF(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options, this.settings.getKeyBinding(gamesettings$options)));
        }
        else
        {
            this.buttonList.add(new GuiOptionSliderOF(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options));
        }
    }

    this.buttonList.add(new GuiButton(210, this.width / 2 - 100, this.height / 6 + 168 + 11 - 44, I18n.format("of.options.other.reset", new Object[0])));
    this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168 + 11, I18n.format("gui.done", new Object[0])));
}
项目:Mods    文件:GuiPages.java   
@Override
public void initGui() {
    super.initGui();
    this.guiLeft=this.width/2-146;
    this.guiTop=this.height/2-120;
    this.buttonsItem=new GuiButtonToggleItem[16*6];
    itemsToRender=NonNullList.<ItemStack>create();
    TF2weapons.tabweapontf2.displayAllRelevantItems(itemsToRender);
    TF2weapons.tabutilitytf2.displayAllRelevantItems(itemsToRender);
    TF2weapons.tabsurvivaltf2.displayAllRelevantItems(itemsToRender);
    for (int x = 0; x < 16; x++)
        for (int y = 0; y < 6; y++) {
            if(x+y*16<itemsToRender.size()) {
                GuiButtonToggleItem button=buttonsItem[x + y * 16]=new GuiButtonToggleItem(x + y * 16,
                        this.guiLeft + 4 + x * 18, this.guiTop + 34 + y * 18, 18, 18);
                this.buttonList.add(button);
            }
        }

    this.buttonList.add(new GuiButton(96, this.guiLeft+200, this.guiTop+14, "Back"));
    //this.buttonList.get(96).visible=false;
    this.setButtons();

}
项目:CreeperHostGui    文件:GuiQuote.java   
@Override
protected void actionPerformed(GuiButton button) throws IOException
{
    if (button.id == 8008135)
    {
        countryOnRelease = true;
    }

    if (countryEnabled && button.id == buttonPrev.id)
    {
        this.countryEnabled = false;
        this.buttonPrev.displayString = Util.localize("button.prev");
        if (changed)
        {
            changed = false;
            updateSummary();
        }
        else
        {
            countryButton.visible = true;
        }
        return;
    }
    super.actionPerformed(button);
}
项目:GeneralLaymansAestheticSpyingScreen    文件:GuiChannelSetter.java   
@Override
    public void initGui()
    {
//        xSize = 93;
//        ySize = 75;

        Keyboard.enableRepeatEvents(true);

        this.guiLeft = (this.width - this.xSize) / 2;
        this.guiTop = (this.height - this.ySize) / 2;

        channelName = new GuiTextField(0, mc.fontRenderer, this.guiLeft + 7, this.guiTop + 17, 80, mc.fontRenderer.FONT_HEIGHT + 4);
        channelName.setMaxStringLength(15);
        channelName.setTextColor(16777215);
        channelName.setText(terminal.channelName.isEmpty() ? "" : terminal.channelName.substring(terminal.channelName.indexOf(":") + 1));

        isPublicChannel = !terminal.channelName.isEmpty() && terminal.channelName.contains("public");

        buttonList.clear();
        buttonList.add(new GuiButton(ID_CONFIRM, guiLeft + (xSize - 50) / 2, guiTop + ySize + 2, 50, 20, I18n.translateToLocal("gui.done")));
        buttonList.add(new GuiButton(ID_PUBLIC_CHANNEL, guiLeft + 6, guiTop + 47, 82, 20, I18n.translateToLocal(isPublicChannel ? "gui.yes" : "gui.no")));
    }
项目:Wurst-MC-1.12-OF    文件:Gui1121Mode.java   
@Override
public void initGui()
{
    buttonList.add(new GuiButton(0, width / 2 - 150, height / 3 * 2, 100,
        20, "MC 1.12"));
    buttonList.add(new GuiButton(1, width / 2 - 50, height / 3 * 2, 100, 20,
        "MC 1.12.1"));
    buttonList.add(new GuiButton(2, width / 2 + 50, height / 3 * 2, 100, 20,
        "MC 1.12.2"));

    buttonList.add(
        new GuiButton(-1, width / 2 - 100, height / 3 * 2 + 40, "Cancel"));

    int version = WurstClient.INSTANCE.options.mc112x_compatibility;
    if(version >= 0 && version < buttonList.size() - 1)
        buttonList.get(version).enabled = false;
}
项目:Wurst-MC-1.12    文件:GuiBookHack.java   
@Override
protected void actionPerformed(GuiButton button) throws IOException
{
    if(!button.enabled)
        return;

    switch(button.id)
    {
        case 0:
        prevScreen.signWithCommand(commandBox.getText());
        break;

        case 1:
        mc.displayGuiScreen(prevScreen);
        break;
    }
}
项目:WirelessRedstone    文件:GuiWirelessSniffer.java   
protected void actionPerformed(GuiButton guibutton)
{
    switch(guibutton.id)
    {
        case 0:
            page++;
        break;

        case 1:
            page--;
        break;
    }

    if(page < 0)
    {
        page = RedstoneEther.numfreqs / 1000 - 1;
    }
    else if(page > RedstoneEther.numfreqs / 1000 - 1)
    {
        page = 0;
    }
}
项目:BaseClient    文件:GuiQualitySettingsOF.java   
/**
 * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
 */
protected void actionPerformed(GuiButton button)
{
    if (button.enabled)
    {
        if (button.id < 200 && button instanceof GuiOptionButton)
        {
            this.settings.setOptionValue(((GuiOptionButton)button).returnEnumOptions(), 1);
            button.displayString = this.settings.getKeyBinding(GameSettings.Options.getEnumOptions(button.id));
        }

        if (button.id == 200)
        {
            this.mc.gameSettings.saveOptions();
            this.mc.displayGuiScreen(this.prevScreen);
        }

        if (button.id != GameSettings.Options.AA_LEVEL.ordinal())
        {
            ScaledResolution scaledresolution = new ScaledResolution(this.mc);
            this.setWorldAndResolution(this.mc, scaledresolution.getScaledWidth(), scaledresolution.getScaledHeight());
        }
    }
}
项目:WurstSDK    文件:GuiPluginInfo.java   
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
    super.drawBackground(0);
    super.drawScreen(mouseX, mouseY, partialTicks);
    PluginManifest manifest = plugin.getManifest();
    int base = 25;
    drawString(Fonts.segoe22, plugin.getName(), width / 2 - Fonts.segoe22.getStringWidth(plugin.getName()) + 15, 10, 0xffffff);
    drawString(fontRendererObj, "Version: " + manifest.getVersion(), 10, base, 0xffffff);
    drawString(fontRendererObj, "Author(s): " + Arrays.toString(manifest.getAuthors()).replaceAll("\\[", "").replaceAll("\\]", ""), 10, base + 12, 0xffffff);
    drawString(fontRendererObj, "Main: " + manifest.getMain(), 10, base + 24, 0xffffff);
    for (GuiButton button : buttonPermissions.keySet()) {
        drawString(fontRendererObj, buttonPermissions.get(button).getName(), 10, button.yPosition + 5, 0xffffff);
        if (button.isMouseOver()) {
            List<String> lines = Arrays.asList("This permission is used to", buttonPermissions.get(button).getDescription());
            drawHoveringText(lines, mouseX, mouseY);
        }
    }
}
项目:BaseClient    文件:GuiDetailSettingsOF.java   
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    int i = 0;

    for (GameSettings.Options gamesettings$options : enumOptions)
    {
        int j = this.width / 2 - 155 + i % 2 * 160;
        int k = this.height / 6 + 21 * (i / 2) - 10;

        if (!gamesettings$options.getEnumFloat())
        {
            this.buttonList.add(new GuiOptionButton(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options, this.settings.getKeyBinding(gamesettings$options)));
        }
        else
        {
            this.buttonList.add(new GuiOptionSlider(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options));
        }

        ++i;
    }

    this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168 + 11, I18n.format("gui.done", new Object[0])));
}
项目:WurstSDK    文件:GuiWurstMainMenu.java   
@Override
public void initGui() {
    super.initGui();

    // adjust position of options, quit & language buttons
    for (int i = 3; i <= 5; i++)
        buttonList.get(i).yPosition =
                Math.min(buttonList.get(i).yPosition, height - 56);
    GuiButton oldBtn = null;
    for (GuiButton button : buttonList)
        if (button.displayString.equals("Alt Manager"))
            oldBtn = button;
    if (oldBtn != null)
        buttonList.remove(oldBtn);
    int y = (this.height / 4 + 48) + +24 * 2;
    buttonList.add(new GuiButton(99, this.width / 2 - 100, y, 98, 20, "Plugins"));
    buttonList.add(new GuiButton(3, this.width / 2 + 2, y, 98, 20, "Alt Manager"));

    // notice
    noticeWidth1 = fontRendererObj.getStringWidth(noticeText);
    noticeWidth2 =
            fontRendererObj.getStringWidth(GuiMainMenu.MORE_INFO_TEXT);
    int noticeWidth = Math.max(noticeWidth1, noticeWidth2);
    noticeX1 = (width - noticeWidth) / 2;
    noticeY1 = buttonList.get(0).yPosition - 24;
    noticeX2 = noticeX1 + noticeWidth;
    noticeY2 = noticeY1 + 24;
}
项目:CustomWorldGen    文件:GuiEditArray.java   
/**
 * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
 */
@Override
protected void actionPerformed(GuiButton button)
{
    if (button.id == 2000)
    {
        try
        {
            this.entryList.saveListChanges();
        }
        catch (Throwable e)
        {
            e.printStackTrace();
        }
        this.mc.displayGuiScreen(this.parentScreen);
    }
    else if (button.id == 2001)
    {
        this.currentValues = configElement.getDefaults();
        this.entryList = new GuiEditArrayEntries(this, this.mc, this.configElement, this.beforeValues, this.currentValues);
    }
    else if (button.id == 2002)
    {
        this.currentValues = Arrays.copyOf(beforeValues, beforeValues.length);
        this.entryList = new GuiEditArrayEntries(this, this.mc, this.configElement, this.beforeValues, this.currentValues);
    }
}
项目:pnc-repressurized    文件:GuiCreativeCompressor.java   
@Override
public void initGui() {
    super.initGui();
    int y = height / 2 - 5;
    int x = width / 2;
    buttonList.add(new GuiButton(0, x - 90, y, 30, 20, "-1"));
    buttonList.add(new GuiButton(1, x - 58, y, 30, 20, "-0.1"));
    buttonList.add(new GuiButton(2, x + 28, y, 30, 20, "+0.1"));
    buttonList.add(new GuiButton(3, x + 60, y, 30, 20, "+1"));
}
项目:WurstSDK    文件:GuiPluginManager.java   
@Override
public void initGui() {
    pluginSlot = new GuiPluginList(mc, this);
    pluginSlot.registerScrollButtons(7, 0);
    pluginSlot.elementClicked(-1, false, 0, 0);
    GuiPluginList.sort();
    buttonList.clear();
    this.buttonList.add(new GuiButton(0, this.width / 2 - 154, this.height - 28, 75, 20, "Info"));
    this.buttonList.add(new GuiButton(1, this.width / 2 - 76, this.height - 28, 74, 20, "Load/Unload"));
    this.buttonList.add(new GuiButton(2, this.width / 2 + 2, this.height - 28, 74, 20, "Reload"));
    this.buttonList.add(new GuiButton(3, this.width / 2 + 80, this.height - 28, 75, 20, "Cancel"));
    this.buttonList.add(new GuiButton(4, width - 108, 8, 100, 20, "Install plugin"));
}
项目:WurstSDK    文件:GuiPluginList.java   
protected void elementClicked(int var1, boolean doubleClick, int var3, int var4) {
    this.selectedSlot = var1;
    if (doubleClick) {
        try {
            ((GuiPluginManager) this.prevScreen).actionPerformed(new GuiButton(getSelectedPlugin().isEnabled() ? 1 : 0, 0, 0, ""));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
项目:SimpleTubes    文件:GuiDisplacerFilter.java   
@Override
protected void actionPerformed(GuiButton button) throws IOException {
    if (button.enabled) {
        if (button.id == 0 && button instanceof GuiButtonTransferMode) {
            GuiButtonTransferMode btn = (GuiButtonTransferMode) button;

            this.transferMode = btn.getMode();
            PacketHandler.sendToServer(new PacketDisplacerGuiMode(this.tileInv, this.transferMode));
        }
    }
}
项目:pnc-repressurized    文件:GuiChargingStation.java   
@Override
public void initGui() {
    super.initGui();

    int xStart = (width - xSize) / 2;
    int yStart = (height - ySize) / 2;
    guiSelectButton = new GuiButton(1, xStart + 90, yStart + 15, 25, 20, "inv.");
    buttonList.add(guiSelectButton);
}
项目:Backmemed    文件:GuiConnecting.java   
/**
 * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
 */
protected void actionPerformed(GuiButton button) throws IOException
{
    if (button.id == 0)
    {
        this.cancel = true;

        if (this.networkManager != null)
        {
            this.networkManager.closeChannel(new TextComponentString("Aborted"));
        }

        this.mc.displayGuiScreen(this.previousGuiScreen);
    }
}
项目:Mods    文件:GuiUpgradeStation.java   
@Override
public void initGui() {
    super.initGui();
    for (int x = 0; x < 2; x++)
        for (int y = 0; y < 3; y++) {
            this.buttonList.add(buttons[x * 2 + y * 4] = new GuiButton(x * 2 + y * 4, this.guiLeft + 81 + x * 101,
                    this.guiTop + 47 + y * 30, 12, 12, "+"));
            this.buttonList.add(buttons[x * 2 + y * 4 + 1] = new GuiButton(x * 2 + y * 4 + 1,
                    this.guiLeft + 94 + x * 101, this.guiTop + 47 + y * 30, 12, 12, "-"));
        }
    setButtons();
}
项目:Backmemed    文件:GuiDirectLogin.java   
public void initGui()
{
    Keyboard.enableRepeatEvents(true);
    buttonList.add(new GuiButton(1, width / 2 - 100, height / 4 + 96 + 12, "Login"));
    buttonList.add(new GuiButton(2, width / 2 - 100, height / 4 + 96 + 36, "Back"));
    usernameBox = new GuiTextField(0, this.fontRendererObj, width / 2 - 100, 76 - 25, 200, 20);
    passwordBox = new GuiPasswordField(2, this.fontRendererObj, width / 2 - 100, 116 - 25, 200, 20);
    usernameBox.setMaxStringLength(200);
    passwordBox.setMaxStringLength(200);
}
项目:HardcoreRevival    文件:PingAddon.java   
@SubscribeEvent
public void onInitGui(GuiScreenEvent.InitGuiEvent.Post event) {
    GuiScreen gui = event.getGui();
    if(isEnabled && gui.mc.player != null && gui.mc.player.getHealth() <= 0f && gui instanceof GuiChat) {
        buttonPing = new GuiButton(-999, gui.width / 2 - 100, gui.height / 2 + 30, I18n.format("gui.hardcorerevival.send_ping"));
        event.getButtonList().add(buttonPing);
    }
}
项目:Backmemed    文件:GuiMessage.java   
/**
 * Called from the main game loop to update the screen.
 */
public void updateScreen()
{
    super.updateScreen();

    if (--this.ticksUntilEnable == 0)
    {
        for (GuiButton guibutton : this.buttonList)
        {
            guibutton.enabled = true;
        }
    }
}
项目:SerenityCE    文件:GuiAddAlt.java   
public void initGui() {
    Keyboard.enableRepeatEvents(true);
    this.buttonList.clear();
    this.buttonList.add(new GuiButton(0, width / 2 - 100,
            height / 4 + 92 + 12, "Add"));
    this.buttonList.add(new GuiButton(1, width / 2 - 100,
            height / 4 + 116 + 12, "Back"));
    this.username = new GuiTextField(0, this.fontRendererObj, this.width / 2 - 100, 60, 200, 20);
    this.username.setMaxStringLength(Integer.MAX_VALUE);
    this.username.setFocused(true);
    this.password = new GuiMaskedTextField(1, this.fontRendererObj, this.width / 2 - 100, 100, 200, 20);
    this.password.setMaxStringLength(Integer.MAX_VALUE);
}
项目:pnc-repressurized    文件:GuiSearchUpgradeOptions.java   
@Override
public void initGui(IGuiScreen gui) {
    gui.getButtonList().add(new GuiButton(10, 30, 40, 150, 20, "Search for item..."));
    gui.getButtonList().add(new GuiButton(11, 30, 128, 150, 20, "Move Stat Screen..."));
    if (searchGui != null && !player.getItemStackFromSlot(EntityEquipmentSlot.HEAD).isEmpty()) {
        ItemStack searchStack = searchGui.getSearchStack();
        ItemStack helmetStack = ItemPneumaticArmor.getSearchedStack(player.getItemStackFromSlot(EntityEquipmentSlot.HEAD));
        if (searchStack.isEmpty() && !helmetStack.isEmpty() || !searchStack.isEmpty() && helmetStack.isEmpty() || !searchStack.isEmpty() && !helmetStack.isEmpty() && !searchStack.isItemEqual(helmetStack)) {
            NetworkHandler.sendToServer(new PacketUpdateSearchStack(searchStack));
            NBTTagCompound tag = NBTUtil.getCompoundTag(player.getItemStackFromSlot(EntityEquipmentSlot.HEAD), "SearchStack");
            tag.setInteger("itemID", searchStack.isEmpty() ? -1 : Item.getIdFromItem(searchStack.getItem()));
            tag.setInteger("itemDamage", searchStack.isEmpty() ? -1 : searchStack.getItemDamage());
        }
    }
}
项目:ServerObserver    文件:GuiHandler.java   
@CoreEvent
public void draw(final DrawScreenEvent.Post e) {
    final GuiScreen gui = this.mc.currentScreen;
    if (gui instanceof GuiMultiplayer) {
    } else if (gui instanceof GuiDisconnected) {
        if (this.disableBackButton!=null&&Config.getConfig().durationDisconnected.get()>=10)
            this.disableBackButton.displayString = I18n.format("serverobserver.gui.backandstop.time", I18n.format("serverobserver.gui.backandstop"), timeremain());
    } else if (gui instanceof GuiMainMenu) {
        final GuiButton button = this.mainMenuButtonMulti;
        if (button!=null&&this.target.getIP()!=null&&!this.manualOpen)
            button.displayString = I18n.format("serverobserver.gui.maintomulti.time", I18n.format("menu.multiplayer"), timeremain());
    }
}