Make the hud fade out when not being used

This commit is contained in:
Sollace 2021-08-08 00:31:57 +02:00
parent 1feb8c84d2
commit 96b65a5b1b

View file

@ -79,8 +79,11 @@ public class UHud extends DrawableHelper {
renderMessage(matrices, tickDelta); renderMessage(matrices, tickDelta);
} }
RenderSystem.enableBlend();
float progress = messageTime >= 20 ? 1 : (messageTime - tickDelta) / 20;
RenderSystem.setShaderColor(1, 1, 1, Math.max(0.1F, progress));
RenderSystem.enableBlend();
RenderSystem.setShaderTexture(0, HUD_TEXTURE); RenderSystem.setShaderTexture(0, HUD_TEXTURE);
boolean swap = client.options.keySneak.isPressed(); boolean swap = client.options.keySneak.isPressed();
@ -117,8 +120,6 @@ public class UHud extends DrawableHelper {
RenderSystem.applyModelViewMatrix(); RenderSystem.applyModelViewMatrix();
}); });
} }
} }
private void renderMessage(MatrixStack matrices, float tickDelta) { private void renderMessage(MatrixStack matrices, float tickDelta) {