diff options
author | CuzImClicks <bruno778.whiteelfie@gmail.com> | 2021-04-03 19:59:46 +0200 |
---|---|---|
committer | CuzImClicks <bruno778.whiteelfie@gmail.com> | 2021-04-03 19:59:46 +0200 |
commit | 09291c4f8ee992d2b1c037dfeac84ee362e6288e (patch) | |
tree | e7ae4675068672d24e012cca0d66ac07ad0f7dc8 /src/main | |
parent | df1f83cf4ddb80969d2086cf1d7a86df9dc90653 (diff) | |
download | SkyblockMod-09291c4f8ee992d2b1c037dfeac84ee362e6288e.tar.gz SkyblockMod-09291c4f8ee992d2b1c037dfeac84ee362e6288e.tar.bz2 SkyblockMod-09291c4f8ee992d2b1c037dfeac84ee362e6288e.zip |
added Completed Commission Highlighting
Diffstat (limited to 'src/main')
5 files changed, 57 insertions, 8 deletions
diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 3aeb452..33c4e86 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -133,6 +133,8 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new WatcherReadyAlert()); MinecraftForge.EVENT_BUS.register(new WaterSolver()); + MinecraftForge.EVENT_BUS.register(new HighlightCommissions()); + ConfigHandler.reloadConfig(); GoldenEnchants.init(); TriviaSolver.init(); @@ -380,7 +382,7 @@ public class DankersSkyblockMod { @SubscribeEvent public void onGuiRender(GuiScreenEvent.BackgroundDrawnEvent event) { - if (!Utils.inSkyblock) return; + //if (!Utils.inSkyblock) return; if (event.gui instanceof GuiChest) { GuiChest inventory = (GuiChest) event.gui; Container containerChest = inventory.inventorySlots; diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index a6f20fc..b9c52e7 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -33,6 +33,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean cakeTimerToggled; public static boolean highlightSlayers; public static boolean highlightArachne; + public static boolean highlightCommissions; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; @@ -76,7 +77,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean bloodRoomMusic; public static boolean dungeonMusic; - @Override + @Override public String getCommandName() { return "toggle"; } @@ -93,7 +94,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "startswithterminal/selectallterminal/clickinorderterminal/" + "ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/" + "melodytooltips/highlightslayers/highlightarachne/dungeonbossmusic/bloodroommusic/" + - "dungeonmusic/list>"; + "dungeonmusic/highlightcommissions/list>"; } public static String usage(ICommandSender arg0) { @@ -121,7 +122,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "selectallterminal", "clickinorderterminal", "ultrasequencer", "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "melodytooltips", "highlightslayers", - "dungeonbossmusic", "bloodroommusic", "dungeonmusic", "list"); + "dungeonbossmusic", "bloodroommusic", "dungeonmusic", "highlightcommissions", "list"); } return null; } @@ -396,6 +397,10 @@ public class ToggleCommand extends CommandBase implements ICommand { highlightArachne = !highlightArachne; ConfigHandler.writeBooleanConfig("toggles", "HighlightArachne", highlightArachne); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Arachne " + DankersSkyblockMod.SECONDARY_COLOUR + highlightArachne + DankersSkyblockMod.MAIN_COLOUR + ".")); + case "highlightcommissions": + highlightCommissions = !highlightCommissions; + ConfigHandler.writeBooleanConfig("toggles", "HighlightCommissions", highlightCommissions); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Commissions " + DankersSkyblockMod.SECONDARY_COLOUR + highlightCommissions + DankersSkyblockMod.MAIN_COLOUR + ".")); case "dungeonbossmusic": dungeonBossMusic = !dungeonBossMusic; CustomMusic.dungeonboss.stop(); diff --git a/src/main/java/me/Danker/features/HighlightCommissions.java b/src/main/java/me/Danker/features/HighlightCommissions.java new file mode 100644 index 0000000..ae262c3 --- /dev/null +++ b/src/main/java/me/Danker/features/HighlightCommissions.java @@ -0,0 +1,37 @@ +package me.Danker.features; + +import me.Danker.commands.ToggleCommand; +import me.Danker.events.GuiChestBackgroundDrawnEvent; +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.Utils; +import net.minecraft.inventory.Slot; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraft.item.ItemWritableBook; + +import org.lwjgl.util.Color; +import java.util.List; + +public class HighlightCommissions { + + @SubscribeEvent + public void onGuiRender(GuiChestBackgroundDrawnEvent event) { + if(!Utils.inSkyblock) return; + if(!ToggleCommand.highlightCommissions) return; + List<Slot> slots = event.slots; + if (!event.displayName.equals("Commissions")) return; + + for (Slot slot : slots) { + if (slot != null && slot.getStack() == null) continue; + if (slot.getStack().getItem() instanceof ItemWritableBook) { + for (String line : Utils.getItemLore(slot.getStack())) { + if (line.contains("COMPLETED")) { + Utils.drawOnSlot(event.chestSize, slot.xDisplayPosition, slot.yDisplayPosition, 0x51FF51 + 0xD7000000); + break; + } + } + + } + } + } + +} diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 569f4d1..22cc001 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -6,10 +6,7 @@ import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.gui.*; import net.minecraft.util.StringUtils; import java.awt.*; @@ -60,6 +57,7 @@ public class DankerGui extends GuiScreen { private GuiButton autoSkillTracker; private GuiButton highlightArachne; private GuiButton highlightSlayer; + private GuiButton highlightCommissions; // Chat Messages private GuiButton sceptreMessages; private GuiButton midasStaffMessages; @@ -143,6 +141,7 @@ public class DankerGui extends GuiScreen { melodyTooltips = new GuiButton(0, 0, 0, "Hide tooltips in Melody's Harp: " + Utils.getColouredBoolean(ToggleCommand.melodyTooltips)); highlightArachne = new GuiButton(0, 0, 0, "Highlight Arachne: " + Utils.getColouredBoolean(ToggleCommand.highlightArachne)); highlightSlayer = new GuiButton(0, 0, 0, "Highlight Slayer: " + Utils.getColouredBoolean(ToggleCommand.highlightSlayers)); + highlightCommissions = new GuiButton(0, 0, 0, "Highlight Commissions: " + Utils.getColouredBoolean(ToggleCommand.highlightCommissions)); allButtons.add(changeDisplay); allButtons.add(puzzleSolvers); @@ -183,6 +182,7 @@ public class DankerGui extends GuiScreen { allButtons.add(melodyTooltips); allButtons.add(highlightArachne); allButtons.add(highlightSlayer); + allButtons.add(highlightCommissions); search.setText(initSearchText); search.setVisible(true); @@ -402,6 +402,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.highlightSlayers = !ToggleCommand.highlightSlayers; ConfigHandler.writeBooleanConfig("toggles", "HighlightSlayers", ToggleCommand.highlightSlayers); highlightSlayer.displayString = "Highlight Slayer: " + Utils.getColouredBoolean(ToggleCommand.highlightSlayers); + } else if (button == highlightCommissions) { + ToggleCommand.highlightCommissions = !ToggleCommand.highlightCommissions; + ConfigHandler.writeBooleanConfig("toggles", "HighlightCommissions", ToggleCommand.highlightCommissions); + highlightCommissions.displayString = "Highlight Commissions: " + Utils.getColouredBoolean(ToggleCommand.highlightCommissions); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index d3b7464..0fe7245 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -228,6 +228,7 @@ public class ConfigHandler { ToggleCommand.melodyTooltips = initBoolean("toggles", "MelodyTooltips", false); ToggleCommand.highlightSlayers = initBoolean("toggles", "HighlightSlayers", false); ToggleCommand.highlightArachne = initBoolean("toggles", "HighlightArachne", false); + ToggleCommand.highlightCommissions = initBoolean("toggles", "HighlightCommissions", false); // Chat Messages ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); |