diff options
10 files changed, 18 insertions, 36 deletions
diff --git a/api/OneConfig.api b/api/OneConfig.api index c047917..55cd208 100644 --- a/api/OneConfig.api +++ b/api/OneConfig.api @@ -22,6 +22,7 @@ public class cc/polyfrost/oneconfig/config/Config { public fun load ()V public fun openGui ()V protected fun registerKeyBind (Lcc/polyfrost/oneconfig/config/core/OneKeyBind;Ljava/lang/Runnable;)V + public fun reset ()Z public fun save ()V } @@ -137,25 +138,6 @@ public abstract interface annotation class cc/polyfrost/oneconfig/config/annotat public abstract fun subcategory ()Ljava/lang/String; } -public class cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilanceConfig : cc/polyfrost/oneconfig/config/Config { - public final field vigilant Lgg/essential/vigilance/Vigilant; - public fun <init> (Lcc/polyfrost/oneconfig/config/data/Mod;Ljava/lang/String;Lgg/essential/vigilance/Vigilant;)V - public fun addDependency (Lgg/essential/vigilance/data/PropertyData;Lgg/essential/vigilance/data/PropertyData;)V - public fun initialize ()V - public fun load ()V - public fun save ()V -} - -public abstract interface annotation class cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilanceName : java/lang/annotation/Annotation { - public abstract fun category ()Ljava/lang/String; - public abstract fun name ()Ljava/lang/String; - public abstract fun subcategory ()Ljava/lang/String; -} - -public abstract interface class cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilantAccessor { - public abstract fun getPropertyCollector ()Lgg/essential/vigilance/data/PropertyCollector; -} - public class cc/polyfrost/oneconfig/config/core/ConfigUtils { public fun <init> ()V public static fun addOptionToPage (Lcc/polyfrost/oneconfig/config/elements/OptionPage;Lcc/polyfrost/oneconfig/internal/config/annotations/Option;Ljava/lang/reflect/Field;Ljava/lang/Object;Lcc/polyfrost/oneconfig/config/migration/Migrator;)Lcc/polyfrost/oneconfig/config/elements/BasicOption; @@ -473,7 +455,7 @@ public abstract interface class cc/polyfrost/oneconfig/gui/GuiPause { } public class cc/polyfrost/oneconfig/gui/HudGui : cc/polyfrost/oneconfig/libs/universal/UScreen, cc/polyfrost/oneconfig/gui/GuiPause { - public fun <init> ()V + public fun <init> (Z)V public fun doesGuiPauseGame ()Z public fun initScreen (II)V public fun onDrawScreen (Lcc/polyfrost/oneconfig/libs/universal/UMatrixStack;IIF)V diff --git a/src/main/java/cc/polyfrost/oneconfig/config/migration/VigilanceMigrator.java b/src/main/java/cc/polyfrost/oneconfig/config/migration/VigilanceMigrator.java index f09d648..aed1919 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/migration/VigilanceMigrator.java +++ b/src/main/java/cc/polyfrost/oneconfig/config/migration/VigilanceMigrator.java @@ -1,6 +1,6 @@ package cc.polyfrost.oneconfig.config.migration; -import cc.polyfrost.oneconfig.config.compatibility.vigilance.VigilanceName; +import cc.polyfrost.oneconfig.internal.config.compatibility.vigilance.VigilanceName; import java.io.BufferedReader; import java.io.File; 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 29a9daa..686fb69 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/profiles/Profiles.java +++ b/src/main/java/cc/polyfrost/oneconfig/config/profiles/Profiles.java @@ -60,7 +60,7 @@ public class Profiles { public static void loadProfile(String profile) { ConfigCore.saveAll(); OneConfigConfig.currentProfile = profile; - //OneConfig.config.save(); todo do we actually need this + OneConfigConfig.getInstance().save(); ConfigCore.reInitAll(); } diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDropdown.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDropdown.java index ddcf6eb..fa48592 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDropdown.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDropdown.java @@ -1,13 +1,13 @@ package cc.polyfrost.oneconfig.gui.elements.config; import cc.polyfrost.oneconfig.config.annotations.Dropdown; -import cc.polyfrost.oneconfig.internal.assets.Colors; import cc.polyfrost.oneconfig.config.elements.BasicOption; import cc.polyfrost.oneconfig.gui.animations.ColorAnimation; +import cc.polyfrost.oneconfig.internal.assets.Colors; +import cc.polyfrost.oneconfig.internal.assets.SVGs; import cc.polyfrost.oneconfig.platform.Platform; import cc.polyfrost.oneconfig.renderer.RenderManager; import cc.polyfrost.oneconfig.renderer.font.Fonts; -import cc.polyfrost.oneconfig.internal.assets.SVGs; import cc.polyfrost.oneconfig.renderer.scissor.Scissor; import cc.polyfrost.oneconfig.utils.InputUtils; import cc.polyfrost.oneconfig.utils.color.ColorPalette; @@ -43,8 +43,8 @@ public class ConfigDropdown extends BasicOption { else hovered = InputUtils.isAreaHovered(x + 352, y, 640, 32) && isEnabled(); if (hovered && InputUtils.isClicked() || opened && InputUtils.isClicked(true) && - (size == 1 && !InputUtils.isAreaHovered(x + 224, y + 40, 256, options.length * 32) || - size == 2 && !InputUtils.isAreaHovered(x + 352, y + 40, 640, options.length * 32))) { + (size == 1 && !InputUtils.isAreaHovered(x + 224, y + 40, 256, options.length * 32, true) || + size == 2 && !InputUtils.isAreaHovered(x + 352, y + 40, 640, options.length * 32, true))) { opened = !opened; backgroundColor.setPalette(opened ? ColorPalette.PRIMARY : ColorPalette.SECONDARY); if (opened) inputScissor = InputUtils.blockAllInput(); diff --git a/src/main/java/cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilanceConfig.java b/src/main/java/cc/polyfrost/oneconfig/internal/config/compatibility/vigilance/VigilanceConfig.java index 97dd0cb..689bf25 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilanceConfig.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/config/compatibility/vigilance/VigilanceConfig.java @@ -1,4 +1,4 @@ -package cc.polyfrost.oneconfig.config.compatibility.vigilance; +package cc.polyfrost.oneconfig.internal.config.compatibility.vigilance; import cc.polyfrost.oneconfig.config.core.ConfigUtils; import cc.polyfrost.oneconfig.internal.config.core.ConfigCore; diff --git a/src/main/java/cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilanceName.java b/src/main/java/cc/polyfrost/oneconfig/internal/config/compatibility/vigilance/VigilanceName.java index 8417ad8..ff84d3c 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilanceName.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/config/compatibility/vigilance/VigilanceName.java @@ -1,4 +1,4 @@ -package cc.polyfrost.oneconfig.config.compatibility.vigilance; +package cc.polyfrost.oneconfig.internal.config.compatibility.vigilance; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/src/main/java/cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilantAccessor.java b/src/main/java/cc/polyfrost/oneconfig/internal/config/compatibility/vigilance/VigilantAccessor.java index c449bd9..f059dbc 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilantAccessor.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/config/compatibility/vigilance/VigilantAccessor.java @@ -1,4 +1,4 @@ -package cc.polyfrost.oneconfig.config.compatibility.vigilance; +package cc.polyfrost.oneconfig.internal.config.compatibility.vigilance; import gg.essential.vigilance.data.PropertyCollector; diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/plugin/OneConfigMixinPlugin.java b/src/main/java/cc/polyfrost/oneconfig/internal/plugin/OneConfigMixinPlugin.java index 0ef2c58..bc9dc7b 100644 --- a/src/main/java/cc/polyfrost/oneconfig/internal/plugin/OneConfigMixinPlugin.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/plugin/OneConfigMixinPlugin.java @@ -59,11 +59,11 @@ public class OneConfigMixinPlugin implements IMixinConfigPlugin { * If anything here is changed, edit the corresponding method in OneConfigMixinPlugin! */ private void transform(ClassNode node) { - if (!node.interfaces.contains("cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilantAccessor")) { + if (!node.interfaces.contains("cc/polyfrost/oneconfig/internal/config/compatibility/vigilance/VigilantAccessor")) { node.fields.add(new FieldNode(Opcodes.ACC_PUBLIC, "oneconfig$config", "Lcc/polyfrost/oneconfig/config/compatibility/vigilance/VigilanceConfig;", null, null)); node.fields.add(new FieldNode(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "oneconfig$file", Type.getDescriptor(File.class), null, null)); - node.interfaces.add("cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilantAccessor"); + node.interfaces.add("cc/polyfrost/oneconfig/internal/config/compatibility/vigilance/VigilantAccessor"); MethodNode methodNode = new MethodNode(Opcodes.ACC_PUBLIC, "getPropertyCollector", "()Lgg/essential/vigilance/data/PropertyCollector;", null, null); LabelNode labelNode = new LabelNode(); methodNode.instructions.add(labelNode); @@ -90,7 +90,7 @@ public class OneConfigMixinPlugin implements IMixinConfigPlugin { methodNode2.instructions.add(new FieldInsnNode(Opcodes.GETFIELD, "gg/essential/vigilance/Vigilant", "oneconfig$config", "Lcc/polyfrost/oneconfig/config/compatibility/vigilance/VigilanceConfig;")); methodNode2.instructions.add(new VarInsnNode(Opcodes.ALOAD, 1)); methodNode2.instructions.add(new VarInsnNode(Opcodes.ALOAD, 2)); - methodNode2.instructions.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, "cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilanceConfig", "addDependency", "(Lgg/essential/vigilance/data/PropertyData;Lgg/essential/vigilance/data/PropertyData;)V", false)); + methodNode2.instructions.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, "cc/polyfrost/oneconfig/internal/config/compatibility/vigilance/VigilanceConfig", "addDependency", "(Lgg/essential/vigilance/data/PropertyData;Lgg/essential/vigilance/data/PropertyData;)V", false)); methodNode2.instructions.add(labelNode4); methodNode2.instructions.add(new LineNumberNode(15636438, labelNode4)); diff --git a/versions/src/main/java/cc/polyfrost/oneconfig/internal/plugin/asm/tweakers/VigilantTransformer.java b/versions/src/main/java/cc/polyfrost/oneconfig/internal/plugin/asm/tweakers/VigilantTransformer.java index 8dd60cf..c217e4e 100644 --- a/versions/src/main/java/cc/polyfrost/oneconfig/internal/plugin/asm/tweakers/VigilantTransformer.java +++ b/versions/src/main/java/cc/polyfrost/oneconfig/internal/plugin/asm/tweakers/VigilantTransformer.java @@ -19,11 +19,11 @@ public class VigilantTransformer implements ITransformer { */ @Override public void transform(String transformedName, ClassNode node) { - if (!node.interfaces.contains("cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilantAccessor")) { + if (!node.interfaces.contains("cc/polyfrost/oneconfig/internal/config/compatibility/vigilance/VigilantAccessor")) { node.fields.add(new FieldNode(Opcodes.ACC_PUBLIC, "oneconfig$config", "Lcc/polyfrost/oneconfig/config/compatibility/vigilance/VigilanceConfig;", null, null)); node.fields.add(new FieldNode(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "oneconfig$file", Type.getDescriptor(File.class), null, null)); - node.interfaces.add("cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilantAccessor"); + node.interfaces.add("cc/polyfrost/oneconfig/internal/config/compatibility/vigilance/VigilantAccessor"); MethodNode methodNode = new MethodNode(Opcodes.ACC_PUBLIC, "getPropertyCollector", "()Lgg/essential/vigilance/data/PropertyCollector;", null, null); LabelNode labelNode = new LabelNode(); methodNode.instructions.add(labelNode); @@ -50,7 +50,7 @@ public class VigilantTransformer implements ITransformer { methodNode2.instructions.add(new FieldInsnNode(Opcodes.GETFIELD, "gg/essential/vigilance/Vigilant", "oneconfig$config", "Lcc/polyfrost/oneconfig/config/compatibility/vigilance/VigilanceConfig;")); methodNode2.instructions.add(new VarInsnNode(Opcodes.ALOAD, 1)); methodNode2.instructions.add(new VarInsnNode(Opcodes.ALOAD, 2)); - methodNode2.instructions.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, "cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilanceConfig", "addDependency", "(Lgg/essential/vigilance/data/PropertyData;Lgg/essential/vigilance/data/PropertyData;)V", false)); + methodNode2.instructions.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, "cc/polyfrost/oneconfig/internal/config/compatibility/vigilance/VigilanceConfig", "addDependency", "(Lgg/essential/vigilance/data/PropertyData;Lgg/essential/vigilance/data/PropertyData;)V", false)); methodNode2.instructions.add(labelNode4); methodNode2.instructions.add(new LineNumberNode(15636438, labelNode4)); diff --git a/versions/src/main/java/cc/polyfrost/oneconfig/internal/plugin/hooks/VigilantHook.java b/versions/src/main/java/cc/polyfrost/oneconfig/internal/plugin/hooks/VigilantHook.java index a012773..fcd5ff4 100644 --- a/versions/src/main/java/cc/polyfrost/oneconfig/internal/plugin/hooks/VigilantHook.java +++ b/versions/src/main/java/cc/polyfrost/oneconfig/internal/plugin/hooks/VigilantHook.java @@ -1,6 +1,6 @@ package cc.polyfrost.oneconfig.internal.plugin.hooks; -import cc.polyfrost.oneconfig.config.compatibility.vigilance.VigilanceConfig; +import cc.polyfrost.oneconfig.internal.config.compatibility.vigilance.VigilanceConfig; import cc.polyfrost.oneconfig.config.data.Mod; import cc.polyfrost.oneconfig.config.data.ModType; import cc.polyfrost.oneconfig.internal.config.core.ConfigCore; |