start of hud rework

This commit is contained in:
kawaiizenbo 2024-09-07 16:14:08 -07:00
parent a3e7e885ac
commit 9ab102a648
12 changed files with 98 additions and 91 deletions

View file

@ -18,6 +18,7 @@ public abstract class Module
public Category category;
public boolean enabled;
public ArrayList<Setting> settings;
public boolean showEditButton;
public BooleanSetting showInModulesList = new BooleanSetting("Show in Modules List", true);
public KeycodeSetting keybind = new KeycodeSetting("Keybind", 0);

View file

@ -14,7 +14,7 @@ public class ModuleManager
registerModules(
new Fly(),
new NoFall(),
new HUDModule(),
new HUDEnabler(),
new Step(),
new Fullbright(),
new Speed(),

View file

@ -0,0 +1,19 @@
package me.kawaiizenbo.moonlight.module.modules;
import me.kawaiizenbo.moonlight.module.Category;
import me.kawaiizenbo.moonlight.module.Module;
import me.kawaiizenbo.moonlight.module.settings.BooleanSetting;
public class HUDEnabler extends Module
{
public BooleanSetting legacyHud = new BooleanSetting("Legacy HUD", true);
public HUDEnabler()
{
super("HUD", "The Moonlight HUD.", Category.RENDER);
this.enabled = true;
this.showInModulesList.value = false;
this.showEditButton = true;
settings.add(legacyHud);
}
}

View file

@ -1,51 +0,0 @@
package me.kawaiizenbo.moonlight.module.modules;
import me.kawaiizenbo.moonlight.Moonlight;
import me.kawaiizenbo.moonlight.module.Category;
import me.kawaiizenbo.moonlight.module.Module;
import me.kawaiizenbo.moonlight.module.settings.BooleanSetting;
import me.kawaiizenbo.moonlight.module.settings.DoubleSetting;
import me.kawaiizenbo.moonlight.ui.HUDOverlay;
import me.kawaiizenbo.moonlight.util.ColorUtils;
public class HUDModule extends Module
{
public BooleanSetting clientTag = new BooleanSetting("Client Tag", true);
public DoubleSetting r = new DoubleSetting("Red", 0x55, 0, 255, 0);
public DoubleSetting g = new DoubleSetting("Green", 255, 0, 255, 0);
public DoubleSetting b = new DoubleSetting("Blue", 255, 0, 255, 0);
//public ColorSetting color = new ColorSetting("Color", 0x55FFFF, ReflectionUtils.tryGetMethod("updateHUD", getClass()));
public HUDModule()
{
super("HUD", "The Moonlight HUD. Toggle to update.", Category.RENDER);
this.enabled = true;
this.showInModulesList.value = false;
settings.add(clientTag);
settings.add(r);
settings.add(g);
settings.add(b);
//settings.add(color);
}
@Override
public void onEnable()
{
super.onEnable();
HUDOverlay.INSTANCE.showClientTag = clientTag.value;
Moonlight.uiColorA =
ColorUtils.rgbaToInt(
(int)r.value,
(int)g.value,
(int)b.value,
255
);
Moonlight.uiColor =
ColorUtils.rgbToInt(
(int)r.value,
(int)g.value,
(int)b.value
);
}
}