diff options
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/config')
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/config/Config.java | 9 | ||||
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilanceConfig.java | 2 | ||||
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/config/core/ConfigUtils.java (renamed from src/main/java/cc/polyfrost/oneconfig/config/core/ConfigCore.java) | 21 | ||||
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/config/profiles/Profiles.java | 2 |
4 files changed, 8 insertions, 26 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/config/Config.java b/src/main/java/cc/polyfrost/oneconfig/config/Config.java index 65d6b00..2c51387 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/Config.java +++ b/src/main/java/cc/polyfrost/oneconfig/config/Config.java @@ -2,7 +2,8 @@ package cc.polyfrost.oneconfig.config; import cc.polyfrost.oneconfig.config.annotations.ConfigPage; import cc.polyfrost.oneconfig.config.annotations.Option; -import cc.polyfrost.oneconfig.config.core.ConfigCore; +import cc.polyfrost.oneconfig.config.core.ConfigUtils; +import cc.polyfrost.oneconfig.internal.config.ConfigCore; import cc.polyfrost.oneconfig.config.data.*; import cc.polyfrost.oneconfig.config.elements.BasicOption; import cc.polyfrost.oneconfig.config.elements.OptionCategory; @@ -13,7 +14,7 @@ import cc.polyfrost.oneconfig.gui.OneConfigGui; import cc.polyfrost.oneconfig.gui.elements.config.*; import cc.polyfrost.oneconfig.gui.pages.ModConfigPage; import cc.polyfrost.oneconfig.hud.BasicHud; -import cc.polyfrost.oneconfig.hud.HudCore; +import cc.polyfrost.oneconfig.internal.hud.HudCore; import cc.polyfrost.oneconfig.utils.gui.GuiUtils; import com.google.gson.*; @@ -144,7 +145,7 @@ public class Config { HudCore.huds.add(hud); options.add(new ConfigHeader(field, hud, option.name(), 1)); options.add(new ConfigSwitch(hud.getClass().getField("enabled"), hud, "Enabled", 1)); - options.addAll(ConfigCore.getClassOptions(hud)); + options.addAll(ConfigUtils.getClassOptions(hud)); options.add(new ConfigCheckbox(hud.getClass().getField("rounded"), hud, "Rounded corners", 1)); options.get(options.size() - 1).setDependency(() -> hud.enabled); options.add(new ConfigCheckbox(hud.getClass().getField("border"), hud, "Outline/border", 1)); @@ -165,7 +166,7 @@ public class Config { e.printStackTrace(); } } else { - options.add(ConfigCore.getOption(option, field, instance)); + options.add(ConfigUtils.getOption(option, field, instance)); } if (!option.type().equals(OptionType.HUD)) optionNames.put(pagePrefix + field.getName(), options.get(options.size() - 1)); diff --git a/src/main/java/cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilanceConfig.java b/src/main/java/cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilanceConfig.java index cfa717f..3b0fcd6 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilanceConfig.java +++ b/src/main/java/cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilanceConfig.java @@ -1,6 +1,6 @@ package cc.polyfrost.oneconfig.config.compatibility.vigilance; -import cc.polyfrost.oneconfig.config.core.ConfigCore; +import cc.polyfrost.oneconfig.internal.config.ConfigCore; import cc.polyfrost.oneconfig.config.core.OneColor; import cc.polyfrost.oneconfig.config.data.Mod; import cc.polyfrost.oneconfig.config.elements.OptionCategory; diff --git a/src/main/java/cc/polyfrost/oneconfig/config/core/ConfigCore.java b/src/main/java/cc/polyfrost/oneconfig/config/core/ConfigUtils.java index f1aa1ab..d44488d 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/core/ConfigCore.java +++ b/src/main/java/cc/polyfrost/oneconfig/config/core/ConfigUtils.java @@ -1,32 +1,13 @@ package cc.polyfrost.oneconfig.config.core; import cc.polyfrost.oneconfig.config.annotations.Option; -import cc.polyfrost.oneconfig.config.data.Mod; import cc.polyfrost.oneconfig.config.elements.BasicOption; import cc.polyfrost.oneconfig.gui.elements.config.*; -import cc.polyfrost.oneconfig.hud.HudCore; import java.lang.reflect.Field; import java.util.ArrayList; -public class ConfigCore { - public static ArrayList<Mod> oneConfigMods = new ArrayList<>(); - - public static void saveAll() { - for (Mod modData : oneConfigMods) { - modData.config.save(); - } - } - - public static void reInitAll() { - ArrayList<Mod> data = new ArrayList<>(oneConfigMods); - oneConfigMods.clear(); - HudCore.huds.clear(); - for (Mod modData : data) { - modData.config.init(modData); - } - } - +public class ConfigUtils { public static BasicOption getOption(Option option, Field field, Object instance) { switch (option.type()) { case SWITCH: diff --git a/src/main/java/cc/polyfrost/oneconfig/config/profiles/Profiles.java b/src/main/java/cc/polyfrost/oneconfig/config/profiles/Profiles.java index 006fea9..2b0a97e 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/profiles/Profiles.java +++ b/src/main/java/cc/polyfrost/oneconfig/config/profiles/Profiles.java @@ -1,7 +1,7 @@ package cc.polyfrost.oneconfig.config.profiles; import cc.polyfrost.oneconfig.internal.OneConfig; -import cc.polyfrost.oneconfig.config.core.ConfigCore; +import cc.polyfrost.oneconfig.internal.config.ConfigCore; import cc.polyfrost.oneconfig.internal.config.OneConfigConfig; import org.apache.commons.io.FileUtils; |