    001/*
    002 * Forge Mod Loader
    003 * Copyright (c) 2012-2013 cpw.
    004 * All rights reserved. This program and the accompanying materials
    005 * are made available under the terms of the GNU Lesser Public License v2.1
    006 * which accompanies this distribution, and is available at
    007 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    008 *
    009 * Contributors:
    010 *     cpw - implementation
    011 */
    012
    013package cpw.mods.fml.client;
    014
    015import java.io.File;
    016import java.util.Map.Entry;
    017
    018import net.minecraft.client.gui.GuiErrorScreen;
    019
    020import cpw.mods.fml.common.DuplicateModsFoundException;
    021import cpw.mods.fml.common.MissingModsException;
    022import cpw.mods.fml.common.ModContainer;
    023import cpw.mods.fml.common.versioning.ArtifactVersion;
    024
    025public class GuiDupesFound extends GuiErrorScreen
    026{
    027
    028    private DuplicateModsFoundException dupes;
    029
    030    public GuiDupesFound(DuplicateModsFoundException dupes)
    031    {
    032        this.dupes = dupes;
    033    }
    034
    035    @Override
    036
    037    /**
    038     * Adds the buttons (and other controls) to the screen in question.
    039     */
    040    public void initGui()
    041    {
    042        super.initGui();
    043    }
    044    @Override
    045
    046    /**
    047     * Draws the screen and all the components in it.
    048     */
    049    public void drawScreen(int par1, int par2, float par3)
    050    {
    051        this.drawDefaultBackground();
    052        int offset = Math.max(85 - dupes.dupes.size() * 10, 10);
    053        this.drawCenteredString(this.fontRenderer, "Forge Mod Loader has found a problem with your minecraft installation", this.width / 2, offset, 0xFFFFFF);
    054        offset+=10;
    055        this.drawCenteredString(this.fontRenderer, "You have mod sources that are duplicate within your system", this.width / 2, offset, 0xFFFFFF);
    056        offset+=10;
    057        this.drawCenteredString(this.fontRenderer, "Mod Id : File name", this.width / 2, offset, 0xFFFFFF);
    058        offset+=5;
    059        for (Entry<ModContainer, File> mc : dupes.dupes.entries())
    060        {
    061            offset+=10;
    062            this.drawCenteredString(this.fontRenderer, String.format("%s : %s", mc.getKey().getModId(), mc.getValue().getName()), this.width / 2, offset, 0xEEEEEE);
    063        }
    064    }
    065}