001    package net.minecraft.src;
002    
003    import cpw.mods.fml.common.Side;
004    import cpw.mods.fml.common.asm.SideOnly;
005    
006    @SideOnly(Side.CLIENT)
007    public abstract class GuiConfirmOpenLink extends GuiYesNo
008    {
009        /** Initialises Copy Button. */
010        private String copyLinkButton;
011        private String field_73946_b;
012    
013        public GuiConfirmOpenLink(GuiScreen par1GuiScreen, String par2Str, int par3)
014        {
015            super(par1GuiScreen, StringTranslate.getInstance().translateKey("chat.link.confirm"), par2Str, par3);
016            StringTranslate var4 = StringTranslate.getInstance();
017            this.buttonText1 = var4.translateKey("gui.yes");
018            this.buttonText2 = var4.translateKey("gui.no");
019            this.field_73946_b = var4.translateKey("chat.copy");
020            this.copyLinkButton = var4.translateKey("chat.link.warning");
021        }
022    
023        /**
024         * Adds the buttons (and other controls) to the screen in question.
025         */
026        public void initGui()
027        {
028            this.controlList.add(new GuiButton(0, this.width / 3 - 83 + 0, this.height / 6 + 96, 100, 20, this.buttonText1));
029            this.controlList.add(new GuiButton(2, this.width / 3 - 83 + 105, this.height / 6 + 96, 100, 20, this.field_73946_b));
030            this.controlList.add(new GuiButton(1, this.width / 3 - 83 + 210, this.height / 6 + 96, 100, 20, this.buttonText2));
031        }
032    
033        /**
034         * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e).
035         */
036        protected void actionPerformed(GuiButton par1GuiButton)
037        {
038            if (par1GuiButton.id == 2)
039            {
040                this.func_73945_e();
041                super.actionPerformed((GuiButton)this.controlList.get(1));
042            }
043            else
044            {
045                super.actionPerformed(par1GuiButton);
046            }
047        }
048    
049        public abstract void func_73945_e();
050    
051        /**
052         * Draws the screen and all the components in it.
053         */
054        public void drawScreen(int par1, int par2, float par3)
055        {
056            super.drawScreen(par1, par2, par3);
057            this.drawCenteredString(this.fontRenderer, this.copyLinkButton, this.width / 2, 110, 16764108);
058        }
059    }