fix config bugs
This commit is contained in:
@@ -13,6 +13,6 @@ public class ConfigTabMixin {
|
||||
// No idea why CallbackInfoReturnable, but fabric crashes otherwise lol
|
||||
@Inject(method = "createScreen", at=@At("HEAD"), remap = false)
|
||||
private void onCreateScreen(CallbackInfoReturnable<?> cir) {
|
||||
ConfigModifier.INSTANCE.hiddenModules.set(RejectsConfig.get().getHiddenModules());
|
||||
ConfigModifier.get().hiddenModules.set(RejectsConfig.get().getHiddenModules());
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package anticope.rejects.mixin.meteor;
|
||||
|
||||
import anticope.rejects.utils.ConfigModifier;
|
||||
import meteordevelopment.meteorclient.systems.Systems;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(Systems.class)
|
||||
public class SystemsMixin {
|
||||
@Inject(method = "init", at = @At(value = "INVOKE", target = "Lmeteordevelopment/meteorclient/systems/System;load()V"), remap = false)
|
||||
private static void onInitializeConfig(CallbackInfo ci) {
|
||||
// adds the reject settings
|
||||
new ConfigModifier();
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user