Skip to content

Commit

Permalink
Merge remote-tracking branch 'Laiff/feature/level-maintainer-terminal…
Browse files Browse the repository at this point in the history
…' into dev
  • Loading branch information
Dream-Master committed Oct 14, 2023
2 parents 3407d8b + be752e8 commit 3b5a6ba
Show file tree
Hide file tree
Showing 12 changed files with 1,085 additions and 902 deletions.
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

dependencies {
api('com.github.GTNewHorizons:NotEnoughItems:2.4.3-GTNH:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-263-GTNH-pre:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-266-GTNH-pre:dev')
api('curse.maven:cofh-core-69162:2388751')
api('com.github.GTNewHorizons:waila:1.6.0:dev')
api("com.github.GTNewHorizons:WirelessCraftingTerminal:1.10.0:dev")
Expand Down
1,433 changes: 1,000 additions & 433 deletions src/main/java/com/glodblock/github/client/gui/GuiInterfaceWireless.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import net.minecraftforge.common.util.ForgeDirection;

import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;

import com.glodblock.github.FluidCraft;
import com.glodblock.github.client.gui.container.ContainerLevelMaintainer;
Expand All @@ -36,7 +37,6 @@
import com.glodblock.github.network.CPacketLevelMaintainer;
import com.glodblock.github.network.CPacketLevelMaintainer.Action;
import com.glodblock.github.network.CPacketLevelTerminalCommands;
import com.glodblock.github.util.Ae2ReflectClient;
import com.glodblock.github.util.FCGuiColors;
import com.glodblock.github.util.NameConst;
import com.glodblock.github.util.Util;
Expand All @@ -45,7 +45,6 @@
import appeng.api.util.DimensionalCoord;
import appeng.client.gui.AEBaseGui;
import appeng.client.gui.widgets.GuiTabButton;
import appeng.client.render.AppEngRenderItem;
import appeng.container.AEBaseContainer;
import appeng.container.slot.SlotFake;
import appeng.core.sync.network.NetworkHandler;
Expand All @@ -63,7 +62,6 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler {
private final ContainerLevelMaintainer cont;
private final Component[] component = new Component[TileLevelMaintainer.REQ_COUNT];
private final MouseRegionManager mouseRegions = new MouseRegionManager(this);
private final AppEngRenderItem stackSizeRenderer = Ae2ReflectClient.getStackSizeRenderer(this);
private FCGuiTextField input;
private int lastWorkingTick;
private int refreshTick;
Expand Down Expand Up @@ -226,13 +224,17 @@ public boolean drawSlot0(Slot slot) {
} else {
fake.setStackSize(0);
}
stackSizeRenderer.setAeStack(fake);
stackSizeRenderer.renderItemOverlayIntoGUI(
float lastZLevel = this.zLevel;
this.zLevel = 0f;
GL11.glTranslatef(0.0f, 0.0f, 200.0f);
aeRenderItem.renderItemOverlayIntoGUI(
fontRendererObj,
mc.getTextureManager(),
fake.getItemStack(),
slot.xDisplayPosition,
slot.yDisplayPosition);
GL11.glTranslatef(0.0f, 0.0f, -200.0f);
this.zLevel = lastZLevel;
return false;
}
return true;
Expand Down Expand Up @@ -322,7 +324,6 @@ public void switchGui() {
originalBlockPos.z,
originalBlockPos.getDimension(),
originalBlockPos.getSide()));
// InventoryHandler.switchGui(originalGui);
}

@Override
Expand Down
24 changes: 13 additions & 11 deletions src/main/java/com/glodblock/github/client/gui/GuiLevelTerminal.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
import com.glodblock.github.network.CPacketLevelTerminalCommands;
import com.glodblock.github.network.CPacketLevelTerminalCommands.Action;
import com.glodblock.github.network.CPacketRenamer;
import com.glodblock.github.util.Ae2ReflectClient;
import com.glodblock.github.util.FCGuiColors;
import com.glodblock.github.util.ModAndClassUtil;
import com.glodblock.github.util.NameConst;
Expand All @@ -68,7 +67,6 @@
import appeng.client.gui.widgets.GuiTabButton;
import appeng.client.gui.widgets.IDropToFillTextField;
import appeng.client.gui.widgets.MEGuiTextField;
import appeng.client.render.AppEngRenderItem;
import appeng.client.render.BlockPosHighlighter;
import appeng.container.AEBaseContainer;
import appeng.container.slot.AppEngSlot;
Expand All @@ -94,7 +92,6 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
private static final ResourceLocation TEX_BG = FluidCraft.resource("textures/gui/level_terminal.png");
protected int offsetY;
private static final int offsetX = 21;
private final AppEngRenderItem stackSizeRenderer = Ae2ReflectClient.getStackSizeRenderer(this);
protected static String searchFieldOutputsText = "";
protected static String searchFieldNamesText = "";
protected static String currentMode = "OFF";
Expand Down Expand Up @@ -496,6 +493,7 @@ private int drawEntry(LevelTerminalEntry entry, int viewY, int titleBottom, int
Tessellator.instance.startDrawingQuads();
int relY = 0;
final int slotLeftMargin = (VIEW_WIDTH - entry.rowSize * 18);
float lastZLevel = aeRenderItem.zLevel;

entry.dispY = viewY;
/* PASS 1: BG */
Expand Down Expand Up @@ -571,6 +569,9 @@ private int drawEntry(LevelTerminalEntry entry, int viewY, int titleBottom, int
if (stack != null) {

NBTTagCompound data = stack.getTagCompound();
ItemStack itemStack = data.hasKey(TLMTags.Stack.tagName)
? ItemStack.loadItemStackFromNBT(data.getCompoundTag(TLMTags.Stack.tagName))
: stack.copy();
long quantity = data.getLong(TLMTags.Quantity.tagName);
long batch = data.getLong(TLMTags.Batch.tagName);
State state = State.values()[data.getInteger(TLMTags.State.tagName)];
Expand All @@ -580,16 +581,16 @@ private int drawEntry(LevelTerminalEntry entry, int viewY, int titleBottom, int
GL11.glTranslatef(colLeft, viewY + rowYTop + 1, ITEM_STACK_Z);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
RenderHelper.enableGUIStandardItemLighting();
stackSizeRenderer.zLevel = 3.0f - 50.0f;
stackSizeRenderer.renderItemAndEffectIntoGUI(fontRendererObj, mc.getTextureManager(), stack, 0, 0);
stackSizeRenderer.zLevel = 0.0f;
aeRenderItem.zLevel = 3.0f - 50.0f;
aeRenderItem.renderItemAndEffectIntoGUI(fontRendererObj, mc.getTextureManager(), itemStack, 0, 0);
aeRenderItem.zLevel = 0.0f;
GL11.glTranslatef(0.0f, 0.0f, ITEM_STACK_OVERLAY_Z - ITEM_STACK_Z);
stack.stackSize = (int) quantity;
stackSizeRenderer.renderItemOverlayIntoGUI(fontRendererObj, mc.getTextureManager(), stack, 0, 0);
itemStack.stackSize = (int) quantity;
aeRenderItem.renderItemOverlayIntoGUI(fontRendererObj, mc.getTextureManager(), itemStack, 0, 0);
if (batch > 0) {
stack.stackSize = (int) batch;
stackSizeRenderer
.renderItemOverlayIntoGUI(fontRendererObj, mc.getTextureManager(), stack, 0, -11);
itemStack.stackSize = (int) batch;
aeRenderItem
.renderItemOverlayIntoGUI(fontRendererObj, mc.getTextureManager(), itemStack, 0, -11);
}
int color = switch (state) {
case Idle -> FCGuiColors.StateIdle.getColor();
Expand Down Expand Up @@ -634,6 +635,7 @@ private int drawEntry(LevelTerminalEntry entry, int viewY, int titleBottom, int
}
}
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
aeRenderItem.zLevel = lastZLevel;
return relY + 1;
}

Expand Down
Loading

0 comments on commit 3b5a6ba

Please sign in to comment.