aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/hud/BasicHud.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/hud/BasicHud.java')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/hud/BasicHud.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/hud/BasicHud.java b/src/main/java/cc/polyfrost/oneconfig/hud/BasicHud.java
index 3fc1007..503dddd 100644
--- a/src/main/java/cc/polyfrost/oneconfig/hud/BasicHud.java
+++ b/src/main/java/cc/polyfrost/oneconfig/hud/BasicHud.java
@@ -31,6 +31,7 @@ import cc.polyfrost.oneconfig.libs.universal.UMatrixStack;
import cc.polyfrost.oneconfig.renderer.RenderManager;
public abstract class BasicHud extends Hud {
+ protected boolean background;
protected boolean rounded;
protected boolean border;
protected OneColor bgColor;
@@ -45,6 +46,7 @@ public abstract class BasicHud extends Hud {
* @param x X-coordinate of hud on a 1080p display
* @param y Y-coordinate of hud on a 1080p display
* @param scale Scale of the hud
+ * @param background If the HUD should have a background
* @param rounded If the corner is rounded or not
* @param cornerRadius Radius of the corner
* @param paddingX Horizontal background padding
@@ -54,8 +56,9 @@ public abstract class BasicHud extends Hud {
* @param borderSize Thickness of the border
* @param borderColor The color of the border
*/
- public BasicHud(boolean enabled, float x, float y, float scale, boolean rounded, float cornerRadius, float paddingX, float paddingY, OneColor bgColor, boolean border, float borderSize, OneColor borderColor) {
+ public BasicHud(boolean enabled, float x, float y, float scale, boolean background, boolean rounded, float cornerRadius, float paddingX, float paddingY, OneColor bgColor, boolean border, float borderSize, OneColor borderColor) {
super(enabled, x, y, scale);
+ this.background = background;
this.rounded = rounded;
this.cornerRadius = cornerRadius;
this.paddingX = paddingX;
@@ -74,7 +77,7 @@ public abstract class BasicHud extends Hud {
* @param scale Scale of the hud
*/
public BasicHud(boolean enabled, float x, float y, float scale) {
- this(enabled, x, y, scale, false, 2, 5, 5, new OneColor(0, 0, 0, 120), false, 2, new OneColor(0, 0, 0));
+ this(enabled, x, y, scale, true, false, 2, 5, 5, new OneColor(0, 0, 0, 120), false, 2, new OneColor(0, 0, 0));
}
/**
@@ -83,18 +86,18 @@ public abstract class BasicHud extends Hud {
* @param y Y-coordinate of hud on a 1080p display
*/
public BasicHud(boolean enabled, float x, float y) {
- this(enabled, x, y, 1, false, 2, 5, 5, new OneColor(0, 0, 0, 120), false, 2, new OneColor(0, 0, 0));
+ this(enabled, x, y, 1, true, false, 2, 5, 5, new OneColor(0, 0, 0, 120), false, 2, new OneColor(0, 0, 0));
}
/**
* @param enabled If the hud is enabled
*/
public BasicHud(boolean enabled) {
- this(enabled, 0, 0, 1, false, 2, 5, 5, new OneColor(0, 0, 0, 120), false, 2, new OneColor(0, 0, 0));
+ this(enabled, 0, 0, 1, true, false, 2, 5, 5, new OneColor(0, 0, 0, 120), false, 2, new OneColor(0, 0, 0));
}
public BasicHud() {
- this(false, 0, 0, 1, false, 2, 5, 5, new OneColor(0, 0, 0, 120), false, 2, new OneColor(0, 0, 0));
+ this(false, 0, 0, 1, true, false, 2, 5, 5, new OneColor(0, 0, 0, 120), false, 2, new OneColor(0, 0, 0));
}
@Override
@@ -102,7 +105,7 @@ public abstract class BasicHud extends Hud {
if (!example && !shouldShow()) return;
preRender(example);
position.setSize(getWidth(scale, example) + paddingX * scale * 2f, getHeight(scale, example) + paddingY * scale * 2f);
- if (shouldDrawBackground())
+ if (shouldDrawBackground() && background)
drawBackground(position.getX(), position.getY(), position.getWidth(), position.getHeight(), scale);
draw(matrices, position.getX() + paddingX * scale, position.getY() + paddingY * scale, scale, example);
}