aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/overlay
diff options
context:
space:
mode:
authorTymanWasTaken <tyman@tyman.tech>2021-07-06 17:27:11 -0400
committerTymanWasTaken <tyman@tyman.tech>2021-07-06 17:27:11 -0400
commit804767ebfc26e2a1252bc327def02389b35dfc6e (patch)
treee3e06c24454080f059355133d633e5a076d85ad3 /src/main/java/com/thatgravyboat/skyblockhud/overlay
parent98ee5a2ae8090c061b1e61e7955d793416991822 (diff)
downloadSkyblockHud-Death-Defied-804767ebfc26e2a1252bc327def02389b35dfc6e.tar.gz
SkyblockHud-Death-Defied-804767ebfc26e2a1252bc327def02389b35dfc6e.tar.bz2
SkyblockHud-Death-Defied-804767ebfc26e2a1252bc327def02389b35dfc6e.zip
fine
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/overlay')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/overlay/DungeonOverlay.java72
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/overlay/GenericOverlays.java22
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/overlay/OverlayHud.java260
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/overlay/RPGHud.java25
4 files changed, 45 insertions, 334 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/overlay/DungeonOverlay.java b/src/main/java/com/thatgravyboat/skyblockhud/overlay/DungeonOverlay.java
index 462896d..f8a2e0d 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/overlay/DungeonOverlay.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/overlay/DungeonOverlay.java
@@ -54,38 +54,18 @@ public class DungeonOverlay extends Gui {
mc.renderEngine.bindTexture(GuiTextures.dungeon);
drawTexturedModalRect((width / 2) - 7, offset + (bossBarVisible ? 20 : 3), 16, 50, 3, 8);
drawTexturedModalRect((width / 2) - 7, offset + (bossBarVisible ? 30 : 13), 19, 50, 3, 8);
- String dungeonTimeElapsed =
- (dungeonTimeMin > 9 ? String.valueOf(dungeonTimeMin) : "0" + dungeonTimeMin) +
- ":" +
- (dungeonTimeSec > 9 ? String.valueOf(dungeonTimeSec) : "0" + dungeonTimeSec);
+ String dungeonTimeElapsed = (dungeonTimeMin > 9 ? String.valueOf(dungeonTimeMin) : "0" + dungeonTimeMin) + ":" + (dungeonTimeSec > 9 ? String.valueOf(dungeonTimeSec) : "0" + dungeonTimeSec);
drawCenteredString(font, dungeonTimeElapsed, (width / 2), offset + (bossBarVisible ? 40 : 23), 0xFFFF55);
//KEYS
- drawString(
- font,
- (DungeonHandler.hasBloodkey() ? "\u2714" : "x"),
- (width / 2),
- offset + (bossBarVisible ? 19 : 2),
- (DungeonHandler.hasBloodkey() ? 0x55FF55 : 0xAA0000)
- );
+ drawString(font, (DungeonHandler.hasBloodkey() ? "\u2714" : "x"), (width / 2), offset + (bossBarVisible ? 19 : 2), (DungeonHandler.hasBloodkey() ? 0x55FF55 : 0xAA0000));
drawString(font, DungeonHandler.getWitherKeys() + "x", (width / 2), offset + (bossBarVisible ? 30 : 13), 0x555555);
//CLEARED PERCENTAGE
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(GuiTextures.overlay);
int clearPercent = DungeonHandler.getDungeonCleared();
- String clearPercentage =
- "Dungeon Cleared: \u00A7" +
- (clearPercent <= 20 ? "4" : clearPercent <= 50 ? "6" : clearPercent <= 80 ? "e" : "a") +
- clearPercent +
- "%";
+ String clearPercentage = "Dungeon Cleared: \u00A7" + (clearPercent <= 20 ? "4" : clearPercent <= 50 ? "6" : clearPercent <= 80 ? "e" : "a") + clearPercent + "%";
drawTexturedModalRect((width / 2) + 17, offset + (bossBarVisible ? 20 : 3), 2, 34, font.getStringWidth(clearPercentage) + 3, 14);
- drawTexturedModalRect(
- ((width / 2) + 17) + font.getStringWidth(clearPercentage) + 3,
- offset + (bossBarVisible ? 20 : 3),
- 252,
- 34,
- 4,
- 14
- );
+ drawTexturedModalRect(((width / 2) + 17) + font.getStringWidth(clearPercentage) + 3, offset + (bossBarVisible ? 20 : 3), 252, 34, 4, 14);
drawString(font, clearPercentage, (width / 2) + 18, offset + (bossBarVisible ? 23 : 6), 0xAAAAAA);
//DEATHS
@@ -105,14 +85,7 @@ public class DungeonOverlay extends Gui {
int totalSecrets = DungeonHandler.getTotalSecrets();
String secretsText = "Secrets: " + secrets + "/" + maxSecrets + " (" + totalSecrets + ")";
drawTexturedModalRect((width / 2) - 17 - (font.getStringWidth(secretsText)) - 4, offset + (bossBarVisible ? 20 : 3), 0, 34, 2, 14);
- drawTexturedModalRect(
- ((width / 2) - 17 - (font.getStringWidth(secretsText))) - 2,
- offset + (bossBarVisible ? 20 : 3),
- 2,
- 34,
- font.getStringWidth(secretsText) + 2,
- 14
- );
+ drawTexturedModalRect(((width / 2) - 17 - (font.getStringWidth(secretsText))) - 2, offset + (bossBarVisible ? 20 : 3), 2, 34, font.getStringWidth(secretsText) + 2, 14);
drawString(font, secretsText, (width / 2) - 17 - (font.getStringWidth(secretsText)), offset + (bossBarVisible ? 23 : 6), 0xAAAAAA);
//CRYPTS
@@ -121,14 +94,7 @@ public class DungeonOverlay extends Gui {
int crypts = DungeonHandler.getCrypts();
String cryptText = "Crypts: " + crypts;
drawTexturedModalRect((width / 2) - 17 - (font.getStringWidth(cryptText)) - 4, offset + (bossBarVisible ? 35 : 18), 0, 34, 2, 14);
- drawTexturedModalRect(
- ((width / 2) - 17 - (font.getStringWidth(cryptText))) - 2,
- offset + (bossBarVisible ? 35 : 18),
- 2,
- 34,
- font.getStringWidth(cryptText) + 2,
- 14
- );
+ drawTexturedModalRect(((width / 2) - 17 - (font.getStringWidth(cryptText))) - 2, offset + (bossBarVisible ? 35 : 18), 2, 34, font.getStringWidth(cryptText) + 2, 14);
drawString(font, cryptText, (width / 2) - 17 - (font.getStringWidth(cryptText)), offset + (bossBarVisible ? 38 : 21), 0xAAAAAA);
}
@@ -141,29 +107,14 @@ public class DungeonOverlay extends Gui {
int x = position.getAbsX(resolution, 182);
int y = position.getAbsY(resolution, 5);
- GenericOverlays.drawLargeBar(
- mc,
- x - 91,
- y,
- percentage,
- 0.999f,
- SpecialColour.specialToChromaRGB(dungeonHud.barLoadColor),
- SpecialColour.specialToChromaRGB(dungeonHud.barFullColor),
- dungeonHud.barStyle
- );
+ GenericOverlays.drawLargeBar(mc, x - 91, y, percentage, 0.999f, SpecialColour.specialToChromaRGB(dungeonHud.barLoadColor), SpecialColour.specialToChromaRGB(dungeonHud.barFullColor), dungeonHud.barStyle);
}
}
@SubscribeEvent
public void renderOverlay(RenderGameOverlayEvent.Post event) {
Minecraft mc = Minecraft.getMinecraft();
- if (
- Utils.overlayShouldRender(
- event.type,
- SkyblockHud.hasSkyblockScoreboard(),
- LocationHandler.getCurrentLocation().equals(Locations.CATACOMBS)
- )
- ) {
+ if (Utils.overlayShouldRender(event.type, SkyblockHud.hasSkyblockScoreboard(), LocationHandler.getCurrentLocation().equals(Locations.CATACOMBS))) {
bossBarVisible = BossStatus.statusBarTime > 0 && GuiIngameForge.renderBossHealth && BossbarHandler.bossBarRendered;
GlStateManager.enableBlend();
drawUltimateBar(mc, event.resolution);
@@ -171,12 +122,7 @@ public class DungeonOverlay extends Gui {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
if (!SkyblockHud.config.dungeon.hideDungeonPlayers) {
int[] hardCodedPos = new int[] { 5, 42, 79, 116 };
- Position[] positions = new Position[] {
- SkyblockHud.config.dungeon.dungeonPlayer1,
- SkyblockHud.config.dungeon.dungeonPlayer2,
- SkyblockHud.config.dungeon.dungeonPlayer3,
- SkyblockHud.config.dungeon.dungeonPlayer4
- };
+ Position[] positions = new Position[] { SkyblockHud.config.dungeon.dungeonPlayer1, SkyblockHud.config.dungeon.dungeonPlayer2, SkyblockHud.config.dungeon.dungeonPlayer3, SkyblockHud.config.dungeon.dungeonPlayer4 };
for (int i = 0; i < Math.min(DungeonHandler.getDungeonPlayers().values().size(), 4); i++) {
DungeonPlayer player = (DungeonPlayer) DungeonHandler.getDungeonPlayers().values().toArray()[i];
int posX;
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/overlay/GenericOverlays.java b/src/main/java/com/thatgravyboat/skyblockhud/overlay/GenericOverlays.java
index 439d857..eeb48e1 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/overlay/GenericOverlays.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/overlay/GenericOverlays.java
@@ -10,16 +10,7 @@ import net.minecraft.client.renderer.GlStateManager;
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
- ) {
+ 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);
@@ -34,16 +25,7 @@ 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
- ) {
+ 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);
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/overlay/OverlayHud.java b/src/main/java/com/thatgravyboat/skyblockhud/overlay/OverlayHud.java
index 530a890..23b9df0 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/overlay/OverlayHud.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/overlay/OverlayHud.java
@@ -42,24 +42,11 @@ public class OverlayHud extends Gui {
timeMin = timeMin - (timeHour * 60);
String militaryTime = timeHour + ":" + (timeMin == 0 ? timeMin + "0" : timeMin);
int time12Hour = timeHour >= 12 ? timeHour - 12 : timeHour;
- String normalTime =
- (time12Hour == 0 ? "00" : String.valueOf(time12Hour)) + ":" + (timeMin == 0 ? "00" : timeMin) + (timeHour >= 12 ? "pm" : "am");
+ String normalTime = (time12Hour == 0 ? "00" : String.valueOf(time12Hour)) + ":" + (timeMin == 0 ? "00" : timeMin) + (timeHour >= 12 ? "pm" : "am");
drawTexturedModalRect((width / 2) - 17, offset + (bossBarVisible ? 17 : 0), 0, 0, 34, 34);
drawTexturedModalRect((width / 2) - 4, offset + (bossBarVisible ? 24 : 7), (timeHour > 19 || timeHour < 4) ? 43 : 43 + 8, 0, 8, 8);
- if (SkyblockHud.config.main.twelveHourClock) drawScaledString(
- 0.8f,
- width / 2,
- offset + (bossBarVisible ? 38 : 21),
- normalTime,
- (timeHour > 19 || timeHour < 4) ? 0xAFB8CC : 0xFFFF55
- ); else drawCenteredString(
- font,
- militaryTime,
- (width / 2),
- offset + (bossBarVisible ? 38 : 21),
- (timeHour > 19 || timeHour < 4) ? 0xAFB8CC : 0xFFFF55
- );
+ if (SkyblockHud.config.main.twelveHourClock) drawScaledString(0.8f, width / 2, offset + (bossBarVisible ? 38 : 21), normalTime, (timeHour > 19 || timeHour < 4) ? 0xAFB8CC : 0xFFFF55); else drawCenteredString(font, militaryTime, (width / 2), offset + (bossBarVisible ? 38 : 21), (timeHour > 19 || timeHour < 4) ? 0xAFB8CC : 0xFFFF55);
//PURSE
drawPurseAndBits(width, offset, mc);
@@ -100,26 +87,10 @@ public class OverlayHud extends Gui {
if (mc.thePlayer.ticksExisted % 600 == 0) eventToggle = true;
mc.renderEngine.bindTexture(GuiTextures.overlay);
String dateText = SeasonDateHandler.getFancySeasonAndDate();
- if (
- eventToggle && !SeasonDateHandler.getCurrentEvent().isEmpty() && !SeasonDateHandler.getCurrentEventTime().isEmpty()
- ) dateText = SeasonDateHandler.getCurrentEvent().trim() + " " + SeasonDateHandler.getCurrentEventTime().trim();
+ if (eventToggle && !SeasonDateHandler.getCurrentEvent().isEmpty() && !SeasonDateHandler.getCurrentEventTime().isEmpty()) dateText = SeasonDateHandler.getCurrentEvent().trim() + " " + SeasonDateHandler.getCurrentEventTime().trim();
drawTexturedModalRect((width / 2) + 17, offset + (bossBarVisible ? 20 : 3), 2, 34, font.getStringWidth(dateText) + 9, 14);
- drawTexturedModalRect(
- ((width / 2) + 17) + font.getStringWidth(dateText) + 9,
- offset + (bossBarVisible ? 20 : 3),
- 252,
- 34,
- 4,
- 14
- );
- drawTexturedModalRect(
- ((width / 2) + 17) + font.getStringWidth(dateText) + 2,
- offset + (bossBarVisible ? 23 : 6),
- SeasonDateHandler.getCurrentSeason().getTextureX(),
- 16,
- 8,
- 8
- );
+ drawTexturedModalRect(((width / 2) + 17) + font.getStringWidth(dateText) + 9, offset + (bossBarVisible ? 20 : 3), 252, 34, 4, 14);
+ drawTexturedModalRect(((width / 2) + 17) + font.getStringWidth(dateText) + 2, offset + (bossBarVisible ? 23 : 6), SeasonDateHandler.getCurrentSeason().getTextureX(), 16, 8, 8);
drawString(font, dateText, (width / 2) + 18, offset + (bossBarVisible ? 23 : 6), 0xffffff);
}
}
@@ -127,55 +98,20 @@ public class OverlayHud extends Gui {
public void drawLocation(int width, int offset, Minecraft mc) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(GuiTextures.overlay);
- drawTexturedModalRect(
- (width / 2) - 33 - (font.getStringWidth(LocationHandler.getCurrentLocation().getDisplayName())),
- offset + (bossBarVisible ? 20 : 3),
- 0,
- 34,
- 2,
- 14
- );
- drawTexturedModalRect(
- ((width / 2) - 33 - (font.getStringWidth(LocationHandler.getCurrentLocation().getDisplayName()))) + 2,
- offset + (bossBarVisible ? 20 : 3),
- 2,
- 34,
- font.getStringWidth(LocationHandler.getCurrentLocation().getDisplayName()) + 14,
- 14
- );
- drawTexturedModalRect(
- ((width / 2) - 33 - (font.getStringWidth(LocationHandler.getCurrentLocation().getDisplayName()))) + 4,
- offset + (bossBarVisible ? 23 : 6),
- LocationHandler.getCurrentLocation().getCategory().getTexturePos(),
- 8,
- 8,
- 8
- );
- drawString(
- font,
- LocationHandler.getCurrentLocation().getDisplayName(),
- (width / 2) - 19 - (font.getStringWidth(LocationHandler.getCurrentLocation().getDisplayName())),
- offset + (bossBarVisible ? 23 : 6),
- 0xFFFFFF
- );
+ drawTexturedModalRect((width / 2) - 33 - (font.getStringWidth(LocationHandler.getCurrentLocation().getDisplayName())), offset + (bossBarVisible ? 20 : 3), 0, 34, 2, 14);
+ drawTexturedModalRect(((width / 2) - 33 - (font.getStringWidth(LocationHandler.getCurrentLocation().getDisplayName()))) + 2, offset + (bossBarVisible ? 20 : 3), 2, 34, font.getStringWidth(LocationHandler.getCurrentLocation().getDisplayName()) + 14, 14);
+ drawTexturedModalRect(((width / 2) - 33 - (font.getStringWidth(LocationHandler.getCurrentLocation().getDisplayName()))) + 4, offset + (bossBarVisible ? 23 : 6), LocationHandler.getCurrentLocation().getCategory().getTexturePos(), 8, 8, 8);
+ drawString(font, LocationHandler.getCurrentLocation().getDisplayName(), (width / 2) - 19 - (font.getStringWidth(LocationHandler.getCurrentLocation().getDisplayName())), offset + (bossBarVisible ? 23 : 6), 0xFFFFFF);
}
public void drawRedstone(int width, int offset, Minecraft mc) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(GuiTextures.overlay);
- int redstoneColor = IslandHandler.redstone > 90
- ? 0xFF0000
- : IslandHandler.redstone > 75 ? 0xC45B00 : IslandHandler.redstone > 50 ? 0xFFFF55 : 0x55FF55;
+ int redstoneColor = IslandHandler.redstone > 90 ? 0xFF0000 : IslandHandler.redstone > 75 ? 0xC45B00 : IslandHandler.redstone > 50 ? 0xFFFF55 : 0x55FF55;
if (IslandHandler.redstone > 0 && Utils.isPlayerHoldingRedstone(mc.thePlayer)) {
drawTexturedModalRect((width / 2) - 15, offset + (bossBarVisible ? 51 : 34), 0, 48, 30, 18);
drawTexturedModalRect((width / 2) - 4, offset + (bossBarVisible ? 51 : 34), 59, 0, 8, 8);
- drawCenteredString(
- mc.fontRendererObj,
- IslandHandler.redstone + "%",
- (width / 2),
- offset + (bossBarVisible ? 58 : 41),
- redstoneColor
- );
+ drawCenteredString(mc.fontRendererObj, IslandHandler.redstone + "%", (width / 2), offset + (bossBarVisible ? 58 : 41), redstoneColor);
}
}
@@ -185,14 +121,7 @@ public class OverlayHud extends Gui {
int xPos = (width / 2) + 17;
//COINS
- drawTexturedModalRect(
- xPos,
- offset + (bossBarVisible ? 35 : 18),
- 2,
- 34,
- font.getStringWidth(CurrencyHandler.getCoinsFormatted()) + 11,
- 14
- );
+ drawTexturedModalRect(xPos, offset + (bossBarVisible ? 35 : 18), 2, 34, font.getStringWidth(CurrencyHandler.getCoinsFormatted()) + 11, 14);
drawTexturedModalRect(xPos + 1, offset + (bossBarVisible ? 37 : 20), 34, 0, 8, 8);
drawString(font, CurrencyHandler.getCoinsFormatted(), xPos + 10, offset + (bossBarVisible ? 38 : 21), 0xFFAA00);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
@@ -201,14 +130,7 @@ public class OverlayHud extends Gui {
//BITS
if (CurrencyHandler.getBits() > 0) {
- drawTexturedModalRect(
- xPos,
- offset + (bossBarVisible ? 35 : 18),
- 2,
- 34,
- font.getStringWidth(CurrencyHandler.getBitsFormatted()) + 11,
- 14
- );
+ drawTexturedModalRect(xPos, offset + (bossBarVisible ? 35 : 18), 2, 34, font.getStringWidth(CurrencyHandler.getBitsFormatted()) + 11, 14);
drawTexturedModalRect(xPos + 1, offset + (bossBarVisible ? 37 : 20), 75, 0, 8, 8);
drawString(font, CurrencyHandler.getBitsFormatted(), xPos + 10, offset + (bossBarVisible ? 38 : 21), 0x55FFFF);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
@@ -224,32 +146,11 @@ public class OverlayHud extends Gui {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
DecimalFormat flightFormat = new DecimalFormat("#.#", DecimalFormatSymbols.getInstance(Locale.CANADA));
String duration;
- if (IslandHandler.flightTime < 60) duration = IslandHandler.flightTime + "s"; else if (
- IslandHandler.flightTime < 3600
- ) duration = flightFormat.format((double) IslandHandler.flightTime / 60) + "m"; else if (
- IslandHandler.flightTime < 86400
- ) duration = flightFormat.format((double) IslandHandler.flightTime / 3600) + "hr"; else if (
- IslandHandler.flightTime < 86460
- ) duration = flightFormat.format((double) IslandHandler.flightTime / 86400) + "day"; else duration =
- flightFormat.format((double) IslandHandler.flightTime / 86400) + "days";
+ if (IslandHandler.flightTime < 60) duration = IslandHandler.flightTime + "s"; else if (IslandHandler.flightTime < 3600) duration = flightFormat.format((double) IslandHandler.flightTime / 60) + "m"; else if (IslandHandler.flightTime < 86400) duration = flightFormat.format((double) IslandHandler.flightTime / 3600) + "hr"; else if (IslandHandler.flightTime < 86460) duration = flightFormat.format((double) IslandHandler.flightTime / 86400) + "day"; else duration = flightFormat.format((double) IslandHandler.flightTime / 86400) + "days";
mc.renderEngine.bindTexture(GuiTextures.overlay);
drawTexturedModalRect((width / 2) - 33 - (font.getStringWidth(duration)), offset + (bossBarVisible ? 35 : 18), 0, 34, 2, 14);
- drawTexturedModalRect(
- ((width / 2) - 33 - (font.getStringWidth(duration))) + 2,
- offset + (bossBarVisible ? 35 : 18),
- 2,
- 34,
- font.getStringWidth(duration) + 14,
- 14
- );
- drawTexturedModalRect(
- ((width / 2) - 33 - (font.getStringWidth(duration))) + 4,
- offset + (bossBarVisible ? 38 : 21),
- 67,
- 0,
- 8,
- 8
- );
+ drawTexturedModalRect(((width / 2) - 33 - (font.getStringWidth(duration))) + 2, offset + (bossBarVisible ? 35 : 18), 2, 34, font.getStringWidth(duration) + 14, 14);
+ drawTexturedModalRect(((width / 2) - 33 - (font.getStringWidth(duration))) + 4, offset + (bossBarVisible ? 38 : 21), 67, 0, 8, 8);
drawString(font, duration, (width / 2) - 19 - (font.getStringWidth(duration)), offset + (bossBarVisible ? 38 : 21), 0xFFFFFF);
}
}
@@ -260,22 +161,8 @@ public class OverlayHud extends Gui {
mc.renderEngine.bindTexture(GuiTextures.overlay);
String duration = "Rain: " + ParkIslandHandler.getRainTime();
drawTexturedModalRect((width / 2) - 33 - (font.getStringWidth(duration)), offset + (bossBarVisible ? 35 : 18), 0, 34, 2, 14);
- drawTexturedModalRect(
- ((width / 2) - 33 - (font.getStringWidth(duration))) + 2,
- offset + (bossBarVisible ? 35 : 18),
- 2,
- 34,
- font.getStringWidth(duration) + 14,
- 14
- );
- drawTexturedModalRect(
- ((width / 2) - 33 - (font.getStringWidth(duration))) + 4,
- offset + (bossBarVisible ? 38 : 21),
- 83,
- 0,
- 8,
- 8
- );
+ drawTexturedModalRect(((width / 2) - 33 - (font.getStringWidth(duration))) + 2, offset + (bossBarVisible ? 35 : 18), 2, 34, font.getStringWidth(duration) + 14, 14);
+ drawTexturedModalRect(((width / 2) - 33 - (font.getStringWidth(duration))) + 4, offset + (bossBarVisible ? 38 : 21), 83, 0, 8, 8);
drawString(font, duration, (width / 2) - 19 - (font.getStringWidth(duration)), offset + (bossBarVisible ? 38 : 21), 0xFFFFFF);
}
}
@@ -312,22 +199,8 @@ public class OverlayHud extends Gui {
}
String text = stringBuilder.toString();
drawTexturedModalRect((width / 2) - 33 - (font.getStringWidth(text)), offset + (bossBarVisible ? 35 : 18), 0, 34, 2, 14);
- drawTexturedModalRect(
- ((width / 2) - 33 - (font.getStringWidth(text))) + 2,
- offset + (bossBarVisible ? 35 : 18),
- 2,
- 34,
- font.getStringWidth(text) + 14,
- 14
- );
- drawTexturedModalRect(
- ((width / 2) - 33 - (font.getStringWidth(text))) + 4,
- offset + (bossBarVisible ? 38 : 21),
- slayerType.getX(),
- 24,
- 8,
- 8
- );
+ drawTexturedModalRect(((width / 2) - 33 - (font.getStringWidth(text))) + 2, offset + (bossBarVisible ? 35 : 18), 2, 34, font.getStringWidth(text) + 14, 14);
+ drawTexturedModalRect(((width / 2) - 33 - (font.getStringWidth(text))) + 4, offset + (bossBarVisible ? 38 : 21), slayerType.getX(), 24, 8, 8);
drawString(font, text, (width / 2) - 19 - (font.getStringWidth(text)), offset + (bossBarVisible ? 38 : 21), 0xFFFFFF);
}
}
@@ -339,22 +212,8 @@ public class OverlayHud extends Gui {
mc.renderEngine.bindTexture(GuiTextures.overlay);
String mithril = DwarvenMineHandler.getMithrilFormatted();
drawTexturedModalRect((width / 2) - 33 - (font.getStringWidth(mithril)), offset + (bossBarVisible ? 35 : 18), 0, 34, 2, 14);
- drawTexturedModalRect(
- ((width / 2) - 33 - (font.getStringWidth(mithril))) + 2,
- offset + (bossBarVisible ? 35 : 18),
- 2,
- 34,
- font.getStringWidth(mithril) + 14,
- 14
- );
- drawTexturedModalRect(
- ((width / 2) - 33 - (font.getStringWidth(mithril))) + 4,
- offset + (bossBarVisible ? 38 : 21),
- 91,
- 0,
- 8,
- 8
- );
+ drawTexturedModalRect(((width / 2) - 33 - (font.getStringWidth(mithril))) + 2, offset + (bossBarVisible ? 35 : 18), 2, 34, font.getStringWidth(mithril) + 14, 14);
+ drawTexturedModalRect(((width / 2) - 33 - (font.getStringWidth(mithril))) + 4, offset + (bossBarVisible ? 38 : 21), 91, 0, 8, 8);
drawString(font, mithril, (width / 2) - 19 - (font.getStringWidth(mithril)), offset + (bossBarVisible ? 38 : 21), 0x00C896);
}
}
@@ -363,26 +222,10 @@ public class OverlayHud extends Gui {
if (LocationHandler.getCurrentLocation().getCategory().equals(LocationCategory.MUSHROOMDESERT)) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(GuiTextures.overlay);
- String duration = FarmingIslandHandler.location != Locations.NONE
- ? FarmingIslandHandler.location.getDisplayName()
- : "" + FarmingIslandHandler.pelts;
+ String duration = FarmingIslandHandler.location != Locations.NONE ? FarmingIslandHandler.location.getDisplayName() : "" + FarmingIslandHandler.pelts;
drawTexturedModalRect((width / 2) - 33 - (font.getStringWidth(duration)), offset + (bossBarVisible ? 35 : 18), 0, 34, 2, 14);
- drawTexturedModalRect(
- ((width / 2) - 33 - (font.getStringWidth(duration))) + 2,
- offset + (bossBarVisible ? 35 : 18),
- 2,
- 34,
- font.getStringWidth(duration) + 14,
- 14
- );
- drawTexturedModalRect(
- ((width / 2) - 33 - (font.getStringWidth(duration))) + 4,
- offset + (bossBarVisible ? 38 : 21),
- FarmingIslandHandler.location != Locations.NONE ? 123 : 115,
- 0,
- 8,
- 8
- );
+ drawTexturedModalRect(((width / 2) - 33 - (font.getStringWidth(duration))) + 2, offset + (bossBarVisible ? 35 : 18), 2, 34, font.getStringWidth(duration) + 14, 14);
+ drawTexturedModalRect(((width / 2) - 33 - (font.getStringWidth(duration))) + 4, offset + (bossBarVisible ? 38 : 21), FarmingIslandHandler.location != Locations.NONE ? 123 : 115, 0, 8, 8);
drawString(font, duration, (width / 2) - 19 - (font.getStringWidth(duration)), offset + (bossBarVisible ? 38 : 21), 0xFFFFFF);
}
}
@@ -393,56 +236,15 @@ public class OverlayHud extends Gui {
mc.renderEngine.bindTexture(GuiTextures.overlay);
if (DwarvenMineHandler.eventMax > 0) {
String duration = DwarvenMineHandler.eventProgress + "/" + DwarvenMineHandler.eventMax;
- drawTexturedModalRect(
- (width / 2) - 33 - (font.getStringWidth(duration)),
- offset + (bossBarVisible ? 35 : 18),
- 0,
- 34,
- 2,
- 14
- );
- drawTexturedModalRect(
- ((width / 2) - 33 - (font.getStringWidth(duration))) + 2,
- offset + (bossBarVisible ? 35 : 18),
- 2,
- 34,
- font.getStringWidth(duration) + 14,
- 14
- );
- drawTexturedModalRect(
- ((width / 2) - 33 - (font.getStringWidth(duration))) + 4,
- offset + (bossBarVisible ? 38 : 21),
- DwarvenMineHandler.currentEvent.x,
- 0,
- 8,
- 8
- );
- drawString(
- font,
- duration,
- (width / 2) - 19 - (font.getStringWidth(duration)),
- offset + (bossBarVisible ? 38 : 21),
- 0xFFFFFF
- );
+ drawTexturedModalRect((width / 2) - 33 - (font.getStringWidth(duration)), offset + (bossBarVisible ? 35 : 18), 0, 34, 2, 14);
+ drawTexturedModalRect(((width / 2) - 33 - (font.getStringWidth(duration))) + 2, offset + (bossBarVisible ? 35 : 18), 2, 34, font.getStringWidth(duration) + 14, 14);
+ drawTexturedModalRect(((width / 2) - 33 - (font.getStringWidth(duration))) + 4, offset + (bossBarVisible ? 38 : 21), DwarvenMineHandler.currentEvent.x, 0, 8, 8);
+ drawString(font, duration, (width / 2) - 19 - (font.getStringWidth(duration)), offset + (bossBarVisible ? 38 : 21), 0xFFFFFF);
} else {
String text = DwarvenMineHandler.currentEvent.displayName;
drawTexturedModalRect((width / 2) - 33 - (font.getStringWidth(text)), offset + (bossBarVisible ? 35 : 18), 0, 34, 2, 14);
- drawTexturedModalRect(
- ((width / 2) - 33 - (font.getStringWidth(text))) + 2,
- offset + (bossBarVisible ? 35 : 18),
- 2,
- 34,
- font.getStringWidth(text) + 14,
- 14
- );
- drawTexturedModalRect(
- ((width / 2) - 33 - (font.getStringWidth(text))) + 4,
- offset + (bossBarVisible ? 38 : 21),
- DwarvenMineHandler.currentEvent.x,
- 0,
- 8,
- 8
- );
+ drawTexturedModalRect(((width / 2) - 33 - (font.getStringWidth(text))) + 2, offset + (bossBarVisible ? 35 : 18), 2, 34, font.getStringWidth(text) + 14, 14);
+ drawTexturedModalRect(((width / 2) - 33 - (font.getStringWidth(text))) + 4, offset + (bossBarVisible ? 38 : 21), DwarvenMineHandler.currentEvent.x, 0, 8, 8);
drawString(font, text, (width / 2) - 19 - (font.getStringWidth(text)), offset + (bossBarVisible ? 38 : 21), 0xFFFFFF);
}
}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/overlay/RPGHud.java b/src/main/java/com/thatgravyboat/skyblockhud/overlay/RPGHud.java
index 7c622e4..d6a9709 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/overlay/RPGHud.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/overlay/RPGHud.java
@@ -52,14 +52,7 @@ public class RPGHud extends Gui {
@SubscribeEvent
public void renderOverlay(RenderGameOverlayEvent.Post event) {
- if (
- Utils.overlayShouldRender(event.type, SkyblockHud.hasSkyblockScoreboard(), SkyblockHud.config.renderer.hideXpBar)
- ) MinecraftForge.EVENT_BUS.post(
- new RenderGameOverlayEvent.Post(
- new RenderGameOverlayEvent(event.partialTicks, event.resolution),
- RenderGameOverlayEvent.ElementType.EXPERIENCE
- )
- );
+ if (Utils.overlayShouldRender(event.type, SkyblockHud.hasSkyblockScoreboard(), SkyblockHud.config.renderer.hideXpBar)) MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.Post(new RenderGameOverlayEvent(event.partialTicks, event.resolution), RenderGameOverlayEvent.ElementType.EXPERIENCE));
if (Utils.overlayShouldRender(event.type, SkyblockHud.hasSkyblockScoreboard(), SkyblockHud.config.rpg.showRpgHud)) {
Minecraft mc = Minecraft.getMinecraft();
GlStateManager.enableBlend();
@@ -101,22 +94,10 @@ public class RPGHud extends Gui {
drawTexturedModalRect(rightAligned ? x + 19 : 41 + x, 33 + y, rightAligned ? 196 : 0, 88, (int) airWidth, 4);
}
GlStateManager.scale(0.75f, 0.75f, 1);
- drawCenteredString(
- mc.fontRendererObj,
- "" + mc.thePlayer.experienceLevel,
- (rightAligned ? 130 : 0) + (int) (15 + x / 0.75f),
- (int) (45 + y / 0.75f),
- 8453920
- );
+ drawCenteredString(mc.fontRendererObj, "" + mc.thePlayer.experienceLevel, (rightAligned ? 130 : 0) + (int) (15 + x / 0.75f), (int) (45 + y / 0.75f), 8453920);
GlStateManager.scale(1 / 0.75f, 1 / 0.75f, 1);
GlStateManager.scale(0.75f, 0.75f, 1);
- font.drawString(
- ChatFormatting.RED + " \u2764 " + health + "/" + maxHealth,
- (rightAligned ? -40 : 0) + (int) (64 + x / 0.75f),
- (int) (8 + y / 0.75f),
- 0xffffff,
- true
- );
+ font.drawString(ChatFormatting.RED + " \u2764 " + health + "/" + maxHealth, (rightAligned ? -40 : 0) + (int) (64 + x / 0.75f), (int) (8 + y / 0.75f), 0xffffff, true);
GlStateManager.scale(1 / 0.75f, 1 / 0.75f, 1);
GlStateManager.color(255, 255, 255);
GlStateManager.disableBlend();