From afcce659fac73e9c1d453a8b4d7f149bc4dd8e60 Mon Sep 17 00:00:00 2001 From: Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> Date: Thu, 20 Jun 2024 23:02:53 +0200 Subject: Fix: ChocoFactory Custom Reminder trigger on TimeTower charge use. (#2126) --- .../chocolatefactory/ChocolateFactoryCustomReminder.kt | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features') diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryCustomReminder.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryCustomReminder.kt index 2439641c3..d903c4f0b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryCustomReminder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryCustomReminder.kt @@ -63,6 +63,7 @@ object ChocolateFactoryCustomReminder { fun onSlotClick(event: GuiContainerEvent.SlotClickEvent) { if (!isEnabled()) return val item = event.item ?: return + if (event.clickedButton != 0) return // TODO add support for prestige and for Chocolate Milestone val cost = ChocolateFactoryAPI.getChocolateBuyCost(item.getLore()) ?: return val duration = ChocolateAmount.CURRENT.timeUntilGoal(cost) @@ -110,9 +111,14 @@ object ChocolateFactoryCustomReminder { private fun update() { display = mutableListOf().also { list -> getTargetDescription()?.let { - list.add(Renderable.clickAndHover(it, listOf("§eClick to remove the goal!"), onClick = { - reset() - })) + list.add( + Renderable.clickAndHover( + it, listOf("§eClick to remove the goal!"), + onClick = { + reset() + }, + ), + ) } } } @@ -138,10 +144,12 @@ object ChocolateFactoryCustomReminder { if (configUpgradeWarnings.upgradeWarningSound) { SoundUtils.playBeepSound() } - ChatUtils.clickableChat("You can now purchase §f$targetName §ein Chocolate factory!", + ChatUtils.clickableChat( + "You can now purchase §f$targetName §ein Chocolate factory!", onClick = { HypixelCommands.chocolateFactory() - }) + }, + ) } private fun reset() { -- cgit