use of mathax.client.systems.hud.HUD in project Client by MatHax.
the class Systems method init.
public static void init() {
System<?> config = add(new Config());
config.init();
config.load();
add(new Modules());
add(new Commands());
add(new Friends());
add(new Enemies());
add(new Macros());
add(new Accounts());
add(new Waypoints());
add(new Profiles());
add(new Proxies());
add(new HUD());
MatHax.EVENT_BUS.subscribe(Systems.class);
}
use of mathax.client.systems.hud.HUD in project Client by MatHax.
the class ResetCommand method build.
@Override
public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.then(literal("settings").then(argument("module", ModuleArgumentType.module()).executes(context -> {
Module module = context.getArgument("module", Module.class);
module.settings.forEach(group -> group.forEach(Setting::reset));
module.info("Reset all settings.");
return SINGLE_SUCCESS;
})).then(literal("all").executes(context -> {
Modules.get().getAll().forEach(module -> module.settings.forEach(group -> group.forEach(Setting::reset)));
info("Reset all module settings.");
return SINGLE_SUCCESS;
}))).then(literal("gui").executes(context -> {
GuiThemes.get().clearWindowConfigs();
info("The Click GUI positioning has been reset.");
return SINGLE_SUCCESS;
}).then(literal("scale").executes(context -> {
GuiThemes.get().resetScale();
info("The GUI scale has been reset.");
return SINGLE_SUCCESS;
}))).then(literal("bind").then(argument("module", ModuleArgumentType.module()).executes(context -> {
Module module = context.getArgument("module", Module.class);
module.keybind.set(true, -1);
module.info("Reset bind.");
return SINGLE_SUCCESS;
})).then(literal("all").executes(context -> {
Modules.get().getAll().forEach(module -> module.keybind.set(true, -1));
info("Reset all binds.");
return SINGLE_SUCCESS;
}))).then(literal("hud").executes(context -> {
Systems.get(HUD.class).reset.run();
ChatUtils.info("HUD", "Reset all elements.");
return SINGLE_SUCCESS;
}));
}
use of mathax.client.systems.hud.HUD in project Client by MatHax.
the class MatHax method onInitializeClient.
@Override
public void onInitializeClient() {
// Instance
if (INSTANCE == null) {
INSTANCE = this;
return;
}
// Log
LOG.info("Initializing MatHax " + Version.getStylized() + " for Minecraft " + Version.getMinecraft() + "...");
// Global Minecraft client accessor
mc = MinecraftClient.getInstance();
// Icon & Title
WindowUtils.MatHax.setIcon();
WindowUtils.MatHax.setTitleLoading();
// Register event handlers
EVENT_BUS.registerLambdaFactory("mathax.client", (lookupInMethod, klass) -> (MethodHandles.Lookup) lookupInMethod.invoke(null, klass, MethodHandles.lookup()));
// Pre-load
Systems.addPreLoadTask(() -> {
if (!FOLDER.exists()) {
FOLDER.getParentFile().mkdirs();
FOLDER.mkdir();
// ACTIVATE
// CAPES
Modules.get().get(CapesModule.class).forceToggle(true);
// DISCORD RPC
Modules.get().get(DiscordRPC.class).forceToggle(true);
// BACKGROUND
Modules.get().get(Background.class).forceToggle(true);
// MIDDLE CLICK FRIEND
Modules.get().get(MiddleClickFriend.class).forceToggle(true);
// VISIBILITY
// CLIENT SPOOF
Modules.get().get(ClientSpoof.class).setVisible(false);
// CAPES
Modules.get().get(CapesModule.class).setVisible(false);
// DISCORD RPC
Modules.get().get(DiscordRPC.class).setVisible(false);
// BACKGROUND
Modules.get().get(Background.class).setVisible(false);
// MIDDLE CLICK FRIEND
Modules.get().get(MiddleClickFriend.class).setVisible(false);
// ZOOM
Modules.get().get(Zoom.class).setVisible(false);
// KEYBINDS
// ZOOM
Modules.get().get(Zoom.class).keybind.set(KeyBind.fromKey(GLFW.GLFW_KEY_C));
// KEYBIND OPTIONS
// ZOOM
Modules.get().get(Zoom.class).toggleOnBindRelease = true;
// TOASTS
// ANCHOR AURA
Modules.get().get(AnchorAura.class).setToggleToast(true);
// BED AURA
Modules.get().get(BedAura.class).setToggleToast(true);
// CEV BREAKER
Modules.get().get(CEVBreaker.class).setToggleToast(true);
// CRYSTAL AURA
Modules.get().get(CrystalAura.class).setToggleToast(true);
// KILL AURA
Modules.get().get(KillAura.class).setToggleToast(true);
// MESSAGES
// ZOOM
Modules.get().get(Zoom.class).setToggleMessage(false);
}
// HUD
if (!Systems.get(HUD.class).getFile().exists())
Systems.get(HUD.class).reset.run();
});
// Pre init
Utils.init();
GL.init();
Shaders.init();
Renderer2D.init();
EntityShaders.initOutlines();
MatHaxExecutor.init();
BlockIterator.init();
EChestMemory.init();
Rotations.init();
Names.init();
FakeClientPlayer.init();
PostProcessRenderer.init();
Tabs.init();
GuiThemes.init();
Fonts.init();
DamageUtils.init();
BlockUtils.init();
Music.init();
// Register module categories
Categories.init();
// Load systems
Systems.init();
// Event bus
EVENT_BUS.subscribe(this);
// Sorting modules
Modules.get().sortModules();
// Load saves
Systems.load();
// Post init
Fonts.load();
GuiRenderer.init();
GuiThemes.postInit();
RainbowColors.init();
// Title
WindowUtils.MatHax.setTitleLoaded();
// Shutdown hook
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
DiscordRPC.disable();
Systems.save();
GuiThemes.save();
}));
// Icon & Title
ClientSpoof cs = Modules.get().get(ClientSpoof.class);
if (cs.isActive() && cs.changeWindowIcon())
WindowUtils.Meteor.setIcon();
else
WindowUtils.MatHax.setIcon();
if (cs.isActive() && cs.changeWindowTitle())
WindowUtils.Meteor.setTitle();
else
WindowUtils.MatHax.setTitle();
// Log
LOG.info("MatHax " + Version.getStylized() + " initialized for Minecraft " + Version.getMinecraft() + "!");
}
Aggregations