Skip to content

Commit

Permalink
Fix the issue where buttons stay highlighted after clicking them
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaocihua committed Oct 17, 2023
1 parent bae0048 commit b62b129
Showing 1 changed file with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import net.minecraft.client.gui.widget.TexturedButtonWidget;
import net.minecraft.screen.ScreenTexts;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import org.jetbrains.annotations.Nullable;

import java.util.Optional;
Expand All @@ -38,17 +39,8 @@ private PosUpdatableButtonWidget(int width,
@Override
public void renderButton(DrawContext context, int mouseX, int mouseY, float delta) {
posUpdater.ifPresent(updater -> setPos(updater.apply((HandledScreenAccessor) parent)));
super.renderButton(context, mouseX, mouseY, delta);
// RenderSystem.setShaderTexture(0, texture);
// int i = v;
// if (!this.isNarratable()) {
// i = v + hoveredVOffset * 2;
// } else if (this.isHovered()) {
// i = v + hoveredVOffset;
// }
//
// RenderSystem.enableDepthTest();
// drawTexture(context, texture, getX(), getY(), u, i, 0, width, height, textureWidth, textureHeight);
Identifier identifier = this.textures.get(this.isNarratable(), this.isHovered());
context.drawGuiTexture(identifier, this.getX(), this.getY(), this.width, this.height);
}

public void setPos(Vec2i pos) {
Expand Down

0 comments on commit b62b129

Please sign in to comment.