You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			73 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			Java
		
	
			
		
		
	
	
			73 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			Java
		
	
package net.minecraft.client.gui;
 | 
						|
 | 
						|
import cpw.mods.fml.relauncher.Side;
 | 
						|
import cpw.mods.fml.relauncher.SideOnly;
 | 
						|
import net.minecraft.client.resources.I18n;
 | 
						|
 | 
						|
@SideOnly(Side.CLIENT)
 | 
						|
public class GuiConfirmOpenLink extends GuiYesNo
 | 
						|
{
 | 
						|
    /** Text to warn players from opening unsafe links. */
 | 
						|
    private final String openLinkWarning;
 | 
						|
    /** Label for the Copy to Clipboard button. */
 | 
						|
    private final String copyLinkButtonText;
 | 
						|
    private final String field_146361_t;
 | 
						|
    private boolean field_146360_u = true;
 | 
						|
    private static final String __OBFID = "CL_00000683";
 | 
						|
 | 
						|
    public GuiConfirmOpenLink(GuiYesNoCallback p_i1084_1_, String p_i1084_2_, int p_i1084_3_, boolean p_i1084_4_)
 | 
						|
    {
 | 
						|
        super(p_i1084_1_, I18n.format(p_i1084_4_ ? "chat.link.confirmTrusted" : "chat.link.confirm", new Object[0]), p_i1084_2_, p_i1084_3_);
 | 
						|
        this.confirmButtonText = I18n.format(p_i1084_4_ ? "chat.link.open" : "gui.yes", new Object[0]);
 | 
						|
        this.cancelButtonText = I18n.format(p_i1084_4_ ? "gui.cancel" : "gui.no", new Object[0]);
 | 
						|
        this.copyLinkButtonText = I18n.format("chat.copy", new Object[0]);
 | 
						|
        this.openLinkWarning = I18n.format("chat.link.warning", new Object[0]);
 | 
						|
        this.field_146361_t = p_i1084_2_;
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * Adds the buttons (and other controls) to the screen in question.
 | 
						|
     */
 | 
						|
    public void initGui()
 | 
						|
    {
 | 
						|
        this.buttonList.add(new GuiButton(0, this.width / 3 - 83 + 0, this.height / 6 + 96, 100, 20, this.confirmButtonText));
 | 
						|
        this.buttonList.add(new GuiButton(2, this.width / 3 - 83 + 105, this.height / 6 + 96, 100, 20, this.copyLinkButtonText));
 | 
						|
        this.buttonList.add(new GuiButton(1, this.width / 3 - 83 + 210, this.height / 6 + 96, 100, 20, this.cancelButtonText));
 | 
						|
    }
 | 
						|
 | 
						|
    protected void actionPerformed(GuiButton button)
 | 
						|
    {
 | 
						|
        if (button.id == 2)
 | 
						|
        {
 | 
						|
            this.copyLinkToClipboard();
 | 
						|
        }
 | 
						|
 | 
						|
        this.parentScreen.confirmClicked(button.id == 0, this.field_146357_i);
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * Copies the link to the system clipboard.
 | 
						|
     */
 | 
						|
    public void copyLinkToClipboard()
 | 
						|
    {
 | 
						|
        setClipboardString(this.field_146361_t);
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * Draws the screen and all the components in it.
 | 
						|
     */
 | 
						|
    public void drawScreen(int mouseX, int mouseY, float partialTicks)
 | 
						|
    {
 | 
						|
        super.drawScreen(mouseX, mouseY, partialTicks);
 | 
						|
 | 
						|
        if (this.field_146360_u)
 | 
						|
        {
 | 
						|
            this.drawCenteredString(this.fontRendererObj, this.openLinkWarning, this.width / 2, 110, 16764108);
 | 
						|
        }
 | 
						|
    }
 | 
						|
 | 
						|
    public void func_146358_g()
 | 
						|
    {
 | 
						|
        this.field_146360_u = false;
 | 
						|
    }
 | 
						|
} |