From 53314b210709f61252d26c5434a5c9400cc57b64 Mon Sep 17 00:00:00 2001 From: CovertJaguar Date: Fri, 26 Apr 2013 18:47:36 -0700 Subject: [PATCH] Added Small MultiButton --- .../core/gui/buttons/GuiMultiButton.java | 6 ++++-- .../core/gui/buttons/GuiMultiButtonSmall.java | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 common/buildcraft/core/gui/buttons/GuiMultiButtonSmall.java diff --git a/common/buildcraft/core/gui/buttons/GuiMultiButton.java b/common/buildcraft/core/gui/buttons/GuiMultiButton.java index 3ca4c1a2..c5b4c50a 100644 --- a/common/buildcraft/core/gui/buttons/GuiMultiButton.java +++ b/common/buildcraft/core/gui/buttons/GuiMultiButton.java @@ -1,5 +1,6 @@ package buildcraft.core.gui.buttons; +import static buildcraft.core.gui.buttons.GuiBetterButton.BUTTON_TEXTURES; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.Minecraft; @@ -14,6 +15,7 @@ import org.lwjgl.opengl.GL11; public class GuiMultiButton extends GuiBetterButton { private final MultiButtonController control; + protected int texOffset = 88; public GuiMultiButton(int id, int x, int y, int width, MultiButtonController control) { super(id, x, y, width, 20, ""); @@ -30,8 +32,8 @@ public class GuiMultiButton extends GuiBetterButton { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); boolean flag = i >= xPosition && j >= yPosition && i < xPosition + width && j < yPosition + height; int hoverState = getHoverState(flag); - drawTexturedModalRect(xPosition, yPosition, 0, 88 + hoverState * 20, width / 2, height); - drawTexturedModalRect(xPosition + width / 2, yPosition, 200 - width / 2, 88 + hoverState * 20, width / 2, height); + drawTexturedModalRect(xPosition, yPosition, 0, texOffset + hoverState * height, width / 2, height); + drawTexturedModalRect(xPosition + width / 2, yPosition, 200 - width / 2, texOffset + hoverState * height, width / 2, height); mouseDragged(minecraft, i, j); displayString = control.getButtonState().getLabel(); if (!enabled) { diff --git a/common/buildcraft/core/gui/buttons/GuiMultiButtonSmall.java b/common/buildcraft/core/gui/buttons/GuiMultiButtonSmall.java new file mode 100644 index 00000000..4c054c48 --- /dev/null +++ b/common/buildcraft/core/gui/buttons/GuiMultiButtonSmall.java @@ -0,0 +1,18 @@ +package buildcraft.core.gui.buttons; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * + * @author CovertJaguar + */ +@SideOnly(Side.CLIENT) +public class GuiMultiButtonSmall extends GuiMultiButton { + + public GuiMultiButtonSmall(int id, int x, int y, int width, MultiButtonController control) { + super(id, x, y, width, control); + height = 15; + texOffset = 168; + } +}