    001package cpw.mods.fml.client;
    002
    003import java.io.File;
    004import java.util.Map.Entry;
    005
    006import net.minecraft.client.gui.GuiErrorScreen;
    007
    008import cpw.mods.fml.common.DuplicateModsFoundException;
    009import cpw.mods.fml.common.MissingModsException;
    010import cpw.mods.fml.common.ModContainer;
    011import cpw.mods.fml.common.versioning.ArtifactVersion;
    012
    013public class GuiDupesFound extends GuiErrorScreen
    014{
    015
    016    private DuplicateModsFoundException dupes;
    017
    018    public GuiDupesFound(DuplicateModsFoundException dupes)
    019    {
    020        this.dupes = dupes;
    021    }
    022
    023    @Override
    024
    025    /**
    026     * Adds the buttons (and other controls) to the screen in question.
    027     */
    028    public void initGui()
    029    {
    030        super.initGui();
    031    }
    032    @Override
    033
    034    /**
    035     * Draws the screen and all the components in it.
    036     */
    037    public void drawScreen(int par1, int par2, float par3)
    038    {
    039        this.drawDefaultBackground();
    040        int offset = Math.max(85 - dupes.dupes.size() * 10, 10);
    041        this.drawCenteredString(this.fontRenderer, "Forge Mod Loader has found a problem with your minecraft installation", this.width / 2, offset, 0xFFFFFF);
    042        offset+=10;
    043        this.drawCenteredString(this.fontRenderer, "You have mod sources that are duplicate within your system", this.width / 2, offset, 0xFFFFFF);
    044        offset+=10;
    045        this.drawCenteredString(this.fontRenderer, "Mod Id : File name", this.width / 2, offset, 0xFFFFFF);
    046        offset+=5;
    047        for (Entry<ModContainer, File> mc : dupes.dupes.entries())
    048        {
    049            offset+=10;
    050            this.drawCenteredString(this.fontRenderer, String.format("%s : %s", mc.getKey().getModId(), mc.getValue().getName()), this.width / 2, offset, 0xEEEEEE);
    051        }
    052    }
    053}