mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-20 04:09:43 +00:00
Added NEI recipe button to those machines that support it.
This commit is contained in:
1 parent
26feb5e646
commit
526a46c009
12 files changed
+39
-8
No files matched your search
@@ -25,5 +25,10 @@ public class GuiFarmStation extends GuiMachineBase {
|
||||
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -82,6 +82,8 @@ public final class IconEIO {
|
||||
|
||||
public static final IconEIO IO_WHATSIT = new IconEIO(192, 148, 13,13);
|
||||
|
||||
public static final IconEIO RECIPE = new IconEIO(128, 116, 24,24);
|
||||
|
||||
|
||||
|
||||
private static final int TEX_SIZE = 256;
|
||||
|
||||
@@ -17,6 +17,7 @@ import crazypants.gui.GuiContainerBase;
|
||||
import crazypants.gui.GuiToolTip;
|
||||
import crazypants.render.RenderUtil;
|
||||
import crazypants.util.BlockCoord;
|
||||
import crazypants.util.Lang;
|
||||
import crazypants.vecmath.Vector4f;
|
||||
|
||||
public abstract class GuiMachineBase extends GuiContainerBase {
|
||||
@@ -61,9 +62,9 @@ public abstract class GuiMachineBase extends GuiContainerBase {
|
||||
int y = 5;
|
||||
redstoneButton = new RedstoneModeButton(this, -1, x, y, tileEntity, new BlockCoord(tileEntity));
|
||||
|
||||
y += 20;
|
||||
y += 19;
|
||||
configB = new IconButtonEIO(this, CONFIG_ID, x, y, IconEIO.IO_CONFIG_UP);
|
||||
configB.setToolTip("Toggles the IO config overlay.");
|
||||
configB.setToolTip(Lang.localize("gui.machine.ioMode.overlay.tooltip"));
|
||||
|
||||
configOverlay = new GuiOverlayIoConfig(machine) {
|
||||
|
||||
@@ -77,6 +78,10 @@ public abstract class GuiMachineBase extends GuiContainerBase {
|
||||
addOverlay(configOverlay);
|
||||
}
|
||||
|
||||
protected boolean showRecipeButton() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public void renderSlotHighlights(IoMode mode) {
|
||||
SlotDefinition slotDef = tileEntity.getSlotDefinition();
|
||||
@@ -149,6 +154,11 @@ public abstract class GuiMachineBase extends GuiContainerBase {
|
||||
guibutton.drawButton(this.mc, 0, 0);
|
||||
}
|
||||
|
||||
if(showRecipeButton()) {
|
||||
IconEIO.RECIPE.renderIcon(k + 155, l + 43,16,16,0, true);
|
||||
//IconEIO.RECIPE.renderIcon(0,0,0,16,16,true);
|
||||
}
|
||||
|
||||
SelectedFace sel = configOverlay.getSelection();
|
||||
if(sel != null) {
|
||||
IoMode mode = sel.config.getIoMode(sel.face);
|
||||
|
||||
@@ -58,7 +58,7 @@ public class GuiAlloySmelter extends GuiMachineBase {
|
||||
super.initGui();
|
||||
|
||||
int x = guiLeft + xSize - 5 - BUTTON_SIZE;
|
||||
int y = guiTop + 60;
|
||||
int y = guiTop + 62;
|
||||
|
||||
vanillaFurnaceButton = new IconButton(getFontRenderer(), SMELT_MODE_BUTTON_ID, x, y, getIconForMode(), RenderUtil.BLOCK_TEX);
|
||||
vanillaFurnaceButton.setSize(BUTTON_SIZE, BUTTON_SIZE);
|
||||
|
||||
@@ -59,6 +59,11 @@ public class GuiCombustionGenerator extends GuiMachineBase {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderSlotHighlights(IoMode mode) {
|
||||
super.renderSlotHighlights(mode);
|
||||
|
||||
@@ -25,6 +25,10 @@ public class GuiStirlingGenerator extends GuiMachineBase {
|
||||
this.entity = te;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
|
||||
|
||||
@@ -39,4 +39,10 @@ public class GuiPainter extends GuiMachineBase {
|
||||
|
||||
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -46,8 +46,7 @@ public class AlloySmelterRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
//Set this up later to show all alloy recipes
|
||||
transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(77-5, 26-3, 19, 25), "EnderIOAlloySmelter", new Object[0]));
|
||||
transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(149, 32, 16, 16), "EnderIOAlloySmelter", new Object[0]));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -56,7 +56,7 @@ public class SagMillRecipeHandler extends TemplateRecipeHandler {
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
//Set this up later to show all alloy recipes
|
||||
transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(81-5, 32-11, 15, 23), "EnderIOSagMill", new Object[0]));
|
||||
transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(149, 32, 16, 16), "EnderIOSagMill", new Object[0]));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -63,8 +63,7 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
//Set this up later to show all alloy recipes
|
||||
transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(81-5, 32-11, 15, 23), "EnderIOVat", new Object[0]));
|
||||
transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(149, 32, 16, 16), "EnderIOVat", new Object[0]));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user