From d644baa4cc78436975584c21ee78093e8df3e3ed Mon Sep 17 00:00:00 2001 From: Mrbysco Date: Tue, 22 Oct 2024 19:22:50 +0200 Subject: [PATCH] Remove unused Buttons class --- .../mod/inventory/gui/Buttons.java | 84 ------------------- 1 file changed, 84 deletions(-) delete mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/Buttons.java diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/Buttons.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/Buttons.java deleted file mode 100644 index 9b84b5c83..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/Buttons.java +++ /dev/null @@ -1,84 +0,0 @@ -package de.ellpeck.actuallyadditions.mod.inventory.gui; - -import com.mojang.blaze3d.platform.GlStateManager; -import com.mojang.blaze3d.systems.RenderSystem; -import de.ellpeck.actuallyadditions.mod.util.AssetUtil; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.client.gui.components.Button; -import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; - -import javax.annotation.Nonnull; - -@Deprecated(forRemoval = true) //Unused because vanilla's Button class can render small just fine and even allows text scrolling -public class Buttons { - - @Deprecated(forRemoval = true) //Vanilla's Button class can render small just fine and even allows text scrolling - public static class SmallerButton extends Button { - - public final ResourceLocation resLoc = AssetUtil.getGuiLocation("gui_inputter"); - private final boolean smaller; - - public SmallerButton(int x, int y, Component display, OnPress pressable) { - this(x, y, display, false, pressable); - } - - public SmallerButton(int x, int y, Component display, boolean smaller, OnPress pressable) { - super(x, y, 16, smaller - ? 12 - : 16, display, pressable, DEFAULT_NARRATION); - this.smaller = smaller; - } - - @Override - public void renderWidget(@Nonnull GuiGraphics guiGraphics, int mouseX, int mouseY, float f) { - if (this.visible) { - RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); - int k = !this.active ? 0 : (this.isHoveredOrFocused() ? 2 : 1); - GlStateManager._enableBlend(); - GlStateManager.glBlendFuncSeparate(770, 771, 1, 0); - GlStateManager._blendFunc(770, 771); - guiGraphics.blit(this.resLoc, this.getX(), this.getY(), this.smaller - ? 200 - : 176, k * this.height, this.width, this.height); - //this.mouseDragged(mc, x, y); // The heck was this doing here? - - int color = 14737632; - if (this.packedFGColor != 0) { - color = this.packedFGColor; - } else if (!this.active) { - color = 10526880; - } else if (this.isHovered) { - color = 16777120; - } - - guiGraphics.drawCenteredString(Minecraft.getInstance().font, this.getMessage(), this.getX() + this.width / 2, this.getY() + (this.height - 8) / 2, this.getMessage().getStyle().getColor().getValue()); - } - - } - } - - - public static class TinyButton extends Button { - - public final ResourceLocation resLoc = AssetUtil.getGuiLocation("gui_inputter"); - - public TinyButton(int id, int x, int y) { - super(x, y, 8, 8, Component.literal(""), Button::onPress, DEFAULT_NARRATION); - } - - @Override - public void renderWidget(GuiGraphics guiGraphics, int mouseX, int mouseY, float f) { - if (this.visible) { - RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); - int k = !this.active ? 0 : (this.isHoveredOrFocused() ? 2 : 1); - GlStateManager._enableBlend(); - GlStateManager.glBlendFuncSeparate(770, 771, 1, 0); - GlStateManager._blendFunc(770, 771); - guiGraphics.blit(this.resLoc, this.getX(), this.getY(), 192, k * 8, 8, 8); - //this.mouseDragged(mc, x, y); - } - } - } -}