GT5-Unofficial/src/main/java/gregtech/api/gui/GT_GUIContainer_MultiMachine.java

64 lines
3.1 KiB
Java
Raw Normal View History

2015-04-23 16:14:22 +00:00
package gregtech.api.gui;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.entity.player.InventoryPlayer;
2015-10-22 02:06:25 +00:00
import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
2015-04-23 16:14:22 +00:00
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
2015-10-22 02:06:25 +00:00
* <p/>
2015-04-23 16:14:22 +00:00
* The GUI-Container I use for all my Basic Machines
2015-10-22 02:06:25 +00:00
* <p/>
2015-04-23 16:14:22 +00:00
* As the NEI-RecipeTransferRect Handler can't handle one GUI-Class for all GUIs I needed to produce some dummy-classes which extend this class
*/
public class GT_GUIContainer_MultiMachine extends GT_GUIContainerMetaTile_Machine {
2015-10-22 02:06:25 +00:00
String mName = "";
2015-04-23 16:14:22 +00:00
public GT_GUIContainer_MultiMachine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile) {
2015-10-22 02:06:25 +00:00
super(new GT_Container_MultiMachine(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "multimachines/" + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
2015-04-23 16:14:22 +00:00
mName = aName;
}
2015-10-22 02:06:25 +00:00
2015-04-23 16:14:22 +00:00
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
2015-10-22 02:06:25 +00:00
fontRendererObj.drawString(mName, 10, 8, 16448255);
2015-04-23 16:14:22 +00:00
if (mContainer != null) {
2015-10-22 02:06:25 +00:00
if ((((GT_Container_MultiMachine) mContainer).mDisplayErrorCode & 1) != 0)
fontRendererObj.drawString("Pipe is loose.", 10, 16, 16448255);
if ((((GT_Container_MultiMachine) mContainer).mDisplayErrorCode & 2) != 0)
fontRendererObj.drawString("Screws are missing.", 10, 24, 16448255);
if ((((GT_Container_MultiMachine) mContainer).mDisplayErrorCode & 4) != 0)
fontRendererObj.drawString("Something is stuck.", 10, 32, 16448255);
if ((((GT_Container_MultiMachine) mContainer).mDisplayErrorCode & 8) != 0)
fontRendererObj.drawString("Platings are dented.", 10, 40, 16448255);
if ((((GT_Container_MultiMachine) mContainer).mDisplayErrorCode & 16) != 0)
fontRendererObj.drawString("Circuitry burned out.", 10, 48, 16448255);
if ((((GT_Container_MultiMachine) mContainer).mDisplayErrorCode & 32) != 0)
fontRendererObj.drawString("That doesn't belong there.", 10, 56, 16448255);
if ((((GT_Container_MultiMachine) mContainer).mDisplayErrorCode & 64) != 0)
fontRendererObj.drawString("Incomplete Structure.", 10, 64, 16448255);
if (((GT_Container_MultiMachine) mContainer).mDisplayErrorCode == 0) {
if (((GT_Container_MultiMachine) mContainer).mActive == 0) {
fontRendererObj.drawString("Hit with Soft Hammer", 10, 16, 16448255);
fontRendererObj.drawString("to (re-)start the Machine", 10, 24, 16448255);
fontRendererObj.drawString("if it doesn't start.", 10, 32, 16448255);
} else {
fontRendererObj.drawString("Running perfectly.", 10, 16, 16448255);
}
}
2015-04-23 16:14:22 +00:00
}
}
2015-10-22 02:06:25 +00:00
2015-04-23 16:14:22 +00:00
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
2015-10-22 02:06:25 +00:00
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
2015-04-23 16:14:22 +00:00
int x = (width - xSize) / 2;
int y = (height - ySize) / 2;
drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
}
}