aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/overlay
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/overlay')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/overlay/GenericOverlays.java22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/overlay/GenericOverlays.java b/src/main/java/com/thatgravyboat/skyblockhud/overlay/GenericOverlays.java
index eeb48e1..fc918db 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/overlay/GenericOverlays.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/overlay/GenericOverlays.java
@@ -1,18 +1,22 @@
package com.thatgravyboat.skyblockhud.overlay;
-import com.thatgravyboat.skyblockhud.GuiTextures;
import com.thatgravyboat.skyblockhud.SkyblockHud;
import com.thatgravyboat.skyblockhud.core.util.render.RenderUtils;
-import java.awt.Color;
+import java.awt.*;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.renderer.GlStateManager;
+import net.minecraft.util.ResourceLocation;
public class GenericOverlays extends Gui {
+ public static int lastBar = 0;
+ public static ResourceLocation bars = new ResourceLocation("skyblockhud", "bars.png");
+
public static void drawLargeBar(Minecraft mc, int x, int y, float percentage, float max, int fullColor, int loadingColor, int barStyle) {
if (SkyblockHud.hasSkyblockScoreboard()) {
- mc.renderEngine.bindTexture(GuiTextures.bars);
+ updateBar();
+ mc.renderEngine.bindTexture(bars);
Color color = new Color(percentage == max ? fullColor : loadingColor);
RenderUtils.drawTexturedModalRect(x, y, 0, 0, 182, 5);
@@ -27,7 +31,8 @@ public class GenericOverlays extends Gui {
public static void drawSmallBar(Minecraft mc, int x, int y, double percentage, double max, int fullColor, int loadingColor, int barStyle) {
if (SkyblockHud.hasSkyblockScoreboard()) {
- mc.renderEngine.bindTexture(GuiTextures.bars);
+ updateBar();
+ mc.renderEngine.bindTexture(bars);;
Color color = new Color(percentage == max ? fullColor : loadingColor);
GlStateManager.enableBlend();
RenderUtils.drawTexturedModalRect(x, y, 0, 35, 62, 5);
@@ -39,4 +44,13 @@ public class GenericOverlays extends Gui {
}
}
}
+
+ public static void updateBar() {
+ if (lastBar != SkyblockHud.config.misc.barTexture) {
+ lastBar = SkyblockHud.config.misc.barTexture;
+ if (lastBar == 0) bars = new ResourceLocation("skyblockhud", "bars.png");
+ else bars = new ResourceLocation("skyblockhud", "bars_"+lastBar+".png");
+ }
+
+ }
}