diff options
| author | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-03-21 14:48:22 +0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-21 08:48:22 +0100 |
| commit | 2696141f9790fd6c8d3df1148f46d298512c4902 (patch) | |
| tree | b05082fdb69de516ec34f07012055ac82dd0bb09 /src/main/java/io/polyfrost/oneconfig/hud/interfaces | |
| parent | 72118423d214b964ea9bd3d2a1411c72941c5f90 (diff) | |
| download | OneConfig-2696141f9790fd6c8d3df1148f46d298512c4902.tar.gz OneConfig-2696141f9790fd6c8d3df1148f46d298512c4902.tar.bz2 OneConfig-2696141f9790fd6c8d3df1148f46d298512c4902.zip | |
stuff (#1)
* new: use archloom instead of forgegradle
* misc: reformat code
* update archloom
Diffstat (limited to 'src/main/java/io/polyfrost/oneconfig/hud/interfaces')
| -rw-r--r-- | src/main/java/io/polyfrost/oneconfig/hud/interfaces/BasicHud.java | 4 | ||||
| -rw-r--r-- | src/main/java/io/polyfrost/oneconfig/hud/interfaces/TextHud.java | 14 |
2 files changed, 6 insertions, 12 deletions
diff --git a/src/main/java/io/polyfrost/oneconfig/hud/interfaces/BasicHud.java b/src/main/java/io/polyfrost/oneconfig/hud/interfaces/BasicHud.java index ebc5459..419bccf 100644 --- a/src/main/java/io/polyfrost/oneconfig/hud/interfaces/BasicHud.java +++ b/src/main/java/io/polyfrost/oneconfig/hud/interfaces/BasicHud.java @@ -42,9 +42,7 @@ public abstract class BasicHud { } private void drawBackground(float x, float y, float scale) { - Renderer.drawRoundRect((int) x, (int) y, - (int) (getWidth(scale) + paddingX * scale), (int) (getHeight(scale) + paddingY * scale), - (int) (2 * scale), new Color(0, 0, 0, 120).getRGB()); + Renderer.drawRoundRect((int) x, (int) y, (int) (getWidth(scale) + paddingX * scale), (int) (getHeight(scale) + paddingY * scale), (int) (2 * scale), new Color(0, 0, 0, 120).getRGB()); } public float getXScaled(int screenWidth) { diff --git a/src/main/java/io/polyfrost/oneconfig/hud/interfaces/TextHud.java b/src/main/java/io/polyfrost/oneconfig/hud/interfaces/TextHud.java index 77f5880..3c9cf4c 100644 --- a/src/main/java/io/polyfrost/oneconfig/hud/interfaces/TextHud.java +++ b/src/main/java/io/polyfrost/oneconfig/hud/interfaces/TextHud.java @@ -14,10 +14,10 @@ public class TextHud extends BasicHud { */ private final FontRenderer fb = Minecraft.getMinecraft().fontRendererObj; boolean shadow = false; + boolean doExample = false; private List<String> cachedLines; private int cachedWidth; private int cachedHeight; - boolean doExample = false; private List<String> cachedExampleLines; private int cachedExampleWidth; private int cachedExampleHeight; @@ -35,8 +35,7 @@ public class TextHud extends BasicHud { cachedWidth = 0; for (String line : cachedLines) { int width = fb.getStringWidth(line); - if (width > cachedWidth) - cachedWidth = width; + if (width > cachedWidth) cachedWidth = width; } } if (doExample) { @@ -46,8 +45,7 @@ public class TextHud extends BasicHud { cachedExampleWidth = 0; for (String line : cachedExampleLines) { int width = fb.getStringWidth(line); - if (width > cachedExampleWidth) - cachedExampleWidth = width; + if (width > cachedExampleWidth) cachedExampleWidth = width; } } } @@ -59,15 +57,13 @@ public class TextHud extends BasicHud { @Override public void draw(int x, int y, float scale) { - if (cachedLines != null) - drawText(cachedLines, x, y, scale); + if (cachedLines != null) drawText(cachedLines, x, y, scale); } @Override public void drawExample(int x, int y, float scale) { doExample = true; - if (cachedExampleLines != null) - drawText(cachedExampleLines, x, y, scale); + if (cachedExampleLines != null) drawText(cachedExampleLines, x, y, scale); } private void drawText(List<String> lines, int x, int y, float scale) { |
