From d5f7fc842c6709e2a6349763ee18045233584b8f Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 12 Oct 2021 08:25:00 -0400 Subject: [PATCH] Fixed #6140 --- core/src/mindustry/ui/Bar.java | 6 ++++-- core/src/mindustry/ui/Minimap.java | 1 + core/src/mindustry/ui/fragments/HudFragment.java | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/core/src/mindustry/ui/Bar.java b/core/src/mindustry/ui/Bar.java index eb4fcf9a54..1d566435e4 100644 --- a/core/src/mindustry/ui/Bar.java +++ b/core/src/mindustry/ui/Bar.java @@ -138,8 +138,10 @@ public class Bar extends Element{ GlyphLayout lay = Pools.obtain(GlyphLayout.class, GlyphLayout::new); lay.setText(font, name); - font.setColor(1f, 1f, 1f, parentAlpha); - font.draw(name, x + width / 2f - lay.width / 2f, y + height / 2f + lay.height / 2f + 1); + font.setColor(1f, 1f, 1f, 1f); + font.getCache().clear(); + font.getCache().addText(name, x + width / 2f - lay.width / 2f, y + height / 2f + lay.height / 2f + 1); + font.getCache().draw(parentAlpha); Pools.free(lay); } diff --git a/core/src/mindustry/ui/Minimap.java b/core/src/mindustry/ui/Minimap.java index 53736910f1..ad828a8dd2 100644 --- a/core/src/mindustry/ui/Minimap.java +++ b/core/src/mindustry/ui/Minimap.java @@ -37,6 +37,7 @@ public class Minimap extends Table{ Draw.rect(renderer.minimap.getRegion(), x + width / 2f, y + height / 2f, width, height); if(renderer.minimap.getTexture() != null){ + Draw.alpha(parentAlpha); renderer.minimap.drawEntities(x, y, width, height, 0.75f, false); } diff --git a/core/src/mindustry/ui/fragments/HudFragment.java b/core/src/mindustry/ui/fragments/HudFragment.java index bfe976d3f3..d37d5b1c07 100644 --- a/core/src/mindustry/ui/fragments/HudFragment.java +++ b/core/src/mindustry/ui/fragments/HudFragment.java @@ -667,7 +667,7 @@ public class HudFragment extends Fragment{ float stroke = width * 0.35f; float bh = height/2f; - Draw.color(color); + Draw.color(color, parentAlpha); float f1 = Math.min(fract * 2f, 1f), f2 = (fract - 0.5f) * 2f; @@ -703,10 +703,10 @@ public class HudFragment extends Fragment{ new Element(){ @Override public void draw(){ - Draw.color(Pal.darkerGray); + Draw.color(Pal.darkerGray, parentAlpha); Fill.poly(x + width/2f, y + height/2f, 6, height / Mathf.sqrt3); Draw.reset(); - Drawf.shadow(x + width/2f, y + height/2f, height * 1.13f); + Drawf.shadow(x + width/2f, y + height/2f, height * 1.13f, parentAlpha); } }, new Table(t -> {