aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-08-10 13:33:52 +0200
committerGitHub <noreply@github.com>2022-08-10 13:33:52 +0200
commit67a78a550c9d87715b834b4615662cc2d9e65bed (patch)
tree00682ca3af62de86fef29e9d28aadd24dfbc03f2
parent97a75485fa125b37c27ffd53ac1c4fbc875a7b40 (diff)
downloadOneConfig-67a78a550c9d87715b834b4615662cc2d9e65bed.tar.gz
OneConfig-67a78a550c9d87715b834b4615662cc2d9e65bed.tar.bz2
OneConfig-67a78a550c9d87715b834b4615662cc2d9e65bed.zip
hud profile fix (#90)
* hud fix * api
-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);