aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/overlay/GenericOverlays.java
diff options
context:
space:
mode:
authorThatGravyBoat <thatgravyboat@gmail.com>2021-07-06 15:10:29 -0230
committerThatGravyBoat <thatgravyboat@gmail.com>2021-07-06 15:10:29 -0230
commit6d8e1e5659f64a4f9ba86d6ab5bbc8e688faf22a (patch)
tree7451e53ceeae3c324d83a7faba83ce80005e6f23 /src/main/java/com/thatgravyboat/skyblockhud/overlay/GenericOverlays.java
downloadskyblockhud-6d8e1e5659f64a4f9ba86d6ab5bbc8e688faf22a.tar.gz
skyblockhud-6d8e1e5659f64a4f9ba86d6ab5bbc8e688faf22a.tar.bz2
skyblockhud-6d8e1e5659f64a4f9ba86d6ab5bbc8e688faf22a.zip
Initial Commit
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/overlay/GenericOverlays.java')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/overlay/GenericOverlays.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/overlay/GenericOverlays.java b/src/main/java/com/thatgravyboat/skyblockhud/overlay/GenericOverlays.java
new file mode 100644
index 0000000..d987c86
--- /dev/null
+++ b/src/main/java/com/thatgravyboat/skyblockhud/overlay/GenericOverlays.java
@@ -0,0 +1,44 @@
+package com.thatgravyboat.skyblockhud.overlay;
+
+import com.thatgravyboat.skyblockhud.GuiTextures;
+import com.thatgravyboat.skyblockhud.SkyblockHud;
+import com.thatgravyboat.skyblockhud.core.util.render.RenderUtils;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.Gui;
+import net.minecraft.client.renderer.GlStateManager;
+
+import java.awt.Color;
+
+
+public class GenericOverlays extends Gui {
+
+ 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);
+ Color color = new Color(percentage == max ? fullColor : loadingColor);
+
+ RenderUtils.drawTexturedModalRect(x, y, 0, 0, 182, 5);
+ GlStateManager.color(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, color.getAlpha() / 255f);
+ RenderUtils.drawTexturedModalRect(x, y, 0, 30, 182, 5);
+ RenderUtils.drawTexturedModalRect(x, y, 0, 5, (int) (182 * percentage), 5);
+ if (barStyle != 0) {
+ RenderUtils.drawTexturedModalRect(x, y, 0, 5 + (barStyle * 5), 182, 5);
+ }
+ }
+ }
+
+ 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);
+ Color color = new Color(percentage == max ? fullColor : loadingColor);
+ GlStateManager.enableBlend();
+ RenderUtils.drawTexturedModalRect(x, y, 0, 35, 62, 5);
+ GlStateManager.color(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, color.getAlpha() / 255f);
+ RenderUtils.drawTexturedModalRect(x, y, 0, 65, 62, 5);
+ RenderUtils.drawTexturedModalRect(x, y, 0, 40, (int) (62 * percentage), 5);
+ if (barStyle != 0) {
+ RenderUtils.drawTexturedModalRect(x, y, 0, 45 + (barStyle * 5), 62, 5);
+ }
+ }
+ }
+}