diff options
author | bowser0000 <bowser0000@gmail.com> | 2022-03-04 13:20:20 -0500 |
---|---|---|
committer | bowser0000 <bowser0000@gmail.com> | 2022-03-04 13:20:20 -0500 |
commit | 2b57ccad6d21b325c3164117fe14e00e13399a7c (patch) | |
tree | ba0d560ed179fa3eb412996ac55ea3c920c2d88d /src/main/java/me/Danker/gui/crystalhollowwaypoints | |
parent | 42b556c49db4d848cddca76b383135dcdaad99fa (diff) | |
download | SkyblockMod-2b57ccad6d21b325c3164117fe14e00e13399a7c.tar.gz SkyblockMod-2b57ccad6d21b325c3164117fe14e00e13399a7c.tar.bz2 SkyblockMod-2b57ccad6d21b325c3164117fe14e00e13399a7c.zip |
Add CH fishing tracker
Organized change display GUI
Add method to make centered text rendering easier
Diffstat (limited to 'src/main/java/me/Danker/gui/crystalhollowwaypoints')
-rw-r--r-- | src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointActionGui.java | 5 | ||||
-rw-r--r-- | src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointActionGui.java b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointActionGui.java index f792892..30447a0 100644 --- a/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointActionGui.java +++ b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointActionGui.java @@ -3,6 +3,7 @@ package me.Danker.gui.crystalhollowwaypoints; import me.Danker.DankersSkyblockMod; import me.Danker.features.CrystalHollowWaypoints; import me.Danker.handlers.TextRenderer; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; @@ -63,9 +64,7 @@ public class CrystalHollowWaypointActionGui extends GuiScreen { CrystalHollowWaypoints.Waypoint waypoint = CrystalHollowWaypoints.waypoints.get(id); - String waypointText = waypoint.location + " @ " + waypoint.getPos(); - int pageWidth = mc.fontRendererObj.getStringWidth(waypointText); - new TextRenderer(mc, waypointText, width / 2 - pageWidth / 2, 10, 1D); + RenderUtils.drawCenteredText(waypoint.location + " @ " + waypoint.getPos(), width, 10, 1D); } @Override diff --git a/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java index a3d0452..2331ec0 100644 --- a/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java +++ b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java @@ -7,6 +7,7 @@ import me.Danker.gui.DankerGui; import me.Danker.gui.buttons.FeatureButton; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.TextRenderer; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; @@ -94,8 +95,7 @@ public class CrystalHollowWaypointsGui extends GuiScreen { super.drawScreen(mouseX, mouseY, partialTicks); String pageText = "Page: " + page + "/" + (int) Math.ceil(allButtons.size() / 7D); - int pageWidth = mc.fontRendererObj.getStringWidth(pageText); - new TextRenderer(mc, pageText, width / 2 - pageWidth / 2, 10, 1D); + RenderUtils.drawCenteredText(pageText, width, 10, 1D); } @Override |