More tweaks to stuff: mod list, branding, more hooks

This commit is contained in:
Christian Weeks committed 2012-05-11 01:45:36 -04:00
1 parent b1ee6c3c95
commit 7ec180ee7c
7 files changed
+326 -87

No files matched your search

@@ -0,0 +1,77 @@
/*
* 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 net.minecraft.client.Minecraft;
import net.minecraft.src.FontRenderer;
import net.minecraft.src.GuiButton;
import net.minecraft.src.GuiScreen;
import net.minecraft.src.GuiSmallButton;
import net.minecraft.src.StringTranslate;
/**
* @author cpw
*
*/
public class GuiModList extends GuiScreen
{
private GuiScreen mainMenu;
private GuiSlotModList modList;
/**
* @param guiMainMenu
*/
public GuiModList(GuiScreen mainMenu)
{
this.mainMenu=mainMenu;
}
public void func_6448_a()
{
StringTranslate translations = StringTranslate.func_20162_a();
this.field_949_e.add(new GuiSmallButton(6, this.field_951_c / 2 - 75, this.field_950_d - 38, translations.func_20163_a("gui.done")));
this.modList=new GuiSlotModList(this);
this.modList.func_22240_a(this.field_949_e, 7, 8);
}
protected void func_572_a(GuiButton button) {
if (button.field_937_g)
{
switch (button.field_938_f)
{
case 6:
this.field_945_b.func_6272_a(this.mainMenu);
}
}
}
public void func_571_a(int p_571_1_, int p_571_2_, float p_571_3_)
{
this.modList.func_22243_a(p_571_1_, p_571_2_, p_571_3_);
this.func_548_a(this.field_6451_g, "Mod List", this.field_951_c / 2, 16, 16777215);
super.func_571_a(p_571_1_, p_571_2_, p_571_3_);
}
Minecraft getMinecraftInstance() {
return field_945_b;
}
FontRenderer getFontRenderer() {
return field_6451_g;
}
}
@@ -0,0 +1,75 @@
/*
* 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 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 GuiSlot
{
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, 18);
this.parent=parent;
}
@Override
protected int func_22249_a()
{
return Loader.getModList().size();
}
@Override
protected void func_22247_a(int var1, boolean var2)
{
// TODO Auto-generated method stub
}
@Override
protected boolean func_22246_a(int var1)
{
return false;
}
@Override
protected void func_22248_c()
{
this.parent.func_578_i();
}
@Override
protected int func_22245_b()
{
return this.func_22249_a() * 18;
}
@Override
protected void func_22242_a(int listIndex, int var2, int var3, int var4, Tessellator var5)
{
this.parent.func_548_a(this.parent.getFontRenderer(), Loader.getModList().get(listIndex).getName(), this.parent.field_951_c / 2, var3 + 1, 16777215);
}
}