diff options
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); } |