From a7a7f5a9ab21c9d0abfb9c2caf13df833c8c51a8 Mon Sep 17 00:00:00 2001 From: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> Date: Tue, 1 Mar 2022 21:03:37 +0100 Subject: more hud stuff and hud scaling that works sometimes --- .../oneconfig/command/OneConfigCommand.java | 32 ++++++++++++---------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'src/main/java/io/polyfrost/oneconfig/command') diff --git a/src/main/java/io/polyfrost/oneconfig/command/OneConfigCommand.java b/src/main/java/io/polyfrost/oneconfig/command/OneConfigCommand.java index d49cb06..575fc3f 100644 --- a/src/main/java/io/polyfrost/oneconfig/command/OneConfigCommand.java +++ b/src/main/java/io/polyfrost/oneconfig/command/OneConfigCommand.java @@ -1,10 +1,10 @@ package io.polyfrost.oneconfig.command; import io.polyfrost.oneconfig.gui.Window; +import io.polyfrost.oneconfig.hud.gui.HudGui; import io.polyfrost.oneconfig.themes.Themes; import io.polyfrost.oneconfig.utils.TickDelay; import net.minecraft.client.Minecraft; -import net.minecraft.command.CommandException; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraft.util.BlockPos; @@ -17,15 +17,8 @@ import java.util.List; public class OneConfigCommand implements ICommand { - private final List aliases; private static final Minecraft mc = Minecraft.getMinecraft(); - public OneConfigCommand() { - aliases = new ArrayList<>(); - aliases.add("oneconfig"); - aliases.add("ocfg"); - } - @Override public String getCommandName() { return "oneconfig"; @@ -38,15 +31,26 @@ public class OneConfigCommand implements ICommand { @Override public List getCommandAliases() { - return this.aliases; + return new ArrayList() {{ + add("oneconfig"); + add("ocfg"); + }}; } @Override - public void processCommand(ICommandSender sender, String[] args) throws CommandException { - new TickDelay(() -> mc.displayGuiScreen(new Window()), 1); - if(args.length != 0) { - mc.thePlayer.addChatMessage(new ChatComponentText("reloading theme!")); - Themes.openTheme(new File("OneConfig/themes/one.zip").getAbsoluteFile()); + public void processCommand(ICommandSender sender, String[] args) { + if (args.length == 0) + new TickDelay(() -> mc.displayGuiScreen(new Window()), 1); + else { + switch (args[0]) { + case "hud": + new TickDelay(() -> mc.displayGuiScreen(new HudGui()), 1); + break; + case "theme": + mc.thePlayer.addChatMessage(new ChatComponentText("reloading theme!")); + Themes.openTheme(new File("OneConfig/themes/one.zip").getAbsoluteFile()); + break; + } } } -- cgit