Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide Modules in ClickGUI #5081

Merged
merged 7 commits into from
Feb 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ protected void init() {

// Category

protected WWindow createCategory(WContainer c, Category category) {
protected WWindow createCategory(WContainer c, Category category, List<Module> moduleList) {
WWindow w = theme.window(category.name);
w.id = category.name;
w.padding = 0;
@@ -68,7 +68,7 @@ protected WWindow createCategory(WContainer c, Category category) {
w.view.hasScrollBar = false;
w.view.spacing = 0;

for (Module module : Modules.get().getGroup(category)) {
for (Module module : moduleList) {
w.add(theme.module(module)).expandX();
}

@@ -202,8 +202,19 @@ protected class WCategoryController extends WContainer {

@Override
public void init() {
List<Module> moduleList = new ArrayList<>();
for (Category category : Modules.loopCategories()) {
windows.add(createCategory(this, category));
for (Module module : Modules.get().getGroup(category)) {
if (!Config.get().hiddenModules.get().contains(module)) {
moduleList.add(module);
}
}

// Ensure empty categories are not shown
if (!moduleList.isEmpty()) {
windows.add(createCategory(this, category, moduleList));
moduleList.clear();
}
}

windows.add(createSearch(this));
Original file line number Diff line number Diff line change
@@ -34,6 +34,9 @@ public static void addPreLoadTask(Runnable task) {
}

public static void init() {
// Has to be loaded first so the hidden modules list in config tab can load modules
add(new Modules());

Config config = new Config();
System<?> configSystem = add(config);
configSystem.init();
@@ -42,7 +45,6 @@ public static void init() {
// Registers the colors from config tab. This allows rainbow colours to work for friends.
config.settings.registerColorSettings(null);

add(new Modules());
add(new Macros());
add(new Friends());
add(new Accounts());
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
import meteordevelopment.meteorclient.settings.*;
import meteordevelopment.meteorclient.systems.System;
import meteordevelopment.meteorclient.systems.Systems;
import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.meteorclient.utils.render.color.SettingColor;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.NbtElement;
@@ -26,6 +27,7 @@ public class Config extends System<Config> {
public final Settings settings = new Settings();

private final SettingGroup sgVisual = settings.createGroup("Visual");
private final SettingGroup sgModules = settings.createGroup("Modules");
private final SettingGroup sgChat = settings.createGroup("Chat");
private final SettingGroup sgMisc = settings.createGroup("Misc");

@@ -94,6 +96,29 @@ public class Config extends System<Config> {
.build()
);

// Modules

public final Setting<List<Module>> hiddenModules = sgModules.add(new ModuleListSetting.Builder()
.name("hidden-modules")
.description("Prevent these modules from being rendered as options in the clickgui.")
.build()
);

public final Setting<Integer> moduleSearchCount = sgModules.add(new IntSetting.Builder()
.name("module-search-count")
.description("Amount of modules and settings to be shown in the module search bar.")
.defaultValue(8)
.min(1).sliderMax(12)
.build()
);

public final Setting<Boolean> moduleAliases = sgModules.add(new BoolSetting.Builder()
.name("search-module-aliases")
.description("Whether or not module aliases will be used in the module search bar.")
.defaultValue(true)
.build()
);

// Chat

public final Setting<String> prefix = sgChat.add(new StringSetting.Builder()
@@ -134,21 +159,6 @@ public class Config extends System<Config> {
.build()
);

public final Setting<Integer> moduleSearchCount = sgMisc.add(new IntSetting.Builder()
.name("module-search-count")
.description("Amount of modules and settings to be shown in the module search bar.")
.defaultValue(8)
.min(1).sliderMax(12)
.build()
);

public final Setting<Boolean> moduleAliases = sgMisc.add(new BoolSetting.Builder()
.name("search-module-aliases")
.description("Whether or not module aliases will be used in the module search bar.")
.defaultValue(true)
.build()
);

public List<String> dontShowAgainPrompts = new ArrayList<>();

public Config() {