001package net.minecraft.client.gui;
002
003import cpw.mods.fml.relauncher.Side;
004import cpw.mods.fml.relauncher.SideOnly;
005import net.minecraft.util.StatCollector;
006
007@SideOnly(Side.CLIENT)
008public class GuiErrorScreen extends GuiScreen
009{
010    /**
011     * Unused class. Would contain a message drawn to the center of the screen.
012     */
013    private String message1;
014
015    /**
016     * Unused class. Would contain a message drawn to the center of the screen.
017     */
018    private String message2;
019
020    public GuiErrorScreen(String par1Str, String par2Str)
021    {
022        this.message1 = par1Str;
023        this.message2 = par2Str;
024    }
025
026    /**
027     * Adds the buttons (and other controls) to the screen in question.
028     */
029    public void initGui()
030    {
031        super.initGui();
032        this.buttonList.add(new GuiButton(0, this.width / 2 - 100, 140, StatCollector.translateToLocal("gui.cancel")));
033    }
034
035    public GuiErrorScreen(){}
036
037    /**
038     * Draws the screen and all the components in it.
039     */
040    public void drawScreen(int par1, int par2, float par3)
041    {
042        this.drawGradientRect(0, 0, this.width, this.height, -12574688, -11530224);
043        this.drawCenteredString(this.fontRenderer, this.message1, this.width / 2, 90, 16777215);
044        this.drawCenteredString(this.fontRenderer, this.message2, this.width / 2, 110, 16777215);
045        super.drawScreen(par1, par2, par3);
046    }
047
048    /**
049     * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e).
050     */
051    protected void keyTyped(char par1, int par2) {}
052
053    /**
054     * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e).
055     */
056    protected void actionPerformed(GuiButton par1GuiButton)
057    {
058        this.mc.displayGuiScreen((GuiScreen)null);
059    }
060}