diff options
Diffstat (limited to 'src/main/java/gregtech/api/gui/GT_GUIScreen.java')
-rw-r--r-- | src/main/java/gregtech/api/gui/GT_GUIScreen.java | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/main/java/gregtech/api/gui/GT_GUIScreen.java b/src/main/java/gregtech/api/gui/GT_GUIScreen.java index 1b01f17ec8..1efaddea35 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIScreen.java +++ b/src/main/java/gregtech/api/gui/GT_GUIScreen.java @@ -1,7 +1,7 @@ package gregtech.api.gui; import gregtech.api.enums.Dyes; -import gregtech.api.enums.GuiColors; +import gregtech.api.gui.GT_GUIColorOverride; import gregtech.api.gui.widgets.GT_GuiFakeItemButton; import gregtech.api.gui.widgets.GT_GuiIntegerTextBox; import gregtech.api.gui.widgets.GT_GuiTooltip; @@ -19,6 +19,7 @@ import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; +import java.io.IOException; import java.util.ArrayList; import java.util.List; @@ -30,20 +31,27 @@ public abstract class GT_GUIScreen extends GuiScreen implements GT_IToolTipRende protected int gui_height = 107; protected int guiTop, guiLeft; protected boolean drawButtons = true; - private final int textColor = GuiColors.multiMachineTitle.getColor(); + + private ResourceLocation mGUIbackgroundLocation; private GuiButton selectedButton; + private GT_GUIColorOverride colorOverride; + private final int textColor; + private final static String guiTexturePath = "gregtech:textures/gui/GuiCover.png"; + public String header; public GT_GuiFakeItemButton headerIcon; - protected List<IGuiElement> elements = new ArrayList<>(); protected List<GT_GuiIntegerTextBox> textBoxes = new ArrayList<>(); public GT_GUIScreen(int width, int height, String header) { - this.gui_width = width; + this.gui_width = width; this.gui_height = height; this.header = header; this.headerIcon = new GT_GuiFakeItemButton(this, 5, 5, null); + this.mGUIbackgroundLocation = new ResourceLocation(guiTexturePath); + this.colorOverride = new GT_GUIColorOverride(guiTexturePath); + this.textColor = getTextColorOrDefault("title", 0xFF222222); } @Override @@ -68,6 +76,10 @@ public abstract class GT_GUIScreen extends GuiScreen implements GT_IToolTipRende protected abstract void onInitGui(int guiLeft, int guiTop, int gui_width, int gui_height); + protected int getTextColorOrDefault(String textType, int defaultColor) { + return colorOverride.getTextColorOrDefault(textType, defaultColor); + } + public void onMouseWheel(int x, int y, int delta) { } @@ -122,7 +134,7 @@ public abstract class GT_GUIScreen extends GuiScreen implements GT_IToolTipRende public void drawBackground(int mouseX, int mouseY, float parTicks) { short[] color = Dyes.MACHINE_METAL.getRGBA(); GL11.glColor3ub((byte) color[0], (byte) color[1], (byte) color[2]); - this.mc.renderEngine.bindTexture(new ResourceLocation("gregtech:textures/gui/GuiCover.png")); + this.mc.renderEngine.bindTexture(mGUIbackgroundLocation); drawTexturedModalRect(guiLeft, guiTop, 0,0, gui_width, gui_height); } |