2019-11-25 06:29:25 +00:00
|
|
|
package com.burnedkirby.TurnBasedMinecraft.client;
|
2018-09-11 06:15:31 +00:00
|
|
|
|
2019-10-21 07:13:11 +00:00
|
|
|
import net.minecraft.client.gui.widget.button.Button;
|
2018-09-11 06:15:31 +00:00
|
|
|
|
2019-10-21 07:13:11 +00:00
|
|
|
public class ItemSelectionButton extends Button
|
2018-09-11 06:15:31 +00:00
|
|
|
{
|
2019-10-21 07:13:11 +00:00
|
|
|
private int itemStackID;
|
2018-09-11 06:15:31 +00:00
|
|
|
|
2019-10-21 07:13:11 +00:00
|
|
|
public ItemSelectionButton(int x, int y, int widthIn, int heightIn, String buttonText, int itemStackID, Button.IPressable onPress) {
|
|
|
|
super(x, y, widthIn, heightIn, buttonText, onPress);
|
2018-09-11 06:15:31 +00:00
|
|
|
this.itemStackID = itemStackID;
|
|
|
|
}
|
2019-10-21 07:13:11 +00:00
|
|
|
|
|
|
|
public int getID() {
|
|
|
|
return itemStackID;
|
2018-09-11 06:15:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2019-10-21 07:13:11 +00:00
|
|
|
public void render(int mouseX, int mouseY, float partialTicks) {
|
|
|
|
if(visible) {
|
|
|
|
boolean hovered = mouseX >= x && mouseY >= y && mouseX < x + width && mouseY < y + height;
|
|
|
|
if(hovered) {
|
|
|
|
fill(x, y, x + width, y + height, 0x80FFFFFF);
|
|
|
|
} else {
|
|
|
|
fill(x, y, x + width, y + height, 0x20707070);
|
2018-09-11 06:15:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|