aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2020-10-06 21:02:00 -0400
committerbowser0000 <bowser0000@gmail.com>2020-10-06 21:02:00 -0400
commit5d477d9d06933c7a52ea5df17160b89391387872 (patch)
tree4e76b9731e3e98a84d95fc7b6d8fbf5f65d22421
parenta0ab465c3d39eac177f45d2b2f6903a27be3ba61 (diff)
downloadSkyblockMod-5d477d9d06933c7a52ea5df17160b89391387872.tar.gz
SkyblockMod-5d477d9d06933c7a52ea5df17160b89391387872.tar.bz2
SkyblockMod-5d477d9d06933c7a52ea5df17160b89391387872.zip
Add ability to outline text in the style of SBA
-rw-r--r--README.md2
-rw-r--r--src/main/java/me/Danker/commands/DHelpCommand.java2
-rw-r--r--src/main/java/me/Danker/commands/ToggleCommand.java12
-rw-r--r--src/main/java/me/Danker/handlers/ConfigHandler.java2
-rw-r--r--src/main/java/me/Danker/handlers/TextRenderer.java13
5 files changed, 25 insertions, 6 deletions
diff --git a/README.md b/README.md
index e16f853..8cf9471 100644
--- a/README.md
+++ b/README.md
@@ -29,7 +29,7 @@ Discord Server: https://discord.gg/QsEkNQS
## Commands
- /dhelp - Returns this message in-game.
-- /toggle <gparty/coords/golden/slayercount/rngesusalerts/splitfishing/chatmaddox/spiritbearalerts/aotd/sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/list> - Toggles features. /toggle list returns values of every toggle.
+- /toggle <gparty/coords/golden/slayercount/rngesusalerts/splitfishing/chatmaddox/spiritbearalerts/aotd/sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/outlinetext/list> - Toggles features. /toggle list returns values of every toggle.
- /setkey <key> - Sets API key.
- /getkey - Returns key set with /setkey and copies it to your clipboard.
- /loot <zombie/spider/wolf/fishing/catacombs> [winter/f(1-6)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead.
diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java
index 65cff49..57cffa3 100644
--- a/src/main/java/me/Danker/commands/DHelpCommand.java
+++ b/src/main/java/me/Danker/commands/DHelpCommand.java
@@ -33,7 +33,7 @@ public class DHelpCommand extends CommandBase {
EnumChatFormatting.AQUA + " <> = Mandatory parameter. [] = Optional parameter.\n" +
EnumChatFormatting.GOLD + " Commands, " + EnumChatFormatting.GREEN + " Keybinds.\n" +
EnumChatFormatting.GOLD + " /dhelp" + EnumChatFormatting.AQUA + " - Returns this message.\n" +
- EnumChatFormatting.GOLD + " /toggle <gparty/coords/golden/slayercount/rngesusalerts/splitfishing/chatmaddox/spiritbearalerts/aotd/sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/list>" + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" +
+ EnumChatFormatting.GOLD + " /toggle <gparty/coords/golden/slayercount/rngesusalerts/splitfishing/chatmaddox/spiritbearalerts/aotd/sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/outlinetext/list>" + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" +
EnumChatFormatting.GOLD + " /setkey <key>" + EnumChatFormatting.AQUA + " - Sets API key.\n" +
EnumChatFormatting.GOLD + " /getkey" + EnumChatFormatting.AQUA + " - Returns key set with /setkey and copies it to your clipboard.\n" +
EnumChatFormatting.GOLD + " /loot <zombie/spider/wolf/fishing/catacombs> [winter/f(1-6)/session]" + EnumChatFormatting.AQUA + " - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead.\n" +
diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java
index 0172ab1..affa5cf 100644
--- a/src/main/java/me/Danker/commands/ToggleCommand.java
+++ b/src/main/java/me/Danker/commands/ToggleCommand.java
@@ -28,6 +28,7 @@ public class ToggleCommand extends CommandBase implements ICommand {
public static boolean golemAlertToggled;
public static boolean expertiseLoreToggled;
public static boolean skill50DisplayToggled;
+ public static boolean outlineTextToggled;
@Override
public String getCommandName() {
@@ -36,7 +37,7 @@ public class ToggleCommand extends CommandBase implements ICommand {
@Override
public String getCommandUsage(ICommandSender arg0) {
- return "/" + getCommandName() + " <gparty/coords/golden/slayercount/rngesusalerts/splitfishing/chatmaddox/spiritbearalert/aotd/sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/list>";
+ return "/" + getCommandName() + " <gparty/coords/golden/slayercount/rngesusalerts/splitfishing/chatmaddox/spiritbearalert/aotd/sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/outlinetext/list>";
}
@Override
@@ -47,7 +48,7 @@ public class ToggleCommand extends CommandBase implements ICommand {
@Override
public List<String> addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) {
if (args.length == 1) {
- return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", "splitfishing", "chatmaddox", "spiritbearalerts", "aotd", "sceptremessages", "petcolors", "dungeontimer", "golemalerts", "expertiselore", "skill50display", "list");
+ return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", "splitfishing", "chatmaddox", "spiritbearalerts", "aotd", "sceptremessages", "petcolors", "dungeontimer", "golemalerts", "expertiselore", "skill50display", "outlinetext", "list");
}
return null;
}
@@ -122,6 +123,10 @@ public class ToggleCommand extends CommandBase implements ICommand {
skill50DisplayToggled = !skill50DisplayToggled;
cf.writeBooleanConfig("toggles", "Skill50Display", skill50DisplayToggled);
player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Skill 50 display has been set to " + EnumChatFormatting.DARK_GREEN + skill50DisplayToggled + EnumChatFormatting.GREEN + "."));
+ } else if (arg1[0].equalsIgnoreCase("outlinetext")) {
+ outlineTextToggled = !outlineTextToggled;
+ cf.writeBooleanConfig("toggles", "OutlineText", outlineTextToggled);
+ player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Outline displayed text has been set to " + EnumChatFormatting.DARK_GREEN + outlineTextToggled + EnumChatFormatting.GREEN + "."));
} else if (arg1[0].equalsIgnoreCase("list")) {
player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Guild party notifications: " + EnumChatFormatting.DARK_GREEN + gpartyToggled + "\n" +
EnumChatFormatting.GREEN + " Coord/Angle display: " + EnumChatFormatting.DARK_GREEN + coordsToggled + "\n" +
@@ -137,7 +142,8 @@ public class ToggleCommand extends CommandBase implements ICommand {
EnumChatFormatting.GREEN + " Dungeon timer: " + EnumChatFormatting.DARK_GREEN + dungeonTimerToggled + "\n" +
EnumChatFormatting.GREEN + " Golem spawn alerts: " + EnumChatFormatting.DARK_GREEN + golemAlertToggled + "\n" +
EnumChatFormatting.GREEN + " Expertise in lore: " + EnumChatFormatting.DARK_GREEN + expertiseLoreToggled + "\n" +
- EnumChatFormatting.GREEN + " Skill 50 display: " + EnumChatFormatting.DARK_GREEN + skill50DisplayToggled));
+ EnumChatFormatting.GREEN + " Skill 50 display: " + EnumChatFormatting.DARK_GREEN + skill50DisplayToggled + "\n" +
+ EnumChatFormatting.GREEN + " Outline displayed text: " + EnumChatFormatting.DARK_GREEN + outlineTextToggled));
} else {
player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: " + getCommandUsage(arg0)));
}
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);
}