mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-27 23:33:08 +00:00
Move the directory structure around to a more conventional one and start out on the 1.7 update.
3797 errors. We have a long way to go.
This commit is contained in:
1 parent
3a0de87a09
commit
ab47724473
1245 files changed
+1764
-5953
No files matched your search
@@ -0,0 +1,77 @@
|
||||
package mekanism.client.gui;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.common.ObfuscatedNames;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public abstract class GuiElement
|
||||
{
|
||||
protected static Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
protected ResourceLocation RESOURCE;
|
||||
|
||||
public IGuiWrapper guiObj;
|
||||
|
||||
public ResourceLocation defaultLocation;
|
||||
|
||||
public GuiElement(ResourceLocation resource, IGuiWrapper gui, ResourceLocation def)
|
||||
{
|
||||
RESOURCE = resource;
|
||||
guiObj = gui;
|
||||
defaultLocation = def;
|
||||
}
|
||||
|
||||
protected void displayTooltip(String s, int xAxis, int yAxis)
|
||||
{
|
||||
guiObj.displayTooltip(s, xAxis, yAxis);
|
||||
}
|
||||
|
||||
protected void displayTooltips(List<String> list, int xAxis, int yAxis)
|
||||
{
|
||||
guiObj.displayTooltips(list, xAxis, yAxis);
|
||||
}
|
||||
|
||||
protected void offsetX(int xSize)
|
||||
{
|
||||
if(guiObj instanceof GuiContainer)
|
||||
{
|
||||
try {
|
||||
int size = (Integer)MekanismUtils.getPrivateValue(guiObj, GuiContainer.class, ObfuscatedNames.GuiContainer_xSize);
|
||||
MekanismUtils.setPrivateValue(guiObj, size + xSize, GuiContainer.class, ObfuscatedNames.GuiContainer_xSize);
|
||||
} catch(Exception e) {}
|
||||
}
|
||||
}
|
||||
|
||||
protected void offsetY(int ySize)
|
||||
{
|
||||
if(guiObj instanceof GuiContainer)
|
||||
{
|
||||
try {
|
||||
int size = (Integer)MekanismUtils.getPrivateValue(guiObj, GuiContainer.class, ObfuscatedNames.GuiContainer_ySize);
|
||||
MekanismUtils.setPrivateValue(guiObj, size + ySize, GuiContainer.class, ObfuscatedNames.GuiContainer_ySize);
|
||||
} catch(Exception e) {}
|
||||
}
|
||||
}
|
||||
|
||||
protected FontRenderer getFontRenderer()
|
||||
{
|
||||
return guiObj.getFont();
|
||||
}
|
||||
|
||||
public abstract void renderBackground(int xAxis, int yAxis, int guiWidth, int guiHeight);
|
||||
|
||||
public abstract void renderForeground(int xAxis, int yAxis);
|
||||
|
||||
public abstract void preMouseClicked(int xAxis, int yAxis, int button);
|
||||
|
||||
public abstract void mouseClicked(int xAxis, int yAxis, int button);
|
||||
}
|
||||
Reference in new issue
Block a user