From 697043f848eed383a9ba11bdba55adecda97f8fa Mon Sep 17 00:00:00 2001 From: Jess Date: Mon, 17 Jun 2024 01:49:46 +0100 Subject: [PATCH] add module coloring thanks to tud's previous changes --- .../de/com/baseband/client/feature/Feature.java | 15 ++++++++++++++- .../client/feature/modules/render/HUD.java | 10 ++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/Client/src/main/java/de/com/baseband/client/feature/Feature.java b/Client/src/main/java/de/com/baseband/client/feature/Feature.java index 2afe4b5..1255a40 100644 --- a/Client/src/main/java/de/com/baseband/client/feature/Feature.java +++ b/Client/src/main/java/de/com/baseband/client/feature/Feature.java @@ -1,8 +1,10 @@ package de.com.baseband.client.feature; +import com.mojang.realmsclient.gui.ChatFormatting; import de.com.baseband.client.BaseBand; import de.com.baseband.client.event.KeyManager; import de.com.baseband.client.feature.category.Command; +import de.com.baseband.client.feature.modules.render.HUD; import de.com.baseband.client.gui.lib.component.*; import de.com.baseband.client.gui.lib.component.Button; import de.com.baseband.client.gui.lib.component.Component; @@ -299,6 +301,17 @@ public abstract class Feature extends ToggleButton implements SetCommand { } public String getHUDText() { - return text + (meta != null ? " ยง7[" + meta + "]" : ""); + HUD.ModuleMetaColor moduleMetaColor; + moduleMetaColor = Features.getFeature(HUD.class).moduleMetaColor; + switch (moduleMetaColor) { + case Future: + return text + (meta != null ? ChatFormatting.GRAY + " [" + ChatFormatting.WHITE + meta + ChatFormatting.GRAY + "]" : ""); + case Colored: + return text + (meta != null ? " [" + meta + "]" : ""); + case Bracketless: + return text + (meta != null ? ChatFormatting.GRAY + " " + meta : ""); + default: //Normal + return text + (meta != null ? ChatFormatting.GRAY + " [" + meta + "]" : ""); + } } } diff --git a/Client/src/main/java/de/com/baseband/client/feature/modules/render/HUD.java b/Client/src/main/java/de/com/baseband/client/feature/modules/render/HUD.java index 2496b48..36515f7 100644 --- a/Client/src/main/java/de/com/baseband/client/feature/modules/render/HUD.java +++ b/Client/src/main/java/de/com/baseband/client/feature/modules/render/HUD.java @@ -72,6 +72,13 @@ public class HUD extends Feature { notifs.add(new Notification(text, time)); } + public enum ModuleMetaColor { + Normal, + Bracketless, + Colored, + Future + } + public enum NotificationLocation { Left, Center, Right @@ -135,6 +142,9 @@ public class HUD extends Feature { @Description("By default, status (greyed out information tucked on the end of module names) is not factored into the sorting. This setting lets you change that.") public boolean includeStatus = false; + @Config("Module Status Color") + public ModuleMetaColor moduleMetaColor = ModuleMetaColor.Normal; + @Config("HUD background") @Description("Renders a slightly transparent background below the HUD") public boolean background = true;