Gui element stuff.
|
@ -7,15 +7,14 @@ import mekanism.common.PacketHandler.Transmission;
|
||||||
import mekanism.common.network.PacketSimpleGui;
|
import mekanism.common.network.PacketSimpleGui;
|
||||||
import mekanism.common.util.MekanismUtils;
|
import mekanism.common.util.MekanismUtils;
|
||||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
public class GuiConfigurationTab extends GuiElement
|
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
|
@Override
|
||||||
|
|
|
@ -19,13 +19,13 @@ public abstract class GuiElement
|
||||||
|
|
||||||
protected ResourceLocation RESOURCE;
|
protected ResourceLocation RESOURCE;
|
||||||
|
|
||||||
public GuiScreen guiObj;
|
public GuiMekanism guiObj;
|
||||||
|
|
||||||
public TileEntity tileEntity;
|
public TileEntity tileEntity;
|
||||||
|
|
||||||
public ResourceLocation defaultLocation;
|
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;
|
RESOURCE = resource;
|
||||||
guiObj = gui;
|
guiObj = gui;
|
||||||
|
@ -35,13 +35,7 @@ public abstract class GuiElement
|
||||||
|
|
||||||
protected void displayTooltip(String s, int xAxis, int yAxis)
|
protected void displayTooltip(String s, int xAxis, int yAxis)
|
||||||
{
|
{
|
||||||
GL11.glPushAttrib(GL11.GL_ENABLE_BIT + GL11.GL_LIGHTING_BIT);
|
guiObj.drawCreativeTabHoveringText(s, xAxis, yAxis);
|
||||||
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();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void offsetX(int xSize)
|
protected void offsetX(int xSize)
|
||||||
|
|
|
@ -9,9 +9,9 @@ import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
public class GuiRecipeType extends GuiElement
|
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
|
@Override
|
||||||
|
|
|
@ -14,9 +14,9 @@ import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
public class GuiRedstoneControl extends GuiElement
|
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
|
@Override
|
||||||
|
|
|
@ -15,9 +15,9 @@ import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
public class GuiSortingTab extends GuiElement
|
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
|
@Override
|
||||||
|
|
|
@ -13,9 +13,9 @@ import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
public class GuiUpgradeManagement extends GuiElement
|
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
|
@Override
|
||||||
|
|
|
@ -1194,6 +1194,7 @@ public final class MekanismUtils
|
||||||
public static enum ResourceType
|
public static enum ResourceType
|
||||||
{
|
{
|
||||||
GUI("gui"),
|
GUI("gui"),
|
||||||
|
GUI_ELEMENT("gui/elements"),
|
||||||
SOUND("sound"),
|
SOUND("sound"),
|
||||||
RENDER("render"),
|
RENDER("render"),
|
||||||
TEXTURE_BLOCKS("textures/blocks"),
|
TEXTURE_BLOCKS("textures/blocks"),
|
||||||
|
|
Before Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |