From 96b65a5b1bcee2435f0f09a65d454399eeaac0f3 Mon Sep 17 00:00:00 2001 From: Sollace Date: Sun, 8 Aug 2021 00:31:57 +0200 Subject: [PATCH] Make the hud fade out when not being used --- .../java/com/minelittlepony/unicopia/client/gui/UHud.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/client/gui/UHud.java b/src/main/java/com/minelittlepony/unicopia/client/gui/UHud.java index e9da6c69..59fea406 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/gui/UHud.java +++ b/src/main/java/com/minelittlepony/unicopia/client/gui/UHud.java @@ -79,8 +79,11 @@ public class UHud extends DrawableHelper { 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); boolean swap = client.options.keySneak.isPressed(); @@ -117,8 +120,6 @@ public class UHud extends DrawableHelper { RenderSystem.applyModelViewMatrix(); }); } - - } private void renderMessage(MatrixStack matrices, float tickDelta) {