aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/gui/GT_GUIContainer_AdvDebugStructureWriter.java
blob: 3ae07cef8e7ce251f1b8fb86c4060d68268d4f2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package gregtech.common.gui;

import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
import static net.minecraft.util.StatCollector.translateToLocal;

import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.gui.widgets.GT_GuiSlotTooltip;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.entity.player.InventoryPlayer;

public class GT_GUIContainer_AdvDebugStructureWriter extends GT_GUIContainerMetaTile_Machine {

    private static final String ADVDEBUGSTRUCTUREWRITER_PRINT_TOOLTIP =
            "GT5U.machines.advdebugstructurewriter.gui.print.tooltip";
    private static final String ADVDEBUGSTRUCTUREWRITER_TRANSPOSE_TOOLTIP =
            "GT5U.machines.advdebugstructurewriter.gui.transpose.tooltip";
    private static final String ADVDEBUGSTRUCTUREWRITER_HIGHLIGHT_TOOLTIP =
            "GT5U.machines.advdebugstructurewriter.gui.highlight.tooltip";

    public GT_GUIContainer_AdvDebugStructureWriter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
        super(
                new GT_Container_AdvDebugStructureWriter(aInventoryPlayer, aTileEntity),
                RES_PATH_GUI + "AdvDebugStructureWriter.png");
    }

    @Override
    protected void drawGuiContainerForegroundLayer(int par1, int par2) {
        if (mContainer != null) {
            GT_Container_AdvDebugStructureWriter dsw = (GT_Container_AdvDebugStructureWriter) mContainer;
            if (dsw.numbers == null) {
                return;
            }
            fontRendererObj.drawString(
                    translateToLocal("GT5U.machines.advdebugstructurewriter.gui.origin"), 46, 8, 16448255);
            fontRendererObj.drawString("A: " + dsw.numbers[0], 46, 18, 16448255);
            fontRendererObj.drawString("B: " + dsw.numbers[1], 46, 26, 16448255);
            fontRendererObj.drawString("C: " + dsw.numbers[2], 46, 34, 16448255);

            fontRendererObj.drawString(
                    translateToLocal("GT5U.machines.advdebugstructurewriter.gui.size"), 46, 60, 16448255);
            fontRendererObj.drawString("A: " + dsw.numbers[3], 46, 70, 16448255);
            fontRendererObj.drawString("B: " + dsw.numbers[4], 46, 78, 16448255);
            fontRendererObj.drawString("C: " + dsw.numbers[5], 46, 86, 16448255);
        }
    }

    @Override
    protected void setupTooltips() {
        addToolTip(new GT_GuiSlotTooltip(
                getContainer().printSlot, mTooltipCache.getData(ADVDEBUGSTRUCTUREWRITER_PRINT_TOOLTIP)));
        addToolTip(new GT_GuiSlotTooltip(
                getContainer().transposeSlot, mTooltipCache.getData(ADVDEBUGSTRUCTUREWRITER_TRANSPOSE_TOOLTIP)));
        addToolTip(new GT_GuiSlotTooltip(
                getContainer().highlightSlot, mTooltipCache.getData(ADVDEBUGSTRUCTUREWRITER_HIGHLIGHT_TOOLTIP)));
    }

    private GT_Container_AdvDebugStructureWriter getContainer() {
        return ((GT_Container_AdvDebugStructureWriter) this.mContainer);
    }

    @Override
    protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
        super.drawGuiContainerBackgroundLayer(par1, par2, par3);
        int x = (width - xSize) / 2;
        int y = (height - ySize) / 2;
        drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
        if (mContainer != null) {
            if (((GT_Container_AdvDebugStructureWriter) mContainer).transpose) {
                drawTexturedModalRect(x + 32, y + 128, 176, 0, 18, 18);
            }
            if (((GT_Container_AdvDebugStructureWriter) mContainer).showHighlightBox) {
                drawTexturedModalRect(x + 53, y + 128, 176, 18, 18, 18);
            }
        }
    }
}