Gui element stuff.

This commit is contained in:
Ben Spiers 2014-01-05 03:43:54 +00:00
parent c20282db35
commit 7109e84907
14 changed files with 14 additions and 20 deletions

View file

@ -7,15 +7,14 @@ import mekanism.common.PacketHandler.Transmission;
import mekanism.common.network.PacketSimpleGui;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
public class GuiConfigurationTab extends GuiElement
{
public GuiConfigurationTab(GuiScreen gui, TileEntity tile, ResourceLocation def)
public GuiConfigurationTab(GuiMekanism gui, TileEntity tile, ResourceLocation def)
{
super(MekanismUtils.getResource(ResourceType.GUI, "GuiConfigurationTab.png"), gui, tile, def);
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiConfigurationTab.png"), gui, tile, def);
}
@Override

View file

@ -19,13 +19,13 @@ public abstract class GuiElement
protected ResourceLocation RESOURCE;
public GuiScreen guiObj;
public GuiMekanism guiObj;
public TileEntity tileEntity;
public ResourceLocation defaultLocation;
public GuiElement(ResourceLocation resource, GuiScreen gui, TileEntity tile, ResourceLocation def)
public GuiElement(ResourceLocation resource, GuiMekanism gui, TileEntity tile, ResourceLocation def)
{
RESOURCE = resource;
guiObj = gui;
@ -35,13 +35,7 @@ public abstract class GuiElement
protected void displayTooltip(String s, int xAxis, int yAxis)
{
GL11.glPushAttrib(GL11.GL_ENABLE_BIT + GL11.GL_LIGHTING_BIT);
try {
Method m = MekanismUtils.getPrivateMethod(GuiContainer.class, ObfuscatedNames.GuiContainer_drawCreativeTabHoveringText, String.class, Integer.TYPE, Integer.TYPE);
m.setAccessible(true);
m.invoke(guiObj, s, xAxis, yAxis);
} catch(Exception e) {}
GL11.glPopAttrib();
guiObj.drawCreativeTabHoveringText(s, xAxis, yAxis);
}
protected void offsetX(int xSize)

View file

@ -9,9 +9,9 @@ import net.minecraft.util.ResourceLocation;
public class GuiRecipeType extends GuiElement
{
public GuiRecipeType(GuiContainer gui, TileEntity tile, ResourceLocation def)
public GuiRecipeType(GuiMekanism gui, TileEntity tile, ResourceLocation def)
{
super(MekanismUtils.getResource(ResourceType.GUI, "GuiRecipeType.png"), gui, tile, def);
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiRecipeType.png"), gui, tile, def);
}
@Override

View file

@ -14,9 +14,9 @@ import net.minecraft.util.ResourceLocation;
public class GuiRedstoneControl extends GuiElement
{
public GuiRedstoneControl(GuiScreen gui, TileEntity tile, ResourceLocation def)
public GuiRedstoneControl(GuiMekanism gui, TileEntity tile, ResourceLocation def)
{
super(MekanismUtils.getResource(ResourceType.GUI, "GuiRedstoneControl.png"), gui, tile, def);
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiRedstoneControl.png"), gui, tile, def);
}
@Override

View file

@ -15,9 +15,9 @@ import net.minecraft.util.ResourceLocation;
public class GuiSortingTab extends GuiElement
{
public GuiSortingTab(GuiScreen gui, TileEntity tile, ResourceLocation def)
public GuiSortingTab(GuiMekanism gui, TileEntity tile, ResourceLocation def)
{
super(MekanismUtils.getResource(ResourceType.GUI, "GuiSortingTab.png"), gui, tile, def);
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiSortingTab.png"), gui, tile, def);
}
@Override

View file

@ -13,9 +13,9 @@ import net.minecraft.util.ResourceLocation;
public class GuiUpgradeManagement extends GuiElement
{
public GuiUpgradeManagement(GuiContainer gui, TileEntity tile, ResourceLocation def)
public GuiUpgradeManagement(GuiMekanism gui, TileEntity tile, ResourceLocation def)
{
super(MekanismUtils.getResource(ResourceType.GUI, "GuiUpgradeManagement.png"), gui, tile, def);
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiUpgradeManagement.png"), gui, tile, def);
}
@Override

View file

@ -1194,6 +1194,7 @@ public final class MekanismUtils
public static enum ResourceType
{
GUI("gui"),
GUI_ELEMENT("gui/elements"),
SOUND("sound"),
RENDER("render"),
TEXTURE_BLOCKS("textures/blocks"),

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

View file

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View file

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View file

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View file

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View file

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB