diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-10-02 20:00:31 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-10-02 20:00:31 +0200 |
commit | fdd5bb7acd10c2ab51b76a3ec47a9ac8405021e2 (patch) | |
tree | b77a542f77549bc5e93e4f678264ca833572227d /src | |
parent | b45002ecafb9fd212d3c956dcd7b2249d6607a8b (diff) | |
download | skyhanni-fdd5bb7acd10c2ab51b76a3ec47a9ac8405021e2.tar.gz skyhanni-fdd5bb7acd10c2ab51b76a3ec47a9ac8405021e2.tar.bz2 skyhanni-fdd5bb7acd10c2ab51b76a3ec47a9ac8405021e2.zip |
code cleanup
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarApi.kt | 9 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarCancelledBuyOrderClipboard.kt | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarApi.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarApi.kt index afd5900f7..25ddb8dac 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarApi.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarApi.kt @@ -66,13 +66,13 @@ object BazaarApi { searchForBazaarItem(internalName.itemNameWithoutColor, amount) } - fun searchForBazaarItem(displayName: String, amount: Int = -1) { + fun searchForBazaarItem(displayName: String, amount: Int? = null) { if (!LorenzUtils.inSkyBlock) return if (NEUItems.neuHasFocus()) return if (LorenzUtils.noTradeMode) return if (DungeonAPI.inDungeon() || LorenzUtils.inKuudraFight) return HypixelCommands.bazaar(displayName.removeColor()) - if (amount != -1) OSUtils.copyToClipboard(amount.toString()) + amount?.let { OSUtils.copyToClipboard(it.toString()) } currentSearchedItem = displayName.removeColor() } @@ -96,12 +96,12 @@ object BazaarApi { orderOptionProduct = internalName } else if (itemName.contains("BUY")) { // pickup items from bazaar order - OwnInventoryData.ignoreItem(1.seconds, { it == internalName }) + OwnInventoryData.ignoreItem(1.seconds) { it == internalName } } } if (InventoryUtils.openInventoryName() == "Order options" && itemName == "§cCancel Order") { // pickup items from own bazaar order - OwnInventoryData.ignoreItem(1.seconds, { it == orderOptionProduct }) + OwnInventoryData.ignoreItem(1.seconds) { it == orderOptionProduct } } } @@ -123,6 +123,7 @@ object BazaarApi { } } + // TODO cache @SubscribeEvent fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { if (!LorenzUtils.inSkyBlock) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarCancelledBuyOrderClipboard.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarCancelledBuyOrderClipboard.kt index a177d3fe6..dfd7e38f9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarCancelledBuyOrderClipboard.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarCancelledBuyOrderClipboard.kt @@ -103,7 +103,7 @@ object BazaarCancelledBuyOrderClipboard { event.blockedReason = "bazaar cancelled buy order clipboard" val lastClicked = lastClickedItem ?: error("last clicked bz item is null") - val message = "Bazaar buy order cancelled. Click to reorder. " + + val message = "Bazaar buy order cancelled. Click to re-order. " + "(§8${latestAmount.addSeparators()}x §r${lastClicked.itemName}§e)" ChatUtils.clickableChat( message, |