mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 11:59:25 +00:00
87 lines
3.0 KiB
Java
87 lines
3.0 KiB
Java
/*
|
|
* The FML Forge Mod Loader suite.
|
|
* Copyright (C) 2012 cpw
|
|
*
|
|
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free
|
|
* Software Foundation; either version 2.1 of the License, or any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
* A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51
|
|
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
*/
|
|
|
|
package cpw.mods.fml.client;
|
|
|
|
import cpw.mods.fml.common.Loader;
|
|
import cpw.mods.fml.common.ModContainer;
|
|
import cpw.mods.fml.common.ModMetadata;
|
|
import net.minecraft.client.Minecraft;
|
|
import net.minecraft.src.GuiLanguage;
|
|
import net.minecraft.src.GuiSlot;
|
|
import net.minecraft.src.StringTranslate;
|
|
import net.minecraft.src.Tessellator;
|
|
|
|
/**
|
|
* @author cpw
|
|
*
|
|
*/
|
|
public class GuiSlotModList extends GuiScrollingList
|
|
{
|
|
private GuiModList parent;
|
|
|
|
public GuiSlotModList(GuiModList parent)
|
|
{
|
|
super(parent.getMinecraftInstance(), parent.field_951_c, parent.field_950_d, 32, parent.field_950_d - 65 + 4, 10, 18);
|
|
this.parent=parent;
|
|
}
|
|
|
|
@Override
|
|
protected int getSize()
|
|
{
|
|
return Loader.getModList().size();
|
|
}
|
|
|
|
@Override
|
|
protected void elementClicked(int var1, boolean var2)
|
|
{
|
|
// TODO Auto-generated method stub
|
|
|
|
}
|
|
|
|
@Override
|
|
protected boolean isSelected(int var1)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
protected void drawBackground()
|
|
{
|
|
this.parent.func_578_i();
|
|
}
|
|
|
|
@Override
|
|
protected int getContentHeight()
|
|
{
|
|
return this.getSize() * 3 * (this.parent.getFontRenderer().field_41063_b +1);
|
|
}
|
|
|
|
@Override
|
|
protected void drawSlot(int listIndex, int var2, int var3, int var4, Tessellator var5)
|
|
{
|
|
ModContainer mc=Loader.getModList().get(listIndex);
|
|
ModMetadata meta=mc.getMetadata();
|
|
if (meta!=null) {
|
|
this.parent.func_548_a(this.parent.getFontRenderer(), meta.name, this.parent.field_951_c / 2, var3 + 1, 16777215);
|
|
this.parent.func_548_a(this.parent.getFontRenderer(), meta.description, this.parent.field_951_c / 2, var3 + this.parent.getFontRenderer().field_41063_b +1, 16777215);
|
|
this.parent.func_548_a(this.parent.getFontRenderer(), mc.getName(), this.parent.field_951_c / 2, var3 + this.parent.getFontRenderer().field_41063_b *2 +2, 16777215);
|
|
} else {
|
|
this.parent.func_548_a(this.parent.getFontRenderer(), mc.getName(), this.parent.field_951_c / 2, var3 + 1, 16777215);
|
|
this.parent.func_548_a(this.parent.getFontRenderer(), "Mod information not found", this.parent.field_951_c / 2, var3 + 1, 16777215);
|
|
}
|
|
}
|
|
|
|
}
|