Skip to content

Commit 3983b67

Browse files
committed
actually fix background
1 parent 8a4dc7a commit 3983b67

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

src/main/java/org/polyfrost/vanillahud/hud/ItemTooltip.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import cc.polyfrost.oneconfig.config.annotations.*;
44
import cc.polyfrost.oneconfig.config.core.OneColor;
5-
import cc.polyfrost.oneconfig.config.data.*;
65
import cc.polyfrost.oneconfig.events.EventManager;
76
import cc.polyfrost.oneconfig.hud.SingleTextHud;
87
import cc.polyfrost.oneconfig.libs.universal.*;
@@ -48,9 +47,6 @@ public static class HeldItemTooltipHUD extends SingleTextHud {
4847
@Exclude
4948
private static final Minecraft mc = UMinecraft.getMinecraft();
5049

51-
@Exclude
52-
private boolean example = false;
53-
5450
public HeldItemTooltipHUD() {
5551
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));
5652
this.textType = 1;
@@ -73,7 +69,9 @@ protected void drawLine(String line, float x, float y, OneColor c, float scale)
7369

7470
@Override
7571
public void drawAll(UMatrixStack matrices, boolean example) {
76-
this.example = example;
72+
if (example) {
73+
opacity = 255;
74+
}
7775
super.drawAll(matrices, example);
7876
}
7977

@@ -88,7 +86,7 @@ protected boolean shouldShow() {
8886
if (o > 255) {
8987
o = 255;
9088
}
91-
opacity = example || instantFade ? 255 : o;
89+
opacity = instantFade ? 255 : o;
9290
String spectatorText = null;
9391
if (mc.thePlayer != null && mc.thePlayer.isSpectator()) {
9492
GuiSpectatorAccessor spectatorAccessor = (GuiSpectatorAccessor) mc.ingameGUI.getSpectatorGui();
@@ -107,7 +105,6 @@ protected boolean shouldShow() {
107105
}
108106

109107
protected void drawBackground(float x, float y, float width, float height, float scale) {
110-
111108
NanoVGHelper nanoVGHelper = NanoVGHelper.INSTANCE;
112109
nanoVGHelper.setupAndDraw(true, (vg) -> {
113110
int bgColor = ColorUtils.setAlpha(this.bgColor.getRGB(), Math.min(this.bgColor.getAlpha(), this.opacity));

0 commit comments

Comments
 (0)