aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/internal
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-06-06 14:54:56 +0200
committerDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-06-06 14:54:56 +0200
commitf4c6691b628cca146ddb44e77f54cb46387aa15d (patch)
treeb20b519e654a472fdeeaa440939ac716e4ee1bf1 /src/main/java/cc/polyfrost/oneconfig/internal
parentda3bf748fb4cca62236922fc35be50133b1bb96a (diff)
downloadOneConfig-f4c6691b628cca146ddb44e77f54cb46387aa15d.tar.gz
OneConfig-f4c6691b628cca146ddb44e77f54cb46387aa15d.tar.bz2
OneConfig-f4c6691b628cca146ddb44e77f54cb46387aa15d.zip
internalizing
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/internal')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java4
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/internal/config/ConfigCore.java25
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/internal/hud/HudCore.java22
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/internal/plugin/asm/tweakers/VigilantTransformer.java2
4 files changed, 50 insertions, 3 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java b/src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java
index 3a00e06..7f0882a 100644
--- a/src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java
+++ b/src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java
@@ -1,10 +1,10 @@
package cc.polyfrost.oneconfig.internal;
-import cc.polyfrost.oneconfig.config.core.ConfigCore;
+import cc.polyfrost.oneconfig.internal.config.ConfigCore;
import cc.polyfrost.oneconfig.config.data.Mod;
import cc.polyfrost.oneconfig.config.data.ModType;
import cc.polyfrost.oneconfig.events.EventManager;
-import cc.polyfrost.oneconfig.hud.HudCore;
+import cc.polyfrost.oneconfig.internal.hud.HudCore;
import cc.polyfrost.oneconfig.internal.config.OneConfigConfig;
import cc.polyfrost.oneconfig.internal.command.OneConfigCommand;
import cc.polyfrost.oneconfig.internal.gui.BlurHandler;
diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/config/ConfigCore.java b/src/main/java/cc/polyfrost/oneconfig/internal/config/ConfigCore.java
new file mode 100644
index 0000000..f41b74e
--- /dev/null
+++ b/src/main/java/cc/polyfrost/oneconfig/internal/config/ConfigCore.java
@@ -0,0 +1,25 @@
+package cc.polyfrost.oneconfig.internal.config;
+
+import cc.polyfrost.oneconfig.config.data.Mod;
+import cc.polyfrost.oneconfig.internal.hud.HudCore;
+
+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);
+ }
+ }
+}
diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/hud/HudCore.java b/src/main/java/cc/polyfrost/oneconfig/internal/hud/HudCore.java
new file mode 100644
index 0000000..7c92799
--- /dev/null
+++ b/src/main/java/cc/polyfrost/oneconfig/internal/hud/HudCore.java
@@ -0,0 +1,22 @@
+package cc.polyfrost.oneconfig.internal.hud;
+
+import cc.polyfrost.oneconfig.events.event.HudRenderEvent;
+import cc.polyfrost.oneconfig.hud.BasicHud;
+import gg.essential.universal.UResolution;
+import me.kbrewster.eventbus.Subscribe;
+
+import java.util.ArrayList;
+
+public class HudCore {
+ public static ArrayList<BasicHud> huds = new ArrayList<>();
+ public static boolean editing = false;
+
+ @Subscribe
+ public void onRender(HudRenderEvent event) {
+ if (editing) return;
+ for (BasicHud hud : huds) {
+ if (hud.enabled)
+ hud.drawAll(hud.getXScaled(UResolution.getScaledWidth()), hud.getYScaled(UResolution.getScaledHeight()), hud.scale, true);
+ }
+ }
+}
diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/plugin/asm/tweakers/VigilantTransformer.java b/src/main/java/cc/polyfrost/oneconfig/internal/plugin/asm/tweakers/VigilantTransformer.java
index f241c74..09f40e7 100644
--- a/src/main/java/cc/polyfrost/oneconfig/internal/plugin/asm/tweakers/VigilantTransformer.java
+++ b/src/main/java/cc/polyfrost/oneconfig/internal/plugin/asm/tweakers/VigilantTransformer.java
@@ -1,7 +1,7 @@
package cc.polyfrost.oneconfig.internal.plugin.asm.tweakers;
import cc.polyfrost.oneconfig.config.compatibility.vigilance.VigilanceConfig;
-import cc.polyfrost.oneconfig.config.core.ConfigCore;
+import cc.polyfrost.oneconfig.internal.config.ConfigCore;
import cc.polyfrost.oneconfig.config.data.Mod;
import cc.polyfrost.oneconfig.config.data.ModType;
import cc.polyfrost.oneconfig.internal.plugin.asm.ITransformer;