diff options
author | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-07-02 06:12:23 +0700 |
---|---|---|
committer | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-07-02 06:12:23 +0700 |
commit | d4bb5a94308d4379ef3d6cc7b9221ea0d98ff051 (patch) | |
tree | 9bb9b53e2823f73084780673763504f4098bae69 /src/main/java/cc/polyfrost/oneconfig/hud/Hud.java | |
parent | d2b1d57120bb51e76191302a58d935afe52b89df (diff) | |
download | OneConfig-d4bb5a94308d4379ef3d6cc7b9221ea0d98ff051.tar.gz OneConfig-d4bb5a94308d4379ef3d6cc7b9221ea0d98ff051.tar.bz2 OneConfig-d4bb5a94308d4379ef3d6cc7b9221ea0d98ff051.zip |
Separate Minecraft dependant and non-dependant code
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/hud/Hud.java')
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/hud/Hud.java | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/hud/Hud.java b/src/main/java/cc/polyfrost/oneconfig/hud/Hud.java index 62cfb2e..9c9a005 100644 --- a/src/main/java/cc/polyfrost/oneconfig/hud/Hud.java +++ b/src/main/java/cc/polyfrost/oneconfig/hud/Hud.java @@ -1,13 +1,11 @@ package cc.polyfrost.oneconfig.hud; +import cc.polyfrost.oneconfig.config.Config; import cc.polyfrost.oneconfig.config.annotations.Switch; import cc.polyfrost.oneconfig.config.core.OneColor; import cc.polyfrost.oneconfig.gui.OneConfigGui; -import cc.polyfrost.oneconfig.libs.universal.UMinecraft; -import cc.polyfrost.oneconfig.libs.universal.UScreen; +import cc.polyfrost.oneconfig.platform.Platform; import cc.polyfrost.oneconfig.renderer.RenderManager; -import cc.polyfrost.oneconfig.config.Config; -import net.minecraft.client.gui.GuiChat; /** * Represents a HUD element in OneConfig. @@ -175,9 +173,9 @@ public abstract class Hud { * @param background If background should be drawn or not */ public void drawAll(float x, float y, float scale, boolean background) { - if (!showInGuis && UScreen.getCurrentScreen() != null && !(UScreen.getCurrentScreen() instanceof OneConfigGui)) return; - if (!showInChat && UScreen.getCurrentScreen() instanceof GuiChat) return; - if (!showInDebug && UMinecraft.getSettings().showDebugInfo) return; + if (!showInGuis && Platform.getGuiPlatform().getCurrentScreen() != null && !(Platform.getGuiPlatform().getCurrentScreen() instanceof OneConfigGui)) return; + if (!showInChat && Platform.getGuiPlatform().isInChat()) return; + if (!showInDebug && Platform.getGuiPlatform().isInDebug()) return; if (background && drawBackground()) drawBackground(x, y, getWidth(scale), getHeight(scale), scale); draw((int) (x + paddingX * scale / 2f), (int) (y + paddingY * scale / 2f), scale); } |