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