add opacity option to ESP
Some checks failed
/ Build BaseBand DSM & Broadway (push) Successful in 1m57s
/ Build BaseBand Installer (push) Successful in 1m6s
/ Build BaseBand Loader (push) Failing after 1m15s
/ Build BaseBand Server (push) Successful in 1m48s

This commit is contained in:
Daniella / Tove 2024-06-12 21:37:06 +02:00
parent 49cc495e6b
commit f6c8fe11e8
Signed by: TudbuT
GPG key ID: B3CF345217F202D3

View file

@ -5,6 +5,9 @@ import de.com.baseband.client.feature.Features;
import de.com.baseband.client.feature.category.Render;
import de.com.baseband.client.feature.client.Client;
import de.com.baseband.client.registry.annotation.Config;
import de.com.baseband.client.registry.annotation.Gate;
import de.com.baseband.client.registry.annotation.Range;
import de.com.baseband.client.util.adapt.Marker;
import de.com.baseband.client.util.render.Pixels;
import de.com.baseband.client.util.render.RenderAdapter;
import net.minecraft.entity.Entity;
@ -39,7 +42,12 @@ public class ESP extends Feature {
public boolean wireframe;
@Config("Fill")
@Marker(1)
public boolean fill;
@Config("Fill opacity")
@Range("0.1..1")
@Gate(1)
public float opacity = 0.2f;
@ -52,7 +60,7 @@ public class ESP extends Feature {
if(fill) {
ready();
translate(-eyePos.x, -eyePos.y, -eyePos.z);
color(Pixels.mulTransparency(Features.getFeature(Client.class).theme.getGreenColor() | 0xff000000, 0.2f));
color(Pixels.mulTransparency(Features.getFeature(Client.class).theme.getGreenColor() | 0xff000000, opacity));
depth(false);
begin(GL11.GL_QUADS);
@ -73,8 +81,6 @@ public class ESP extends Feature {
end();
}
end();
}
private void draw(RenderWorldLastEvent event, Consumer<AxisAlignedBB> renderer) {