misc fixes + hud stuff
All checks were successful
/ Build BaseBand DSM & Broadway (push) Successful in 2m12s

This commit is contained in:
Jess H 2024-06-17 03:46:41 +01:00
parent 92065c3d13
commit d7ff8d17cb
Signed by: UnixSystemV
GPG key ID: 9B21C50B68D67F19
3 changed files with 59 additions and 6 deletions

View file

@ -72,6 +72,11 @@ public class AltControl extends Feature {
BaseBand.publish(new RemoteSendMessageEvent(String.join(" ", args)));
}
@Override
public void onTick() {
this.meta = String.valueOf(BaseBand.REMOTE_EVENT_BUS.clients.size());
}
@Override
public String toString() {
return "AltControl";

View file

@ -23,6 +23,7 @@ public class AntiLevitation extends Feature {
@Override
public void onTick() {
meta = mode.name();
if(mc.player.isPotionActive(MobEffects.LEVITATION) && mode == Mode.Effect) {
mc.player.getActivePotionMap().remove(MobEffects.LEVITATION);
}

View file

@ -23,6 +23,7 @@ import net.minecraft.entity.Entity;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import java.awt.*;
import java.text.SimpleDateFormat;
import java.util.*;
@ -79,6 +80,11 @@ public class HUD extends Feature {
Future
}
public enum ModuleColor {
Normal,
Future,
Trans
}
public enum NotificationLocation {
Left, Center, Right
@ -145,14 +151,13 @@ public class HUD extends Feature {
@Config("Module Status Color")
public ModuleMetaColor moduleMetaColor = ModuleMetaColor.Normal;
@Config("Module Color")
public ModuleColor moduleColor = ModuleColor.Normal;
@Config("HUD background")
@Description("Renders a slightly transparent background below the HUD")
public boolean background = true;
@Config("Module HashColors")
@Description("Gets the Module color from a hash of the module's name")
public boolean hashColor = false;
@Config("Text shadow")
public boolean textShadow = true;
@ -246,8 +251,9 @@ public class HUD extends Feature {
TextSplitter.drawString(initString, 3,3, theme.getGreenColor(), textShadow, false);
int y = 3 + TextSplitter.getStringHeight(initString);
for (Feature f : renderFeatures) {
mc.fontRenderer.drawString(f.getHUDText(), 3, y, hashColor ? f.getHashColor() : theme.getGreenColor(), textShadow);
for (int i = 0; i < renderFeatures.length; i++) {
Feature f = renderFeatures[i];
mc.fontRenderer.drawString(f.getHUDText(), 3, y, getColor(f, i), textShadow);
y = y + mc.fontRenderer.FONT_HEIGHT;
}
@ -335,6 +341,47 @@ public class HUD extends Feature {
}
}
public int getColor(Feature feature, int featureIndex) {
switch (moduleColor) {
case Normal:
GuiTheme.ITheme theme = Features.getFeature(Client.class).getTheme();
return theme.getGreenColor();
case Future:
return feature.getHashColor();
case Trans:
return getCuteColor(featureIndex);
default:
return 0; //should not be possible fuck you
}
}
private int getCuteColor(int index) {
int size = (int) Arrays.stream(Features.features).filter(m -> m.enabled && m.displayOnHUD()).count();
int light_blue = new Color(91, 206, 250).getRGB();
int white = Color.WHITE.getRGB();
int pink = new Color(245, 169, 184).getRGB();
int part = (int) ((float) index / size * 5);
if (part == 0) {
return light_blue;
}
if (part == 1) {
return pink;
}
if (part == 2) {
return white;
}
if (part == 3) {
return pink;
}
return light_blue; //fail
}
@Render
public static class ShowTPS extends Feature {