diff options
-rw-r--r-- | README.md | 8 | ||||
-rw-r--r-- | src/main/java/me/Danker/DankersSkyblockMod.java | 3 | ||||
-rw-r--r-- | src/main/java/me/Danker/commands/CustomMusicCommand.java | 53 | ||||
-rw-r--r-- | src/main/java/me/Danker/commands/DankerGuiCommand.java | 2 | ||||
-rw-r--r-- | src/main/java/me/Danker/commands/LobbyBankCommand.java | 1 | ||||
-rw-r--r-- | src/main/java/me/Danker/commands/ToggleCommand.java | 34 | ||||
-rw-r--r-- | src/main/java/me/Danker/features/ArachneESP.java | 10 | ||||
-rw-r--r-- | src/main/java/me/Danker/features/CustomMusic.java | 111 | ||||
-rw-r--r-- | src/main/java/me/Danker/features/SlayerESP.java | 1 | ||||
-rw-r--r-- | src/main/java/me/Danker/gui/CustomMusicGui.java | 73 | ||||
-rw-r--r-- | src/main/java/me/Danker/gui/DankerGui.java | 35 | ||||
-rw-r--r-- | src/main/java/me/Danker/gui/OnlySlayerGui.java | 1 | ||||
-rw-r--r-- | src/main/java/me/Danker/handlers/ConfigHandler.java | 5 |
13 files changed, 239 insertions, 98 deletions
@@ -41,7 +41,7 @@ Discord Server: https://discord.gg/QsEkNQS - Watcher ready message - Catacombs F7 Stage 3 solvers (Starts with letter, select all colour, ignore arrows on sea lanterns) - Find correct Livid (with graphic display of HP) -- Use custom music in dungeon boss room +- Use custom music in supported locations - Experimentation solvers (Ultrasequencer, Chronomatron, Superpairs) - Hide tooltips in experiment addons - Hide tooltips in Melody's Harp @@ -85,7 +85,7 @@ Discord Server: https://discord.gg/QsEkNQS - /reparty - Disbands and reparties all members in the party - /fairysouls - Check the fairysouls of a player - /lobbybank - Uses API to find the average bank total of the lobby, as well the three players with the highest total money in the bank (and purse). -- /dsmmusic <stop/reload/volume> [dungeonboss] [#] - Stops or reloads the custom music. +- /dsmmusic <stop/reload/volume> [dungeonboss/bloodroom/dungeon] [#] - Stops, reloads or changes the volume of custom music. ## Keybinds - Open Maddox menu - M by default. @@ -93,7 +93,9 @@ Discord Server: https://discord.gg/QsEkNQS - Start/Stop Skill Tracker - Numpad 5 by default. ## Custom Music -- To use custom music, place a music file with the given name in the `.minecraft/config/dsmmusic` folder and enable the custom song in /dsm. +- To use custom music, place a music file with the given name in the `.minecraft/config/dsmmusic` folder, either run `/dsmmusic reload` or restart your game, and enable the custom song in `/dsm`. + - Dungeon music: `dungeon.wav` + - Blood room music: `bloodroom.wav` - Dungeon boss music: `dungeonboss.wav` ### Notes diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 0e7000b..17def9a 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -340,6 +340,9 @@ public class DankersSkyblockMod { case "skilltracker": mc.displayGuiScreen(new SkillTrackerGui()); break; + case "custommusic": + mc.displayGuiScreen(new CustomMusicGui()); + break; } } guiToOpen = null; diff --git a/src/main/java/me/Danker/commands/CustomMusicCommand.java b/src/main/java/me/Danker/commands/CustomMusicCommand.java index 8e389ac..6412474 100644 --- a/src/main/java/me/Danker/commands/CustomMusicCommand.java +++ b/src/main/java/me/Danker/commands/CustomMusicCommand.java @@ -10,8 +10,6 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; -import javax.sound.sampled.Clip; -import javax.sound.sampled.FloatControl; import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.UnsupportedAudioFileException; import java.io.IOException; @@ -26,7 +24,7 @@ public class CustomMusicCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " <stop/reload/volume> [dungeonboss] [#]"; + return "/" + getCommandName() + " <stop/reload/volume> [dungeonboss/bloodroom/dungeon] [#]"; } public static String usage(ICommandSender arg0) { @@ -43,7 +41,7 @@ public class CustomMusicCommand extends CommandBase { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "stop", "reload", "volume"); } else if (args.length == 2) { - return getListOfStringsMatchingLastWord(args, "dungeonboss"); + return getListOfStringsMatchingLastWord(args, "dungeonboss", "bloodroom", "dungeon"); } return null; } @@ -59,7 +57,7 @@ public class CustomMusicCommand extends CommandBase { switch (arg1[0].toLowerCase()) { case "stop": - if (CustomMusic.dungeonboss != null) CustomMusic.dungeonboss.stop(); + CustomMusic.reset(); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Stopped custom music.")); break; case "reload": @@ -77,28 +75,43 @@ public class CustomMusicCommand extends CommandBase { return; } + float volume = Float.parseFloat(arg1[2]); + boolean success; + switch (arg1[1].toLowerCase()) { case "dungeonboss": - try { - float volume = Float.parseFloat(arg1[2]); - - FloatControl bounds = (FloatControl) CustomMusic.dungeonboss.getControl(FloatControl.Type.MASTER_GAIN); - if (volume <= bounds.getMinimum() || volume >= bounds.getMaximum()) { - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Volume can only be set between " + bounds.getMinimum() + " and " + bounds.getMaximum() + ".")); - return; - } - - CustomMusic.dungeonbossDecibels = volume; - ConfigHandler.writeIntConfig("music", "DungeonBossDecibels", (int) volume); - CustomMusic.init(DankersSkyblockMod.configDirectory); - } catch (IOException | LineUnavailableException | UnsupportedAudioFileException e) { - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "An error occurred while trying to reload music.")); - e.printStackTrace(); + success = CustomMusic.dungeonboss.setVolume(volume); + if (!success) { + return; } + + CustomMusic.dungeonbossDecibels = volume; + ConfigHandler.writeIntConfig("music", "DungeonBossDecibels", (int) volume); + break; + case "bloodroom": + success = CustomMusic.bloodroom.setVolume(volume); + if (!success) { + return; + } + + CustomMusic.bloodroomDecibels = volume; + ConfigHandler.writeIntConfig("music", "BloodRoomDecibels", (int) volume); + break; + case "dungeon": + success = CustomMusic.dungeon.setVolume(volume); + if (!success) { + return; + } + + CustomMusic.dungeonDecibels = volume; + ConfigHandler.writeIntConfig("music", "DungeonDecibels", (int) volume); break; default: player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); + return; } + + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.SECONDARY_COLOUR + arg1[1] + DankersSkyblockMod.MAIN_COLOUR + " was set to " + DankersSkyblockMod.SECONDARY_COLOUR + volume + "db")); break; default: player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index 97af0df..40fcb0a 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -97,6 +97,8 @@ public class DankerGuiCommand extends CommandBase { debug.append("[specialhoe][").append(ToggleCommand.specialHoeRightClick).append("]\n"); debug.append("[melodyTooltips][").append(ToggleCommand.melodyTooltips).append("]\n"); debug.append("[dungeonbossmusic][").append(ToggleCommand.dungeonBossMusic).append("]\n"); + debug.append("[bloodroommusic][").append(ToggleCommand.bloodRoomMusic).append("]\n"); + debug.append("[dungeonmusic][").append(ToggleCommand.dungeonMusic).append("]\n"); debug.append("# Locations\n"); debug.append("[coords][").append(MoveCommand.coordsXY[0]).append(", ").append(MoveCommand.coordsXY[1]).append("]\n"); debug.append("[display][").append(MoveCommand.displayXY[0]).append(", ").append(MoveCommand.displayXY[1]).append("]\n"); diff --git a/src/main/java/me/Danker/commands/LobbyBankCommand.java b/src/main/java/me/Danker/commands/LobbyBankCommand.java index 77dce2a..886077c 100644 --- a/src/main/java/me/Danker/commands/LobbyBankCommand.java +++ b/src/main/java/me/Danker/commands/LobbyBankCommand.java @@ -5,7 +5,6 @@ import com.google.gson.JsonObject; import me.Danker.DankersSkyblockMod; import me.Danker.handlers.APIHandler; import me.Danker.handlers.ConfigHandler; -import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.network.NetworkPlayerInfo; import net.minecraft.command.CommandBase; diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index b8b5845..73011ad 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -80,6 +80,8 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean melodyTooltips; // Custom Music public static boolean dungeonBossMusic; + public static boolean bloodRoomMusic; + public static boolean dungeonMusic; @Override public String getCommandName() { @@ -96,8 +98,9 @@ public class ToggleCommand extends CommandBase implements ICommand { "notifyslayerslain/necronnotifications/bonzotimer/threemanpuzzle/oruopuzzle/blazepuzzle/" + "creeperpuzzle/waterpuzzle/tictactoepuzzle/boulderpuzzle/silverfishpuzzle/icewalkpuzzle/watchermessage/" + "startswithterminal/selectallterminal/clickinorderterminal/blockwrongterminalclicks/" + - "itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/ " + - "/specialhoe/melodytooltips/highlightslayers/highlightArachne/dungeonbossmusic/list>"; + "itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/" + + "specialhoe/melodytooltips/highlightslayers/highlightarachne/dungeonbossmusic/bloodroommusic/" + + "dungeonmusic/list>"; } public static String usage(ICommandSender arg0) { @@ -124,7 +127,8 @@ public class ToggleCommand extends CommandBase implements ICommand { "silverfishpuzzle", "icewalkpuzzle", "watchermessage", "startswithterminal", "selectallterminal", "clickinorderterminal", "blockwrongterminalclicks", "itemframeonsealanterns", "ultrasequencer", "chronomatron", "superpairs", - "hidetooltipsinaddons", "pickblock", "specialhoe", "melodytooltips", "highlightslayers", "dungeonbossmusic", "list"); + "hidetooltipsinaddons", "pickblock", "specialhoe", "melodytooltips", "highlightslayers", + "dungeonbossmusic", "bloodroommusic", "dungeonmusic", "list"); } return null; } @@ -436,16 +440,22 @@ public class ToggleCommand extends CommandBase implements ICommand { player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Arachne " + DankersSkyblockMod.SECONDARY_COLOUR + highlightArachne + DankersSkyblockMod.MAIN_COLOUR + ".")); case "dungeonbossmusic": dungeonBossMusic = !dungeonBossMusic; - if (CustomMusic.dungeonboss != null) { - if (dungeonBossMusic) { - CustomMusic.start(); - } else { - CustomMusic.dungeonboss.stop(); - } - } + CustomMusic.dungeonboss.stop(); ConfigHandler.writeBooleanConfig("toggles", "DungeonBossMusic", dungeonBossMusic); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom dungeon boss music has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + dungeonBossMusic + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "bloodroommusic": + bloodRoomMusic = !bloodRoomMusic; + CustomMusic.bloodroom.stop(); + ConfigHandler.writeBooleanConfig("toggles", "BloodRoomMusic", bloodRoomMusic); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom blood room music has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + bloodRoomMusic + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; + case "dungeonmusic": + dungeonMusic = !dungeonMusic; + CustomMusic.dungeon.stop(); + ConfigHandler.writeBooleanConfig("toggles", "DungeonMusic", dungeonMusic); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom dungeon music has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + dungeonMusic + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "list": player.addChatMessage(new ChatComponentText(DankersSkyblockMod.TYPE_COLOUR + "Guild party notifications: " + DankersSkyblockMod.VALUE_COLOUR + gpartyToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Coord/Angle display: " + DankersSkyblockMod.VALUE_COLOUR + coordsToggled + "\n" + @@ -496,7 +506,9 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Hide tooltips in Melody's Harp " + DankersSkyblockMod.VALUE_COLOUR + melodyTooltips + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Highlight Slayer Bosses " + DankersSkyblockMod.VALUE_COLOUR + highlightSlayers + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Highlight Arachne Boss " + DankersSkyblockMod.VALUE_COLOUR + highlightArachne + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon boss music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonBossMusic + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon boss music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonBossMusic + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Custom blood room music: " + DankersSkyblockMod.VALUE_COLOUR + bloodRoomMusic + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonMusic )); break; default: diff --git a/src/main/java/me/Danker/features/ArachneESP.java b/src/main/java/me/Danker/features/ArachneESP.java index 1a9b0b2..491c42a 100644 --- a/src/main/java/me/Danker/features/ArachneESP.java +++ b/src/main/java/me/Danker/features/ArachneESP.java @@ -1,27 +1,17 @@ package me.Danker.features; -import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; import me.Danker.handlers.ScoreboardHandler; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; -import net.minecraft.entity.monster.EntitySpider; -import net.minecraft.entity.monster.EntityZombie; -import net.minecraft.entity.passive.EntityWolf; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StringUtils; import net.minecraft.world.World; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.client.event.RenderWorldLastEvent; -import net.minecraftforge.event.entity.player.AttackEntityEvent; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.gameevent.TickEvent; - import java.util.List; diff --git a/src/main/java/me/Danker/features/CustomMusic.java b/src/main/java/me/Danker/features/CustomMusic.java index ee0a2cc..342913f 100644 --- a/src/main/java/me/Danker/features/CustomMusic.java +++ b/src/main/java/me/Danker/features/CustomMusic.java @@ -6,6 +6,8 @@ import me.Danker.handlers.ScoreboardHandler; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ChatComponentText; import net.minecraft.util.StringUtils; import net.minecraft.world.World; import net.minecraftforge.client.event.ClientChatReceivedEvent; @@ -22,10 +24,15 @@ import java.util.List; public class CustomMusic { + static boolean cancelNotes; static boolean prevInDungeonBossRoom = false; - static boolean inDungeonBossRoom = false; - public static Clip dungeonboss; + public static boolean inDungeonBossRoom = false; + public static Song dungeonboss; public static float dungeonbossDecibels; + public static Song bloodroom; + public static float bloodroomDecibels; + public static Song dungeon; + public static float dungeonDecibels; @SubscribeEvent public void onWorldChange(WorldEvent.Load event) { @@ -56,30 +63,44 @@ public class CustomMusic { firstLine.contains("necron")) { // F7 inDungeonBossRoom = true; - if (!prevInDungeonBossRoom && dungeonboss != null) { - start(); + if (!prevInDungeonBossRoom) { + dungeonboss.start(); } } else { - reset(); + inDungeonBossRoom = false; + dungeonboss.stop(); } } } } } - @SubscribeEvent + @SubscribeEvent(receiveCanceled = true) public void onChat(ClientChatReceivedEvent event) { - if (!Utils.inDungeons) return; String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); - if (message.contains("EXTRA STATS ")) { - if (dungeonboss != null) dungeonboss.stop(); + if (ToggleCommand.dungeonMusic && Utils.inDungeons) { + if (message.contains("[NPC] Mort: Here, I found this map when I first entered the dungeon.")) { + dungeon.start(); + } + } + + if (message.contains(":")) return; + + if (Utils.inDungeons) { + if (message.contains("EXTRA STATS ")) { + dungeonboss.stop(); + bloodroom.stop(); + dungeon.stop(); + } else if (ToggleCommand.bloodRoomMusic && message.contains("The BLOOD DOOR has been opened!")) { + bloodroom.start(); + } } } @SubscribeEvent public void onSound(PlaySoundEvent event) { - if (ToggleCommand.dungeonBossMusic && Utils.inDungeons && inDungeonBossRoom) { + if (cancelNotes) { if (event.isCancelable() && event.name.startsWith("note.")) event.setCanceled(true); } } @@ -91,29 +112,69 @@ public class CustomMusic { reset(); - dungeonboss = AudioSystem.getClip(); - File dungeonBossFile = new File(configDirectory + "/dsmmusic/dungeonboss.wav"); + File dungeonBossFile = new File(directory + "/dungeonboss.wav"); System.out.println("dungeonboss.wav exists?: " + dungeonBossFile.exists()); - if (dungeonBossFile.exists()) { - AudioInputStream ais = AudioSystem.getAudioInputStream(dungeonBossFile); - dungeonboss.open(ais); + dungeonboss = new Song(dungeonBossFile, dungeonbossDecibels); - FloatControl volume = (FloatControl) dungeonboss.getControl(FloatControl.Type.MASTER_GAIN); - volume.setValue(dungeonbossDecibels); - } + File bloodRoomFile = new File(directory + "/bloodroom.wav"); + System.out.println("bloodroom.wav exists?: " + bloodRoomFile.exists()); + bloodroom = new Song(bloodRoomFile, bloodroomDecibels); + + File dungeonFile = new File(directory + "/dungeon.wav"); + System.out.println("dungeon.wav exists?: " + dungeonFile.exists()); + dungeon = new Song(dungeonFile, dungeonDecibels); } - static void reset() { - inDungeonBossRoom = false; + public static void reset() { + cancelNotes = false; if (dungeonboss != null) dungeonboss.stop(); + if (bloodroom != null) bloodroom.stop(); + if (dungeon != null) dungeon.stop(); } - public static void start() { - if (dungeonboss != null && inDungeonBossRoom) { - dungeonboss.setMicrosecondPosition(0); - dungeonboss.start(); - dungeonboss.loop(Clip.LOOP_CONTINUOUSLY); + public static class Song { + + public Clip music; + + public Song(File file, float decibels) throws IOException, UnsupportedAudioFileException, LineUnavailableException { + if (file.exists()) { + music = AudioSystem.getClip(); + AudioInputStream ais = AudioSystem.getAudioInputStream(file); + music.open(ais); + + setVolume(decibels); + } } + + public void start() { + reset(); + cancelNotes = true; + if (music != null) { + music.setMicrosecondPosition(0); + music.start(); + music.loop(Clip.LOOP_CONTINUOUSLY); + } + } + + public void stop() { + cancelNotes = false; + if (music != null) music.stop(); + } + + public boolean setVolume(float decibels) { + if (music == null) return false; + + FloatControl control = (FloatControl) music.getControl(FloatControl.Type.MASTER_GAIN); + if (decibels <= control.getMinimum() || decibels >= control.getMaximum()) { + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + if (player != null) player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Volume can only be set between " + control.getMinimum() + " and " + control.getMaximum() + ".")); + return false; + } + + control.setValue(decibels); + return true; + } + } } diff --git a/src/main/java/me/Danker/features/SlayerESP.java b/src/main/java/me/Danker/features/SlayerESP.java index 17a1c0e..51537ba 100644 --- a/src/main/java/me/Danker/features/SlayerESP.java +++ b/src/main/java/me/Danker/features/SlayerESP.java @@ -11,7 +11,6 @@ import net.minecraft.util.StringUtils; import net.minecraft.world.World; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.client.event.RenderWorldLastEvent; -import net.minecraftforge.event.AttachCapabilitiesEvent; import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; diff --git a/src/main/java/me/Danker/gui/CustomMusicGui.java b/src/main/java/me/Danker/gui/CustomMusicGui.java new file mode 100644 index 0000000..505bf34 --- /dev/null +++ b/src/main/java/me/Danker/gui/CustomMusicGui.java @@ -0,0 +1,73 @@ +package me.Danker.gui; + +import me.Danker.DankersSkyblockMod; +import me.Danker.commands.ToggleCommand; +import me.Danker.features.CustomMusic; +import me.Danker.handlers.ConfigHandler; +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.ScaledResolution; + +public class CustomMusicGui extends GuiScreen { + + private GuiButton goBack; + + private GuiButton dungeonBossMusic; + private GuiButton bloodRoomMusic; + private GuiButton dungeonMusic; + + @Override + public boolean doesGuiPauseGame() { + return false; + } + + @Override + public void initGui() { + super.initGui(); + + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + int height = sr.getScaledHeight(); + int width = sr.getScaledWidth(); + + goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back"); + dungeonMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Custom Dungeon Music: " + Utils.getColouredBoolean(ToggleCommand.dungeonMusic)); + bloodRoomMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Custom Blood Room Music: " + Utils.getColouredBoolean(ToggleCommand.bloodRoomMusic)); + dungeonBossMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Custom Dungeon Boss Music: " + Utils.getColouredBoolean(ToggleCommand.dungeonBossMusic)); + + this.buttonList.add(dungeonMusic); + this.buttonList.add(bloodRoomMusic); + this.buttonList.add(dungeonBossMusic); + this.buttonList.add(goBack); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + @Override + public void actionPerformed(GuiButton button) { + if (button == goBack) { + DankersSkyblockMod.guiToOpen = "dankergui1"; + } else if (button == dungeonBossMusic) { + ToggleCommand.dungeonBossMusic = !ToggleCommand.dungeonBossMusic; + CustomMusic.dungeonboss.stop(); + ConfigHandler.writeBooleanConfig("toggles", "DungeonBossMusic", ToggleCommand.dungeonBossMusic); + dungeonBossMusic.displayString = "Custom Dungeon Boss Music: " + Utils.getColouredBoolean(ToggleCommand.dungeonBossMusic); + } else if (button == bloodRoomMusic) { + ToggleCommand.bloodRoomMusic = !ToggleCommand.bloodRoomMusic; + CustomMusic.bloodroom.stop(); + ConfigHandler.writeBooleanConfig("toggles", "BloodRoomMusic", ToggleCommand.bloodRoomMusic); + bloodRoomMusic.displayString = "Custom Blood Room Music: " + Utils.getColouredBoolean(ToggleCommand.bloodRoomMusic); + } else if (button == dungeonMusic) { + ToggleCommand.dungeonMusic = !ToggleCommand.dungeonMusic; + CustomMusic.dungeon.stop(); + ConfigHandler.writeBooleanConfig("toggles", "DungeonMusic", ToggleCommand.dungeonMusic); + dungeonMusic.displayString = "Custom Dungeon Music: " + Utils.getColouredBoolean(ToggleCommand.dungeonMusic); + } + } + +} diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 307882f..796be2b 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -2,7 +2,6 @@ package me.Danker.gui; import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; -import me.Danker.features.CustomMusic; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; @@ -40,7 +39,7 @@ public class DankerGui extends GuiScreen { private GuiButton puzzleSolvers; private GuiButton experimentationTableSolvers; private GuiButton skillTracker; - private GuiButton highlightArachne; + private GuiButton customMusic; // Toggles private GuiButton gparty; private GuiButton coords; @@ -57,10 +56,13 @@ public class DankerGui extends GuiScreen { private GuiButton skill50Display; private GuiButton outlineText; private GuiButton cakeTimer; + private GuiButton pickBlock; + private GuiButton notifySlayerSlain; private GuiButton shadowFury; private GuiButton specialHoe; private GuiButton melodyTooltips; - private GuiButton dungeonBossMusic; + private GuiButton autoSkillTracker; + private GuiButton highlightArachne; // Chat Messages private GuiButton lividDagger; private GuiButton sceptreMessages; @@ -77,11 +79,8 @@ public class DankerGui extends GuiScreen { private GuiButton stopSalvageStarred; private GuiButton watcherReadyMessage; private GuiButton flowerWeapons; - private GuiButton pickBlock; - private GuiButton notifySlayerSlain; private GuiButton necronNotifications; private GuiButton bonzoTimer; - private GuiButton autoSkillTracker; public DankerGui(int page, String searchText) { this.page = page; @@ -110,15 +109,14 @@ public class DankerGui extends GuiScreen { editLocations = new GuiButton(0, 2, 5, 100, 20, "Edit Locations"); search = new GuiTextField(0, this.fontRendererObj, width - 202, 5, 200, 20); - // Page 1 changeDisplay = new GuiButton(0, 0, 0, "Change Display Settings"); onlySlayer = new GuiButton(0, 0, 0, "Set Slayer Quest"); puzzleSolvers = new GuiButton(0, 0, 0, "Toggle Dungeons Puzzle Solvers"); experimentationTableSolvers = new GuiButton(0, 0, 0, "Toggle Experimentation Table Solvers"); skillTracker = new GuiButton(0, 0, 0, "Toggle Skill XP/Hour Tracking"); + customMusic = new GuiButton(0, 0, 0, "Custom Music"); outlineText = new GuiButton(0, 0, 0, "Outline Displayed Text: " + Utils.getColouredBoolean(ToggleCommand.outlineTextToggled)); pickBlock = new GuiButton(0, 0, 0, "Auto-Swap to Pick Block: " + Utils.getColouredBoolean(ToggleCommand.swapToPickBlockToggled)); - // Page 2 coords = new GuiButton(0, 0, 0, "Coordinate/Angle Display: " + Utils.getColouredBoolean(ToggleCommand.coordsToggled)); chatMaddox = new GuiButton(0, 0, 0, "Click On-Screen to Open Maddox: " + Utils.getColouredBoolean(ToggleCommand.chatMaddoxToggled)); cakeTimer = new GuiButton(0, 0, 0, "Cake Timer: " + Utils.getColouredBoolean(ToggleCommand.cakeTimerToggled)); @@ -126,7 +124,6 @@ public class DankerGui extends GuiScreen { slayerCount = new GuiButton(0, 0, 0, "Count Total 20% Drops: " + Utils.getColouredBoolean(ToggleCommand.slayerCountTotal)); aotd = new GuiButton(0, 0, 0, "Disable AOTD Ability: " + Utils.getColouredBoolean(ToggleCommand.aotdToggled)); lividDagger = new GuiButton(0, 0, 0, "Disable Livid Dagger Ability: " + Utils.getColouredBoolean(ToggleCommand.lividDaggerToggled)); - // Page 3 spiritBearAlert = new GuiButton(0, 0, 0, "Spirit Bear Spawn Alerts: " + Utils.getColouredBoolean(ToggleCommand.spiritBearAlerts)); sceptreMessages = new GuiButton(0, 0, 0, "Spirit Sceptre Messages: " + Utils.getColouredBoolean(ToggleCommand.sceptreMessages)); midasStaffMessages = new GuiButton(0, 0, 0, "Midas Staff Messages: " + Utils.getColouredBoolean(ToggleCommand.midasStaffMessages)); @@ -134,7 +131,6 @@ public class DankerGui extends GuiScreen { healMessages = new GuiButton(0, 0, 0, "Heal Messages: " + Utils.getColouredBoolean(ToggleCommand.healMessages)); cooldownMessages = new GuiButton(0, 0, 0, "Cooldown Messages: " + Utils.getColouredBoolean(ToggleCommand.cooldownMessages)); manaMessages = new GuiButton(0, 0, 0, "Mana Messages: " + Utils.getColouredBoolean(ToggleCommand.manaMessages)); - // Page 4 killComboMessages = new GuiButton(0, 0, 0, "Kill Combo Messages: " + Utils.getColouredBoolean(ToggleCommand.killComboMessages)); goldenEnch = new GuiButton(0, 0, 0, "Golden T10/T6/T4 Enchantments: " + Utils.getColouredBoolean(ToggleCommand.goldenToggled)); petColours = new GuiButton(0, 0, 0, "Colour Pet Backgrounds: " + Utils.getColouredBoolean(ToggleCommand.petColoursToggled)); @@ -142,7 +138,6 @@ public class DankerGui extends GuiScreen { gparty = new GuiButton(0, 0, 0, "Guild Party Notifications: " + Utils.getColouredBoolean(ToggleCommand.gpartyToggled)); golemAlerts = new GuiButton(0, 0, 0, "Alert When Golem Spawns: " + Utils.getColouredBoolean(ToggleCommand.golemAlertToggled)); rngesusAlert = new GuiButton(0, 0, 0, "RNGesus Alerts: " + Utils.getColouredBoolean(ToggleCommand.rngesusAlerts)); - // Page 5 splitFishing = new GuiButton(0, 0, 0, "Split Fishing Display: " + Utils.getColouredBoolean(ToggleCommand.splitFishing)); lowHealthNotify = new GuiButton(0, 0, 0, "Low Health Notifications: " + Utils.getColouredBoolean(ToggleCommand.lowHealthNotifyToggled)); lividSolver = new GuiButton(0, 0, 0, "Find Correct Livid: " + Utils.getColouredBoolean(ToggleCommand.lividSolverToggled)); @@ -150,15 +145,12 @@ public class DankerGui extends GuiScreen { stopSalvageStarred = new GuiButton(0, 0, 0, "Stop Salvaging Starred Items: " + Utils.getColouredBoolean(ToggleCommand.stopSalvageStarredToggled)); watcherReadyMessage = new GuiButton(0, 0, 0, "Display Watcher Ready Message: " + Utils.getColouredBoolean(ToggleCommand.watcherReadyToggled)); flowerWeapons = new GuiButton(0, 0, 0, "Prevent Placing FoT/Spirit Sceptre: " + Utils.getColouredBoolean(ToggleCommand.flowerWeaponsToggled)); - // Page 6 notifySlayerSlain = new GuiButton(0, 0, 0, "Notify when Slayer Slain: " + Utils.getColouredBoolean(ToggleCommand.notifySlayerSlainToggled)); necronNotifications = new GuiButton(0, 0, 0, "Necron Phase Notifications: " + Utils.getColouredBoolean(ToggleCommand.necronNotificationsToggled)); bonzoTimer = new GuiButton(0, 0, 0, "Bonzo's Mask Timer: " + Utils.getColouredBoolean(ToggleCommand.bonzoTimerToggled)); autoSkillTracker = new GuiButton(0, 0, 0, "Auto Start/Stop Skill Tracker: " + Utils.getColouredBoolean(ToggleCommand.autoSkillTrackerToggled)); - dungeonBossMusic = new GuiButton(0, 0, 0, "Custom Dungeon Boss Music: " + Utils.getColouredBoolean(ToggleCommand.dungeonBossMusic)); shadowFury = new GuiButton(0, 0, 0, "Block Shadow Fury ability: " + Utils.getColouredBoolean(ToggleCommand.shadowFuryToggled)); specialHoe = new GuiButton(0, 0, 0, "Block Special Hoe right click: " + Utils.getColouredBoolean(ToggleCommand.specialHoeRightClick)); - // Page 7 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)); @@ -167,6 +159,7 @@ public class DankerGui extends GuiScreen { allButtons.add(puzzleSolvers); allButtons.add(experimentationTableSolvers); allButtons.add(skillTracker); + allButtons.add(customMusic); allButtons.add(outlineText); allButtons.add(pickBlock); allButtons.add(coords); @@ -201,7 +194,6 @@ public class DankerGui extends GuiScreen { allButtons.add(necronNotifications); allButtons.add(bonzoTimer); allButtons.add(autoSkillTracker); - allButtons.add(dungeonBossMusic); allButtons.add(shadowFury); allButtons.add(specialHoe); allButtons.add(melodyTooltips); @@ -289,6 +281,8 @@ public class DankerGui extends GuiScreen { DankersSkyblockMod.guiToOpen = "experimentsolvers"; } else if (button == skillTracker) { DankersSkyblockMod.guiToOpen = "skilltracker"; + } else if (button == customMusic) { + DankersSkyblockMod.guiToOpen = "custommusic"; } else if (button == outlineText) { ToggleCommand.outlineTextToggled = !ToggleCommand.outlineTextToggled; ConfigHandler.writeBooleanConfig("toggles", "OutlineText", ToggleCommand.outlineTextToggled); @@ -441,17 +435,6 @@ public class DankerGui extends GuiScreen { ToggleCommand.highlightArachne = !ToggleCommand.highlightArachne; ConfigHandler.writeBooleanConfig("toggles", "HighlightArachne", ToggleCommand.highlightArachne); highlightArachne.displayString = "Highlight Arachne: " + Utils.getColouredBoolean(ToggleCommand.highlightArachne); - } else if (button == dungeonBossMusic) { - ToggleCommand.dungeonBossMusic = !ToggleCommand.dungeonBossMusic; - if (CustomMusic.dungeonboss != null) { - if (ToggleCommand.dungeonBossMusic) { - CustomMusic.start(); - } else { - CustomMusic.dungeonboss.stop(); - } - } - ConfigHandler.writeBooleanConfig("toggles", "DungeonBossMusic", ToggleCommand.dungeonBossMusic); - dungeonBossMusic.displayString = "Custom Dungeon Boss Music: " + Utils.getColouredBoolean(ToggleCommand.dungeonBossMusic); } } diff --git a/src/main/java/me/Danker/gui/OnlySlayerGui.java b/src/main/java/me/Danker/gui/OnlySlayerGui.java index 762e5e5..ec26a13 100644 --- a/src/main/java/me/Danker/gui/OnlySlayerGui.java +++ b/src/main/java/me/Danker/gui/OnlySlayerGui.java @@ -7,7 +7,6 @@ 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.Gui; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.ScaledResolution; diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 8a95ae5..6d474d4 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -274,7 +274,12 @@ public class ConfigHandler { ToggleCommand.hideTooltipsInExperimentAddonsToggled = initBoolean("toggles", "HideTooltipsInExperimentAddons", false); // Custom Music ToggleCommand.dungeonBossMusic = initBoolean("toggles", "DungeonBossMusic", false); + ToggleCommand.bloodRoomMusic = initBoolean("toggles", "BloodRoomMusic", false); + ToggleCommand.dungeonMusic = initBoolean("toggles", "DungeonMusic", false); + // Music Volume CustomMusic.dungeonbossDecibels = (float) initInt("music", "DungeonBossDecibels", -20); + CustomMusic.bloodroomDecibels = (float) initInt("music", "BloodRoomDecibels", -20); + CustomMusic.dungeonDecibels = (float) initInt("music", "DungeonDecibels", -20); // API if (!hasKey("api", "APIKey")) writeStringConfig("api", "APIKey", ""); |