aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api/OneConfig.api1
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/hud/Hud.java7
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/internal/hud/HudCore.java1
3 files changed, 9 insertions, 0 deletions
diff --git a/api/OneConfig.api b/api/OneConfig.api
index 51fc6fd..b8a8849 100644
--- a/api/OneConfig.api
+++ b/api/OneConfig.api
@@ -913,6 +913,7 @@ public abstract class cc/polyfrost/oneconfig/hud/Hud {
public fun <init> (ZFFF)V
protected abstract fun draw (Lcc/polyfrost/oneconfig/libs/universal/UMatrixStack;FFFZ)V
public fun drawAll (Lcc/polyfrost/oneconfig/libs/universal/UMatrixStack;Z)V
+ public fun getConfig ()Lcc/polyfrost/oneconfig/config/Config;
protected abstract fun getHeight (FZ)F
public fun getScale ()F
protected abstract fun getWidth (FZ)F
diff --git a/src/main/java/cc/polyfrost/oneconfig/hud/Hud.java b/src/main/java/cc/polyfrost/oneconfig/hud/Hud.java
index 12fd5bb..2440bfc 100644
--- a/src/main/java/cc/polyfrost/oneconfig/hud/Hud.java
+++ b/src/main/java/cc/polyfrost/oneconfig/hud/Hud.java
@@ -167,6 +167,13 @@ public abstract class Hud {
}
/**
+ * @return The config of this HUD
+ */
+ public Config getConfig() {
+ return this.config;
+ }
+
+ /**
* @return The scale of the Hud
*/
public float getScale() {
diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/hud/HudCore.java b/src/main/java/cc/polyfrost/oneconfig/internal/hud/HudCore.java
index d78df55..f557c8d 100644
--- a/src/main/java/cc/polyfrost/oneconfig/internal/hud/HudCore.java
+++ b/src/main/java/cc/polyfrost/oneconfig/internal/hud/HudCore.java
@@ -56,6 +56,7 @@ public class HudCore {
field.getKey().setAccessible(true);
Hud oldHud = huds.get(field);
Hud newHud = (Hud) field.getKey().get(field.getValue());
+ newHud.setConfig(oldHud.getConfig());
for (BasicOption option : hudOptions) {
if (option.getParent().equals(oldHud)) {
option.setParent(newHud);