Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
DrParanoya authored Feb 2, 2025
1 parent cf168e6 commit d20fbd4
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions src/main/java/drparanoya/hausehud/addon/hud/VisionBlocker.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
import drparanoya.hausehud.addon.HauseHUD;
import meteordevelopment.meteorclient.renderer.GL;
import meteordevelopment.meteorclient.renderer.Renderer2D;
import meteordevelopment.meteorclient.systems.hud.Hud;
import meteordevelopment.meteorclient.systems.hud.HudElement;
import meteordevelopment.meteorclient.systems.hud.HudElementInfo;
import meteordevelopment.meteorclient.systems.hud.HudRenderer;
import meteordevelopment.meteorclient.settings.Setting;
import meteordevelopment.meteorclient.settings.SettingGroup;
import meteordevelopment.meteorclient.settings.ColorSetting;
import meteordevelopment.meteorclient.settings.DoubleSetting;
import meteordevelopment.meteorclient.utils.render.color.Color;
import meteordevelopment.meteorclient.utils.render.color.SettingColor;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.Identifier;
Expand All @@ -21,18 +19,36 @@ public class VisionBlocker extends HudElement {

private final Setting<Double> scale = sgGeneral.add(new DoubleSetting.Builder()
.name("Scale")
.description("How much of your vision should we block?")
.description("Scale of image.png")
.defaultValue(1)
.min(0)
.sliderRange(0, 10)
.build()
);
private final Setting<SettingColor> imageColor = sgGeneral.add(new ColorSetting.Builder()
.name("Color")
.description("Color of the image.")
.description("Color of image.png.")
.defaultValue(new SettingColor())
.build()
);
private final Setting<Double> width = sgGeneral.add(new DoubleSetting.Builder()
.name("Width")
.description("Width of image.png")
.defaultValue(255)
.min(0)
.noSlider()
.decimalPlaces(0)
.build()
);
private final Setting<Double> height = sgGeneral.add(new DoubleSetting.Builder()
.name("Height")
.description("Height of image.png")
.defaultValue(255)
.min(0)
.noSlider()
.decimalPlaces(0)
.build()
);

private final Identifier image = Identifier.of("hausehud", "image.png");
public static final HudElementInfo<VisionBlocker> INFO = new HudElementInfo<>(HauseHUD.HUD_GROUP, "vision-blocker", "Renders an image to block your vision.", VisionBlocker::new);
Expand All @@ -43,11 +59,11 @@ public VisionBlocker() {

@Override
public void render(HudRenderer renderer) {
setSize(scale.get() * 255, scale.get() * 255);
setSize(width.get() * scale.get(), height.get() * scale.get());
MatrixStack matrixStack = new MatrixStack();
GL.bindTexture(image);
Renderer2D.TEXTURE.begin();
Renderer2D.TEXTURE.texQuad(this.x, this.y, scale.get() * 255, scale.get() * 255, imageColor.get());
Renderer2D.TEXTURE.texQuad(this.x, this.y, width.get() * scale.get(), height.get() * scale.get(), imageColor.get());
Renderer2D.TEXTURE.render(matrixStack);
}
}

0 comments on commit d20fbd4

Please sign in to comment.