diff options
author | ThatGravyBoat <thatgravyboat@gmail.com> | 2021-07-13 01:51:19 -0230 |
---|---|---|
committer | ThatGravyBoat <thatgravyboat@gmail.com> | 2021-07-13 01:51:19 -0230 |
commit | 3bd212839e1d3c497a840221a0c149451967467e (patch) | |
tree | 9a306491b76808a17a26c6bef6f74c08cbc99964 /src/main/java/com/thatgravyboat/skyblockhud/overlay | |
parent | 087d97fb0663edc5e343187c0fa4ec1bc6b081bc (diff) | |
download | SkyblockHud-Death-Defied-3bd212839e1d3c497a840221a0c149451967467e.tar.gz SkyblockHud-Death-Defied-3bd212839e1d3c497a840221a0c149451967467e.tar.bz2 SkyblockHud-Death-Defied-3bd212839e1d3c497a840221a0c149451967467e.zip |
Added 2 new subcommands to crystal waypoints, Added medals shown in farmhouse, Added config option to stop auto flipping of rpg hud, Added option so if exp bar is still being rendered it should hide when holding drill to not overlay them and keep a consistent hud
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/overlay')
3 files changed, 41 insertions, 5 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/overlay/MiningHud.java b/src/main/java/com/thatgravyboat/skyblockhud/overlay/MiningHud.java index 273f98d..2c2feaa 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/overlay/MiningHud.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/overlay/MiningHud.java @@ -23,17 +23,21 @@ public class MiningHud extends Gui { MiningHud.heat = heat; } + public static int getHeat() { + return heat; + } + @SubscribeEvent public void renderOverlay(RenderGameOverlayEvent.Post event) { - if (Utils.overlayShouldRender(event.type, SkyblockHud.hasSkyblockScoreboard(), SkyblockHud.config.miningHud.showDrillBar || SkyblockHud.config.miningHud.showHeatBar)) { + if (Utils.overlayShouldRender(event.type, SkyblockHud.hasSkyblockScoreboard(), SkyblockHud.config.mining.showDrillBar || SkyblockHud.config.mining.showHeatBar)) { Minecraft mc = Minecraft.getMinecraft(); - if (heat > 0 && Utils.isDrill(mc.thePlayer.getHeldItem()) && SkyblockHud.config.miningHud.showDrillBar && SkyblockHud.config.miningHud.showHeatBar) { + if (heat > 0 && Utils.isDrill(mc.thePlayer.getHeldItem()) && SkyblockHud.config.mining.showDrillBar && SkyblockHud.config.mining.showHeatBar) { renderFuelBar(mc, (event.resolution.getScaledWidth() / 2) - 91, event.resolution.getScaledHeight() - 31); renderHeatBar(mc, (event.resolution.getScaledWidth() / 2) + 46, event.resolution.getScaledHeight() - 31); - } else if (Utils.isDrill(mc.thePlayer.getHeldItem()) && SkyblockHud.config.miningHud.showDrillBar) { + } else if (Utils.isDrill(mc.thePlayer.getHeldItem()) && SkyblockHud.config.mining.showDrillBar) { renderFuelBar(mc, (event.resolution.getScaledWidth() / 2) - 68, event.resolution.getScaledHeight() - 31); - } else if (heat > 0 && SkyblockHud.config.miningHud.showHeatBar) { + } else if (heat > 0 && SkyblockHud.config.mining.showHeatBar) { renderHeatBar(mc, (event.resolution.getScaledWidth() / 2) - 22, event.resolution.getScaledHeight() - 31); } } diff --git a/src/main/java/com/thatgravyboat/skyblockhud/overlay/OverlayHud.java b/src/main/java/com/thatgravyboat/skyblockhud/overlay/OverlayHud.java index a1e1f54..8c64ddd 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/overlay/OverlayHud.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/overlay/OverlayHud.java @@ -60,6 +60,9 @@ public class OverlayHud extends Gui { // LOCATION drawLocation(width, offset, mc); + //FARMHOUSE + drawFarmHouseMedals(width, offset, mc); + //EXTRA SLOT if (LocationHandler.getCurrentLocation().equals(Locations.YOURISLAND)) { if (IslandHandler.flightTime > 0) drawFlightDuration(width, offset, mc); @@ -273,6 +276,24 @@ public class OverlayHud extends Gui { } } + public void drawFarmHouseMedals(int width, int offset, Minecraft mc) { + if (LocationHandler.getCurrentLocation().equals(Locations.FARMHOUSE)) { + int bronze = font.getStringWidth(FarmHouseHandler.getFormattedMedals(FarmHouseHandler.Medal.BRONZE)); + int silver = font.getStringWidth(FarmHouseHandler.getFormattedMedals(FarmHouseHandler.Medal.SILVER)); + int gold = font.getStringWidth(FarmHouseHandler.getFormattedMedals(FarmHouseHandler.Medal.GOLD)); + + int end = drawLeftBottomBar(width, offset, 40 + bronze + silver + gold, mc); + drawTexturedModalRect(end + 2, offset + (bossBarVisible ? 38 : 21), 139, 0, 8, 8); + drawTexturedModalRect(end + 14 + gold, offset + (bossBarVisible ? 38 : 21), 147, 0, 8, 8); + drawTexturedModalRect(end + 26 + gold + silver, offset + (bossBarVisible ? 38 : 21), 155, 0, 8, 8); + + drawString(font, FarmHouseHandler.getFormattedMedals(FarmHouseHandler.Medal.GOLD), end + 12, offset + (bossBarVisible ? 38 : 21), 0xffffff); + drawString(font, FarmHouseHandler.getFormattedMedals(FarmHouseHandler.Medal.SILVER), end + gold + 24, offset + (bossBarVisible ? 38 : 21), 0xffffff); + drawString(font, FarmHouseHandler.getFormattedMedals(FarmHouseHandler.Medal.BRONZE), end + gold + silver + 36, offset + (bossBarVisible ? 38 : 21), 0xffffff); + + } + } + @SubscribeEvent public void renderOverlay(RenderGameOverlayEvent.Post event) { if (Utils.overlayShouldRender(event.type, SkyblockHud.hasSkyblockScoreboard())) { @@ -291,4 +312,15 @@ public class OverlayHud extends Gui { drawCenteredString(font, text, (int) (x / factor), (int) (y / factor), color); GlStateManager.scale(1 / factor, 1 / factor, 1); } + + + public int drawLeftBottomBar(int width, int offset, int barWidth, Minecraft mc) { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + mc.renderEngine.bindTexture(GuiTextures.overlay); + int edge = (width / 2) - 17; + + drawTexturedModalRect(edge - barWidth, offset + (bossBarVisible ? 35 : 18), 0, 34, 2, 14); + drawTexturedModalRect(edge - barWidth + 2, offset + (bossBarVisible ? 35 : 18), 2, 34, barWidth - 2, 14); + return edge - barWidth + 2; + } } diff --git a/src/main/java/com/thatgravyboat/skyblockhud/overlay/RPGHud.java b/src/main/java/com/thatgravyboat/skyblockhud/overlay/RPGHud.java index 9d0f00d..ef19553 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/overlay/RPGHud.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/overlay/RPGHud.java @@ -67,7 +67,7 @@ public class RPGHud extends Gui { int x = position.getAbsX(event.resolution, 120); int y = position.getAbsY(event.resolution, 47); - boolean rightAligned = position.rightAligned(event.resolution, 120); + boolean rightAligned = position.rightAligned(event.resolution, 120) && SkyblockHud.config.rpg.flipHud; drawTexturedModalRect(x, y, rightAligned ? 131 : 5, 6, 120, 47); |