diff options
author | bowser0000 <bowser0000@gmail.com> | 2022-08-15 20:40:34 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-15 20:40:34 -0400 |
commit | 3aa11b859a2a22be30a5035f7273e1a604a4dde4 (patch) | |
tree | 8f428b29a6b56cc9d010b0441bf41b6b78373548 /src/main/java/me/Danker/gui | |
parent | 33710ac6d9f57fa59e8dfb19a81b053346f1b097 (diff) | |
parent | daceea1e42371c295c36f80b3246601a6ffb2cc5 (diff) | |
download | SkyblockMod-3aa11b859a2a22be30a5035f7273e1a604a4dde4.tar.gz SkyblockMod-3aa11b859a2a22be30a5035f7273e1a604a4dde4.tar.bz2 SkyblockMod-3aa11b859a2a22be30a5035f7273e1a604a4dde4.zip |
1.8.7
Diffstat (limited to 'src/main/java/me/Danker/gui')
20 files changed, 1831 insertions, 172 deletions
diff --git a/src/main/java/me/Danker/gui/CustomMusicGui.java b/src/main/java/me/Danker/gui/CustomMusicGui.java index 505bf34..98210f5 100644 --- a/src/main/java/me/Danker/gui/CustomMusicGui.java +++ b/src/main/java/me/Danker/gui/CustomMusicGui.java @@ -1,6 +1,5 @@ package me.Danker.gui; -import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; import me.Danker.features.CustomMusic; import me.Danker.handlers.ConfigHandler; @@ -12,11 +11,31 @@ import net.minecraft.client.gui.ScaledResolution; public class CustomMusicGui extends GuiScreen { + private int page; + private GuiButton goBack; + private GuiButton backPage; + private GuiButton nextPage; private GuiButton dungeonBossMusic; private GuiButton bloodRoomMusic; private GuiButton dungeonMusic; + private GuiButton hubMusic; + private GuiButton islandMusic; + private GuiButton dungeonHubMusic; + private GuiButton farmingIslandsMusic; + private GuiButton goldMineMusic; + private GuiButton deepCavernsMusic; + private GuiButton dwarvenMinesMusic; + private GuiButton crystalHollowsMusic; + private GuiButton spidersDenMusic; + private GuiButton crimsonIsleMusic; + private GuiButton endMusic; + private GuiButton parkMusic; + + public CustomMusicGui(int page) { + this.page = page; + } @Override public boolean doesGuiPauseGame() { @@ -32,13 +51,53 @@ public class CustomMusicGui extends GuiScreen { int width = sr.getScaledWidth(); goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back"); + backPage = new GuiButton(0, width / 2 - 100, (int) (height * 0.8), 80, 20, "< Back"); + nextPage = new GuiButton(0, width / 2 + 20, (int) (height * 0.8), 80, 20, "Next >"); + 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)); + hubMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Custom Hub Music: " + Utils.getColouredBoolean(ToggleCommand.hubMusic)); + islandMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Custom Island Music: " + Utils.getColouredBoolean(ToggleCommand.islandMusic)); + dungeonHubMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Custom Dungeon Hub Music: " + Utils.getColouredBoolean(ToggleCommand.dungeonHubMusic)); + farmingIslandsMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Custom Farming Islands Music: " + Utils.getColouredBoolean(ToggleCommand.farmingIslandsMusic)); + goldMineMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Custom Gold Mine Music: " + Utils.getColouredBoolean(ToggleCommand.goldMineMusic)); + deepCavernsMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Custom Deep Caverns Music: " + Utils.getColouredBoolean(ToggleCommand.deepCavernsMusic)); + dwarvenMinesMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Custom Dwarven Mines Music: " + Utils.getColouredBoolean(ToggleCommand.dwarvenMinesMusic)); + crystalHollowsMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Custom Crystal Hollows Music: " + Utils.getColouredBoolean(ToggleCommand.crystalHollowsMusic)); + spidersDenMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Custom Spider's Den Music: " + Utils.getColouredBoolean(ToggleCommand.spidersDenMusic)); + crimsonIsleMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Custom Crimson Isle Music: " + Utils.getColouredBoolean(ToggleCommand.crimsonIsleMusic)); + endMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Custom End Music: " + Utils.getColouredBoolean(ToggleCommand.endMusic)); + parkMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Custom Park Music: " + Utils.getColouredBoolean(ToggleCommand.parkMusic)); + + switch (page) { + case 1: + this.buttonList.add(dungeonMusic); + this.buttonList.add(bloodRoomMusic); + this.buttonList.add(dungeonBossMusic); + this.buttonList.add(hubMusic); + this.buttonList.add(islandMusic); + this.buttonList.add(dungeonHubMusic); + this.buttonList.add(farmingIslandsMusic); + this.buttonList.add(nextPage); + break; + case 2: + this.buttonList.add(goldMineMusic); + this.buttonList.add(deepCavernsMusic); + this.buttonList.add(dwarvenMinesMusic); + this.buttonList.add(crystalHollowsMusic); + this.buttonList.add(spidersDenMusic); + this.buttonList.add(crimsonIsleMusic); + this.buttonList.add(endMusic); + this.buttonList.add(nextPage); + this.buttonList.add(backPage); + break; + case 3: + this.buttonList.add(parkMusic); + this.buttonList.add(backPage); + break; + } - this.buttonList.add(dungeonMusic); - this.buttonList.add(bloodRoomMusic); - this.buttonList.add(dungeonBossMusic); this.buttonList.add(goBack); } @@ -51,7 +110,11 @@ public class CustomMusicGui extends GuiScreen { @Override public void actionPerformed(GuiButton button) { if (button == goBack) { - DankersSkyblockMod.guiToOpen = "dankergui1"; + mc.displayGuiScreen(new DankerGui(1, "")); + } else if (button == backPage) { + Minecraft.getMinecraft().displayGuiScreen(new CustomMusicGui(page - 1)); + } else if (button == nextPage) { + Minecraft.getMinecraft().displayGuiScreen(new CustomMusicGui(page + 1)); } else if (button == dungeonBossMusic) { ToggleCommand.dungeonBossMusic = !ToggleCommand.dungeonBossMusic; CustomMusic.dungeonboss.stop(); @@ -67,6 +130,66 @@ public class CustomMusicGui extends GuiScreen { CustomMusic.dungeon.stop(); ConfigHandler.writeBooleanConfig("toggles", "DungeonMusic", ToggleCommand.dungeonMusic); dungeonMusic.displayString = "Custom Dungeon Music: " + Utils.getColouredBoolean(ToggleCommand.dungeonMusic); + } else if (button == hubMusic) { + ToggleCommand.hubMusic = !ToggleCommand.hubMusic; + CustomMusic.hub.stop(); + ConfigHandler.writeBooleanConfig("toggles", "HubMusic", ToggleCommand.hubMusic); + hubMusic.displayString = "Custom Hub Music: " + Utils.getColouredBoolean(ToggleCommand.hubMusic); + } else if (button == islandMusic) { + ToggleCommand.islandMusic = !ToggleCommand.islandMusic; + CustomMusic.island.stop(); + ConfigHandler.writeBooleanConfig("toggles", "IslandMusic", ToggleCommand.islandMusic); + islandMusic.displayString = "Custom Island Music: " + Utils.getColouredBoolean(ToggleCommand.islandMusic); + } else if (button == dungeonHubMusic) { + ToggleCommand.dungeonHubMusic = !ToggleCommand.dungeonHubMusic; + CustomMusic.dungeonHub.stop(); + ConfigHandler.writeBooleanConfig("toggles", "DungeonHubMusic", ToggleCommand.dungeonHubMusic); + dungeonHubMusic.displayString = "Custom Dungeon Hub Music: " + Utils.getColouredBoolean(ToggleCommand.dungeonHubMusic); + } else if (button == farmingIslandsMusic) { + ToggleCommand.farmingIslandsMusic = !ToggleCommand.farmingIslandsMusic; + CustomMusic.farmingIslands.stop(); + ConfigHandler.writeBooleanConfig("toggles", "FarmingIslandsMusic", ToggleCommand.farmingIslandsMusic); + farmingIslandsMusic.displayString = "Custom Farming Islands Music: " + Utils.getColouredBoolean(ToggleCommand.farmingIslandsMusic); + } else if (button == goldMineMusic) { + ToggleCommand.goldMineMusic = !ToggleCommand.goldMineMusic; + CustomMusic.goldMine.stop(); + ConfigHandler.writeBooleanConfig("toggles", "GoldMineMusic", ToggleCommand.goldMineMusic); + goldMineMusic.displayString = "Custom Gold Mine Music: " + Utils.getColouredBoolean(ToggleCommand.goldMineMusic); + } else if (button == deepCavernsMusic) { + ToggleCommand.deepCavernsMusic = !ToggleCommand.deepCavernsMusic; + CustomMusic.deepCaverns.stop(); + ConfigHandler.writeBooleanConfig("toggles", "DeepCavernsMusic", ToggleCommand.deepCavernsMusic); + deepCavernsMusic.displayString = "Custom Deep Caverns Music: " + Utils.getColouredBoolean(ToggleCommand.deepCavernsMusic); + } else if (button == dwarvenMinesMusic) { + ToggleCommand.dwarvenMinesMusic = !ToggleCommand.dwarvenMinesMusic; + CustomMusic.dwarvenMines.stop(); + ConfigHandler.writeBooleanConfig("toggles", "DwarvenMinesMusic", ToggleCommand.dwarvenMinesMusic); + dwarvenMinesMusic.displayString = "Custom Dwarven Mines Music: " + Utils.getColouredBoolean(ToggleCommand.dwarvenMinesMusic); + } else if (button == crystalHollowsMusic) { + ToggleCommand.crystalHollowsMusic = !ToggleCommand.crystalHollowsMusic; + CustomMusic.crystalHollows.stop(); + ConfigHandler.writeBooleanConfig("toggles", "CrystalHollowsMusic", ToggleCommand.crystalHollowsMusic); + crystalHollowsMusic.displayString = "Custom Crystal Hollows Music: " + Utils.getColouredBoolean(ToggleCommand.crystalHollowsMusic); + } else if (button == spidersDenMusic) { + ToggleCommand.spidersDenMusic = !ToggleCommand.spidersDenMusic; + CustomMusic.spidersDen.stop(); + ConfigHandler.writeBooleanConfig("toggles", "SpidersDenMusic", ToggleCommand.spidersDenMusic); + spidersDenMusic.displayString = "Custom Spider's Den Music: " + Utils.getColouredBoolean(ToggleCommand.spidersDenMusic); + } else if (button == crimsonIsleMusic) { + ToggleCommand.crimsonIsleMusic = !ToggleCommand.crimsonIsleMusic; + CustomMusic.crimsonIsle.stop(); + ConfigHandler.writeBooleanConfig("toggles", "BlazingFortressMusic", ToggleCommand.crimsonIsleMusic); + crimsonIsleMusic.displayString = "Custom Crimson Isle Music: " + Utils.getColouredBoolean(ToggleCommand.crimsonIsleMusic); + } else if (button == endMusic) { + ToggleCommand.endMusic = !ToggleCommand.endMusic; + CustomMusic.end.stop(); + ConfigHandler.writeBooleanConfig("toggles", "EndMusic", ToggleCommand.endMusic); + endMusic.displayString = "Custom End Music: " + Utils.getColouredBoolean(ToggleCommand.endMusic); + } else if (button == parkMusic) { + ToggleCommand.parkMusic = !ToggleCommand.parkMusic; + CustomMusic.park.stop(); + ConfigHandler.writeBooleanConfig("toggles", "ParkMusic", ToggleCommand.parkMusic); + parkMusic.displayString = "Custom Park Music: " + Utils.getColouredBoolean(ToggleCommand.parkMusic); } } diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 569f4d1..f009d34 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -1,15 +1,19 @@ package me.Danker.gui; -import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; +import me.Danker.gui.alerts.AlertsGui; +import me.Danker.gui.aliases.AliasesGui; +import me.Danker.gui.buttons.FeatureButton; +import me.Danker.gui.crystalhollowwaypoints.CrystalHollowWaypointsGui; import me.Danker.handlers.ConfigHandler; -import me.Danker.handlers.TextRenderer; +import me.Danker.utils.RenderUtils; 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.util.EnumChatFormatting; import net.minecraft.util.StringUtils; import java.awt.*; @@ -21,9 +25,9 @@ import java.util.List; public class DankerGui extends GuiScreen { - private int page; - private List<GuiButton> allButtons = new ArrayList<>(); - private List<GuiButton> foundButtons = new ArrayList<>(); + private final int page; + private final List<GuiButton> allButtons = new ArrayList<>(); + private final List<GuiButton> foundButtons = new ArrayList<>(); String initSearchText; private GuiButton closeGUI; @@ -35,15 +39,20 @@ public class DankerGui extends GuiScreen { private GuiTextField search; private GuiButton changeDisplay; + private GuiButton onlySlayer; private GuiButton puzzleSolvers; private GuiButton experimentationTableSolvers; private GuiButton skillTracker; private GuiButton customMusic; + private GuiButton crystalHollowWaypoints; + private GuiButton alerts; + private GuiButton aliases; // Toggles private GuiButton gparty; private GuiButton coords; private GuiButton goldenEnch; private GuiButton slayerCount; + private GuiButton masterSPlusDisplay; private GuiButton rngesusAlert; private GuiButton splitFishing; private GuiButton chatMaddox; @@ -60,6 +69,33 @@ public class DankerGui extends GuiScreen { private GuiButton autoSkillTracker; private GuiButton highlightArachne; private GuiButton highlightSlayer; + private GuiButton highlightSkeletonMasters; + private GuiButton teammatesInRadius; + private GuiButton giantHP; + private GuiButton hidePetCandy; + private GuiButton highlightCommissions; + private GuiButton customColouredNames; + private GuiButton customNametags; + private GuiButton endOfFarmAlert; + private GuiButton gemstoneLore; + private GuiButton autoAcceptReparty; + private GuiButton abilityCooldown; + private GuiButton dungeonTimer; + private GuiButton lowHealthNotify; + private GuiButton lividSolver; + private GuiButton stopSalvageStarred; + private GuiButton watcherReadyMessage; + private GuiButton flowerWeapons; + private GuiButton necronNotifications; + private GuiButton bonzoTimer; + private GuiButton dungeonScore; + private GuiButton hideArmour; + private GuiButton autoJoinSkyblock; + private GuiButton firePillar; + private GuiButton fishingAlert; + private GuiButton minionLastCollected; + private GuiButton showTrophyCompletion; + private GuiButton showTotalMagmafish; // Chat Messages private GuiButton sceptreMessages; private GuiButton midasStaffMessages; @@ -68,14 +104,6 @@ public class DankerGui extends GuiScreen { private GuiButton cooldownMessages; private GuiButton manaMessages; private GuiButton killComboMessages; - // Dungeons - private GuiButton dungeonTimer; - private GuiButton lowHealthNotify; - private GuiButton lividSolver; - private GuiButton stopSalvageStarred; - private GuiButton watcherReadyMessage; - private GuiButton necronNotifications; - private GuiButton bonzoTimer; public DankerGui(int page, String searchText) { this.page = page; @@ -105,50 +133,80 @@ public class DankerGui extends GuiScreen { search = new GuiTextField(0, this.fontRendererObj, width - 202, 5, 200, 20); 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)); - 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)); - skill50Display = new GuiButton(0, 0, 0, "Display Progress To Skill Level 50: " + Utils.getColouredBoolean(ToggleCommand.skill50DisplayToggled)); - slayerCount = new GuiButton(0, 0, 0, "Count Total 20% Drops: " + Utils.getColouredBoolean(ToggleCommand.slayerCountTotal)); - 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)); - implosionMessages = new GuiButton(0, 0, 0, "Implosion Messages: " + Utils.getColouredBoolean(ToggleCommand.implosionMessages)); - 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)); - 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)); - expertiseLore = new GuiButton(0, 0, 0, "Expertise Kills In Lore: " + Utils.getColouredBoolean(ToggleCommand.expertiseLoreToggled)); - gparty = new GuiButton(0, 0, 0, "Guild Party Notifications: " + Utils.getColouredBoolean(ToggleCommand.gpartyToggled)); - golemAlerts = new GuiButton(0, 0, 0, "Golem Spawn Alert And Timer: " + Utils.getColouredBoolean(ToggleCommand.golemAlertToggled)); - rngesusAlert = new GuiButton(0, 0, 0, "RNGesus Alerts: " + Utils.getColouredBoolean(ToggleCommand.rngesusAlerts)); - 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)); - dungeonTimer = new GuiButton(0, 0, 0, "Display Dungeon Timers: " + Utils.getColouredBoolean(ToggleCommand.dungeonTimerToggled)); - 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)); - 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)); - 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)); + crystalHollowWaypoints = new GuiButton(0, 0, 0, "Crystal Hollows Waypoints"); + alerts = new GuiButton(0, 0, 0, "Alerts"); + aliases = new GuiButton(0, 0, 0, "Aliases"); + outlineText = new FeatureButton("Outline Displayed Text: " + Utils.getColouredBoolean(ToggleCommand.outlineTextToggled), "Adds bold outline to on-screen text."); + pickBlock = new FeatureButton("Auto-Swap to Pick Block: " + Utils.getColouredBoolean(ToggleCommand.swapToPickBlockToggled), "Automatically changes left clicks to middle clicks.\nHelpful when lagging."); + coords = new FeatureButton("Coordinate/Angle Display: " + Utils.getColouredBoolean(ToggleCommand.coordsToggled), "Displays coordinates and angle."); + chatMaddox = new FeatureButton("Click On-Screen to Open Maddox: " + Utils.getColouredBoolean(ToggleCommand.chatMaddoxToggled), "Open chat then click anywhere after calling Maddox to open the menu."); + cakeTimer = new FeatureButton("Cake Timer: " + Utils.getColouredBoolean(ToggleCommand.cakeTimerToggled), "Displays time until century cake buffs run out."); + skill50Display = new FeatureButton("Display Progress To Skill Level 50: " + Utils.getColouredBoolean(ToggleCommand.skill50DisplayToggled), "Display total progress to max skill level."); + slayerCount = new FeatureButton("Count Total 20% Drops: " + Utils.getColouredBoolean(ToggleCommand.slayerCountTotal), "Counts times dropped instead of amount dropped.\nE.x. Hamster Wheels: 40 -> Hamster Wheels: 10 times."); + masterSPlusDisplay = new FeatureButton("Display MM S+ Runs: " + Utils.getColouredBoolean(ToggleCommand.masterSPlusDisplay), "Dispay Master Mode S+ runs instead of S runs."); + spiritBearAlert = new FeatureButton("Spirit Bear Spawn Alerts: " + Utils.getColouredBoolean(ToggleCommand.spiritBearAlerts), "Alert when Spirit Bear spawns."); + sceptreMessages = new FeatureButton("Spirit Sceptre Messages: " + Utils.getColouredBoolean(ToggleCommand.sceptreMessages), "Turn " + EnumChatFormatting.RED + "off" + EnumChatFormatting.RESET + " to hide Spirit Sceptre messages."); + midasStaffMessages = new FeatureButton("Midas Staff Messages: " + Utils.getColouredBoolean(ToggleCommand.midasStaffMessages), "Turn " + EnumChatFormatting.RED + "off" + EnumChatFormatting.RESET + " to hide Midas Staff messages."); + implosionMessages = new FeatureButton("Implosion Messages: " + Utils.getColouredBoolean(ToggleCommand.implosionMessages), "Turn " + EnumChatFormatting.RED + "off" + EnumChatFormatting.RESET + " to hide Implosion messages."); + healMessages = new FeatureButton("Heal Messages: " + Utils.getColouredBoolean(ToggleCommand.healMessages), "Turn " + EnumChatFormatting.RED + "off" + EnumChatFormatting.RESET + " to hide healing messages."); + cooldownMessages = new FeatureButton("Cooldown Messages: " + Utils.getColouredBoolean(ToggleCommand.cooldownMessages), "Turn " + EnumChatFormatting.RED + "off" + EnumChatFormatting.RESET + " to hide cooldown messages."); + manaMessages = new FeatureButton("Mana Messages: " + Utils.getColouredBoolean(ToggleCommand.manaMessages), "Turn " + EnumChatFormatting.RED + "off" + EnumChatFormatting.RESET + " to hide out of mana messages."); + killComboMessages = new FeatureButton("Kill Combo Messages: " + Utils.getColouredBoolean(ToggleCommand.killComboMessages), "Turn " + EnumChatFormatting.RED + "off" + EnumChatFormatting.RESET + " to hide kill combo messages."); + goldenEnch = new FeatureButton("Golden T10/T6/T4 Enchantments: " + Utils.getColouredBoolean(ToggleCommand.goldenToggled), "Turns expensive enchants golden in tooltips."); + petColours = new FeatureButton("Colour Pet Backgrounds: " + Utils.getColouredBoolean(ToggleCommand.petColoursToggled), "Colors pets based on their level."); + expertiseLore = new FeatureButton("Expertise Kills In Lore: " + Utils.getColouredBoolean(ToggleCommand.expertiseLoreToggled), "Adds expertise kills to fishing rod tooltip."); + gparty = new FeatureButton("Guild Party Notifications: " + Utils.getColouredBoolean(ToggleCommand.gpartyToggled), "Creates desktop notification on guild party."); + golemAlerts = new FeatureButton("Golem Spawn Alert And Timer: " + Utils.getColouredBoolean(ToggleCommand.golemAlertToggled), "Creates alert with 20s countdown when golem is spawning."); + rngesusAlert = new FeatureButton("RNGesus Alerts: " + Utils.getColouredBoolean(ToggleCommand.rngesusAlerts), "Alerts when an RNGesus item is dropped."); + splitFishing = new FeatureButton("Split Fishing Display: " + Utils.getColouredBoolean(ToggleCommand.splitFishing), "Splits fishing display in half to save vertical space."); + lowHealthNotify = new FeatureButton("Low Health Notifications: " + Utils.getColouredBoolean(ToggleCommand.lowHealthNotifyToggled), "Alerts when dungeon teammate has low health."); + lividSolver = new FeatureButton("Find Correct Livid: " + Utils.getColouredBoolean(ToggleCommand.lividSolverToggled), "Shows health and color of correct Livid."); + dungeonTimer = new FeatureButton("Display Dungeon Timers: " + Utils.getColouredBoolean(ToggleCommand.dungeonTimerToggled), "Displays timing of certain dungeon objectives and other information."); + stopSalvageStarred = new FeatureButton("Stop Salvaging Starred Items: " + Utils.getColouredBoolean(ToggleCommand.stopSalvageStarredToggled), "Blocks salvaging starred items."); + watcherReadyMessage = new FeatureButton("Display Watcher Ready Message: " + Utils.getColouredBoolean(ToggleCommand.watcherReadyToggled), "Alerts when Watcher finishes spawning mobs."); + flowerWeapons = new FeatureButton("Prevent Placing FoT/Spirit Sceptre: " + Utils.getColouredBoolean(ToggleCommand.flowerWeaponsToggled), "Blocks placing Flower of Truth or Spirit Sceptre."); + notifySlayerSlain = new FeatureButton("Notify when Slayer Slain: " + Utils.getColouredBoolean(ToggleCommand.notifySlayerSlainToggled), "Alerts when slayer boss has been slain."); + necronNotifications = new FeatureButton("Floor 7 Phase Notifications: " + Utils.getColouredBoolean(ToggleCommand.necronNotificationsToggled), "Creates alert on different phases of the floor 7 fight."); + bonzoTimer = new FeatureButton("Bonzo's Mask Timer: " + Utils.getColouredBoolean(ToggleCommand.bonzoTimerToggled), "Displays cooldown of Bonzo Mask ability."); + autoSkillTracker = new FeatureButton("Auto Start/Stop Skill Tracker: " + Utils.getColouredBoolean(ToggleCommand.autoSkillTrackerToggled), "Automatically pauses skill tracker when opening a gui."); + melodyTooltips = new FeatureButton("Hide tooltips in Melody's Harp: " + Utils.getColouredBoolean(ToggleCommand.melodyTooltips), "Hides tooltips in Melody's Harp."); + highlightArachne = new FeatureButton("Highlight Arachne: " + Utils.getColouredBoolean(ToggleCommand.highlightArachne), "Highlights Arachne bosses."); + highlightSlayer = new FeatureButton("Highlight Slayer: " + Utils.getColouredBoolean(ToggleCommand.highlightSlayers), "Highlights Slayer bosses."); + highlightSkeletonMasters = new FeatureButton("Highlight Skeleton Masters: " + Utils.getColouredBoolean(ToggleCommand.highlightSkeletonMasters), "Highlights Skeleton Masters."); + teammatesInRadius = new FeatureButton("Display Players in 30 Block Radius: " + Utils.getColouredBoolean(ToggleCommand.teammatesInRadius), "Displays dungeon teammates in 30 block radius for tether and diversion."); + giantHP = new FeatureButton("Display Giant HP: " + Utils.getColouredBoolean(ToggleCommand.giantHP), "Displays health of Sadan's giants during F6 bossfight and F7 blood room."); + hidePetCandy = new FeatureButton("Hide Pet Candy: " + Utils.getColouredBoolean(ToggleCommand.hidePetCandy), "Hide pet candy in pet tooltips."); + highlightCommissions = new FeatureButton("Highlight Commissions: " + Utils.getColouredBoolean(ToggleCommand.highlightCommissions), "Show which commissions are completed."); + customColouredNames = new FeatureButton("Custom Name Colors: " + Utils.getColouredBoolean(ToggleCommand.customColouredNames), "Replaces some player's usernames with a custom color."); + customNametags = new FeatureButton("Custom Color on Nametags: " + Utils.getColouredBoolean(ToggleCommand.customNametags), "Displays custom name colors on nametags. Disabling will increase performance with custom colors."); + endOfFarmAlert = new FeatureButton("Alert When Reaching End of Farm: " + Utils.getColouredBoolean(ToggleCommand.endOfFarmAlert), "Alerts when you go past coords set with /dsmfarmlength."); + gemstoneLore = new FeatureButton("Applied Gemstones in Lore: " + Utils.getColouredBoolean(ToggleCommand.gemstoneLore), "Adds applied gemstones to item tooltip."); + autoAcceptReparty = new FeatureButton("Auto Accept Reparty: " + Utils.getColouredBoolean(ToggleCommand.autoAcceptReparty), "Automatically rejoins parties when disbanded and invited."); + abilityCooldown = new FeatureButton("Ability Cooldowns: " + Utils.getColouredBoolean(ToggleCommand.abilityCooldowns), "Displays ability cooldowns."); + dungeonScore = new FeatureButton("Dungeon Score Display: " + Utils.getColouredBoolean(ToggleCommand.dungeonScore), "Displays an estimated dungeon score with secrets."); + hideArmour = new FeatureButton("Hide Player Armour: " + Utils.getColouredBoolean(ToggleCommand.hideArmour), "Makes player armour invisible, showing their skin."); + autoJoinSkyblock = new FeatureButton("Automatically Join Skyblock: " + Utils.getColouredBoolean(ToggleCommand.autoJoinSkyblock), "Automatically join Skyblock when you join Hypixel.\nYou have an addiction."); + firePillar = new FeatureButton("Fire Pillar Display: " + Utils.getColouredBoolean(ToggleCommand.firePillar), "Displays blaze fire pillar text on screen"); + fishingAlert = new FeatureButton("Fishing Spawn Alerts: " + Utils.getColouredBoolean(ToggleCommand.fishingAlert), "Alerts when a Thunder or Lord Jawbus spawns nearby"); + minionLastCollected = new FeatureButton("Show When Minion Last Collected: " + Utils.getColouredBoolean(ToggleCommand.minionLastCollected), "Displays when a minion was last collected over the minion."); + showTrophyCompletion = new FeatureButton("Show Trophy Fish Completion: " + Utils.getColouredBoolean(ToggleCommand.showTrophyCompletion), "Show completion instead of count in trophy fish tracker display."); + showTotalMagmafish = new FeatureButton("Show Total Fillet Magmafish: " + Utils.getColouredBoolean(ToggleCommand.showTotalMagmafish), "Show total Magmafish you would get if you filleted all the trophy fish in your inventory."); + allButtons.clear(); allButtons.add(changeDisplay); + allButtons.add(onlySlayer); allButtons.add(puzzleSolvers); allButtons.add(experimentationTableSolvers); allButtons.add(skillTracker); allButtons.add(customMusic); + allButtons.add(crystalHollowWaypoints); + allButtons.add(alerts); + allButtons.add(aliases); allButtons.add(outlineText); allButtons.add(pickBlock); allButtons.add(coords); @@ -156,6 +214,7 @@ public class DankerGui extends GuiScreen { allButtons.add(cakeTimer); allButtons.add(skill50Display); allButtons.add(slayerCount); + allButtons.add(masterSPlusDisplay); allButtons.add(spiritBearAlert); allButtons.add(sceptreMessages); allButtons.add(midasStaffMessages); @@ -176,6 +235,7 @@ public class DankerGui extends GuiScreen { allButtons.add(dungeonTimer); allButtons.add(stopSalvageStarred); allButtons.add(watcherReadyMessage); + allButtons.add(flowerWeapons); allButtons.add(notifySlayerSlain); allButtons.add(necronNotifications); allButtons.add(bonzoTimer); @@ -183,6 +243,25 @@ public class DankerGui extends GuiScreen { allButtons.add(melodyTooltips); allButtons.add(highlightArachne); allButtons.add(highlightSlayer); + allButtons.add(highlightSkeletonMasters); + allButtons.add(teammatesInRadius); + allButtons.add(giantHP); + allButtons.add(hidePetCandy); + allButtons.add(highlightCommissions); + allButtons.add(customColouredNames); + allButtons.add(customNametags); + allButtons.add(endOfFarmAlert); + allButtons.add(gemstoneLore); + allButtons.add(autoAcceptReparty); + allButtons.add(abilityCooldown); + allButtons.add(dungeonScore); + allButtons.add(hideArmour); + allButtons.add(autoJoinSkyblock); + allButtons.add(firePillar); + allButtons.add(fishingAlert); + allButtons.add(minionLastCollected); + allButtons.add(showTrophyCompletion); + allButtons.add(showTotalMagmafish); search.setText(initSearchText); search.setVisible(true); @@ -228,8 +307,14 @@ public class DankerGui extends GuiScreen { super.drawScreen(mouseX, mouseY, partialTicks); String pageText = "Page: " + page + "/" + (int) Math.ceil(foundButtons.size() / 7D); - int pageWidth = mc.fontRendererObj.getStringWidth(pageText); - new TextRenderer(mc, pageText, width / 2 - pageWidth / 2, 10, 1D); + RenderUtils.drawCenteredText(pageText, width, 10, 1D); + + for (GuiButton button : this.buttonList) { + if (button instanceof FeatureButton && button.isMouseOver()) { + FeatureButton feature = (FeatureButton) button; + drawHoveringText(feature.hoverText, mouseX - 5, mouseY); + } + } search.drawTextBox(); } @@ -243,7 +328,7 @@ public class DankerGui extends GuiScreen { } else if (button == backPage) { mc.displayGuiScreen(new DankerGui(page - 1, search.getText())); } else if (button == editLocations) { - DankersSkyblockMod.guiToOpen = "editlocations"; + mc.displayGuiScreen(new EditLocationsGui()); } else if (button == githubLink) { try { Desktop.getDesktop().browse(new URI("https://github.com/bowser0000/SkyblockMod")); @@ -257,15 +342,23 @@ public class DankerGui extends GuiScreen { ex.printStackTrace(); } } else if (button == changeDisplay) { - DankersSkyblockMod.guiToOpen = "displaygui"; + mc.displayGuiScreen(new DisplayGui()); + } else if (button == onlySlayer) { + mc.displayGuiScreen(new OnlySlayerGui()); } else if (button == puzzleSolvers) { - DankersSkyblockMod.guiToOpen = "puzzlesolvers"; + mc.displayGuiScreen(new PuzzleSolversGui(1)); } else if (button == experimentationTableSolvers) { - DankersSkyblockMod.guiToOpen = "experimentsolvers"; + mc.displayGuiScreen(new ExperimentsGui()); } else if (button == skillTracker) { - DankersSkyblockMod.guiToOpen = "skilltracker"; + mc.displayGuiScreen(new SkillTrackerGui()); } else if (button == customMusic) { - DankersSkyblockMod.guiToOpen = "custommusic"; + mc.displayGuiScreen(new CustomMusicGui(1)); + } else if (button == crystalHollowWaypoints) { + mc.displayGuiScreen(new CrystalHollowWaypointsGui(1)); + } else if (button == alerts) { + mc.displayGuiScreen(new AlertsGui(1)); + } else if (button == aliases) { + mc.displayGuiScreen(new AliasesGui(1)); } else if (button == outlineText) { ToggleCommand.outlineTextToggled = !ToggleCommand.outlineTextToggled; ConfigHandler.writeBooleanConfig("toggles", "OutlineText", ToggleCommand.outlineTextToggled); @@ -373,7 +466,7 @@ public class DankerGui extends GuiScreen { } else if (button == necronNotifications) { ToggleCommand.necronNotificationsToggled = !ToggleCommand.necronNotificationsToggled; ConfigHandler.writeBooleanConfig("toggles", "NecronNotifications", ToggleCommand.necronNotificationsToggled); - necronNotifications.displayString = "Necron Phase Notifications: " + Utils.getColouredBoolean(ToggleCommand.necronNotificationsToggled); + necronNotifications.displayString = "Floor 7 Phase Notifications: " + Utils.getColouredBoolean(ToggleCommand.necronNotificationsToggled); } else if (button == bonzoTimer) { ToggleCommand.bonzoTimerToggled = !ToggleCommand.bonzoTimerToggled; ConfigHandler.writeBooleanConfig("toggles", "BonzoTimer", ToggleCommand.bonzoTimerToggled); @@ -382,6 +475,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.swapToPickBlockToggled = !ToggleCommand.swapToPickBlockToggled; ConfigHandler.writeBooleanConfig("toggles", "PickBlock", ToggleCommand.swapToPickBlockToggled); pickBlock.displayString = "Auto-Swap to Pick Block: " + Utils.getColouredBoolean(ToggleCommand.swapToPickBlockToggled); + } else if (button == flowerWeapons) { + ToggleCommand.flowerWeaponsToggled = !ToggleCommand.flowerWeaponsToggled; + ConfigHandler.writeBooleanConfig("toggles", "FlowerWeapons", ToggleCommand.flowerWeaponsToggled); + flowerWeapons.displayString = "Prevent Placing FoT/Spirit Sceptre: " + Utils.getColouredBoolean(ToggleCommand.flowerWeaponsToggled); } else if (button == autoSkillTracker) { ToggleCommand.autoSkillTrackerToggled = !ToggleCommand.autoSkillTrackerToggled; ConfigHandler.writeBooleanConfig("toggles", "AutoSkillTracker", ToggleCommand.autoSkillTrackerToggled); @@ -402,6 +499,86 @@ 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 == highlightSkeletonMasters) { + ToggleCommand.highlightSkeletonMasters = !ToggleCommand.highlightSkeletonMasters; + ConfigHandler.writeBooleanConfig("toggles", "HighlightSkeletonMasters", ToggleCommand.highlightSkeletonMasters); + highlightSkeletonMasters.displayString = "Highlight Skeleton Masters: " + Utils.getColouredBoolean(ToggleCommand.highlightSkeletonMasters); + } else if (button == teammatesInRadius) { + ToggleCommand.teammatesInRadius = !ToggleCommand.teammatesInRadius; + ConfigHandler.writeBooleanConfig("toggles", "TeammatesInRadius", ToggleCommand.teammatesInRadius); + teammatesInRadius.displayString = "Display Players in 30 Block Radius: " + Utils.getColouredBoolean(ToggleCommand.teammatesInRadius); + } else if (button == giantHP) { + ToggleCommand.giantHP = !ToggleCommand.giantHP; + ConfigHandler.writeBooleanConfig("toggles", "GiantHP", ToggleCommand.giantHP); + giantHP.displayString = "Display Giant HP: " + Utils.getColouredBoolean(ToggleCommand.giantHP); + } else if (button == hidePetCandy) { + ToggleCommand.hidePetCandy = !ToggleCommand.hidePetCandy; + ConfigHandler.writeBooleanConfig("toggles", "HidePetCandy", ToggleCommand.hidePetCandy); + hidePetCandy.displayString = "Hide Pet Candy: " + Utils.getColouredBoolean(ToggleCommand.hidePetCandy); + } else if (button == highlightCommissions) { + ToggleCommand.highlightCommissions = !ToggleCommand.highlightCommissions; + ConfigHandler.writeBooleanConfig("toggles", "HighlightCommissions", ToggleCommand.highlightCommissions); + highlightCommissions.displayString = "Highlight Commissions: " + Utils.getColouredBoolean(ToggleCommand.highlightCommissions); + } else if (button == customColouredNames) { + ToggleCommand.customColouredNames = !ToggleCommand.customColouredNames; + ConfigHandler.writeBooleanConfig("toggles", "CustomColouredNames", ToggleCommand.customColouredNames); + customColouredNames.displayString = "Custom Name Colors: " + Utils.getColouredBoolean(ToggleCommand.customColouredNames); + } else if (button == endOfFarmAlert) { + ToggleCommand.endOfFarmAlert = !ToggleCommand.endOfFarmAlert; + ConfigHandler.writeBooleanConfig("toggles", "EndOfFarmAlert", ToggleCommand.endOfFarmAlert); + endOfFarmAlert.displayString = "Alert When Reaching End of Farm: " + Utils.getColouredBoolean(ToggleCommand.endOfFarmAlert); + } else if (button == gemstoneLore) { + ToggleCommand.gemstoneLore = !ToggleCommand.gemstoneLore; + ConfigHandler.writeBooleanConfig("toggles", "GemstoneLore", ToggleCommand.gemstoneLore); + gemstoneLore.displayString = "Applied Gemstones in Lore: " + Utils.getColouredBoolean(ToggleCommand.gemstoneLore); + } else if (button == autoAcceptReparty) { + ToggleCommand.autoAcceptReparty = !ToggleCommand.autoAcceptReparty; + ConfigHandler.writeBooleanConfig("toggles", "AutoAcceptReparty", ToggleCommand.autoAcceptReparty); + autoAcceptReparty.displayString = "Auto Accept Reparty: " + Utils.getColouredBoolean(ToggleCommand.autoAcceptReparty); + } else if (button == abilityCooldown) { + ToggleCommand.abilityCooldowns = !ToggleCommand.abilityCooldowns; + ConfigHandler.writeBooleanConfig("toggles", "AbilityCooldowns", ToggleCommand.abilityCooldowns); + abilityCooldown.displayString = "Ability Cooldowns: " + Utils.getColouredBoolean(ToggleCommand.abilityCooldowns); + } else if (button == dungeonScore) { + ToggleCommand.dungeonScore = !ToggleCommand.dungeonScore; + ConfigHandler.writeBooleanConfig("toggles", "DungeonScore", ToggleCommand.dungeonScore); + dungeonScore.displayString = "Dungeon Score Display: " + Utils.getColouredBoolean(ToggleCommand.dungeonScore); + } else if (button == masterSPlusDisplay) { + ToggleCommand.masterSPlusDisplay = !ToggleCommand.masterSPlusDisplay; + ConfigHandler.writeBooleanConfig("toggles", "MasterSPlusDisplay", ToggleCommand.masterSPlusDisplay); + masterSPlusDisplay.displayString = "Display MM S+ Runs: " + Utils.getColouredBoolean(ToggleCommand.masterSPlusDisplay); + } else if (button == hideArmour) { + ToggleCommand.hideArmour = !ToggleCommand.hideArmour; + ConfigHandler.writeBooleanConfig("toggles", "HideArmour", ToggleCommand.hideArmour); + hideArmour.displayString = "Hide Player Armour: " + Utils.getColouredBoolean(ToggleCommand.hideArmour); + } else if (button == autoJoinSkyblock) { + ToggleCommand.autoJoinSkyblock = !ToggleCommand.autoJoinSkyblock; + ConfigHandler.writeBooleanConfig("toggles", "AutoJoinSkyblock", ToggleCommand.autoJoinSkyblock); + autoJoinSkyblock.displayString = "Automatically Join Skyblock: " + Utils.getColouredBoolean(ToggleCommand.autoJoinSkyblock); + } else if (button == firePillar) { + ToggleCommand.firePillar = !ToggleCommand.firePillar; + ConfigHandler.writeBooleanConfig("toggles", "FirePillar", ToggleCommand.firePillar); + firePillar.displayString = "Fire Pillar Display: " + Utils.getColouredBoolean(ToggleCommand.firePillar); + } else if (button == fishingAlert) { + ToggleCommand.fishingAlert = !ToggleCommand.fishingAlert; + ConfigHandler.writeBooleanConfig("toggles", "FishingAlert", ToggleCommand.fishingAlert); + fishingAlert.displayString = "Fishing Spawn Alerts: " + Utils.getColouredBoolean(ToggleCommand.fishingAlert); + } else if (button == customNametags) { + ToggleCommand.customNametags = !ToggleCommand.customNametags; + ConfigHandler.writeBooleanConfig("toggles", "CustomNametags", ToggleCommand.customNametags); + customNametags.displayString = "Custom Color on Nametags: " + Utils.getColouredBoolean(ToggleCommand.customNametags); + } else if (button == minionLastCollected) { + ToggleCommand.minionLastCollected = !ToggleCommand.minionLastCollected; + ConfigHandler.writeBooleanConfig("toggles", "MinionLastCollected", ToggleCommand.minionLastCollected); + minionLastCollected.displayString = "Show When Minion Last Collected: " + Utils.getColouredBoolean(ToggleCommand.minionLastCollected); + } else if (button == showTrophyCompletion) { + ToggleCommand.showTrophyCompletion = !ToggleCommand.showTrophyCompletion; + ConfigHandler.writeBooleanConfig("toggles", "ShowTrophyCompletion", ToggleCommand.showTrophyCompletion); + showTrophyCompletion.displayString = "Show Trophy Fish Completion: " + Utils.getColouredBoolean(ToggleCommand.showTrophyCompletion); + } else if (button == showTotalMagmafish) { + ToggleCommand.showTotalMagmafish = !ToggleCommand.showTotalMagmafish; + ConfigHandler.writeBooleanConfig("toggles", "ShowTotalMagmafish", ToggleCommand.showTotalMagmafish); + showTotalMagmafish.displayString = "Show Total Fillet Magmafish: " + Utils.getColouredBoolean(ToggleCommand.showTotalMagmafish); } } @@ -415,6 +592,7 @@ public class DankerGui extends GuiScreen { protected void keyTyped(char typedChar, int keyCode) throws IOException { super.keyTyped(typedChar, keyCode); search.textboxKeyTyped(typedChar, keyCode); + initSearchText = search.getText(); reInit(); } diff --git a/src/main/java/me/Danker/gui/DisplayGui.java b/src/main/java/me/Danker/gui/DisplayGui.java index 38459ee..f7fd2f3 100644 --- a/src/main/java/me/Danker/gui/DisplayGui.java +++ b/src/main/java/me/Danker/gui/DisplayGui.java @@ -1,9 +1,8 @@ package me.Danker.gui; -import me.Danker.DankersSkyblockMod; import me.Danker.features.loot.LootDisplay; import me.Danker.handlers.ConfigHandler; -import me.Danker.handlers.TextRenderer; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; @@ -20,12 +19,16 @@ public class DisplayGui extends GuiScreen { private GuiButton zombie; private GuiButton spider; private GuiButton wolf; + private GuiButton enderman; + private GuiButton blaze; private GuiButton auto; private GuiButton fishing; private GuiButton fishingWinter; private GuiButton fishingFestival; private GuiButton fishingSpooky; - private GuiButton mythological; + private GuiButton fishingCH; + private GuiButton fishingLava; + private GuiButton fishingTrophy; private GuiButton catacombsF1; private GuiButton catacombsF2; private GuiButton catacombsF3; @@ -33,6 +36,8 @@ public class DisplayGui extends GuiScreen { private GuiButton catacombsF5; private GuiButton catacombsF6; private GuiButton catacombsF7; + private GuiButton catacombsMM; + private GuiButton mythological; private GuiButton ghost; @Override @@ -52,22 +57,28 @@ public class DisplayGui extends GuiScreen { showSession = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Current Session Only: " + Utils.getColouredBoolean(addSession)); off = new GuiButton(0, width / 2 - 210, (int) (height * 0.2), "Off"); auto = new GuiButton(0, width / 2 + 10, (int) (height * 0.2), "Auto"); - zombie = new GuiButton(0, width / 2 - 190, (int) (height * 0.3), 110, 20, "Zombie"); - spider = new GuiButton(0, width / 2 - 55, (int) (height * 0.3), 110, 20, "Spider"); - wolf = new GuiButton(0, width / 2 + 75, (int) (height * 0.3), 110, 20, "Wolf"); - fishing = new GuiButton(0, width / 2 - 230, (int) (height * 0.4), 100, 20, "Fishing"); - fishingWinter = new GuiButton(0, width / 2 - 110, (int) (height * 0.4), 100, 20, "Fishing Winter"); - fishingFestival = new GuiButton(0, width / 2 + 10, (int) (height * 0.4), 100, 20, "Fishing Festival"); - fishingSpooky = new GuiButton(0, width / 2 + 130, (int) (height * 0.4), 100, 20, "Fishing Spooky"); - mythological = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), 95, 20, "Mythological"); - ghost = new GuiButton(0, width / 2 + 5, (int) (height * 0.5), 95, 20, "Ghost"); - catacombsF1 = new GuiButton(0, width / 2 - 205, (int) (height * 0.65), 50, 20, "F1"); - catacombsF2 = new GuiButton(0, width / 2 - 145, (int) (height * 0.65), 50, 20, "F2"); - catacombsF3 = new GuiButton(0, width / 2 - 85, (int) (height * 0.65), 50, 20, "F3"); - catacombsF4 = new GuiButton(0, width / 2 - 25, (int) (height * 0.65), 50, 20, "F4"); - catacombsF5 = new GuiButton(0, width / 2 + 35, (int) (height * 0.65), 50, 20, "F5"); - catacombsF6 = new GuiButton(0, width / 2 + 95, (int) (height * 0.65), 50, 20, "F6"); - catacombsF7 = new GuiButton(0, width / 2 + 155, (int) (height * 0.65), 50, 20, "F7"); + zombie = new GuiButton(0, width / 2 - 270, (int) (height * 0.35), 100, 20, "Zombie"); + spider = new GuiButton(0, width / 2 - 160, (int) (height * 0.35), 100, 20, "Spider"); + wolf = new GuiButton(0, width / 2 - 50, (int) (height * 0.35), 100, 20, "Wolf"); + enderman = new GuiButton(0, width / 2 + 60, (int) (height * 0.35), 100, 20, "Enderman"); + blaze = new GuiButton(0, width / 2 + 170, (int) (height * 0.35), 100, 20, "Blaze"); + fishing = new GuiButton(0, width / 2 - 310, (int) (height * 0.5), 80, 20, "Fishing"); + fishingWinter = new GuiButton(0, width / 2 - 220, (int) (height * 0.5), 80, 20, "Fishing Winter"); + fishingFestival = new GuiButton(0, width / 2 - 130, (int) (height * 0.5), 80, 20, "Fishing Festival"); + fishingSpooky = new GuiButton(0, width / 2 - 40, (int) (height * 0.5), 80, 20, "Fishing Spooky"); + fishingCH = new GuiButton(0, width / 2 + 50, (int) (height * 0.5), 80, 20, "CH Fishing"); + fishingLava = new GuiButton(0, width / 2 + 140, (int) (height * 0.5), 80, 20, "Lava Fishing"); + fishingTrophy = new GuiButton(0, width / 2 + 230, (int) (height * 0.5), 80, 20, "Fishing Trophy"); + catacombsF1 = new GuiButton(0, width / 2 - 235, (int) (height * 0.65), 50, 20, "F1"); + catacombsF2 = new GuiButton(0, width / 2 - 175, (int) (height * 0.65), 50, 20, "F2"); + catacombsF3 = new GuiButton(0, width / 2 - 115, (int) (height * 0.65), 50, 20, "F3"); + catacombsF4 = new GuiButton(0, width / 2 - 55, (int) (height * 0.65), 50, 20, "F4"); + catacombsF5 = new GuiButton(0, width / 2 + 5, (int) (height * 0.65), 50, 20, "F5"); + catacombsF6 = new GuiButton(0, width / 2 + 65, (int) (height * 0.65), 50, 20, "F6"); + catacombsF7 = new GuiButton(0, width / 2 + 125, (int) (height * 0.65), 50, 20, "F7"); + catacombsMM = new GuiButton(0, width / 2 + 185, (int) (height * 0.65), 50, 20, "MM"); + mythological = new GuiButton(0, width / 2 - 100, (int) (height * 0.8), 95, 20, "Mythological"); + ghost = new GuiButton(0, width / 2 + 5, (int) (height * 0.8), 95, 20, "Ghost"); this.buttonList.add(showSession); this.buttonList.add(off); @@ -75,11 +86,15 @@ public class DisplayGui extends GuiScreen { this.buttonList.add(zombie); this.buttonList.add(spider); this.buttonList.add(wolf); + this.buttonList.add(enderman); + this.buttonList.add(blaze); this.buttonList.add(fishing); this.buttonList.add(fishingWinter); this.buttonList.add(fishingFestival); this.buttonList.add(fishingSpooky); - this.buttonList.add(mythological); + this.buttonList.add(fishingCH); + this.buttonList.add(fishingLava); + this.buttonList.add(fishingTrophy); this.buttonList.add(catacombsF1); this.buttonList.add(catacombsF2); this.buttonList.add(catacombsF3); @@ -87,6 +102,8 @@ public class DisplayGui extends GuiScreen { this.buttonList.add(catacombsF5); this.buttonList.add(catacombsF6); this.buttonList.add(catacombsF7); + this.buttonList.add(catacombsMM); + this.buttonList.add(mythological); this.buttonList.add(ghost); this.buttonList.add(goBack); } @@ -94,20 +111,13 @@ public class DisplayGui extends GuiScreen { @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); - Minecraft mc = Minecraft.getMinecraft(); - - String displayText; - if (LootDisplay.auto) { - displayText = "Current Display: auto"; - } else { - displayText = "Current Display: " + LootDisplay.display; - } - int displayWidth = mc.fontRendererObj.getStringWidth(displayText); - new TextRenderer(mc, displayText, width / 2 - displayWidth / 2, 10, 1D); - - String catacombsTitleText = "Catacombs Dungeon"; - int catacombsTitleWidth = mc.fontRendererObj.getStringWidth(catacombsTitleText); - new TextRenderer(mc, catacombsTitleText, width / 2 - catacombsTitleWidth / 2, (int) (height * 0.6), 1D); + + String displayText = LootDisplay.auto ? "Current Display: auto" : "Current Display: " + LootDisplay.display; + RenderUtils.drawCenteredText(displayText, width, 10, 1D); + RenderUtils.drawCenteredText("Slayer", width, (int) (height * 0.3), 1D); + RenderUtils.drawCenteredText("Fishing", width, (int) (height * 0.45), 1D); + RenderUtils.drawCenteredText("Catacombs Dungeon", width, (int) (height * 0.6), 1D); + RenderUtils.drawCenteredText("Misc", width, (int) (height * 0.75), 1D); super.drawScreen(mouseX, mouseY, partialTicks); } @@ -115,49 +125,62 @@ public class DisplayGui extends GuiScreen { @Override public void actionPerformed(GuiButton button) { if (button == goBack) { - DankersSkyblockMod.guiToOpen = "dankergui1"; + mc.displayGuiScreen(new DankerGui(1, "")); } else if (button == showSession) { addSession = !addSession; showSession.displayString = "Current Session Only: " + Utils.getColouredBoolean(addSession); } else if (button == off) { setDisplay("off", true); } else if (button == zombie) { - setDisplay("zombie", false); + setDisplay("zombie"); } else if (button == spider) { - setDisplay("spider", false); + setDisplay("spider"); } else if (button == wolf) { - setDisplay("wolf", false); + setDisplay("wolf"); + } else if (button == enderman) { + setDisplay("enderman"); + } else if (button == blaze) { + setDisplay("blaze"); } else if (button == auto) { LootDisplay.auto = true; ConfigHandler.writeBooleanConfig("misc", "autoDisplay", true); } else if (button == fishing) { - setDisplay("fishing", false); + setDisplay("fishing"); } else if (button == fishingWinter) { - setDisplay("fishing_winter", false); + setDisplay("fishing_winter"); } else if (button == fishingFestival) { - setDisplay("fishing_festival", false); + setDisplay("fishing_festival"); } else if (button == fishingSpooky) { - setDisplay("fishing_spooky", false); + setDisplay("fishing_spooky"); + } else if (button == fishingCH) { + setDisplay("fishing_ch"); + } else if (button == fishingLava) { + setDisplay("fishing_lava"); + } else if (button == fishingTrophy) { + setDisplay("fishing_trophy"); } else if (button == mythological) { - setDisplay("mythological", false); + setDisplay("mythological"); } else if (button == catacombsF1) { - setDisplay("catacombs_floor_one", false); + setDisplay("catacombs_floor_one"); } else if (button == catacombsF2) { - setDisplay("catacombs_floor_two", false); + setDisplay("catacombs_floor_two"); } else if (button == catacombsF3) { - setDisplay("catacombs_floor_three", false); + setDisplay("catacombs_floor_three"); } else if (button == catacombsF4) { - setDisplay("catacombs_floor_four", false); + setDisplay("catacombs_floor_four"); } else if (button == catacombsF5) { - setDisplay("catacombs_floor_five", false); + setDisplay("catacombs_floor_five"); } else if (button == catacombsF6) { - setDisplay("catacombs_floor_six", false); + setDisplay("catacombs_floor_six"); } else if (button == catacombsF7) { - setDisplay("catacombs_floor_seven", false); - } else if (button == ghost) - setDisplay("ghost",false); + setDisplay("catacombs_floor_seven"); + } else if (button == catacombsMM) { + setDisplay("catacombs_master"); + } else if (button == ghost) { + setDisplay("ghost"); + } } - + public void setDisplay(String display, boolean forceNoSession) { if (!forceNoSession && addSession) display += "_session"; LootDisplay.auto = false; @@ -165,5 +188,9 @@ public class DisplayGui extends GuiScreen { ConfigHandler.writeBooleanConfig("misc", "autoDisplay", false); ConfigHandler.writeStringConfig("misc", "display", display); } + + public void setDisplay(String display) { + setDisplay(display, false); + } } diff --git a/src/main/java/me/Danker/gui/EditLocationsGui.java b/src/main/java/me/Danker/gui/EditLocationsGui.java index 3a7c94b..24f0908 100644 --- a/src/main/java/me/Danker/gui/EditLocationsGui.java +++ b/src/main/java/me/Danker/gui/EditLocationsGui.java @@ -29,6 +29,11 @@ public class EditLocationsGui extends GuiScreen { private LocationButton waterAnswer; private LocationButton bonzoTimer; private LocationButton golemTimer; + private LocationButton teammatesInRadius; + private LocationButton giantHP; + private LocationButton abilityCooldown; + private LocationButton dungeonScore; + private LocationButton firePillar; @Override public boolean doesGuiPauseGame() { @@ -86,16 +91,49 @@ public class EditLocationsGui extends GuiScreen { EnumChatFormatting.GREEN + "Green: " + EnumChatFormatting.YELLOW + "Gold, " + EnumChatFormatting.GREEN + "Emerald\n" + EnumChatFormatting.RED + "Red: " + EnumChatFormatting.YELLOW + "Gold, " + EnumChatFormatting.AQUA + "Diamond, " + EnumChatFormatting.GREEN + "Emerald, " + EnumChatFormatting.RED + "Clay"; - display = new LocationButton(0, MoveCommand.displayXY[0], MoveCommand.displayXY[1], 145 * ScaleCommand.displayScale, 102 * ScaleCommand.displayScale, ScaleCommand.displayScale, displayText, displayNums, 110); - dungeonTimer = new LocationButton(0, MoveCommand.dungeonTimerXY[0], MoveCommand.dungeonTimerXY[1], 113 * ScaleCommand.dungeonTimerScale, 57 * ScaleCommand.dungeonTimerScale, ScaleCommand.dungeonTimerScale, dungeonTimerText, dungeonTimerNums, 80); - coords = new LocationButton(0, MoveCommand.coordsXY[0], MoveCommand.coordsXY[1], 141 * ScaleCommand.coordsScale, 12 * ScaleCommand.coordsScale, ScaleCommand.coordsScale, NoF3Coords.COORDS_COLOUR + "74 / 14 / -26 (141.1 / 6.7)", null, null); - skill50 = new LocationButton(0, MoveCommand.skill50XY[0], MoveCommand.skill50XY[1], 233 * ScaleCommand.skill50Scale, 12 * ScaleCommand.skill50Scale, ScaleCommand.skill50Scale, Skill50Display.SKILL_50_COLOUR + "+3.5 Farming (28,882,117.7/55,172,425) 52.34%", null, null); - lividHP = new LocationButton(0, MoveCommand.lividHpXY[0], MoveCommand.lividHpXY[1], 85 * ScaleCommand.lividHpScale, 12 * ScaleCommand.lividHpScale, ScaleCommand.lividHpScale, EnumChatFormatting.WHITE + "﴾ Livid " + EnumChatFormatting.YELLOW + "6.9M" + EnumChatFormatting.RED + "❤ " + EnumChatFormatting.WHITE + "﴿", null, null); - cakeTimer = new LocationButton(0, MoveCommand.cakeTimerXY[0], MoveCommand.cakeTimerXY[1] + 5, 85 * ScaleCommand.cakeTimerScale, 18 * ScaleCommand.cakeTimerScale, ScaleCommand.cakeTimerScale, CakeTimer.CAKE_COLOUR + " 11h16m", null, null); - skillTracker = new LocationButton(0, MoveCommand.skillTrackerXY[0], MoveCommand.skillTrackerXY[1], 150 * ScaleCommand.skillTrackerScale, 28 * ScaleCommand.skillTrackerScale, ScaleCommand.skillTrackerScale, skillTrackerText, null, null); - waterAnswer = new LocationButton(0, MoveCommand.waterAnswerXY[0], MoveCommand.waterAnswerXY[1], 190 * ScaleCommand.waterAnswerScale, 54 * ScaleCommand.waterAnswerScale, ScaleCommand.waterAnswerScale, waterAnswerText, null, null); - bonzoTimer = new LocationButton(0, MoveCommand.bonzoTimerXY[0], MoveCommand.bonzoTimerXY[1] + 5, 53 * ScaleCommand.bonzoTimerScale, 18 * ScaleCommand.bonzoTimerScale, ScaleCommand.bonzoTimerScale, BonzoMaskTimer.BONZO_COLOR + " 3m30s", null, null); - golemTimer = new LocationButton(0, MoveCommand.golemTimerXY[0], MoveCommand.golemTimerXY[1] + 5, 42 * ScaleCommand.golemTimerScale, 18 * ScaleCommand.golemTimerScale, ScaleCommand.golemTimerScale, GolemSpawningAlert.GOLEM_COLOUR + " 20s", null, null); + String teammatesInRadiusText = EnumChatFormatting.AQUA + "Teammates In Radius:\n" + + EnumChatFormatting.GREEN + "NoticeMehSenpai\n" + + EnumChatFormatting.GREEN + "DeathStreeks\n" + + EnumChatFormatting.GREEN + "Not_A_Neko\n" + + EnumChatFormatting.GREEN + "Minikloon"; + + String giantHPText = EnumChatFormatting.DARK_RED + "L.A.S.R. " + EnumChatFormatting.GREEN + "25M" + EnumChatFormatting.RED + "❤\n" + + EnumChatFormatting.RED + "Bigfoot " + EnumChatFormatting.GREEN + "25M" + EnumChatFormatting.RED + "❤\n" + + EnumChatFormatting.LIGHT_PURPLE + "Jolly Pink Giant " + EnumChatFormatting.GREEN + "25M" + EnumChatFormatting.RED + "❤\n" + + EnumChatFormatting.DARK_AQUA + "The Diamond Giant " + EnumChatFormatting.GREEN + "25M" + EnumChatFormatting.RED + "❤"; + + String abilityCooldownText = EnumChatFormatting.GREEN + "Spirit Glide: " + EnumChatFormatting.YELLOW + "32.734s\n" + + EnumChatFormatting.GREEN + "Parley: " + EnumChatFormatting.YELLOW + "2.652s\n" + + EnumChatFormatting.GREEN + "Ice Spray: " + EnumChatFormatting.YELLOW + "1.429s"; + + String dungeonScoreText = " Secrets Found: " + EnumChatFormatting.GREEN + "100.0%\n" + + EnumChatFormatting.GOLD + "Skill:\n" + + EnumChatFormatting.GOLD + "Explore:\n" + + EnumChatFormatting.GOLD + "Speed:\n" + + EnumChatFormatting.GOLD + "Bonus:\n" + + EnumChatFormatting.GOLD + "Total:"; + String dungeonScoreNums = "\n" + + EnumChatFormatting.GOLD + "100\n" + + EnumChatFormatting.GOLD + "100\n" + + EnumChatFormatting.GOLD + "100\n" + + EnumChatFormatting.GOLD + "5\n" + + EnumChatFormatting.GOLD + "305 " + EnumChatFormatting.GRAY + "(" + EnumChatFormatting.GOLD + "S+" + EnumChatFormatting.GRAY + ")"; + + display = new LocationButton(MoveCommand.displayXY[0], MoveCommand.displayXY[1], ScaleCommand.displayScale, displayText, displayNums, 110); + dungeonTimer = new LocationButton(MoveCommand.dungeonTimerXY[0], MoveCommand.dungeonTimerXY[1], ScaleCommand.dungeonTimerScale, dungeonTimerText, dungeonTimerNums, 80); + coords = new LocationButton(MoveCommand.coordsXY[0], MoveCommand.coordsXY[1], ScaleCommand.coordsScale, NoF3Coords.COORDS_COLOUR + "74 / 14 / -26 (141.1 / 6.7)"); + skill50 = new LocationButton(MoveCommand.skill50XY[0], MoveCommand.skill50XY[1], ScaleCommand.skill50Scale, Skill50Display.SKILL_50_COLOUR + "+3.5 Farming (28,882,117.7/55,172,425) 52.34%"); + lividHP = new LocationButton(MoveCommand.lividHpXY[0], MoveCommand.lividHpXY[1], ScaleCommand.lividHpScale, EnumChatFormatting.WHITE + "﴾ Livid " + EnumChatFormatting.YELLOW + "6.9M" + EnumChatFormatting.RED + "❤ " + EnumChatFormatting.WHITE + "﴿"); + cakeTimer = new LocationButton(MoveCommand.cakeTimerXY[0], MoveCommand.cakeTimerXY[1] + 5, ScaleCommand.cakeTimerScale, CakeTimer.CAKE_COLOUR + " 11h16m"); + skillTracker = new LocationButton(MoveCommand.skillTrackerXY[0], MoveCommand.skillTrackerXY[1], ScaleCommand.skillTrackerScale, skillTrackerText); + waterAnswer = new LocationButton(MoveCommand.waterAnswerXY[0], MoveCommand.waterAnswerXY[1], ScaleCommand.waterAnswerScale, waterAnswerText); + bonzoTimer = new LocationButton(MoveCommand.bonzoTimerXY[0], MoveCommand.bonzoTimerXY[1] + 5, ScaleCommand.bonzoTimerScale, BonzoMaskTimer.BONZO_COLOR + " 3m30s"); + golemTimer = new LocationButton(MoveCommand.golemTimerXY[0], MoveCommand.golemTimerXY[1] + 5, ScaleCommand.golemTimerScale, GolemSpawningAlert.GOLEM_COLOUR + " 20s"); + teammatesInRadius = new LocationButton(MoveCommand.teammatesInRadiusXY[0], MoveCommand.teammatesInRadiusXY[1], ScaleCommand.teammatesInRadiusScale, teammatesInRadiusText); + giantHP = new LocationButton(MoveCommand.giantHPXY[0], MoveCommand.giantHPXY[1], ScaleCommand.giantHPScale, giantHPText); + abilityCooldown = new LocationButton(MoveCommand.abilityCooldownsXY[0], MoveCommand.abilityCooldownsXY[1], ScaleCommand.abilityCooldownsScale, abilityCooldownText); + dungeonScore = new LocationButton(MoveCommand.dungeonScoreXY[0], MoveCommand.dungeonScoreXY[1], ScaleCommand.dungeonScoreScale, dungeonScoreText, dungeonScoreNums, 80); + firePillar = new LocationButton(MoveCommand.firePillarXY[0], MoveCommand.firePillarXY[1], ScaleCommand.firePillarScale, EnumChatFormatting.GOLD + "3s " + EnumChatFormatting.RED + "8 hits"); this.buttonList.add(coords); this.buttonList.add(dungeonTimer); @@ -107,6 +145,11 @@ public class EditLocationsGui extends GuiScreen { this.buttonList.add(display); this.buttonList.add(skill50); this.buttonList.add(golemTimer); + this.buttonList.add(teammatesInRadius); + this.buttonList.add(giantHP); + this.buttonList.add(abilityCooldown); + this.buttonList.add(dungeonScore); + this.buttonList.add(firePillar); } @Override @@ -204,6 +247,35 @@ public class EditLocationsGui extends GuiScreen { golemTimer.xPosition = MoveCommand.golemTimerXY[0]; golemTimer.yPosition = MoveCommand.golemTimerXY[1]; break; + case "teammatesInRadius": + MoveCommand.teammatesInRadiusXY[0] += xMoved; + MoveCommand.teammatesInRadiusXY[1] += yMoved; + teammatesInRadius.xPosition = MoveCommand.teammatesInRadiusXY[0]; + teammatesInRadius.yPosition = MoveCommand.teammatesInRadiusXY[1]; + break; + case "giantHP": + MoveCommand.giantHPXY[0] += xMoved; + MoveCommand.giantHPXY[1] += yMoved; + giantHP.xPosition = MoveCommand.giantHPXY[0]; + giantHP.yPosition = MoveCommand.giantHPXY[1]; + break; + case "abilityCooldown": + MoveCommand.abilityCooldownsXY[0] += xMoved; + MoveCommand.abilityCooldownsXY[1] += yMoved; + abilityCooldown.xPosition = MoveCommand.abilityCooldownsXY[0]; + abilityCooldown.yPosition = MoveCommand.abilityCooldownsXY[1]; + break; + case "dungeonScore": + MoveCommand.dungeonScoreXY[0] += xMoved; + MoveCommand.dungeonScoreXY[1] += yMoved; + dungeonScore.xPosition = MoveCommand.dungeonScoreXY[0]; + dungeonScore.yPosition = MoveCommand.dungeonScoreXY[1]; + break; + case "firePillar": + MoveCommand.firePillarXY[0] += xMoved; + MoveCommand.firePillarXY[1] += yMoved; + firePillar.xPosition = MoveCommand.firePillarXY[0]; + firePillar.yPosition = MoveCommand.firePillarXY[1]; } this.buttonList.clear(); initGui(); @@ -236,6 +308,16 @@ public class EditLocationsGui extends GuiScreen { moving = "bonzoTimer"; } else if (button == golemTimer) { moving = "golemTimer"; + } else if (button == teammatesInRadius) { + moving = "teammatesInRadius"; + } else if (button == giantHP) { + moving = "giantHP"; + } else if (button == abilityCooldown) { + moving = "abilityCooldown"; + } else if (button == dungeonScore) { + moving = "dungeonScore"; + } else if (button == firePillar) { + moving = "firePillar"; } } } @@ -264,6 +346,16 @@ public class EditLocationsGui extends GuiScreen { ConfigHandler.writeIntConfig("locations", "bonzoTimerY", MoveCommand.bonzoTimerXY[1]); ConfigHandler.writeIntConfig("locations", "golemTimerX", MoveCommand.golemTimerXY[0]); ConfigHandler.writeIntConfig("locations", "golemTimerY", MoveCommand.golemTimerXY[1]); + ConfigHandler.writeIntConfig("locations", "teammatesInRadiusX", MoveCommand.teammatesInRadiusXY[0]); + ConfigHandler.writeIntConfig("locations", "teammatesInRadiusY", MoveCommand.teammatesInRadiusXY[1]); + ConfigHandler.writeIntConfig("locations", "giantHPX", MoveCommand.giantHPXY[0]); + ConfigHandler.writeIntConfig("locations", "giantHPY", MoveCommand.giantHPXY[1]); + ConfigHandler.writeIntConfig("locations", "abilityCooldownsX", MoveCommand.abilityCooldownsXY[0]); + ConfigHandler.writeIntConfig("locations", "abilityCooldownsY", MoveCommand.abilityCooldownsXY[1]); + ConfigHandler.writeIntConfig("locations", "dungeonScoreX", MoveCommand.dungeonScoreXY[0]); + ConfigHandler.writeIntConfig("locations", "dungeonScoreY", MoveCommand.dungeonScoreXY[1]); + ConfigHandler.writeIntConfig("locations", "firePillarX", MoveCommand.firePillarXY[0]); + ConfigHandler.writeIntConfig("locations", "firePillarY", MoveCommand.firePillarXY[1]); } } diff --git a/src/main/java/me/Danker/gui/ExperimentsGui.java b/src/main/java/me/Danker/gui/ExperimentsGui.java index c3f4f47..53eb118 100644 --- a/src/main/java/me/Danker/gui/ExperimentsGui.java +++ b/src/main/java/me/Danker/gui/ExperimentsGui.java @@ -1,6 +1,5 @@ package me.Danker.gui; -import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; import me.Danker.handlers.ConfigHandler; import me.Danker.utils.Utils; @@ -52,7 +51,7 @@ public class ExperimentsGui extends GuiScreen { @Override public void actionPerformed(GuiButton button) { if (button == goBack) { - DankersSkyblockMod.guiToOpen = "dankergui1"; + mc.displayGuiScreen(new DankerGui(1, "")); } else if (button == ultrasequencer) { ToggleCommand.ultrasequencerToggled = !ToggleCommand.ultrasequencerToggled; ConfigHandler.writeBooleanConfig("toggles", "UltraSequencer", ToggleCommand.ultrasequencerToggled); diff --git a/src/main/java/me/Danker/gui/OnlySlayerGui.java b/src/main/java/me/Danker/gui/OnlySlayerGui.java new file mode 100644 index 0000000..c637ff9 --- /dev/null +++ b/src/main/java/me/Danker/gui/OnlySlayerGui.java @@ -0,0 +1,162 @@ +package me.Danker.gui; + +import me.Danker.features.BlockWrongSlayer; +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.RenderUtils; +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 OnlySlayerGui extends GuiScreen { + + private int onlyNumberInt = 4; + private String onlyName = "Revenant Horror"; + + private GuiButton goBack; + private GuiButton off; + private GuiButton zombie; + private GuiButton spider; + private GuiButton wolf; + private GuiButton enderman; + private GuiButton blaze; + private GuiButton one; + private GuiButton two; + private GuiButton three; + private GuiButton four; + private GuiButton five; + + @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(); + + onlyName = BlockWrongSlayer.onlySlayerName; + switch (BlockWrongSlayer.onlySlayerNumber) { + case "I": + onlyNumberInt = 1; + break; + case "II": + onlyNumberInt = 2; + break; + case "III": + onlyNumberInt = 3; + break; + case "IV": + default: + onlyNumberInt = 4; + break; + case "V": + onlyNumberInt = 5; + break; + } + + goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back"); + off = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Off"); + zombie = new GuiButton(0, width / 2 - 270, (int) (height * 0.4), 100, 20, "Zombie"); + spider = new GuiButton(0, width / 2 - 160, (int) (height * 0.4), 100, 20, "Spider"); + wolf = new GuiButton(0, width / 2 - 50, (int) (height * 0.4), 100, 20, "Wolf"); + enderman = new GuiButton(0, width / 2 + 60, (int) (height * 0.4), 100, 20, "Enderman"); + blaze = new GuiButton(0, width / 2 + 170, (int) (height * 0.4), 100, 20, "Blaze"); + one = new GuiButton(0, width / 2 - 190, (int) (height * 0.6), 60, 20, "I"); + two = new GuiButton(0, width / 2 - 110, (int) (height * 0.6), 60, 20, "II"); + three = new GuiButton(0, width / 2 - 30, (int) (height * 0.6), 60, 20, "III"); + four = new GuiButton(0, width / 2 + 50, (int) (height * 0.6), 60, 20, "IV"); + five = new GuiButton(0, width / 2 + 130, (int) (height * 0.6), 60, 20, "V"); + + this.buttonList.add(off); + this.buttonList.add(zombie); + this.buttonList.add(spider); + this.buttonList.add(wolf); + this.buttonList.add(enderman); + this.buttonList.add(blaze); + this.buttonList.add(one); + this.buttonList.add(two); + this.buttonList.add(three); + this.buttonList.add(four); + this.buttonList.add(five); + this.buttonList.add(goBack); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + + String displayText; + if (BlockWrongSlayer.onlySlayerName.equals("")) { + displayText = "Only Allow Slayer: Off"; + } else { + displayText = "Only Allow Slayer: " + BlockWrongSlayer.onlySlayerName + " " + BlockWrongSlayer.onlySlayerNumber; + } + RenderUtils.drawCenteredText(displayText, width, 10, 1D); + + super.drawScreen(mouseX, mouseY, partialTicks); + } + + @Override + public void actionPerformed(GuiButton button) { + if (button == goBack) { + mc.displayGuiScreen(new DankerGui(1, "")); + return; + } else if (button == off) { + BlockWrongSlayer.onlySlayerName = ""; + BlockWrongSlayer.onlySlayerNumber = ""; + ConfigHandler.writeStringConfig("toggles", "BlockSlayer", ""); + return; + } else if (button == zombie) { + onlyName = "Revenant Horror"; + } else if (button == spider) { + onlyName = "Tarantula Broodfather"; + } else if (button == wolf) { + onlyName = "Sven Packmaster"; + } else if (button == enderman) { + onlyName = "Voidgloom Seraph"; + } else if (button == blaze) { + onlyName = "Inferno Demonlord"; + } else if (button == one) { + onlyNumberInt = 1; + } else if (button == two) { + onlyNumberInt = 2; + } else if (button == three) { + onlyNumberInt = 3; + } else if (button == four) { + onlyNumberInt = 4; + } else if (button == five) { + onlyNumberInt = 5; + } + + String onlyNumber; + switch (onlyNumberInt) { + case 1: + onlyNumber = "I"; + break; + case 2: + onlyNumber = "II"; + break; + case 3: + onlyNumber = "III"; + break; + case 4: + onlyNumber = "IV"; + break; + case 5: + onlyNumber = "V"; + break; + default: + onlyNumber = "IV"; + } + + BlockWrongSlayer.onlySlayerName = onlyName; + BlockWrongSlayer.onlySlayerNumber = onlyNumber; + ConfigHandler.writeStringConfig("toggles", "BlockSlayer", BlockWrongSlayer.onlySlayerName + " " + BlockWrongSlayer.onlySlayerNumber); + } + +} diff --git a/src/main/java/me/Danker/gui/PuzzleSolversGui.java b/src/main/java/me/Danker/gui/PuzzleSolversGui.java index 70cd982..2f87630 100644 --- a/src/main/java/me/Danker/gui/PuzzleSolversGui.java +++ b/src/main/java/me/Danker/gui/PuzzleSolversGui.java @@ -1,6 +1,5 @@ package me.Danker.gui; -import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; import me.Danker.handlers.ConfigHandler; import me.Danker.utils.Utils; @@ -20,6 +19,7 @@ public class PuzzleSolversGui extends GuiScreen { private GuiButton trivia; private GuiButton blaze; private GuiButton creeper; + private GuiButton creeperLines; private GuiButton water; private GuiButton ticTacToe; private GuiButton boulder; @@ -28,6 +28,9 @@ public class PuzzleSolversGui extends GuiScreen { private GuiButton startsWith; private GuiButton selectAll; private GuiButton clickOrder; + private GuiButton sameColour; + private GuiButton blockClicks; + private GuiButton itemFrameOnSeaLanterns; public PuzzleSolversGui(int page) { this.page = page; @@ -55,35 +58,47 @@ public class PuzzleSolversGui extends GuiScreen { trivia = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Trivia Solver: " + Utils.getColouredBoolean(ToggleCommand.oruoToggled)); blaze = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Blaze Solver: " + Utils.getColouredBoolean(ToggleCommand.blazeToggled)); creeper = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Creeper Solver: " + Utils.getColouredBoolean(ToggleCommand.creeperToggled)); - water = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Water Solver: " + Utils.getColouredBoolean(ToggleCommand.waterToggled)); - ticTacToe = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Tic Tac Toe Solver: " + Utils.getColouredBoolean(ToggleCommand.ticTacToeToggled)); - boulder = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Boulder Solver: " + Utils.getColouredBoolean(ToggleCommand.boulderToggled)); + creeperLines = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Lines In Creeper Solver: " + Utils.getColouredBoolean(ToggleCommand.creeperLinesToggled)); + water = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Water Solver: " + Utils.getColouredBoolean(ToggleCommand.waterToggled)); + ticTacToe = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Tic Tac Toe Solver: " + Utils.getColouredBoolean(ToggleCommand.ticTacToeToggled)); // Page 2 - silverfish = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Silverfish Solver: " + Utils.getColouredBoolean(ToggleCommand.silverfishToggled)); - iceWalk = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Ice Walk Solver: " + Utils.getColouredBoolean(ToggleCommand.iceWalkToggled)); - startsWith = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Starts With Letter Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.startsWithToggled)); - selectAll = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Select All Color Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.selectAllToggled)); - clickOrder = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Click in Order Terminal Helper: " + Utils.getColouredBoolean(ToggleCommand.clickInOrderToggled)); - + boulder = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Boulder Solver: " + Utils.getColouredBoolean(ToggleCommand.boulderToggled)); + silverfish = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Silverfish Solver: " + Utils.getColouredBoolean(ToggleCommand.silverfishToggled)); + iceWalk = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Ice Walk Solver: " + Utils.getColouredBoolean(ToggleCommand.iceWalkToggled)); + startsWith = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Starts With Letter Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.startsWithToggled)); + selectAll = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Select All Color Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.selectAllToggled)); + clickOrder = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Click in Order Terminal Helper: " + Utils.getColouredBoolean(ToggleCommand.clickInOrderToggled)); + sameColour = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Same Colour Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.sameColourToggled)); + // Page 3 + blockClicks = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Block Wrong Clicks on Terminals: " + Utils.getColouredBoolean(ToggleCommand.blockWrongTerminalClicksToggled)); + itemFrameOnSeaLanterns = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Ignore Arrows On Sea Lanterns: " + Utils.getColouredBoolean(ToggleCommand.itemFrameOnSeaLanternsToggled)); + switch (page) { case 1: this.buttonList.add(riddle); this.buttonList.add(trivia); this.buttonList.add(blaze); this.buttonList.add(creeper); + this.buttonList.add(creeperLines); this.buttonList.add(water); this.buttonList.add(ticTacToe); - this.buttonList.add(boulder); this.buttonList.add(nextPage); break; case 2: + this.buttonList.add(boulder); this.buttonList.add(silverfish); this.buttonList.add(iceWalk); this.buttonList.add(startsWith); this.buttonList.add(selectAll); this.buttonList.add(clickOrder); + this.buttonList.add(sameColour); + this.buttonList.add(nextPage); this.buttonList.add(backPage); break; + case 3: + this.buttonList.add(blockClicks); + this.buttonList.add(itemFrameOnSeaLanterns); + this.buttonList.add(backPage); } this.buttonList.add(goBack); } @@ -97,7 +112,7 @@ public class PuzzleSolversGui extends GuiScreen { @Override public void actionPerformed(GuiButton button) { if (button == goBack) { - DankersSkyblockMod.guiToOpen = "dankergui1"; + mc.displayGuiScreen(new DankerGui(1, "")); } else if (button == backPage) { Minecraft.getMinecraft().displayGuiScreen(new PuzzleSolversGui(page - 1)); } else if (button == nextPage) { @@ -118,6 +133,10 @@ public class PuzzleSolversGui extends GuiScreen { ToggleCommand.creeperToggled = !ToggleCommand.creeperToggled; ConfigHandler.writeBooleanConfig("toggles", "CreeperPuzzle", ToggleCommand.creeperToggled); creeper.displayString = "Creeper Solver: " + Utils.getColouredBoolean(ToggleCommand.creeperToggled); + } else if (button == creeperLines) { + ToggleCommand.creeperLinesToggled = !ToggleCommand.creeperLinesToggled; + ConfigHandler.writeBooleanConfig("toggles", "CreeperLines", ToggleCommand.creeperLinesToggled); + creeperLines.displayString = "Lines In Creeper Solver: " + Utils.getColouredBoolean(ToggleCommand.creeperLinesToggled); } else if (button == water) { ToggleCommand.waterToggled = !ToggleCommand.waterToggled; ConfigHandler.writeBooleanConfig("toggles", "WaterPuzzle", ToggleCommand.waterToggled); @@ -150,6 +169,18 @@ public class PuzzleSolversGui extends GuiScreen { ToggleCommand.clickInOrderToggled = !ToggleCommand.clickInOrderToggled; ConfigHandler.writeBooleanConfig("toggles", "ClickInOrderTerminal", ToggleCommand.clickInOrderToggled); clickOrder.displayString = "Click in Order Terminal Helper: " + Utils.getColouredBoolean(ToggleCommand.clickInOrderToggled); + } else if (button == blockClicks) { + ToggleCommand.blockWrongTerminalClicksToggled = !ToggleCommand.blockWrongTerminalClicksToggled; + ConfigHandler.writeBooleanConfig("toggles", "BlockWrongTerminalClicks", ToggleCommand.blockWrongTerminalClicksToggled); + blockClicks.displayString = "Block Wrong Clicks on Terminals: " + Utils.getColouredBoolean(ToggleCommand.blockWrongTerminalClicksToggled); + } else if (button == itemFrameOnSeaLanterns) { + ToggleCommand.itemFrameOnSeaLanternsToggled = !ToggleCommand.itemFrameOnSeaLanternsToggled; + ConfigHandler.writeBooleanConfig("toggles", "IgnoreItemFrameOnSeaLanterns", ToggleCommand.itemFrameOnSeaLanternsToggled); + itemFrameOnSeaLanterns.displayString = "Ignore Arrows On Sea Lanterns: " + Utils.getColouredBoolean(ToggleCommand.itemFrameOnSeaLanternsToggled); + } else if (button == sameColour) { + ToggleCommand.sameColourToggled = !ToggleCommand.sameColourToggled; + ConfigHandler.writeBooleanConfig("toggles", "SameColourTerminal", ToggleCommand.sameColourToggled); + sameColour.displayString = "Same Colour Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.sameColourToggled); } } diff --git a/src/main/java/me/Danker/gui/SkillTrackerGui.java b/src/main/java/me/Danker/gui/SkillTrackerGui.java index fb7a7c9..e77f785 100644 --- a/src/main/java/me/Danker/gui/SkillTrackerGui.java +++ b/src/main/java/me/Danker/gui/SkillTrackerGui.java @@ -1,9 +1,8 @@ package me.Danker.gui; -import me.Danker.DankersSkyblockMod; import me.Danker.features.SkillTracker; import me.Danker.handlers.ConfigHandler; -import me.Danker.handlers.TextRenderer; +import me.Danker.utils.RenderUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; @@ -50,6 +49,7 @@ public class SkillTrackerGui extends GuiScreen { @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); + String stateText = ""; if (SkillTracker.skillStopwatch.isStarted() && !SkillTracker.skillStopwatch.isSuspended()) { stateText = "Timer: Running"; @@ -59,15 +59,15 @@ public class SkillTrackerGui extends GuiScreen { if (!SkillTracker.showSkillTracker) { stateText += " (Hidden)"; } - int stateTextWidth = mc.fontRendererObj.getStringWidth(stateText); - new TextRenderer(mc, stateText, width / 2 - stateTextWidth / 2, 10, 1D); + RenderUtils.drawCenteredText(stateText, width, 10, 1D); + super.drawScreen(mouseX, mouseY, partialTicks); } @Override public void actionPerformed(GuiButton button) { if (button == goBack) { - DankersSkyblockMod.guiToOpen = "dankergui1"; + mc.displayGuiScreen(new DankerGui(1, "")); } else if (button == start) { if (SkillTracker.skillStopwatch.isStarted() && SkillTracker.skillStopwatch.isSuspended()) { SkillTracker.skillStopwatch.resume(); diff --git a/src/main/java/me/Danker/gui/WarningGui.java b/src/main/java/me/Danker/gui/WarningGui.java index db0c21b..901b59e 100644 --- a/src/main/java/me/Danker/gui/WarningGui.java +++ b/src/main/java/me/Danker/gui/WarningGui.java @@ -1,10 +1,11 @@ package me.Danker.gui; -import me.Danker.handlers.TextRenderer; +import me.Danker.utils.RenderUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.util.EnumChatFormatting; public class WarningGui extends GuiScreen { private GuiButton close; @@ -34,15 +35,11 @@ public class WarningGui extends GuiScreen { @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); - String text0 = "§cWARNING!§0"; - int text0Width = mc.fontRendererObj.getStringWidth(text0); - new TextRenderer(mc, text0, (int)(width * 0.45) - text0Width / 2, (int) (height * 0.1), 2 ); - String text1 = "You are using SpiderFrog's Old Animations mod."; - int text1Width = mc.fontRendererObj.getStringWidth(text1); - new TextRenderer(mc, text1, width / 2 - text1Width / 2, (int) (height * 0.3), 1D ); - String text2 = "This mod breaks Danker's Skyblock Mod."; - int text2Width = mc.fontRendererObj.getStringWidth(text2); - new TextRenderer(mc, text2, width / 2 - text2Width / 2, (int) (height * 0.4), 1D); + + RenderUtils.drawCenteredText(EnumChatFormatting.RED + "WARNING!", (int) (width * 0.9), (int) (height * 0.1), 2D); + RenderUtils.drawCenteredText("You are using SpiderFrog's Old Animations mod.", width, (int) (height * 0.3), 1D); + RenderUtils.drawCenteredText("This mod breaks Danker's Skyblock Mod.", width, (int) (height * 0.4), 1D); + super.drawScreen(mouseX, mouseY, partialTicks); } diff --git a/src/main/java/me/Danker/gui/alerts/AlertActionGui.java b/src/main/java/me/Danker/gui/alerts/AlertActionGui.java new file mode 100644 index 0000000..02c3d3b --- /dev/null +++ b/src/main/java/me/Danker/gui/alerts/AlertActionGui.java @@ -0,0 +1,87 @@ +package me.Danker.gui.alerts; + +import me.Danker.features.Alerts; +import me.Danker.utils.RenderUtils; +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; +import net.minecraft.util.EnumChatFormatting; + +public class AlertActionGui extends GuiScreen { + + private final int id; + + private GuiButton goBack; + private GuiButton toggle; + private GuiButton toggleDesktop; + private GuiButton edit; + private GuiButton delete; + + public AlertActionGui(int id) { + this.id = id; + } + + @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(); + + Alerts.Alert alert = Alerts.alerts.get(id); + + goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back"); + toggle = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Enabled: " + Utils.getColouredBoolean(alert.toggled)); + toggleDesktop = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Desktop Notification: " + Utils.getColouredBoolean(alert.desktop)); + edit = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Edit >"); + delete = new GuiButton(0, width / 2 - 100, (int) (height * 0.8), EnumChatFormatting.RED + "Delete Alert"); + + this.buttonList.add(toggle); + this.buttonList.add(toggleDesktop); + this.buttonList.add(edit); + this.buttonList.add(delete); + this.buttonList.add(goBack); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + super.drawScreen(mouseX, mouseY, partialTicks); + + Alerts.Alert alert = Alerts.alerts.get(id); + + RenderUtils.drawCenteredText(alert.alert, width, 10, 1D); + } + + @Override + public void actionPerformed(GuiButton button) { + Alerts.Alert alert = Alerts.alerts.get(id); + if (button == goBack) { + mc.displayGuiScreen(new AlertsGui(1)); + } else if (button == toggle) { + alert.toggle(); + toggle.displayString = "Enabled: " + Utils.getColouredBoolean(alert.toggled); + } else if (button == toggleDesktop) { + alert.toggleDesktop(); + toggleDesktop.displayString = "Desktop Notification: " + Utils.getColouredBoolean(alert.desktop); + } else if (button == edit) { + mc.displayGuiScreen(new AlertAddGui(alert, id)); + } else if (button == delete) { + Alerts.alerts.remove(id); + Alerts.save(); + mc.displayGuiScreen(new AlertsGui(1)); + return; + } + Alerts.alerts.set(id, alert); + Alerts.save(); + } + +} diff --git a/src/main/java/me/Danker/gui/alerts/AlertAddGui.java b/src/main/java/me/Danker/gui/alerts/AlertAddGui.java new file mode 100644 index 0000000..304c77a --- /dev/null +++ b/src/main/java/me/Danker/gui/alerts/AlertAddGui.java @@ -0,0 +1,161 @@ +package me.Danker.gui.alerts; + +import me.Danker.features.Alerts; +import me.Danker.handlers.TextRenderer; +import me.Danker.utils.RenderUtils; +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.minecraftforge.fml.client.config.GuiCheckBox; + +import java.io.IOException; + +public class AlertAddGui extends GuiScreen { + + private boolean editing; + private Alerts.Alert base = null; + private int id; + + private GuiButton cancel; + + private String mode = "Contains"; + private String location = "Skyblock"; + private GuiButton startsWith; + private GuiButton contains; + private GuiButton endsWith; + private GuiButton regex; + private GuiButton everywhere; + private GuiButton skyblock; + private GuiButton dungeons; + private GuiTextField message; + private GuiTextField alert; + private GuiCheckBox desktop; + private GuiCheckBox toggled; + private GuiButton add; + + public AlertAddGui() {} + + public AlertAddGui(Alerts.Alert alert, int id) { + editing = true; + base = alert; + this.id = id; + } + + @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(); + + cancel = new GuiButton(0, 2, height - 30, 100, 20, "Cancel"); + + startsWith = new GuiButton(0, width / 2 - 260, (int) (height * 0.2), 120, 20, "Starts With"); + contains = new GuiButton(0, width / 2 - 130, (int) (height * 0.2), 120, 20, "Contains"); + endsWith = new GuiButton(0, width / 2 + 10, (int) (height * 0.2), 120, 20, "Ends With"); + regex = new GuiButton(0, width / 2 + 140, (int) (height * 0.2), 120, 20, "Regex"); + everywhere = new GuiButton(0, width / 2 - 200, (int) (height * 0.3), 120, 20, "Everywhere"); + skyblock = new GuiButton(0, width / 2 - 60, (int) (height * 0.3), 120, 20, "Skyblock"); + dungeons = new GuiButton(0, width / 2 + 80, (int) (height * 0.3), 120, 20, "Dungeons"); + message = new GuiTextField(0, this.fontRendererObj, width / 2 - 100, (int) (height * 0.4), 200, 20); + alert = new GuiTextField(0, this.fontRendererObj, width / 2 - 100, (int) (height * 0.5), 200, 20); + desktop = new GuiCheckBox(0, width / 2 - 58, (int) (height * 0.6), "Desktop Notification", false); + toggled = new GuiCheckBox(0, width / 2 - 26, (int) (height * 0.65), "Toggled", true); + add = new GuiButton(0, width / 2 - 25, (int) (height * 0.8), 50, 20, "Add"); + + if (editing) { + mode = base.mode; + location = base.location; + message.setText(base.message); + alert.setText(base.alert); + desktop.setIsChecked(base.desktop); + toggled.setIsChecked(base.toggled); + } + + message.setVisible(true); + message.setEnabled(true); + message.setMaxStringLength(100); + alert.setVisible(true); + alert.setEnabled(true); + alert.setMaxStringLength(100); + + this.buttonList.add(cancel); + this.buttonList.add(startsWith); + this.buttonList.add(contains); + this.buttonList.add(endsWith); + this.buttonList.add(regex); + this.buttonList.add(everywhere); + this.buttonList.add(skyblock); + this.buttonList.add(dungeons); + this.buttonList.add(desktop); + this.buttonList.add(toggled); + this.buttonList.add(add); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + super.drawScreen(mouseX, mouseY, partialTicks); + + message.drawTextBox(); + alert.drawTextBox(); + + RenderUtils.drawCenteredText("Mode: " + mode, width, (int) (height * 0.1), 1D); + RenderUtils.drawCenteredText("Location: " + location, width, (int) (height * 0.15), 1D); + new TextRenderer(mc, "Trigger:", width / 2 - 145, (int) (height * 0.42), 1D); + new TextRenderer(mc, "Alert Text:", width / 2 - 158, (int) (height * 0.52), 1D); + } + + @Override + public void actionPerformed(GuiButton button) { + if (button == cancel) { + mc.displayGuiScreen(new AlertsGui(1)); + } else if (button == startsWith) { + mode = "Starts With"; + } else if (button == contains) { + mode = "Contains"; + } else if (button == endsWith) { + mode = "Ends With"; + } else if (button == regex) { + mode = "Regex"; + } else if (button == everywhere) { + location = "Everywhere"; + } else if (button == skyblock) { + location = "Skyblock"; + } else if (button == dungeons) { + location = "Dungeons"; + } else if (button == add) { + Alerts.Alert newAlert = new Alerts.Alert(mode, location, message.getText(), alert.getText(), desktop.isChecked(), toggled.isChecked()); + if (editing) { + Alerts.alerts.set(id, newAlert); + } else { + Alerts.alerts.add(newAlert); + } + Alerts.save(); + mc.displayGuiScreen(new AlertsGui(1)); + } + } + + @Override + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { + super.mouseClicked(mouseX, mouseY, mouseButton); + message.mouseClicked(mouseX, mouseY, mouseButton); + alert.mouseClicked(mouseX, mouseY, mouseButton); + } + + @Override + protected void keyTyped(char typedChar, int keyCode) throws IOException { + super.keyTyped(typedChar, keyCode); + message.textboxKeyTyped(typedChar, keyCode); + alert.textboxKeyTyped(typedChar, keyCode); + } + +} diff --git a/src/main/java/me/Danker/gui/alerts/AlertsGui.java b/src/main/java/me/Danker/gui/alerts/AlertsGui.java new file mode 100644 index 0000000..d73d56a --- /dev/null +++ b/src/main/java/me/Danker/gui/alerts/AlertsGui.java @@ -0,0 +1,103 @@ +package me.Danker.gui.alerts; + +import me.Danker.commands.ToggleCommand; +import me.Danker.features.Alerts; +import me.Danker.gui.DankerGui; +import me.Danker.gui.buttons.FeatureButton; +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.RenderUtils; +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; + +import java.util.ArrayList; +import java.util.List; + +public class AlertsGui extends GuiScreen { + + private final int page; + private final List<GuiButton> allButtons = new ArrayList<>(); + + private GuiButton goBack; + private GuiButton backPage; + private GuiButton nextPage; + private GuiButton add; + private GuiButton alerts; + + public AlertsGui(int page) { + this.page = page; + } + + @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"); + backPage = new GuiButton(0, width / 2 - 100, (int) (height * 0.8), 80, 20, "< Back"); + nextPage = new GuiButton(0, width / 2 + 20, (int) (height * 0.8), 80, 20, "Next >"); + alerts = new FeatureButton("Alerts: " + Utils.getColouredBoolean(ToggleCommand.alerts), "Sends custom alert when a message is recieved"); + add = new GuiButton(0, 0, 0, "Add Alert"); + + allButtons.clear(); + allButtons.add(alerts); + allButtons.add(add); + for (int i = 0; i < Alerts.alerts.size(); i++) { + Alerts.Alert alert = Alerts.alerts.get(i); + GuiButton button = new GuiButton(i, 0, 0, alert.alert + " >"); + allButtons.add(button); + } + + reInit(); + } + + public void reInit() { + this.buttonList.clear(); + + for (int i = (page - 1) * 7, iteration = 0; iteration < 7 && i < allButtons.size(); i++, iteration++) { + GuiButton button = allButtons.get(i); + button.xPosition = width / 2 - 100; + button.yPosition = (int) (height * (0.1 * (iteration + 1))); + this.buttonList.add(button); + } + + if (page > 1) this.buttonList.add(backPage); + if (page < Math.ceil(allButtons.size() / 7D)) this.buttonList.add(nextPage); + + this.buttonList.add(goBack); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + super.drawScreen(mouseX, mouseY, partialTicks); + + String pageText = "Page: " + page + "/" + (int) Math.ceil(allButtons.size() / 7D); + RenderUtils.drawCenteredText(pageText, width, 10, 1D); + } + + @Override + public void actionPerformed(GuiButton button) { + if (button == goBack) { + mc.displayGuiScreen(new DankerGui(1, "")); + } else if (button == nextPage) { + mc.displayGuiScreen(new AlertsGui(page + 1)); + } else if (button == backPage) { + mc.displayGuiScreen(new AlertsGui(page - 1)); + } else if (button == add) { + mc.displayGuiScreen(new AlertAddGui()); + } else if (button == alerts) { + ToggleCommand.alerts = !ToggleCommand.alerts; + ConfigHandler.writeBooleanConfig("toggles", "Alerts", ToggleCommand.alerts); + alerts.displayString = "Alerts: " + Utils.getColouredBoolean(ToggleCommand.alerts); + } else { + mc.displayGuiScreen(new AlertActionGui(button.id)); + } + } + +} diff --git a/src/main/java/me/Danker/gui/aliases/AliasesActionGui.java b/src/main/java/me/Danker/gui/aliases/AliasesActionGui.java new file mode 100644 index 0000000..d2c7a6a --- /dev/null +++ b/src/main/java/me/Danker/gui/aliases/AliasesActionGui.java @@ -0,0 +1,81 @@ +package me.Danker.gui.aliases; + +import me.Danker.features.ChatAliases; +import me.Danker.utils.RenderUtils; +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; +import net.minecraft.util.EnumChatFormatting; + +public class AliasesActionGui extends GuiScreen { + + private final int id; + + private GuiButton goBack; + private GuiButton toggle; + private GuiButton edit; + private GuiButton delete; + + public AliasesActionGui(int id) { + this.id = id; + } + + @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(); + + ChatAliases.Alias alias = ChatAliases.aliases.get(id); + + goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back"); + toggle = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Enabled: " + Utils.getColouredBoolean(alias.toggled)); + edit = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Edit >"); + delete = new GuiButton(0, width / 2 - 100, (int) (height * 0.8), EnumChatFormatting.RED + "Delete Alias"); + + this.buttonList.add(toggle); + this.buttonList.add(edit); + this.buttonList.add(delete); + this.buttonList.add(goBack); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + super.drawScreen(mouseX, mouseY, partialTicks); + + ChatAliases.Alias alias = ChatAliases.aliases.get(id); + + RenderUtils.drawCenteredText(alias.text, width, 10, 1D); + } + + @Override + public void actionPerformed(GuiButton button) { + ChatAliases.Alias alias = ChatAliases.aliases.get(id); + if (button == goBack) { + mc.displayGuiScreen(new AliasesGui(1)); + } else if (button == toggle) { + alias.toggle(); + toggle.displayString = "Enabled: " + Utils.getColouredBoolean(alias.toggled); + } else if (button == edit) { + mc.displayGuiScreen(new AliasesAddGui(alias, id)); + } else if (button == delete) { + ChatAliases.aliases.remove(id); + ChatAliases.save(); + mc.displayGuiScreen(new AliasesGui(1)); + return; + } + ChatAliases.aliases.set(id, alias); + ChatAliases.save(); + } + +} diff --git a/src/main/java/me/Danker/gui/aliases/AliasesAddGui.java b/src/main/java/me/Danker/gui/aliases/AliasesAddGui.java new file mode 100644 index 0000000..610354a --- /dev/null +++ b/src/main/java/me/Danker/gui/aliases/AliasesAddGui.java @@ -0,0 +1,115 @@ +package me.Danker.gui.aliases; + +import me.Danker.features.ChatAliases; +import me.Danker.handlers.TextRenderer; +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.minecraftforge.fml.client.config.GuiCheckBox; + +import java.io.IOException; + +public class AliasesAddGui extends GuiScreen { + + private boolean editing; + private ChatAliases.Alias base = null; + private int id; + + private GuiButton cancel; + + private GuiTextField text; + private GuiTextField alias; + private GuiCheckBox toggled; + private GuiButton add; + + public AliasesAddGui() {} + + public AliasesAddGui(ChatAliases.Alias alias, int id) { + editing = true; + base = alias; + this.id = id; + } + + @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(); + + cancel = new GuiButton(0, 2, height - 30, 100, 20, "Cancel"); + + + text = new GuiTextField(0, this.fontRendererObj, width / 2 - 100, (int) (height * 0.2), 200, 20); + alias = new GuiTextField(0, this.fontRendererObj, width / 2 - 100, (int) (height * 0.3), 200, 20); + toggled = new GuiCheckBox(0, width / 2 - 26, (int) (height * 0.4), "Toggled", true); + add = new GuiButton(0, width / 2 - 25, (int) (height * 0.8), 50, 20, "Add"); + + if (editing) { + text.setText(base.text); + alias.setText(base.alias); + toggled.setIsChecked(base.toggled); + } + + text.setVisible(true); + text.setEnabled(true); + alias.setVisible(true); + alias.setEnabled(true); + alias.setMaxStringLength(100); + + this.buttonList.add(cancel); + this.buttonList.add(toggled); + this.buttonList.add(add); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + super.drawScreen(mouseX, mouseY, partialTicks); + + text.drawTextBox(); + alias.drawTextBox(); + + new TextRenderer(mc, "Text:", width / 2 - 135, (int) (height * 0.22), 1D); + new TextRenderer(mc, "Alias:", width / 2 - 137, (int) (height * 0.32), 1D); + } + + @Override + public void actionPerformed(GuiButton button) { + if (button == cancel) { + mc.displayGuiScreen(new AliasesGui(1)); + } else if (button == add) { + ChatAliases.Alias newAlias = new ChatAliases.Alias(text.getText(), alias.getText(), toggled.isChecked()); + if (editing) { + ChatAliases.aliases.set(id, newAlias); + } else { + ChatAliases.aliases.add(newAlias); + } + ChatAliases.save(); + mc.displayGuiScreen(new AliasesGui(1)); + } + } + + @Override + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { + super.mouseClicked(mouseX, mouseY, mouseButton); + text.mouseClicked(mouseX, mouseY, mouseButton); + alias.mouseClicked(mouseX, mouseY, mouseButton); + } + + @Override + protected void keyTyped(char typedChar, int keyCode) throws IOException { + super.keyTyped(typedChar, keyCode); + text.textboxKeyTyped(typedChar, keyCode); + alias.textboxKeyTyped(typedChar, keyCode); + } + +} diff --git a/src/main/java/me/Danker/gui/aliases/AliasesGui.java b/src/main/java/me/Danker/gui/aliases/AliasesGui.java new file mode 100644 index 0000000..f5b863a --- /dev/null +++ b/src/main/java/me/Danker/gui/aliases/AliasesGui.java @@ -0,0 +1,108 @@ +package me.Danker.gui.aliases; + +import me.Danker.commands.ToggleCommand; +import me.Danker.features.ChatAliases; +import me.Danker.gui.DankerGui; +import me.Danker.gui.buttons.FeatureButton; +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.RenderUtils; +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; + +import java.util.ArrayList; +import java.util.List; + +public class AliasesGui extends GuiScreen { + + private final int page; + private final List<GuiButton> allButtons = new ArrayList<>(); + + private GuiButton goBack; + private GuiButton backPage; + private GuiButton nextPage; + private GuiButton add; + private GuiButton aliases; + + public AliasesGui(int page) { + this.page = page; + } + + @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"); + backPage = new GuiButton(0, width / 2 - 100, (int) (height * 0.8), 80, 20, "< Back"); + nextPage = new GuiButton(0, width / 2 + 20, (int) (height * 0.8), 80, 20, "Next >"); + aliases = new FeatureButton("Aliases: " + Utils.getColouredBoolean(ToggleCommand.aliases), "Replaces text in chat with an alias"); + add = new GuiButton(0, 0, 0, "Add Alias"); + + allButtons.clear(); + allButtons.add(aliases); + allButtons.add(add); + for (int i = 0; i < ChatAliases.aliases.size(); i++) { + ChatAliases.Alias alias = ChatAliases.aliases.get(i); + GuiButton button = new GuiButton(i, 0, 0, alias.text + " >"); + allButtons.add(button); + } + + reInit(); + } + + public void reInit() { + this.buttonList.clear(); + + for (int i = (page - 1) * 7, iteration = 0; iteration < 7 && i < allButtons.size(); i++, iteration++) { + GuiButton button = allButtons.get(i); + button.xPosition = width / 2 - 100; + button.yPosition = (int) (height * (0.1 * (iteration + 1))); + this.buttonList.add(button); + } + + if (page > 1) this.buttonList.add(backPage); + if (page < Math.ceil(allButtons.size() / 7D)) this.buttonList.add(nextPage); + + this.buttonList.add(goBack); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + super.drawScreen(mouseX, mouseY, partialTicks); + + String pageText = "Page: " + page + "/" + (int) Math.ceil(allButtons.size() / 7D); + RenderUtils.drawCenteredText(pageText, width, 10, 1D); + } + + @Override + public void actionPerformed(GuiButton button) { + if (button == goBack) { + mc.displayGuiScreen(new DankerGui(1, "")); + } else if (button == nextPage) { + mc.displayGuiScreen(new AliasesGui(page + 1)); + } else if (button == backPage) { + mc.displayGuiScreen(new AliasesGui(page - 1)); + } else if (button == add) { + mc.displayGuiScreen(new AliasesAddGui()); + } else if (button == aliases) { + ToggleCommand.aliases = !ToggleCommand.aliases; + ConfigHandler.writeBooleanConfig("toggles", "Aliases", ToggleCommand.aliases); + aliases.displayString = "Aliases: " + Utils.getColouredBoolean(ToggleCommand.aliases); + } else { + mc.displayGuiScreen(new AliasesActionGui(button.id)); + } + } + +} diff --git a/src/main/java/me/Danker/gui/buttons/FeatureButton.java b/src/main/java/me/Danker/gui/buttons/FeatureButton.java new file mode 100644 index 0000000..a997e09 --- /dev/null +++ b/src/main/java/me/Danker/gui/buttons/FeatureButton.java @@ -0,0 +1,17 @@ +package me.Danker.gui.buttons; + +import net.minecraft.client.gui.GuiButton; + +import java.util.Arrays; +import java.util.List; + +public class FeatureButton extends GuiButton { + + public List<String> hoverText; + + public FeatureButton(String displayString, String hoverText) { + super(0, 0, 0, displayString); + this.hoverText = Arrays.asList(hoverText.split("\n")); + } + +} diff --git a/src/main/java/me/Danker/gui/buttons/LocationButton.java b/src/main/java/me/Danker/gui/buttons/LocationButton.java index a8937fd..533bf83 100644 --- a/src/main/java/me/Danker/gui/buttons/LocationButton.java +++ b/src/main/java/me/Danker/gui/buttons/LocationButton.java @@ -13,21 +13,17 @@ public class LocationButton extends GuiButton { private String text; private String text2; private Integer text2Offset; + private int longestText; - public LocationButton(int buttonId, int x, int y, double width, double height, double scale, String text, String text2, Integer text2Offset) { - super(buttonId, x, y, text); + public LocationButton(int x, int y, double scale, String text, String text2, Integer text2Offset) { + super(0, x, y, text); this.x = x; this.y = y; - this.width = (int) width; - this.height = (int) height; this.scale = scale; this.text = text; this.text2 = text2; this.text2Offset = text2Offset; - } - - @Override - public void drawButton(Minecraft mc, int mouseX, int mouseY) { + String[] splitText; if (text2 == null) { splitText = text.split("\n"); @@ -37,24 +33,30 @@ public class LocationButton extends GuiButton { int longestText = -1; for (String s : splitText) { - int stringLength = mc.fontRendererObj.getStringWidth(s); + int stringLength = Minecraft.getMinecraft().fontRendererObj.getStringWidth(s); if (stringLength > longestText) { longestText = stringLength; } } - - if (text2 == null) { - drawRect(x - 2, y - 2, (int) (x + longestText * scale + 3), (int) (y + (splitText.length * 9 + 3) * scale), 0x40D3D3D3); - } else { - drawRect(x - 2, y - 2, (int) (x + (longestText + text2Offset) * scale + 3), (int) (y + (splitText.length * 9 + 3) * scale), 0x40D3D3D3); - new TextRenderer(mc, text2, (int) (x + (text2Offset * scale)), y, scale); - } - new TextRenderer(mc, text, x, y, scale); + + this.longestText = longestText; + int offset = text2Offset == null ? 0 : text2Offset; + this.height = (int) ((splitText.length * 9 + 3) * scale); + this.width = (int) ((this.longestText + offset + 3) * scale); + } + + public LocationButton(int x, int y, double scale, String text) { + this(x, y, scale, text, null, null); } @Override - public void playPressSound(SoundHandler soundHandler) { - + public void drawButton(Minecraft mc, int mouseX, int mouseY) { + drawRect(x - 2, y - 2, x + width, y + height, 0x40D3D3D3); + if (text2 != null) new TextRenderer(mc, text2, (int) (x + (text2Offset * scale)), y, scale); + new TextRenderer(mc, text, x, y, scale); } + @Override + public void playPressSound(SoundHandler soundHandler) {} + } diff --git a/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowAddWaypointGui.java b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowAddWaypointGui.java new file mode 100644 index 0000000..52c0fba --- /dev/null +++ b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowAddWaypointGui.java @@ -0,0 +1,133 @@ +package me.Danker.gui.crystalhollowwaypoints; + +import me.Danker.features.CrystalHollowWaypoints; +import me.Danker.handlers.TextRenderer; +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.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; + +import java.io.IOException; + +public class CrystalHollowAddWaypointGui extends GuiScreen { + + private GuiButton cancel; + + private GuiTextField name; + private GuiButton curPos; + private GuiTextField x; + private GuiTextField y; + private GuiTextField z; + private GuiButton add; + + private int xPos = -1; + private int yPos = -1; + private int zPos = -1; + + public CrystalHollowAddWaypointGui() {} + + public CrystalHollowAddWaypointGui(int x, int y, int z) { + xPos = x; + yPos = y; + zPos = z; + } + + @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(); + + cancel = new GuiButton(0, 2, height - 30, 100, 20, "Cancel"); + + name = new GuiTextField(0, this.fontRendererObj, width / 2 - 100, (int) (height * 0.1), 200, 20); + curPos = new GuiButton(0, width / 2 - 50, (int) (height * 0.25), 100, 20, "Current Position"); + x = new GuiTextField(0, this.fontRendererObj, width / 2 - 85, (int) (height * 0.4), 50, 20); + y = new GuiTextField(0, this.fontRendererObj, width / 2 - 25, (int) (height * 0.4), 50, 20); + z = new GuiTextField(0, this.fontRendererObj, width / 2 + 35, (int) (height * 0.4), 50, 20); + add = new GuiButton(0, width / 2 - 25, (int) (height * 0.6), 50, 20, "Add"); + + name.setVisible(true); + name.setEnabled(true); + x.setVisible(true); + x.setEnabled(true); + if (xPos != -1) x.setText(xPos + ""); + y.setVisible(true); + y.setEnabled(true); + if (yPos != -1) y.setText(yPos + ""); + z.setVisible(true); + z.setEnabled(true); + if (zPos != -1) z.setText(zPos + ""); + + this.buttonList.add(cancel); + this.buttonList.add(curPos); + this.buttonList.add(add); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + super.drawScreen(mouseX, mouseY, partialTicks); + + name.drawTextBox(); + x.drawTextBox(); + y.drawTextBox(); + z.drawTextBox(); + + new TextRenderer(mc, "X:", width / 2 - 85, (int) (height * 0.35), 1D); + new TextRenderer(mc, "Y:", width / 2 - 25, (int) (height * 0.35), 1D); + new TextRenderer(mc, "Z:", width / 2 + 35, (int) (height * 0.35), 1D); + } + + @Override + public void actionPerformed(GuiButton button) { + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + + if (button == cancel) { + mc.displayGuiScreen(new CrystalHollowWaypointsGui(1)); + } else if (button == curPos) { + x.setText(Integer.toString(player.getPosition().getX())); + y.setText(Integer.toString(player.getPosition().getY())); + z.setText(Integer.toString(player.getPosition().getZ())); + } else if (button == add) { + String loc = name.getText().length() == 0 ? Integer.toString(CrystalHollowWaypoints.waypoints.size()) : name.getText(); + int xPos = x.getText().matches("[-]?\\d+") ? Integer.parseInt(x.getText()) : player.getPosition().getX(); + int yPos = y.getText().matches("[-]?\\d+") ? Integer.parseInt(y.getText()) : player.getPosition().getY(); + int zPos = z.getText().matches("[-]?\\d+") ? Integer.parseInt(z.getText()) : player.getPosition().getZ(); + + BlockPos pos = new BlockPos(xPos, yPos, zPos); + CrystalHollowWaypoints.waypoints.add(new CrystalHollowWaypoints.Waypoint(loc, pos)); + + mc.displayGuiScreen(new CrystalHollowWaypointsGui(1)); + } + } + + @Override + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { + super.mouseClicked(mouseX, mouseY, mouseButton); + name.mouseClicked(mouseX, mouseY, mouseButton); + x.mouseClicked(mouseX, mouseY, mouseButton); + y.mouseClicked(mouseX, mouseY, mouseButton); + z.mouseClicked(mouseX, mouseY, mouseButton); + } + + @Override + protected void keyTyped(char typedChar, int keyCode) throws IOException { + super.keyTyped(typedChar, keyCode); + name.textboxKeyTyped(typedChar, keyCode); + x.textboxKeyTyped(typedChar, keyCode); + y.textboxKeyTyped(typedChar, keyCode); + z.textboxKeyTyped(typedChar, keyCode); + } + +} diff --git a/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointActionGui.java b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointActionGui.java new file mode 100644 index 0000000..8d6fa85 --- /dev/null +++ b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointActionGui.java @@ -0,0 +1,93 @@ +package me.Danker.gui.crystalhollowwaypoints; + +import me.Danker.DankersSkyblockMod; +import me.Danker.features.CrystalHollowWaypoints; +import me.Danker.utils.RenderUtils; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.util.EnumChatFormatting; + +public class CrystalHollowWaypointActionGui extends GuiScreen { + + private int id; + + private GuiButton goBack; + private GuiButton toggle; + private GuiButton sendNormal; + private GuiButton sendDSM; + private GuiButton sendSBE; + private GuiButton delete; + + public CrystalHollowWaypointActionGui(int id) { + this.id = id; + } + + @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(); + + CrystalHollowWaypoints.Waypoint waypoint = CrystalHollowWaypoints.waypoints.get(id); + + goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back"); + toggle = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Set Visibility: " + Utils.getColouredBoolean(waypoint.toggled)); + sendNormal = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Send Location And Coordinates"); + sendDSM = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Send DSM Formatted Waypoint"); + sendSBE = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Send SBE Formatted Waypoint"); + delete = new GuiButton(0, width / 2 - 100, (int) (height * 0.8), EnumChatFormatting.RED + "Delete Waypoint"); + + this.buttonList.add(toggle); + this.buttonList.add(sendNormal); + this.buttonList.add(sendDSM); + this.buttonList.add(sendSBE); + this.buttonList.add(delete); + this.buttonList.add(goBack); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + super.drawScreen(mouseX, mouseY, partialTicks); + + CrystalHollowWaypoints.Waypoint waypoint = CrystalHollowWaypoints.waypoints.get(id); + + RenderUtils.drawCenteredText(waypoint.location + " @ " + waypoint.getPos(), width, 10, 1D); + } + + @Override + public void actionPerformed(GuiButton button) { + CrystalHollowWaypoints.Waypoint waypoint = CrystalHollowWaypoints.waypoints.get(id); + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + if (button == goBack) { + mc.displayGuiScreen(new CrystalHollowWaypointsGui(1)); + DankersSkyblockMod.guiToOpen = "crystalwaypoints"; + } else if (button == toggle) { + waypoint.toggle(); + toggle.displayString = "Set Visibility: " + Utils.getColouredBoolean(waypoint.toggled); + } else if (button == sendNormal) { + player.sendChatMessage(waypoint.location + " @ " + waypoint.getPos()); + } else if (button == sendDSM) { + player.sendChatMessage("$DSMCHWP:" + waypoint.getFormattedWaypoint()); + } else if (button == sendSBE) { + player.sendChatMessage("$SBECHWP:" + waypoint.getFormattedWaypoint()); + } else if (button == delete) { + CrystalHollowWaypoints.waypoints.remove(id); + mc.displayGuiScreen(new CrystalHollowWaypointsGui(1)); + return; + } + CrystalHollowWaypoints.waypoints.set(id, waypoint); + } + +} diff --git a/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java new file mode 100644 index 0000000..6780542 --- /dev/null +++ b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java @@ -0,0 +1,150 @@ +package me.Danker.gui.crystalhollowwaypoints; + +import me.Danker.commands.ToggleCommand; +import me.Danker.features.CrystalHollowWaypoints; +import me.Danker.gui.DankerGui; +import me.Danker.gui.buttons.FeatureButton; +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.RenderUtils; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; + +import java.util.ArrayList; +import java.util.List; + +public class CrystalHollowWaypointsGui extends GuiScreen { + + private final int page; + private final List<GuiButton> allButtons = new ArrayList<>(); + + private GuiButton goBack; + private GuiButton backPage; + private GuiButton nextPage; + private GuiButton sendDSM; + private GuiButton sendSBE; + private GuiButton add; + private FeatureButton crystalHollowWaypoints; + private FeatureButton crystalAutoWaypoints; + private FeatureButton crystalAutoPlayerWaypoints; + + public CrystalHollowWaypointsGui(int page) { + this.page = page; + } + + @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"); + backPage = new GuiButton(0, width / 2 - 100, (int) (height * 0.8), 80, 20, "< Back"); + nextPage = new GuiButton(0, width / 2 + 20, (int) (height * 0.8), 80, 20, "Next >"); + sendDSM = new GuiButton(0, 2, 10, 175, 20, "Send DSM Formatted Waypoints"); + sendSBE = new GuiButton(0, 2, 40, 175, 20, "Send SBE Formatted Waypoints"); + add = new GuiButton(0, 0, 0, "Add Waypoint"); + crystalHollowWaypoints = new FeatureButton("Crystal Hollows Waypoints: " + Utils.getColouredBoolean(ToggleCommand.crystalHollowWaypoints), "Shows waypoints to various places in the Crystal Hollows."); + crystalAutoWaypoints = new FeatureButton("Auto Waypoints: " + Utils.getColouredBoolean(ToggleCommand.crystalAutoWaypoints), "Automatically creates waypoints when you visit a special place in the Crystal Hollows."); + crystalAutoPlayerWaypoints = new FeatureButton("Auto Add Player Waypoints: " + Utils.getColouredBoolean(ToggleCommand.crystalAutoPlayerWaypoints), "Automatically adds waypoints sent from players."); + + allButtons.clear(); + allButtons.add(add); + allButtons.add(crystalHollowWaypoints); + allButtons.add(crystalAutoWaypoints); + allButtons.add(crystalAutoPlayerWaypoints); + for (int i = 0; i < CrystalHollowWaypoints.waypoints.size(); i++) { + CrystalHollowWaypoints.Waypoint waypoint = CrystalHollowWaypoints.waypoints.get(i); + GuiButton button = new GuiButton(i, 0, 0, waypoint.location + " >"); + allButtons.add(button); + } + + reInit(); + } + + public void reInit() { + this.buttonList.clear(); + + for (int i = (page - 1) * 7, iteration = 0; iteration < 7 && i < allButtons.size(); i++, iteration++) { + GuiButton button = allButtons.get(i); + button.xPosition = width / 2 - 100; + button.yPosition = (int) (height * (0.1 * (iteration + 1))); + this.buttonList.add(button); + } + + if (page > 1) this.buttonList.add(backPage); + if (page < Math.ceil(allButtons.size() / 7D)) this.buttonList.add(nextPage); + + this.buttonList.add(goBack); + this.buttonList.add(sendDSM); + this.buttonList.add(sendSBE); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + super.drawScreen(mouseX, mouseY, partialTicks); + + String pageText = "Page: " + page + "/" + (int) Math.ceil(allButtons.size() / 7D); + RenderUtils.drawCenteredText(pageText, width, 10, 1D); + } + + @Override + public void actionPerformed(GuiButton button) { + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + if (button == goBack) { + mc.displayGuiScreen(new DankerGui(1, "")); + } else if (button == nextPage) { + mc.displayGuiScreen(new CrystalHollowWaypointsGui(page + 1)); + } else if (button == backPage) { + mc.displayGuiScreen(new CrystalHollowWaypointsGui(page - 1)); + } else if (button == sendDSM) { + if (CrystalHollowWaypoints.waypoints.size() > 0) { + StringBuilder message = new StringBuilder(); + for (CrystalHollowWaypoints.Waypoint waypoint : CrystalHollowWaypoints.waypoints) { + if (message.length() > 0) message.append("\\n"); + message.append(waypoint.getFormattedWaypoint()); + } + message.insert(0, "$DSMCHWP:"); + player.sendChatMessage(message.toString()); + } + } else if (button == sendSBE) { + if (CrystalHollowWaypoints.waypoints.size() > 0) { + StringBuilder message = new StringBuilder(); + for (CrystalHollowWaypoints.Waypoint waypoint : CrystalHollowWaypoints.waypoints) { + if (message.length() > 0) message.append("\\n"); + message.append(waypoint.getFormattedWaypoint()); + } + message.insert(0, "$SBECHWP:"); + player.sendChatMessage(message.toString()); + } + } else if (button == add) { + mc.displayGuiScreen(new CrystalHollowAddWaypointGui()); + } else if (button == crystalHollowWaypoints) { + ToggleCommand.crystalHollowWaypoints = !ToggleCommand.crystalHollowWaypoints; + ConfigHandler.writeBooleanConfig("toggles", "CrystalHollowWaypoints", ToggleCommand.crystalHollowWaypoints); + crystalHollowWaypoints.displayString = "Crystal Hollows Waypoints: " + Utils.getColouredBoolean(ToggleCommand.crystalHollowWaypoints); + } else if (button == crystalAutoWaypoints) { + ToggleCommand.crystalAutoWaypoints = !ToggleCommand.crystalAutoWaypoints; + ConfigHandler.writeBooleanConfig("toggles", "CrystalAutoWaypoints", ToggleCommand.crystalAutoWaypoints); + crystalAutoWaypoints.displayString = "Auto Waypoints: " + Utils.getColouredBoolean(ToggleCommand.crystalAutoWaypoints); + } else if (button == crystalAutoPlayerWaypoints) { + ToggleCommand.crystalAutoPlayerWaypoints = !ToggleCommand.crystalAutoPlayerWaypoints; + ConfigHandler.writeBooleanConfig("toggles", "CrystalAutoPlayerWaypoints", ToggleCommand.crystalAutoPlayerWaypoints); + crystalAutoPlayerWaypoints.displayString = "Auto Add Player Waypoints: " + Utils.getColouredBoolean(ToggleCommand.crystalAutoPlayerWaypoints); + } else { + mc.displayGuiScreen(new CrystalHollowWaypointActionGui(button.id)); + } + } + +} |