mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-20 04:09:45 +00:00
Angry Boubs
This commit is contained in:
1 parent
4fb83ddea6
commit
371337cf77
2 files changed
+13
-17
No files matched your search
Binary file not shown.
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 11 KiB |
@@ -1,18 +1,16 @@
|
||||
package codechicken.nei.config;
|
||||
|
||||
import codechicken.lib.render.CCRenderState;
|
||||
import codechicken.nei.Image;
|
||||
import codechicken.nei.LayoutManager;
|
||||
import codechicken.nei.drawable.DrawableBuilder;
|
||||
import codechicken.nei.drawable.DrawableResource;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
|
||||
import static codechicken.lib.gui.GuiDraw.changeTexture;
|
||||
import static codechicken.lib.gui.GuiDraw.drawStringC;
|
||||
import static codechicken.lib.gui.GuiDraw.drawTexturedModalRect;
|
||||
public class OptionToggleButtonBoubs extends OptionButton {
|
||||
private static final DrawableResource coolBoubs = new DrawableBuilder("nei:textures/nei_tabbed_sprites.png", 48, 16, 22, 22).build();
|
||||
private static final DrawableResource angryBoubs = new DrawableBuilder("nei:textures/nei_tabbed_sprites.png", 70, 16, 22, 22).build();
|
||||
|
||||
public class OptionToggleButtonBoubs extends OptionButton
|
||||
{
|
||||
public final boolean prefixed;
|
||||
|
||||
public OptionToggleButtonBoubs(String name, boolean prefixed) {
|
||||
@@ -32,19 +30,17 @@ public class OptionToggleButtonBoubs extends OptionButton
|
||||
public void drawButton(int mx, int my) {
|
||||
Rectangle b = buttonSize();
|
||||
LayoutManager.drawButtonBackground(b.x, b.y, b.width, b.height, true, getButtonTex(mx, my));
|
||||
if(state()) {
|
||||
changeTexture("nei:textures/nei_sprites.png");
|
||||
GL11.glColor4f(1, 1, 1, 1);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
Image image = new Image(48, 52, 24, 24);
|
||||
// drawTexturedModalRect(x, y, image.x, image.y, image.width, image.height);
|
||||
drawTexturedModalRect(b.x + (b.width/2) - (image.width/2), b.y, image.x, image.y, image.width, image.height);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glColor4f(1, 1, 1, 1);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
if(state()) {
|
||||
coolBoubs.draw(b.x + (b.width/2) - (coolBoubs.getWidth()/2), b.y);
|
||||
}else {
|
||||
drawStringC(getButtonText(), b.x, b.y, b.width, b.height, getTextColour(mx, my));
|
||||
angryBoubs.draw(b.x + (b.width/2) - (angryBoubs.getWidth()/2), b.y);
|
||||
}
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
|
||||
}
|
||||
|
||||
public String getButtonText() {
|
||||
|
||||
Reference in new issue
Block a user