Skip to content

Commit

Permalink
actually fix background
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyvest committed Jun 21, 2024
1 parent 8a4dc7a commit 3983b67
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/main/java/org/polyfrost/vanillahud/hud/ItemTooltip.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import cc.polyfrost.oneconfig.config.annotations.*;
import cc.polyfrost.oneconfig.config.core.OneColor;
import cc.polyfrost.oneconfig.config.data.*;
import cc.polyfrost.oneconfig.events.EventManager;
import cc.polyfrost.oneconfig.hud.SingleTextHud;
import cc.polyfrost.oneconfig.libs.universal.*;
Expand Down Expand Up @@ -48,9 +47,6 @@ public static class HeldItemTooltipHUD extends SingleTextHud {
@Exclude
private static final Minecraft mc = UMinecraft.getMinecraft();

@Exclude
private boolean example = false;

public HeldItemTooltipHUD() {
super("", true, 1920f / 2, 1080f - 37f, 1, false, false, 0, 0, 0, new OneColor(0, 0, 0, 80), false, 2, new OneColor(0, 0, 0));
this.textType = 1;
Expand All @@ -73,7 +69,9 @@ protected void drawLine(String line, float x, float y, OneColor c, float scale)

@Override
public void drawAll(UMatrixStack matrices, boolean example) {
this.example = example;
if (example) {
opacity = 255;
}
super.drawAll(matrices, example);
}

Expand All @@ -88,7 +86,7 @@ protected boolean shouldShow() {
if (o > 255) {
o = 255;
}
opacity = example || instantFade ? 255 : o;
opacity = instantFade ? 255 : o;
String spectatorText = null;
if (mc.thePlayer != null && mc.thePlayer.isSpectator()) {
GuiSpectatorAccessor spectatorAccessor = (GuiSpectatorAccessor) mc.ingameGUI.getSpectatorGui();
Expand All @@ -107,7 +105,6 @@ protected boolean shouldShow() {
}

protected void drawBackground(float x, float y, float width, float height, float scale) {

NanoVGHelper nanoVGHelper = NanoVGHelper.INSTANCE;
nanoVGHelper.setupAndDraw(true, (vg) -> {
int bgColor = ColorUtils.setAlpha(this.bgColor.getRGB(), Math.min(this.bgColor.getAlpha(), this.opacity));
Expand Down

0 comments on commit 3983b67

Please sign in to comment.