fix config bugs

This commit is contained in:
C10udburst
2022-02-02 11:30:51 +01:00
parent 99a473f463
commit 4eec0c00e3
5 changed files with 17 additions and 25 deletions

View File

@@ -12,11 +12,7 @@ import java.util.List;
public class ConfigModifier {
public static ConfigModifier INSTANCE;
public ConfigModifier() {
INSTANCE = this;
}
private static ConfigModifier INSTANCE;
public final SettingGroup sgRejects = Config.get().settings.createGroup("Rejects");
@@ -36,4 +32,9 @@ public class ConfigModifier {
.onChanged(v -> RejectsConfig.get().setHiddenModules(v))
.build()
);
public static ConfigModifier get() {
if (INSTANCE == null) INSTANCE = new ConfigModifier();
return INSTANCE;
}
}

View File

@@ -4,6 +4,7 @@ import meteordevelopment.meteorclient.systems.System;
import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.meteorclient.systems.modules.Modules;
import meteordevelopment.meteorclient.MeteorClient;
import meteordevelopment.meteorclient.utils.render.prompts.OkPrompt;
import java.util.Arrays;
import java.util.HashSet;
@@ -40,6 +41,14 @@ public class RejectsConfig extends System<RejectsConfig> {
}
public void setHiddenModules(List<Module> newList) {
if (newList.size() < hiddenModules.size()) {
OkPrompt.create()
.title("Hidden Modules")
.message("In order to see the modules you have removed from the list you need to restart Minecraft.")
.id("hidden-modules-unhide")
.show();
}
hiddenModules.clear();
for (Module module : newList) {
if (module.isActive()) module.toggle();
hiddenModules.add(module.name);