diff options
author | CuzImClicks <bruno778.whiteelfie@gmail.com> | 2021-04-30 08:24:42 +0200 |
---|---|---|
committer | CuzImClicks <bruno778.whiteelfie@gmail.com> | 2021-04-30 08:24:42 +0200 |
commit | a5572571f43ab3bd89c08678bba3050672be7615 (patch) | |
tree | 5169f378416544c0436186b5770d0d88fd26c981 /src/main/java/me/Danker/gui | |
parent | 09622e51e46d6772e9017bfa9bb544616ebba8b7 (diff) | |
parent | d79def85f593605e0ac2ff59232449b4a8446bb8 (diff) | |
download | SkyblockMod-a5572571f43ab3bd89c08678bba3050672be7615.tar.gz SkyblockMod-a5572571f43ab3bd89c08678bba3050672be7615.tar.bz2 SkyblockMod-a5572571f43ab3bd89c08678bba3050672be7615.zip |
Merge branch 'development' of https://github.com/bowser0000/SkyblockMod into development
Diffstat (limited to 'src/main/java/me/Danker/gui')
-rw-r--r-- | src/main/java/me/Danker/gui/DankerGui.java | 113 | ||||
-rw-r--r-- | src/main/java/me/Danker/gui/EditLocationsGui.java | 58 | ||||
-rw-r--r-- | src/main/java/me/Danker/gui/buttons/FeatureButton.java | 17 | ||||
-rw-r--r-- | src/main/java/me/Danker/gui/buttons/LocationButton.java | 27 |
4 files changed, 158 insertions, 57 deletions
diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 22cc001..11e8bfa 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -2,10 +2,16 @@ package me.Danker.gui; import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; +import me.Danker.gui.buttons.FeatureButton; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.client.gui.*; import net.minecraft.util.StringUtils; @@ -57,6 +63,10 @@ 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; // Chat Messages private GuiButton sceptreMessages; @@ -107,42 +117,47 @@ public class DankerGui extends GuiScreen { 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)); - highlightCommissions = new GuiButton(0, 0, 0, "Highlight Commissions: " + Utils.getColouredBoolean(ToggleCommand.highlightCommissions)); + 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."); + 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."); + notifySlayerSlain = new FeatureButton("Notify when Slayer Slain: " + Utils.getColouredBoolean(ToggleCommand.notifySlayerSlainToggled), "Alerts when slayer boss has been slain."); + necronNotifications = new FeatureButton("Necron Phase Notifications: " + Utils.getColouredBoolean(ToggleCommand.necronNotificationsToggled), "Creates alert on different phases of the Necron 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."); + allButtons.clear(); allButtons.add(changeDisplay); allButtons.add(puzzleSolvers); allButtons.add(experimentationTableSolvers); @@ -182,6 +197,10 @@ 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); search.setText(initSearchText); @@ -231,6 +250,13 @@ public class DankerGui extends GuiScreen { int pageWidth = mc.fontRendererObj.getStringWidth(pageText); new TextRenderer(mc, pageText, width / 2 - pageWidth / 2, 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(); } @@ -402,6 +428,22 @@ 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); @@ -419,6 +461,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/EditLocationsGui.java b/src/main/java/me/Danker/gui/EditLocationsGui.java index 3a7c94b..fed6ee9 100644 --- a/src/main/java/me/Danker/gui/EditLocationsGui.java +++ b/src/main/java/me/Danker/gui/EditLocationsGui.java @@ -29,6 +29,8 @@ public class EditLocationsGui extends GuiScreen { private LocationButton waterAnswer; private LocationButton bonzoTimer; private LocationButton golemTimer; + private LocationButton teammatesInRadius; + private LocationButton giantHP; @Override public boolean doesGuiPauseGame() { @@ -86,16 +88,30 @@ 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 + "❤"; + + + 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)", null, null); + 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%", null, null); + lividHP = new LocationButton(MoveCommand.lividHpXY[0], MoveCommand.lividHpXY[1], ScaleCommand.lividHpScale, EnumChatFormatting.WHITE + "﴾ Livid " + EnumChatFormatting.YELLOW + "6.9M" + EnumChatFormatting.RED + "❤ " + EnumChatFormatting.WHITE + "﴿", null, null); + cakeTimer = new LocationButton(MoveCommand.cakeTimerXY[0], MoveCommand.cakeTimerXY[1] + 5, ScaleCommand.cakeTimerScale, CakeTimer.CAKE_COLOUR + " 11h16m", null, null); + skillTracker = new LocationButton(MoveCommand.skillTrackerXY[0], MoveCommand.skillTrackerXY[1], ScaleCommand.skillTrackerScale, skillTrackerText, null, null); + waterAnswer = new LocationButton(MoveCommand.waterAnswerXY[0], MoveCommand.waterAnswerXY[1], ScaleCommand.waterAnswerScale, waterAnswerText, null, null); + bonzoTimer = new LocationButton(MoveCommand.bonzoTimerXY[0], MoveCommand.bonzoTimerXY[1] + 5, ScaleCommand.bonzoTimerScale, BonzoMaskTimer.BONZO_COLOR + " 3m30s", null, null); + golemTimer = new LocationButton(MoveCommand.golemTimerXY[0], MoveCommand.golemTimerXY[1] + 5, ScaleCommand.golemTimerScale, GolemSpawningAlert.GOLEM_COLOUR + " 20s", null, null); + teammatesInRadius = new LocationButton(MoveCommand.teammatesInRadiusXY[0], MoveCommand.teammatesInRadiusXY[1], ScaleCommand.teammatesInRadiusScale, teammatesInRadiusText, null, null); + giantHP = new LocationButton(MoveCommand.giantHPXY[0], MoveCommand.giantHPXY[1], ScaleCommand.giantHPScale, giantHPText, null, null); this.buttonList.add(coords); this.buttonList.add(dungeonTimer); @@ -107,6 +123,8 @@ 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); } @Override @@ -204,6 +222,18 @@ 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; } this.buttonList.clear(); initGui(); @@ -236,6 +266,10 @@ 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"; } } } @@ -264,6 +298,10 @@ 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]); } } 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..f328c58 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,16 +33,23 @@ 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; } } - + + this.longestText = longestText; + this.height = (int) ((splitText.length * 9 + 3) * scale); + this.width = (int) ((this.longestText + 3) * scale); + } + + @Override + public void drawButton(Minecraft mc, int mouseX, int mouseY) { if (text2 == null) { - drawRect(x - 2, y - 2, (int) (x + longestText * scale + 3), (int) (y + (splitText.length * 9 + 3) * scale), 0x40D3D3D3); + drawRect(x - 2, y - 2, x + width, y + height, 0x40D3D3D3); } else { - drawRect(x - 2, y - 2, (int) (x + (longestText + text2Offset) * scale + 3), (int) (y + (splitText.length * 9 + 3) * scale), 0x40D3D3D3); + drawRect(x - 2, y - 2, (int) (x + (longestText + text2Offset + 3) * scale), y + height, 0x40D3D3D3); new TextRenderer(mc, text2, (int) (x + (text2Offset * scale)), y, scale); } new TextRenderer(mc, text, x, y, scale); |