From 21d31344a151dfe94c79a20b503af55120c63b63 Mon Sep 17 00:00:00 2001 From: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> Date: Mon, 6 Jun 2022 18:20:23 +0200 Subject: rewrite config system --- .../config/compatibility/vigilance/VigilanceConfig.java | 14 +++++++------- .../config/compatibility/vigilance/VigilanceName.java | 16 ++++++++++++++++ 2 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 src/main/java/cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilanceName.java (limited to 'src/main/java/cc/polyfrost/oneconfig/config/compatibility/vigilance') 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 3b0fcd6..a34b792 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.internal.config.ConfigCore; +import cc.polyfrost.oneconfig.internal.config.core.ConfigCore; import cc.polyfrost.oneconfig.config.core.OneColor; import cc.polyfrost.oneconfig.config.data.Mod; import cc.polyfrost.oneconfig.config.elements.OptionCategory; @@ -55,7 +55,7 @@ public class VigilanceConfig extends Config { } private void generateOptionsList(OptionPage page) { - for (PropertyData option : ((VigilantAccessor) vigilant).getPropertyCollector().getProperties()) { + /*for (PropertyData option : ((VigilantAccessor) vigilant).getPropertyCollector().getProperties()) { PropertyAttributesExt attributes = option.getAttributesExt(); if (attributes.getHidden()) continue; if (!page.categories.containsKey(getCategory(attributes))) @@ -66,7 +66,7 @@ public class VigilanceConfig extends Config { ArrayList options = category.subcategories.get(category.subcategories.size() - 1).options; switch (attributes.getType()) { case SWITCH: - options.add(new ConfigSwitch(getFieldOfProperty(option), option.getInstance(), getName(attributes), 2)); + options.add(new ConfigSwitch(getFieldOfProperty(option), option.getInstance(), getName(attributes), "", "", 2)); break; case CHECKBOX: options.add(new ConfigCheckbox(getFieldOfProperty(option), option.getInstance(), getName(attributes), 2)); @@ -97,7 +97,7 @@ public class VigilanceConfig extends Config { if (attributes.getType() == PropertyType.SWITCH || attributes.getType() == PropertyType.CHECKBOX) { optionNames.put(PropertyKt.fullPropertyPath(option.getAttributesExt()), options.get(options.size() - 1)); } - } + }*/ } private Field getFieldOfProperty(PropertyData data) { @@ -163,11 +163,11 @@ public class VigilanceConfig extends Config { public void addDependency(PropertyData property, PropertyData dependency) { BasicOption option = optionNames.get(PropertyKt.fullPropertyPath(property.getAttributesExt())); if (option != null) { - option.setDependency(() -> Objects.equals(dependency.getValue().getValue(vigilant), true)); + option.addDependency(() -> Objects.equals(dependency.getValue().getValue(vigilant), true)); } } - private static class CompatConfigColorElement extends ConfigColorElement { + /*private static class CompatConfigColorElement extends ConfigColorElement { private final Field color; private Color prevColor = null; private OneColor cachedColor = null; @@ -198,5 +198,5 @@ public class VigilanceConfig extends Config { } } } - } + }*/ } diff --git a/src/main/java/cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilanceName.java b/src/main/java/cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilanceName.java new file mode 100644 index 0000000..8417ad8 --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilanceName.java @@ -0,0 +1,16 @@ +package cc.polyfrost.oneconfig.config.compatibility.vigilance; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface VigilanceName { + String name(); + + String category(); + + String subcategory(); +} -- cgit