diff options
author | bowser0000 <bowser0000@gmail.com> | 2020-10-06 21:02:00 -0400 |
---|---|---|
committer | bowser0000 <bowser0000@gmail.com> | 2020-10-06 21:02:00 -0400 |
commit | 5d477d9d06933c7a52ea5df17160b89391387872 (patch) | |
tree | 4e76b9731e3e98a84d95fc7b6d8fbf5f65d22421 /src/main/java/me/Danker/handlers | |
parent | a0ab465c3d39eac177f45d2b2f6903a27be3ba61 (diff) | |
download | SkyblockMod-5d477d9d06933c7a52ea5df17160b89391387872.tar.gz SkyblockMod-5d477d9d06933c7a52ea5df17160b89391387872.tar.bz2 SkyblockMod-5d477d9d06933c7a52ea5df17160b89391387872.zip |
Add ability to outline text in the style of SBA
Diffstat (limited to 'src/main/java/me/Danker/handlers')
-rw-r--r-- | src/main/java/me/Danker/handlers/ConfigHandler.java | 2 | ||||
-rw-r--r-- | src/main/java/me/Danker/handlers/TextRenderer.java | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 0c839d1..fcb33b2 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -186,6 +186,7 @@ public class ConfigHandler { if (!hasKey("toggles", "GolemAlerts")) writeBooleanConfig("toggles", "GolemAlerts", false); if (!hasKey("toggles", "ExpertiseLore")) writeBooleanConfig("toggles", "ExpertiseLore", true); if (!hasKey("toggles", "Skill50Display")) writeBooleanConfig("toggles", "Skill50Display", false); + if (!hasKey("toggles", "OutlineText")) writeBooleanConfig("toggles", "OutlineText", false); if (!hasKey("api", "APIKey")) writeStringConfig("api", "APIKey", ""); @@ -349,6 +350,7 @@ public class ConfigHandler { tf.golemAlertToggled = getBoolean("toggles", "GolemAlerts"); tf.expertiseLoreToggled = getBoolean("toggles", "ExpertiseLore"); tf.skill50DisplayToggled = getBoolean("toggles", "Skill50Display"); + tf.outlineTextToggled = getBoolean("toggles", "OutlineText"); final BlockSlayerCommand bs = new BlockSlayerCommand(); String onlySlayer = getString("toggles", "BlockSlayer"); diff --git a/src/main/java/me/Danker/handlers/TextRenderer.java b/src/main/java/me/Danker/handlers/TextRenderer.java index bf5711d..0e965e6 100644 --- a/src/main/java/me/Danker/handlers/TextRenderer.java +++ b/src/main/java/me/Danker/handlers/TextRenderer.java @@ -2,8 +2,10 @@ package me.Danker.handlers; import org.lwjgl.opengl.GL11; +import me.Danker.commands.ToggleCommand; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; +import net.minecraft.util.StringUtils; public class TextRenderer extends Gui { public TextRenderer(Minecraft mc, String text, int x, int y, double scale) { @@ -13,7 +15,16 @@ public class TextRenderer extends Gui { y -= mc.fontRendererObj.FONT_HEIGHT; for (String line : text.split("\n")) { y += mc.fontRendererObj.FONT_HEIGHT * scale; - drawString(mc.fontRendererObj, line, (int) Math.round(x / scale), (int) Math.round(y / scale), 0xFFFFFF); + if (ToggleCommand.outlineTextToggled) { + String noColorLine = StringUtils.stripControlCodes(line); + mc.fontRendererObj.drawString(noColorLine, (int) Math.round(x / scale) - 1, (int) Math.round(y / scale), 0x000000, false); + mc.fontRendererObj.drawString(noColorLine, (int) Math.round(x / scale) + 1, (int) Math.round(y / scale), 0x000000, false); + mc.fontRendererObj.drawString(noColorLine, (int) Math.round(x / scale), (int) Math.round(y / scale) - 1, 0x000000, false); + mc.fontRendererObj.drawString(noColorLine, (int) Math.round(x / scale), (int) Math.round(y / scale) + 1, 0x000000, false); + mc.fontRendererObj.drawString(line, (int) Math.round(x / scale), (int) Math.round(y / scale), 0xFFFFFF, false); + } else { + mc.fontRendererObj.drawString(line, (int) Math.round(x / scale), (int) Math.round(y / scale), 0xFFFFFF, true); + } } GL11.glScaled(scaleReset, scaleReset, scaleReset); } |