Added Small MultiButton
This commit is contained in:
parent
8985ec9402
commit
53314b2107
2 changed files with 22 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
||||||
package buildcraft.core.gui.buttons;
|
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.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
@ -14,6 +15,7 @@ import org.lwjgl.opengl.GL11;
|
||||||
public class GuiMultiButton extends GuiBetterButton {
|
public class GuiMultiButton extends GuiBetterButton {
|
||||||
|
|
||||||
private final MultiButtonController control;
|
private final MultiButtonController control;
|
||||||
|
protected int texOffset = 88;
|
||||||
|
|
||||||
public GuiMultiButton(int id, int x, int y, int width, MultiButtonController control) {
|
public GuiMultiButton(int id, int x, int y, int width, MultiButtonController control) {
|
||||||
super(id, x, y, width, 20, "");
|
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);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
boolean flag = i >= xPosition && j >= yPosition && i < xPosition + width && j < yPosition + height;
|
boolean flag = i >= xPosition && j >= yPosition && i < xPosition + width && j < yPosition + height;
|
||||||
int hoverState = getHoverState(flag);
|
int hoverState = getHoverState(flag);
|
||||||
drawTexturedModalRect(xPosition, yPosition, 0, 88 + hoverState * 20, width / 2, height);
|
drawTexturedModalRect(xPosition, yPosition, 0, texOffset + hoverState * height, width / 2, height);
|
||||||
drawTexturedModalRect(xPosition + width / 2, yPosition, 200 - width / 2, 88 + hoverState * 20, width / 2, height);
|
drawTexturedModalRect(xPosition + width / 2, yPosition, 200 - width / 2, texOffset + hoverState * height, width / 2, height);
|
||||||
mouseDragged(minecraft, i, j);
|
mouseDragged(minecraft, i, j);
|
||||||
displayString = control.getButtonState().getLabel();
|
displayString = control.getButtonState().getLabel();
|
||||||
if (!enabled) {
|
if (!enabled) {
|
||||||
|
|
18
common/buildcraft/core/gui/buttons/GuiMultiButtonSmall.java
Normal file
18
common/buildcraft/core/gui/buttons/GuiMultiButtonSmall.java
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
package buildcraft.core.gui.buttons;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author CovertJaguar <railcraft.wikispaces.com>
|
||||||
|
*/
|
||||||
|
@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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue